void flavor_init(void)
{
int i;
+ u32b state_backup[4];
- /* Hack -- Use the "simple" RNG */
- Rand_quick = TRUE;
+ /* Hack -- Backup the RNG state */
+ Rand_state_backup(state_backup);
/* Hack -- Induce consistant flavors */
- Rand_value = seed_flavor;
+ Rand_state_init(seed_flavor);
/* Initialize flavor index of each object by itself */
shuffle_flavors(TV_SCROLL);
- /* Hack -- Use the "complex" RNG */
- Rand_quick = FALSE;
+ /* Hack -- Restore the RNG state */
+ Rand_state_restore(state_backup);
/* Analyze every object */
for (i = 1; i < max_k_idx; i++)
*ptr = '\0';
}
+bool object_is_quest_target(object_type *o_ptr)
+{
+ if (p_ptr->inside_quest)
+ {
+ int a_idx = quest[p_ptr->inside_quest].k_idx;
+ if (a_idx)
+ {
+ artifact_type *a_ptr = &a_info[a_idx];
+ if (!(a_ptr->gen_flags & TRG_INSTA_ART))
+ {
+ if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
+ {
+ return TRUE;
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+
/*
* Creates a description of the item "o_ptr", and stores it in "out_val".
cptr modstr = "";
int power;
+ int fire_rate;
bool aware = FALSE;
bool known = FALSE;
case TV_DIGGING:
/* In Vault Quest, hide the dice of target weapon. */
- if (!known && p_ptr->inside_quest)
+ if(object_is_quest_target(o_ptr) && !known)
{
- int a_idx = quest[p_ptr->inside_quest].k_idx;
- if (a_idx)
- {
- artifact_type *a_ptr = &a_info[a_idx];
- if (!(a_ptr->gen_flags & TRG_INSTA_ART))
- {
- if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
- {
- break;
- }
- }
- }
+ break;
}
/* Append a "damage" string */
t = object_desc_chr(t, 'x');
t = object_desc_num(t, power);
t = object_desc_chr(t, p2);
-
+
+ fire_rate = calc_num_fire(o_ptr);
+ /* Show Fire rate */
+ if (fire_rate != 0 && power > 0 && known)
+ {
+ fire_rate = bow_energy(o_ptr->sval) / fire_rate;
+
+ t = object_desc_chr(t, ' ');
+ t = object_desc_chr(t, p1);
+ t = object_desc_num(t, fire_rate/100);
+ t = object_desc_chr(t, '.');
+ t = object_desc_num(t, fire_rate%100);
+ t = object_desc_str(t, "turn");
+ t = object_desc_chr(t, p2);
+ }
+
/* All done */
break;
}
/* Get extra damage from concentration */
if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam);
-
+
if (avgdam < 0) avgdam = 0;
- /* Display (shot damage/ avg damage) */
+ /* Display (shot damage/ shot damage with critical/ avg damage with critical) */
t = object_desc_chr(t, ' ');
t = object_desc_chr(t, p1);
+
+ if(show_ammo_no_crit)
+ {
+ /* Damage with no-crit */
+ t = object_desc_num(t, avgdam);
+ t = object_desc_str(t, show_ammo_detail ? "/shot " : "/");
+ }
+
+ /* Apply Expect damage of Critical */
+ avgdam = calc_expect_crit_shot(o_ptr->weight, o_ptr->to_h, bow_ptr->to_h, avgdam);
t = object_desc_num(t, avgdam);
- t = object_desc_chr(t, '/');
-
+
+ t = show_ammo_no_crit ? object_desc_str(t, show_ammo_detail ? "/crit " : "/")
+ : object_desc_str(t, show_ammo_detail ? "/shot " : "/");
+
if (p_ptr->num_fire == 0)
{
t = object_desc_chr(t, '0');
avgdam *= (p_ptr->num_fire * 100);
avgdam /= energy_fire;
t = object_desc_num(t, avgdam);
+ t = object_desc_str(t, show_ammo_detail ? "/turn" : "");
+
+ if(show_ammo_crit_ratio)
+ {
+ int percent = calc_crit_ratio_shot(o_ptr->weight,
+ known ? o_ptr->to_h : 0,
+ object_is_known(bow_ptr) ? bow_ptr->to_h : 0, avgdam);
+
+ t = object_desc_chr(t, '/');
+ t = object_desc_num(t, percent / 100);
+ t = object_desc_chr(t, '.');
+ t = object_desc_num(t, percent % 100);
+ t = object_desc_str(t, show_ammo_detail ? "% crit" : "%");
+ }
}
t = object_desc_chr(t, p2);