lite_spot(y, x);
}
-#ifdef USE_SCRIPT
- object_delete_callback(j_ptr);
-#endif /* USE_SCRIPT */
-
/* Wipe the object */
object_wipe(j_ptr);
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
-#ifdef USE_SCRIPT
- object_delete_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
/* Wipe the object */
object_wipe(o_ptr);
/* Structure copy */
o_list[i2] = o_list[i1];
-#ifdef USE_SCRIPT
- object_delete_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
/* Wipe the hole */
object_wipe(o_ptr);
}
{
/* Message */
#ifdef JP
-msg_print("¥¢¥¤¥Æ¥à¾ðÊó¤ò°µ½Ì¤·¤Æ¤¤¤Þ¤¹...");
+ msg_print("¥¢¥¤¥Æ¥à¾ðÊó¤ò°µ½Ì¤·¤Æ¤¤¤Þ¤¹...");
#else
msg_print("Compacting objects...");
#endif
c_ptr->o_idx = 0;
}
-#ifdef USE_SCRIPT
- object_delete_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
/* Wipe the object */
object_wipe(o_ptr);
}
/* Warn the player (except during dungeon creation) */
#ifdef JP
-if (character_dungeon) msg_print("¥¢¥¤¥Æ¥à¤¬Â¿¤¹¤®¤ë¡ª");
+ if (character_dungeon) msg_print("¥¢¥¤¥Æ¥à¤¬Â¿¤¹¤®¤ë¡ª");
#else
if (character_dungeon) msg_print("Too many objects!");
#endif
if ((level > 0) && !(d_info[dungeon_type].flags1 & DF1_BEGINNER))
{
/* Occasional "boost" */
- if (rand_int(GREAT_OBJ) == 0)
+ if (one_in_(GREAT_OBJ))
{
/* What a bizarre calculation */
level = 1 + (level * MAX_DEPTH / randint(MAX_DEPTH));
if (f3 & TR3_TELEPATHY) total += 20000;
if (f3 & TR3_SLOW_DIGEST) total += 750;
if (f3 & TR3_REGEN) total += 2500;
+ if (f3 & TR3_WARNING) total += 2000;
if (f3 & TR3_XTRA_MIGHT) total += 2250;
if (f3 & TR3_XTRA_SHOTS) total += 10000;
if (f3 & TR3_IGNORE_ACID) total += 100;
#if 0
/* Oops */
#ifdef JP
-msg_format("¥¢¥¤¥Æ¥à¤¬¤Ê¤¤ (%d,%d)", tval, sval);
+ msg_format("¥¢¥¤¥Æ¥à¤¬¤Ê¤¤ (%d,%d)", tval, sval);
#else
msg_format("No object (%d,%d)", tval, sval);
#endif
{
/* Copy the structure */
COPY(o_ptr, j_ptr, object_type);
-
-#ifdef USE_SCRIPT
- j_ptr->python = object_copy_callback(o_ptr, j_ptr);
-#endif /* USE_SCRIPT */
}
{
/* Silly message */
#ifdef JP
-msg_format("ÅÁÀâ¤Î¥¢¥¤¥Æ¥à (%s)", o_name);
+ msg_format("ÅÁÀâ¤Î¥¢¥¤¥Æ¥à (%s)", o_name);
#else
msg_format("Artifact (%s)", o_name);
#endif
else if (o_ptr->art_name)
{
#ifdef JP
-msg_print("¥é¥ó¥À¥à¡¦¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È");
+ msg_print("¥é¥ó¥À¥à¡¦¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È");
#else
msg_print("Random artifact");
#endif
{
/* Silly message */
#ifdef JP
-msg_format("̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à (%s)", o_name);
+ msg_format("̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à (%s)", o_name);
#else
msg_format("Ego-item (%s)", o_name);
#endif
{
/* Silly message */
#ifdef JP
-msg_format("¥¢¥¤¥Æ¥à (%s)", o_name);
+ msg_format("¥¢¥¤¥Æ¥à (%s)", o_name);
#else
msg_format("Object (%s)", o_name);
#endif
/* No artifacts in the town */
if (!dun_level) return (FALSE);
+ /* Themed object */
+ if (get_obj_num_hook) return (FALSE);
+
/* Check the artifact list (just the "specials") */
for (i = 0; i < max_a_idx; i++)
{
int d = (a_ptr->level - dun_level) * 2;
/* Roll for out-of-depth creation */
- if (rand_int(d) != 0) continue;
+ if (!one_in_(d)) continue;
}
/* Artifact "rarity roll" */
- if (rand_int(a_ptr->rarity) != 0) continue;
+ if (!one_in_(a_ptr->rarity)) continue;
/* Find the base object */
k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
int d = (k_info[k_idx].level - object_level) * 5;
/* Roll for out-of-depth creation */
- if (rand_int(d) != 0) continue;
+ if (!one_in_(d)) continue;
}
/* Assign the template */
int d = (a_ptr->level - dun_level) * 2;
/* Roll for out-of-depth creation */
- if (rand_int(d) != 0) continue;
+ if (!one_in_(d)) continue;
}
/* We must make the "rarity roll" */
- if (rand_int(a_ptr->rarity) != 0) continue;
+ if (!one_in_(a_ptr->rarity)) continue;
/* Hack -- mark the item as an artifact */
o_ptr->name1 = i;
/* Very good */
if (power > 1)
{
- if (randint(30) == 1)
+ if (one_in_(30))
create_artifact(o_ptr, FALSE);
else
/* Special Ego-item */
/* Very Good */
if (power > 1)
{
- if (one_in_((o_ptr->tval == TV_POLEARM) ? 42 : 44))
+ if (one_in_(40))
{
create_artifact(o_ptr, FALSE);
break;
switch (o_ptr->name2)
{
case EGO_HA:
- if ((randint(4) == 1) && (level > 40))
+ if (one_in_(4) && (level > 40))
o_ptr->art_flags1 |= TR1_BLOWS;
break;
case EGO_DF:
- if (randint(3) == 1)
+ if (one_in_(3))
o_ptr->art_flags2 |= TR2_RES_POIS;
random_resistance(o_ptr, FALSE, randint(22)+16);
break;
break;
case EGO_KILL_DRAGON:
random_resistance(o_ptr, FALSE, randint(12) + 4);
- if (randint(3) == 1)
+ if (one_in_(3))
o_ptr->art_flags2 |= TR2_RES_POIS;
random_resistance(o_ptr, FALSE, randint(14) + 4);
case EGO_WEST:
- if (randint(3) == 1)
+ if (one_in_(3))
o_ptr->art_flags2 |= TR2_RES_FEAR;
break;
case EGO_CHAOTIC:
random_resistance(o_ptr, FALSE, (randint(34) + 4));
break;
case EGO_SLAYING_WEAPON:
- if (randint(3) == 1) /* double damage */
+ if (one_in_(3)) /* double damage */
o_ptr->dd *= 2;
else
{
{
o_ptr->dd++;
}
- while (randint(o_ptr->dd) == 1);
+ while (one_in_(o_ptr->dd));
do
{
o_ptr->ds++;
}
- while (randint(o_ptr->ds) == 1);
+ while (one_in_(o_ptr->ds));
}
- if (randint(5) == 1)
+ if (one_in_(5))
{
o_ptr->art_flags1 |= TR1_BRAND_POIS;
}
- if (o_ptr->tval == TV_SWORD && (randint(3) == 1))
+ if (o_ptr->tval == TV_SWORD && one_in_(3))
{
o_ptr->art_flags1 |= TR1_VORPAL;
}
break;
case EGO_TRUMP:
random_resistance(o_ptr, FALSE, (randint(22) + 16));
- if (randint(5) == 1)
+ if (one_in_(5))
o_ptr->art_flags1 |= TR1_SLAY_DEMON;
break;
case EGO_PATTERN:
- if (randint(3) == 1)
+ if (one_in_(3))
o_ptr->art_flags2 |= TR2_HOLD_LIFE;
- if (randint(3) == 1)
+ if (one_in_(3))
o_ptr->art_flags1 |= TR1_DEX;
- if (randint(5) == 1)
+ if (one_in_(5))
o_ptr->art_flags2 |= TR2_RES_FEAR;
random_resistance(o_ptr, FALSE, (randint(22) + 16));
break;
o_ptr->pval = m_bonus(5, level) + 1;
break;
case EGO_EARTHQUAKES:
- if ((randint(3) == 1) && (level > 60))
+ if (one_in_(3) && (level > 60))
o_ptr->art_flags1 |= TR1_BLOWS;
else
o_ptr->pval = m_bonus(3, level);
if (!o_ptr->art_name)
{
/* Hack -- Super-charge the damage dice */
- while (rand_int(10L * o_ptr->dd * o_ptr->ds) == 0) o_ptr->dd++;
+ while (one_in_(10L * o_ptr->dd * o_ptr->ds)) o_ptr->dd++;
/* Hack -- Lower the damage dice */
if (o_ptr->dd > 9) o_ptr->dd = 9;
/* Very good */
if (power > 1)
{
- if (one_in_(21))
+ if (one_in_(20))
{
create_artifact(o_ptr, FALSE);
break;
}
/* Hack -- super-charge the damage dice */
- while (rand_int(10L * o_ptr->dd * o_ptr->ds) == 0) o_ptr->dd++;
+ while (one_in_(10L * o_ptr->dd * o_ptr->ds)) o_ptr->dd++;
/* Hack -- restrict the damage dice */
if (o_ptr->dd > 9) o_ptr->dd = 9;
{
artifact_bias = 0;
- if (randint(4) == 1)
+ if (one_in_(4))
random_resistance(o_ptr, FALSE, (randint(14) + 4));
else
random_resistance(o_ptr, FALSE, (randint(22) + 16));
}
- while (randint(2) == 1);
+ while (one_in_(2));
}
{
/* Rating boost */
rating += 30;
- if(rand_int(50) == 1)
+ if(one_in_(50))
create_artifact(o_ptr, FALSE);
/* Mention the item */
break;
}
- if (one_in_((o_ptr->tval == TV_HARD_ARMOR) ? 21 : 19))
+ if (one_in_(20))
{
create_artifact(o_ptr, FALSE);
break;
}
else
{
- if (randint(4) == 1)
+ if (one_in_(4))
o_ptr->art_flags1 |= TR1_CON;
break;
}
/* Mention the item */
if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
- if (randint(3) != 1) break;
+ if (!one_in_(3)) break;
}
/* Very good */
if (power > 1)
{
- if (one_in_(23))
+ if (one_in_(20))
{
create_artifact(o_ptr, FALSE);
break;
/* Mention the item */
if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
- if (randint(3) != 1) break;
+ if (!one_in_(3)) break;
}
if (power > 1)
{
/* Mention the item */
if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
- if (randint(3) != 1) break;
+ if (!one_in_(3)) break;
}
/* Very good */
if (power > 1)
/* Mention the item */
if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
- if (randint(3) != 1) break;
+ if (!one_in_(3)) break;
}
/* Very good */
{
random_resistance(o_ptr, FALSE, randint(20) + 18);
}
- while (randint(4) == 1);
+ while (one_in_(4));
/* Bonus to armor class */
o_ptr->to_a = 10 + randint(5) + m_bonus(10, level);
break;
}
}
- if (randint(400) == 1 && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
+ if (one_in_(400) && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
{
o_ptr->pval = MIN(o_ptr->pval,4);
/* Randart amulet */
case SV_AMULET_RESISTANCE:
{
- if (randint(3) == 1) random_resistance(o_ptr, FALSE, (randint(34) + 4));
- if (randint(5) == 1) o_ptr->art_flags2 |= TR2_RES_POIS;
+ if (one_in_(3)) random_resistance(o_ptr, FALSE, (randint(34) + 4));
+ if (one_in_(5)) o_ptr->art_flags2 |= TR2_RES_POIS;
}
break;
break;
}
}
- if (randint(150) == 1 && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
+ if (one_in_(150) && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
{
o_ptr->pval = MIN(o_ptr->pval,4);
/* Randart amulet */
if (cheat_peek)
{
#ifdef JP
-msg_format("%s¤Î¿Í·Á, ¿¼¤µ +%d%s",
+ msg_format("%s¤Î¿Í·Á, ¿¼¤µ +%d%s",
#else
msg_format("Figurine of %s, depth +%d%s",
#endif
if (cheat_peek)
{
#ifdef JP
-msg_format("%s¤Î»àÂÎ,¿¼¤µ +%d",
+ msg_format("%s¤Î»àÂÎ,¿¼¤µ +%d",
#else
msg_format("Corpse of %s, depth +%d",
#endif
if (cheat_peek)
{
#ifdef JP
-msg_format("%s¤ÎÁü,", r_name + r_ptr->name);
+ msg_format("%s¤ÎÁü,", r_name + r_ptr->name);
#else
msg_format("Statue of %s", r_name + r_ptr->name);
#endif
/* Trump weapon */
case EGO_TRUMP:
{
- if (randint(7) == 1) o_ptr->xtra1 = EGO_XTRA_ABILITY;
+ if (one_in_(7)) o_ptr->xtra1 = EGO_XTRA_ABILITY;
break;
}
/* Generate a special object, or a normal object */
- if ((rand_int(prob) != 0) || !make_artifact_special(j_ptr))
+ if (!one_in_(prob) || !make_artifact_special(j_ptr))
{
int k_idx;
/* Place the object */
c_ptr->o_idx = o_idx;
-#ifdef USE_SCRIPT
- o_ptr->python = object_create_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
/* Notice */
note_spot(y, x);
i = ((randint(object_level + 2) + 2) / 2) - 1;
/* Apply "extra" magic */
- if (rand_int(GREAT_OBJ) == 0)
+ if (one_in_(GREAT_OBJ))
{
i += randint(object_level + 1);
}
/* Place the object */
c_ptr->o_idx = o_idx;
-#ifdef USE_SCRIPT
- o_ptr->python = object_create_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
/* Notice */
note_spot(y, x);
/* Debug */
#ifdef JP
-if (wizard) msg_print("(ÇË»)");
+ if (wizard) msg_print("(ÇË»)");
#else
if (wizard) msg_print("(breakage)");
#endif
if (s > bs) bn = 0;
/* Apply the randomizer to equivalent values */
- if ((++bn >= 2) && (rand_int(bn) != 0)) continue;
+ if ((++bn >= 2) && !one_in_(bn)) continue;
/* Keep score */
bs = s;
/* Debug */
#ifdef JP
-if (wizard) msg_print("(¾²¥¹¥Ú¡¼¥¹¤¬¤Ê¤¤)");
+ if (wizard) msg_print("(¾²¥¹¥Ú¡¼¥¹¤¬¤Ê¤¤)");
#else
if (wizard) msg_print("(no floor space)");
#endif
/* Debug */
#ifdef JP
-if (wizard) msg_print("(¥¢¥¤¥Æ¥à¤¬Â¿²á¤®¤ë)");
+ if (wizard) msg_print("(¥¢¥¤¥Æ¥à¤¬Â¿²á¤®¤ë)");
#else
if (wizard) msg_print("(too many objects)");
#endif
if (chance && (by == py) && (bx == px))
{
#ifdef JP
-msg_print("²¿¤«¤¬Â²¼¤Ëž¤¬¤Ã¤Æ¤¤¿¡£");
+ msg_print("²¿¤«¤¬Â²¼¤Ëž¤¬¤Ã¤Æ¤¤¿¡£");
#else
msg_print("You feel something roll beneath your feet.");
#endif
object_known(i_ptr);
}
-#ifdef USE_SCRIPT
- i_ptr->python = object_create_callback(i_ptr);
-#endif /* USE_SCRIPT */
-
/* Drop the object */
(void)drop_near(i_ptr, -1, y1, x1);
}
/* One less item */
inven_cnt--;
-#ifdef USE_SCRIPT
- object_delete_callback(&inventory[item]);
-#endif /* USE_SCRIPT */
-
/* Slide everything down */
for (i = item; i < INVEN_PACK; i++)
{
/* One less item */
equip_cnt--;
-#ifdef USE_SCRIPT
- object_delete_callback(&inventory[item]);
-#endif /* USE_SCRIPT */
-
/* Erase the empty slot */
object_wipe(&inventory[item]);
object_copy(&inventory[k+1], &inventory[k]);
}
-#ifdef USE_SCRIPT
- /* Not a real deletion */
- /* object_delete_callback(&inventory[i]); */
-#endif /* USE_SCRIPT */
-
/* Wipe the empty slot */
object_wipe(&inventory[i]);
}
if (item == INVEN_RARM)
{
#ifdef JP
-act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
+ act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
#else
act = "You were wielding";
#endif
else if (item == INVEN_BOW)
{
#ifdef JP
-act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
+ act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
#else
act = "You were holding";
#endif
else if (item == INVEN_LITE)
{
#ifdef JP
-act = "¤ò¸÷¸»¤«¤é¤Ï¤º¤·¤¿";
+ act = "¤ò¸÷¸»¤«¤é¤Ï¤º¤·¤¿";
#else
act = "You were holding";
#endif
else
{
#ifdef JP
-act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
+ act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
#else
act = "You were wearing";
#endif
/* Message */
#ifdef JP
-msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
+ msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
#else
msg_format("You drop %s (%c).", o_name, index_to_label(item));
#endif
inventory[k] = inventory[k+1];
}
-#ifdef USE_SCRIPT
- object_delete_callback(&inventory[k]);
-#endif /* USE_SCRIPT */
-
/* Erase the "final" slot */
object_wipe(&inventory[k]);
/* Message */
#ifdef JP
-if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤ò¤Þ¤È¤áľ¤·¤¿¡£");
+ if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤ò¤Þ¤È¤áľ¤·¤¿¡£");
#else
if (flag) msg_print("You combine some items in your pack.");
#endif
/* Message */
#ifdef JP
-if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤òÊ¤Ùľ¤·¤¿¡£");
+ if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤òÊ¤Ùľ¤·¤¿¡£");
#else
if (flag) msg_print("You reorder some items in your pack.");
#endif
}
}
+/* Choose one of items that have warning flag */
+object_type *choose_warning_item(void)
+{
+ int i;
+ int choices[INVEN_TOTAL-INVEN_RARM];
+ int number = 0;
+
+ /* Paranoia -- Player has no warning-item */
+ if (!p_ptr->warning) return (NULL);
+
+ /* Search Inventry */
+ for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
+ {
+ u32b f1, f2, f3;
+ object_type *o_ptr = &inventory[i];
+
+ object_flags(o_ptr, &f1, &f2, &f3);
+ if (f3 & (TR3_WARNING))
+ {
+ choices[number] = i;
+ number++;
+ }
+ }
+
+ /* Choice one of them */
+ return (&inventory[choices[rand_int(number)]]);
+}
+
/* Examine the grid (xx,yy) and warn the player if there are any danger */
-bool process_frakir(int xx, int yy){
- int mx,my;
- cave_type *c_ptr;
+bool process_frakir(int xx, int yy)
+{
+ int mx,my;
+ cave_type *c_ptr;
+ char o_name[MAX_NLEN];
#define FRAKIR_AWARE_RANGE 12
- int dam_max=0;
- static int old_damage = 0;
-
- for (mx=xx-FRAKIR_AWARE_RANGE;mx<xx+FRAKIR_AWARE_RANGE+1;mx++){
- for (my=yy-FRAKIR_AWARE_RANGE;my<yy+FRAKIR_AWARE_RANGE+1;my++){
- if (!in_bounds(my,mx) || (distance(my,mx,yy,xx)>FRAKIR_AWARE_RANGE))continue;
-
- c_ptr = &cave[my][mx];
- if (c_ptr->m_idx > 0){
-
- int dam_max0=0;
- int m_idx = c_ptr->m_idx;
- monster_type *m_ptr = &m_list[m_idx];
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
+ int dam_max = 0;
+ static int old_damage = 0;
+
+ for (mx = xx-FRAKIR_AWARE_RANGE; mx < xx+FRAKIR_AWARE_RANGE+1; mx++)
+ {
+ for (my = yy-FRAKIR_AWARE_RANGE; my < yy+FRAKIR_AWARE_RANGE+1; my++)
+ {
+ int dam_max0=0;
+ monster_type *m_ptr;
+ monster_race *r_ptr;
+ u32b f4, f5, f6;
+ int rlev;
- u32b f4 = r_ptr->flags4;
- u32b f5 = r_ptr->flags5;
- u32b f6 = r_ptr->flags6;
+ if (!in_bounds(my,mx) || (distance(my,mx,yy,xx)>FRAKIR_AWARE_RANGE)) continue;
- int rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
+ c_ptr = &cave[my][mx];
- if (m_ptr->csleep) continue;
- if (is_pet(m_ptr)) continue;
+ if (!c_ptr->m_idx) continue;
- /* Monster spells (only powerful ones)*/
- if(projectable(my,mx,yy,xx)){
+ m_ptr = &m_list[c_ptr->m_idx];
+ r_ptr = &r_info[m_ptr->r_idx];
+
+ f4 = r_ptr->flags4;
+ f5 = r_ptr->flags5;
+ f6 = r_ptr->flags6;
+
+ rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
+
+ if (m_ptr->csleep) continue;
+ if (is_pet(m_ptr)) continue;
+
+ /* Monster spells (only powerful ones)*/
+ if(projectable(my,mx,yy,xx))
+ {
#define DAMCALC(f,val,max,im,vln,res,resx,resy,op,opx,opy,dmax) \
if (f){ int dam = (val)>(max)? (max):(val); \
if (dam>dmax) dmax = dam; \
}
- DAMCALC(f4 & (RF4_BR_FIRE), m_ptr->hp / 3, 1600,
- p_ptr->immune_fire, p_ptr->muta3 & MUT3_VULN_ELEM,
- p_ptr->resist_fire, 1, 3,
- p_ptr->oppose_fire, 1, 3, dam_max0);
+ DAMCALC(f4 & (RF4_BR_FIRE), m_ptr->hp / 3, 1600,
+ p_ptr->immune_fire, p_ptr->muta3 & MUT3_VULN_ELEM,
+ p_ptr->resist_fire, 1, 3,
+ p_ptr->oppose_fire, 1, 3, dam_max0);
- DAMCALC(f4 & (RF4_BR_COLD), m_ptr->hp / 3, 1600,
- p_ptr->immune_cold, p_ptr->muta3 & MUT3_VULN_ELEM,
- p_ptr->resist_cold, 1, 3,
- p_ptr->oppose_cold, 1, 3, dam_max0);
+ DAMCALC(f4 & (RF4_BR_COLD), m_ptr->hp / 3, 1600,
+ p_ptr->immune_cold, p_ptr->muta3 & MUT3_VULN_ELEM,
+ p_ptr->resist_cold, 1, 3,
+ p_ptr->oppose_cold, 1, 3, dam_max0);
- DAMCALC(f4 & (RF4_BR_ELEC), m_ptr->hp / 3, 1600,
- p_ptr->immune_elec, p_ptr->muta3 & MUT3_VULN_ELEM,
- p_ptr->resist_elec, 1, 3,
- p_ptr->oppose_elec, 1, 3, dam_max0);
+ DAMCALC(f4 & (RF4_BR_ELEC), m_ptr->hp / 3, 1600,
+ p_ptr->immune_elec, p_ptr->muta3 & MUT3_VULN_ELEM,
+ p_ptr->resist_elec, 1, 3,
+ p_ptr->oppose_elec, 1, 3, dam_max0);
- DAMCALC(f4 & (RF4_BR_ACID), m_ptr->hp / 3, 1600,
- p_ptr->immune_acid, p_ptr->muta3 & MUT3_VULN_ELEM,
- p_ptr->resist_acid, 1, 3,
- p_ptr->oppose_acid, 1, 3, dam_max0);
+ DAMCALC(f4 & (RF4_BR_ACID), m_ptr->hp / 3, 1600,
+ p_ptr->immune_acid, p_ptr->muta3 & MUT3_VULN_ELEM,
+ p_ptr->resist_acid, 1, 3,
+ p_ptr->oppose_acid, 1, 3, dam_max0);
- DAMCALC(f4 & (RF4_BR_POIS), m_ptr->hp / 3, 800,
- FALSE , FALSE,
- p_ptr->resist_pois, 1, 3,
- p_ptr->oppose_pois, 1, 3, dam_max0);
+ DAMCALC(f4 & (RF4_BR_POIS), m_ptr->hp / 3, 800,
+ FALSE , FALSE,
+ p_ptr->resist_pois, 1, 3,
+ p_ptr->oppose_pois, 1, 3, dam_max0);
- DAMCALC(f4 & (RF4_BR_NETH), m_ptr->hp / 6, 550, FALSE , FALSE,
- p_ptr->resist_neth, 6, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_NETH), m_ptr->hp / 6, 550, FALSE , FALSE,
+ p_ptr->resist_neth, 6, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_LITE), m_ptr->hp / 6, 400, FALSE , FALSE,
- p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_LITE), m_ptr->hp / 6, 400, FALSE , FALSE,
+ p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_DARK), m_ptr->hp / 6, 400, FALSE , FALSE,
- p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_DARK), m_ptr->hp / 6, 400, FALSE , FALSE,
+ p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_CONF), m_ptr->hp / 6, 450, FALSE , FALSE,
- p_ptr->resist_conf, 5, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_CONF), m_ptr->hp / 6, 450, FALSE , FALSE,
+ p_ptr->resist_conf, 5, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_SOUN), m_ptr->hp / 6, 450, FALSE , FALSE,
- p_ptr->resist_sound, 5, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_SOUN), m_ptr->hp / 6, 450, FALSE , FALSE,
+ p_ptr->resist_sound, 5, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_CHAO), m_ptr->hp / 6, 600, FALSE , FALSE,
- p_ptr->resist_chaos, 6, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_CHAO), m_ptr->hp / 6, 600, FALSE , FALSE,
+ p_ptr->resist_chaos, 6, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_DISE), m_ptr->hp / 6, 500, FALSE , FALSE,
- p_ptr->resist_disen, 6, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_DISE), m_ptr->hp / 6, 500, FALSE , FALSE,
+ p_ptr->resist_disen, 6, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_NEXU), m_ptr->hp / 3, 250, FALSE , FALSE,
- p_ptr->resist_nexus, 6, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_NEXU), m_ptr->hp / 3, 250, FALSE , FALSE,
+ p_ptr->resist_nexus, 6, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_TIME), m_ptr->hp / 3, 150, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_TIME), m_ptr->hp / 3, 150, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_INER), m_ptr->hp / 6, 200, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_INER), m_ptr->hp / 6, 200, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_GRAV), m_ptr->hp / 3, 200, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_GRAV), m_ptr->hp / 3, 200, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_SHAR), m_ptr->hp / 6, 500, FALSE , FALSE,
- p_ptr->resist_shard, 6, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_SHAR), m_ptr->hp / 6, 500, FALSE , FALSE,
+ p_ptr->resist_shard, 6, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_PLAS), m_ptr->hp / 6, 150, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_PLAS), m_ptr->hp / 6, 150, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_WALL), m_ptr->hp / 6, 200, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_WALL), m_ptr->hp / 6, 200, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_MANA), m_ptr->hp / 3, 250, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_MANA), m_ptr->hp / 3, 250, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_BR_NUKE), m_ptr->hp / 3, 800, FALSE , FALSE,
- p_ptr->resist_pois, 2, 5,
- p_ptr->oppose_pois, 2, 5, dam_max0);
+ DAMCALC(f4 & (RF4_BR_NUKE), m_ptr->hp / 3, 800, FALSE , FALSE,
+ p_ptr->resist_pois, 2, 5,
+ p_ptr->oppose_pois, 2, 5, dam_max0);
- DAMCALC(f4 & (RF4_BR_DISI), m_ptr->hp / 3, 300, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_BR_DISI), m_ptr->hp / 3, 300, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_ROCKET), m_ptr->hp / 4, 800, FALSE , FALSE,
- p_ptr->resist_shard, 1, 2, FALSE, 1, 1, dam_max0);
+ DAMCALC(f4 & (RF4_ROCKET), m_ptr->hp / 4, 800, FALSE , FALSE,
+ p_ptr->resist_shard, 1, 2, FALSE, 1, 1, dam_max0);
- DAMCALC(f5 & (RF5_BA_MANA), rlev*4 + 150, 9999, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ DAMCALC(f5 & (RF5_BA_MANA), rlev*4 + 150, 9999, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f5 & (RF5_BA_DARK), rlev*4 + 150, 9999, FALSE , FALSE,
- p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f5 & (RF5_BA_DARK), rlev*4 + 150, 9999, FALSE , FALSE,
+ p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f5 & (RF5_BA_LITE), rlev*4 + 150, 9999, FALSE , FALSE,
- p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
+ DAMCALC(f5 & (RF5_BA_LITE), rlev*4 + 150, 9999, FALSE , FALSE,
+ p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
- DAMCALC(f4 & (RF4_ROCKET),m_ptr->hp / 4, 800, FALSE , FALSE,
- p_ptr->resist_shard, 1, 2, FALSE, 1, 1, dam_max0);
+ DAMCALC(f6 & (RF6_HAND_DOOM), p_ptr->chp*6/10, 9999, FALSE , FALSE,
+ FALSE, 1, 1, FALSE, 1, 1, dam_max0);
- DAMCALC(f6 & (RF6_HAND_DOOM), p_ptr->chp*6/10, 9999, FALSE , FALSE,
- FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+ }
- }
+ /* Monster melee attacks */
+ if(mx <= xx+1 && mx >= xx-1 && my <=yy+1 && my >= yy-1)
+ {
+ int m;
+ int dam_melee=0;
+ for (m = 0; m < 4; m++)
+ {
+ int d1, d2;
+
+ /* Skip non-attacks */
+ if (!r_ptr->blow[m].method) continue;
+
+ /* Extract the attack info */
+ d1 = r_ptr->blow[m].d_dice;
+ d2 = r_ptr->blow[m].d_side;
+
+ dam_melee += d1*d2;
+ }
+ if(dam_melee>dam_max0)dam_max0=dam_melee;
+ }
- /* Monster melee attacks */
- if( mx <= xx+1 && mx >= xx-1 && my <=yy+1 && my >= yy-1 ){
- int m;
- int dam_melee=0;
- for (m = 0; m < 4; m++)
- {
- int d1, d2;
-
- /* Skip non-attacks */
- if (!r_ptr->blow[m].method) continue;
-
- /* Extract the attack info */
- d1 = r_ptr->blow[m].d_dice;
- d2 = r_ptr->blow[m].d_side;
-
- dam_melee += d1*d2;
- }
- if(dam_melee>dam_max0)dam_max0=dam_melee;
+ /* Contribution from this monster */
+ dam_max+=dam_max0;
+ }
}
- /* Contribution from this monster */
- dam_max+=dam_max0;
- }
-
-
- }
- }
+ /* Prevent excessive warning */
+ if(dam_max > old_damage)
+ {
+ old_damage=dam_max * 3 / 2;
+
+ if (dam_max>(p_ptr->chp)/2)
+ {
+ object_type *o_ptr = choose_warning_item();
- /* Prevent excessive warning */
- if(dam_max>old_damage){
- old_damage=dam_max * 3 / 2;
-
- if (dam_max>(p_ptr->chp)/2){
+ object_desc(o_name, o_ptr, FALSE, 0);
#ifdef JP
- msg_print("»ØÎؤ¬±Ô¤¯¿Ì¤¨¤¿¡ª");
+ msg_format("%s¤¬±Ô¤¯¿Ì¤¨¤¿¡ª", o_name);
#else
- msg_print("The Ring pulsates sharply!");
+ msg_format("%s pulsates sharply!", o_name);
#endif
- disturb(0,0);
+ disturb(0,0);
#ifdef JP
- return(get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
+ return (get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
#else
- return(get_check("Realy want to go ahead? "));
+ return (get_check("Realy want to go ahead? "));
#endif
- }
- }
- else old_damage = old_damage/2;
+ }
+ }
+ else old_damage = old_damage/2;
- c_ptr = &cave[yy][xx];
- if (((is_trap(c_ptr->feat) && !easy_disarm) || (c_ptr->info & CAVE_TRAP)) && randint(13)!=1){
+ c_ptr = &cave[yy][xx];
+ if (((is_trap(c_ptr->feat) && !easy_disarm) || (c_ptr->info & CAVE_TRAP)) && !one_in_(13))
+ {
+ object_type *o_ptr = choose_warning_item();
+
+ object_desc(o_name, o_ptr, FALSE, 0);
#ifdef JP
- msg_print("»ØÎؤ¬¿Ì¤¨¤¿¡ª");
+ msg_format("%s¤¬¿Ì¤¨¤¿¡ª", o_name);
#else
- msg_print("The Ring pulsates!");
+ msg_format("%s pulsates!", o_name);
#endif
- disturb(0,0);
+ disturb(0,0);
#ifdef JP
- return(get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
+ return (get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
#else
- return(get_check("Realy want to go ahead? "));
+ return (get_check("Realy want to go ahead? "));
#endif
- }
- return(TRUE);
+ }
+ return(TRUE);
}
/* Get an item */
#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤«¤éÃê½Ð¤·¤Þ¤¹¤«¡©";
-s = "Ãê½Ð¤Ç¤¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
+ q = "¤É¤Î¥¢¥¤¥Æ¥à¤«¤éÃê½Ð¤·¤Þ¤¹¤«¡©";
+ s = "Ãê½Ð¤Ç¤¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
#else
q = "Extract from which item? ";
s = "You have nothing you can extract from.";
/* Build a prompt */
#ifdef JP
-(void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎǽÎϤòÉղä·¤Þ¤¹¤«¡©");
+ (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎǽÎϤòÉղä·¤Þ¤¹¤«¡©");
#else
(void)strnfmt(out_val, 78, "(*=List, ESC=exit) Add which ability? ");
#endif
/* Get an item */
#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²þÎɤ·¤Þ¤¹¤«¡©";
-s = "²þÎɤǤ¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
+ q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²þÎɤ·¤Þ¤¹¤«¡©";
+ s = "²þÎɤǤ¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
#else
q = "Improve which item? ";
s = "You have nothing to improve.";
/* Get an item */
#ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤Î¥¨¥Ã¥»¥ó¥¹¤ò¾Ãµî¤·¤Þ¤¹¤«¡©";
-s = "¥¨¥Ã¥»¥ó¥¹¤òÉղä·¤¿¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
+ q = "¤É¤Î¥¢¥¤¥Æ¥à¤Î¥¨¥Ã¥»¥ó¥¹¤ò¾Ãµî¤·¤Þ¤¹¤«¡©";
+ s = "¥¨¥Ã¥»¥ó¥¹¤òÉղä·¤¿¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
#else
q = "Remove from which item? ";
s = "You have nothing to remove essence.";
if (p_ptr->confused)
{
#ifdef JP
-msg_print("º®Í𤷤Ƥ¤¤Æºî¶È¤Ç¤¤Ê¤¤¡ª");
+ msg_print("º®Í𤷤Ƥ¤¤Æºî¶È¤Ç¤¤Ê¤¤¡ª");
#else
msg_print("You are too confused!");
#endif
if (p_ptr->blind)
{
#ifdef JP
-msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤¤Ê¤¤¡ª");
+ msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤¤Ê¤¤¡ª");
#else
msg_print("You are blind!");
#endif
if (p_ptr->image)
{
#ifdef JP
-msg_print("¤¦¤Þ¤¯¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤¤Ê¤¤¡ª");
+ msg_print("¤¦¤Þ¤¯¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤¤Ê¤¤¡ª");
#else
msg_print("You are hullcinating!");
#endif