/* File: cmd6.c */
-/* Purpose: Object commands */
-
/*
- * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
*
- * This software may be copied and distributed for educational, research, and
- * not for profit purposes provided that this copyright and statement are
- * included in all such copies.
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies. Other copyrights may also apply.
*/
+/* Purpose: Object commands */
+
#include "angband.h"
int ident, lev;
object_type *o_ptr;
+ if (music_singing_any()) stop_singing();
+ if (hex_spelling_any()) stop_hex_spell_all();
+
/* Get the item (in the pack) */
if (item >= 0)
{
ident = FALSE;
/* Object level */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
if (o_ptr->tval == TV_FOOD)
{
{
case SV_FOOD_POISON:
{
- if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
+ if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
{
if (set_poisoned(p_ptr->poisoned + randint0(10) + 10))
{
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
- if (!(object_aware_p(o_ptr)))
+ if (!(object_is_aware(o_ptr)))
{
chg_virtue(V_KNOWLEDGE, -1);
chg_virtue(V_PATIENCE, -1);
}
/* We have tried it */
- object_tried(o_ptr);
+ if (o_ptr->tval == TV_FOOD) object_tried(o_ptr);
/* The player is now aware of the object */
- if (ident && !object_aware_p(o_ptr))
+ if (ident && !object_is_aware(o_ptr))
{
object_aware(o_ptr);
gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
#endif
}
- else if (p_ptr->prace == RACE_SKELETON)
+ else if ((prace_is_(RACE_SKELETON) ||
+ prace_is_(RACE_GOLEM) ||
+ prace_is_(RACE_ZOMBIE) ||
+ prace_is_(RACE_SPECTRE)) &&
+ (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND))
+ {
+ cptr staff;
+
+ if (o_ptr->tval == TV_STAFF &&
+ (item < 0) && (o_ptr->number > 1))
+ {
+#ifdef JP
+ msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
+#else
+ msg_print("You must first pick up the staffs.");
+#endif
+ return;
+ }
+
+#ifdef JP
+ staff = (o_ptr->tval == TV_STAFF) ? "¾ó" : "ËâË¡ËÀ";
+#else
+ staff = (o_ptr->tval == TV_STAFF) ? "staff" : "wand";
+#endif
+
+ /* "Eat" charges */
+ if (o_ptr->pval == 0)
+ {
+#ifdef JP
+ msg_format("¤³¤Î%s¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£", staff);
+#else
+ msg_format("The %s has no charges left.", staff);
+#endif
+
+ o_ptr->ident |= (IDENT_EMPTY);
+
+ /* Combine / Reorder the pack (later) */
+ p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+ p_ptr->window |= (PW_INVEN);
+
+ return;
+ }
+
+#ifdef JP
+ msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎËâÎϤò¥¨¥Í¥ë¥®¡¼¸»¤È¤·¤ÆµÛ¼ý¤·¤¿¡£", staff);
+#else
+ msg_format("You absorb mana of the %s as your energy.", staff);
+#endif
+
+ /* Use a single charge */
+ o_ptr->pval--;
+
+ /* Eat a charge */
+ set_food(p_ptr->food + 5000);
+
+ /* XXX Hack -- unstack if necessary */
+ if (o_ptr->tval == TV_STAFF &&
+ (item >= 0) && (o_ptr->number > 1))
+ {
+ object_type forge;
+ object_type *q_ptr;
+
+ /* Get local object */
+ q_ptr = &forge;
+
+ /* Obtain a local object */
+ object_copy(q_ptr, o_ptr);
+
+ /* Modify quantity */
+ q_ptr->number = 1;
+
+ /* Restore the charges */
+ o_ptr->pval++;
+
+ /* Unstack the used item */
+ o_ptr->number--;
+ p_ptr->total_weight -= q_ptr->weight;
+ item = inven_carry(q_ptr);
+
+ /* Message */
+#ifdef JP
+ msg_format("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
+#else
+ msg_print("You unstack your staff.");
+#endif
+ }
+
+ /* Describe charges in the pack */
+ if (item >= 0)
+ {
+ inven_item_charges(item);
+ }
+
+ /* Describe charges on the floor */
+ else
+ {
+ floor_item_charges(0 - item);
+ }
+
+ /* Window stuff */
+ p_ptr->window |= (PW_INVEN | PW_EQUIP);
+
+ /* Don't eat a staff/wand itself */
+ return;
+ }
+ else if ((prace_is_(RACE_DEMON) ||
+ (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
+ (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
+ my_strchr("pht", r_info[o_ptr->pval].d_char)))
+ {
+ /* Drain vitality of humanoids */
+ char o_name[MAX_NLEN];
+
+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+
+#ifdef JP
+ msg_format("%s¤Ïdz¤¨¾å¤ê³¥¤Ë¤Ê¤Ã¤¿¡£ÀºÎϤòµÛ¼ý¤·¤¿µ¤¤¬¤¹¤ë¡£", o_name);
+#else
+ msg_format("%^s is burnt to ashes. You absorb its vitality!", o_name);
+#endif
+ (void)set_food(PY_FOOD_MAX - 1);
+ }
+ else if (prace_is_(RACE_SKELETON))
{
+#if 0
+ if (o_ptr->tval == TV_SKELETON ||
+ (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
+ {
+#ifdef JP
+ msg_print("¤¢¤Ê¤¿¤Ï¹ü¤Ç¼«Ê¬¤ÎÂΤòÊä¤Ã¤¿¡£");
+#else
+ msg_print("Your body absorbs the bone.");
+#endif
+ set_food(p_ptr->food + 5000);
+ }
+ else
+#endif
+
if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
(o_ptr->sval < SV_FOOD_BISCUIT)))
{
}
}
- else if ((p_ptr->prace == RACE_GOLEM) ||
- (p_ptr->prace == RACE_ZOMBIE) ||
- (p_ptr->prace == RACE_ENT) ||
- (p_ptr->prace == RACE_DEMON) ||
- (p_ptr->prace == RACE_ANDROID) ||
- (p_ptr->prace == RACE_SPECTRE) ||
+ else if (prace_is_(RACE_GOLEM) ||
+ prace_is_(RACE_ZOMBIE) ||
+ prace_is_(RACE_ENT) ||
+ prace_is_(RACE_DEMON) ||
+ prace_is_(RACE_ANDROID) ||
+ prace_is_(RACE_SPECTRE) ||
(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
{
#ifdef JP
set_food(p_ptr->food + ((o_ptr->pval) / 20));
}
+ else if (o_ptr->tval == TV_FOOD && o_ptr->sval == SV_FOOD_WAYBREAD)
+ {
+ /* Waybread is always fully satisfying. */
+ set_food(MAX(p_ptr->food, PY_FOOD_MAX - 1));
+ }
else
{
+ /* Food can feed the player */
(void)set_food(p_ptr->food + o_ptr->pval);
}
*/
static bool item_tester_hook_eatable(object_type *o_ptr)
{
-/* if ((o_ptr->tval==TV_FOOD) || ((o_ptr->tval==TV_CORPSE) && o_ptr->sval)) return (TRUE); */
- if (o_ptr->tval==TV_FOOD) return (TRUE);
+ if (o_ptr->tval==TV_FOOD) return TRUE;
+
+#if 0
+ if (prace_is_(RACE_SKELETON))
+ {
+ if (o_ptr->tval == TV_SKELETON ||
+ (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
+ return TRUE;
+ }
+ else
+#endif
+
+ if (prace_is_(RACE_SKELETON) ||
+ prace_is_(RACE_GOLEM) ||
+ prace_is_(RACE_ZOMBIE) ||
+ prace_is_(RACE_SPECTRE))
+ {
+ if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
+ return TRUE;
+ }
+ else if (prace_is_(RACE_DEMON) ||
+ (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
+ {
+ if (o_ptr->tval == TV_CORPSE &&
+ o_ptr->sval == SV_CORPSE &&
+ my_strchr("pht", r_info[o_ptr->pval].d_char))
+ return TRUE;
+ }
/* Assume not */
return (FALSE);
static void do_cmd_quaff_potion_aux(int item)
{
int ident, lev;
- object_type *o_ptr;
+ object_type *o_ptr;
object_type forge;
object_type *q_ptr;
return;
}
- if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
- {
- stop_singing();
- }
+ if (music_singing_any()) stop_singing();
+ if (hex_spelling_any())
+ {
+ if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
+ }
/* Get the item (in the pack) */
if (item >= 0)
ident = FALSE;
/* Object level */
- lev = get_object_level(q_ptr);
+ lev = k_info[q_ptr->k_idx].level;
/* Analyze the potion */
- switch (q_ptr->sval)
+ if (q_ptr->tval == TV_POTION)
{
+ switch (q_ptr->sval)
+ {
#ifdef JP
- /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
+ /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
case SV_POTION_WATER:
- {
msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
ident = TRUE;
break;
- }
+
case SV_POTION_APPLE_JUICE:
- {
msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
ident = TRUE;
break;
- }
+
case SV_POTION_SLIME_MOLD:
- {
msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
ident = TRUE;
break;
- }
+
#else
case SV_POTION_WATER:
case SV_POTION_APPLE_JUICE:
case SV_POTION_SLIME_MOLD:
- {
msg_print("You feel less thirsty.");
ident = TRUE;
break;
- }
#endif
-
case SV_POTION_SLOWNESS:
- {
if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
break;
- }
case SV_POTION_SALT_WATER:
- {
#ifdef JP
msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
#else
msg_print("The potion makes you vomit!");
#endif
- (void)set_food(PY_FOOD_STARVE - 1);
+ if (!(prace_is_(RACE_GOLEM) ||
+ prace_is_(RACE_ZOMBIE) ||
+ prace_is_(RACE_DEMON) ||
+ prace_is_(RACE_ANDROID) ||
+ prace_is_(RACE_SPECTRE) ||
+ (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
+ {
+ /* Only living creatures get thirsty */
+ (void)set_food(PY_FOOD_STARVE - 1);
+ }
+
(void)set_poisoned(0);
(void)set_paralyzed(p_ptr->paralyzed + 4);
ident = TRUE;
break;
- }
case SV_POTION_POISON:
- {
- if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
+ if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
{
if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
{
}
}
break;
- }
case SV_POTION_BLINDNESS:
- {
if (!p_ptr->resist_blind)
{
if (set_blind(p_ptr->blind + randint0(100) + 100))
}
}
break;
- }
case SV_POTION_CONFUSION: /* Booze */
- {
if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
if (!p_ptr->resist_conf)
ident = TRUE;
if (one_in_(3)) lose_all_info();
else wiz_dark();
- teleport_player(100);
+ (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
wiz_dark();
#ifdef JP
-msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
-msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
+ msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
+ msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
#else
msg_print("You wake up somewhere with a sore head...");
msg_print("You can't remember a thing, or how you got here!");
}
}
break;
- }
case SV_POTION_SLEEP:
- {
if (!p_ptr->free_act)
{
#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
+ msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
#else
- msg_print("You fall asleep.");
+ msg_print("You fall asleep.");
#endif
}
}
break;
- }
case SV_POTION_LOSE_MEMORIES:
- {
if (!p_ptr->hold_life && (p_ptr->exp > 0))
{
#ifdef JP
ident = TRUE;
}
break;
- }
case SV_POTION_RUINATION:
- {
#ifdef JP
msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
(void)dec_stat(A_INT, 25, TRUE);
ident = TRUE;
break;
- }
case SV_POTION_DEC_STR:
- {
if (do_dec_stat(A_STR)) ident = TRUE;
break;
- }
case SV_POTION_DEC_INT:
- {
if (do_dec_stat(A_INT)) ident = TRUE;
break;
- }
case SV_POTION_DEC_WIS:
- {
if (do_dec_stat(A_WIS)) ident = TRUE;
break;
- }
case SV_POTION_DEC_DEX:
- {
if (do_dec_stat(A_DEX)) ident = TRUE;
break;
- }
case SV_POTION_DEC_CON:
- {
if (do_dec_stat(A_CON)) ident = TRUE;
break;
- }
case SV_POTION_DEC_CHR:
- {
if (do_dec_stat(A_CHR)) ident = TRUE;
break;
- }
case SV_POTION_DETONATIONS:
- {
#ifdef JP
msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
(void)set_cut(p_ptr->cut + 5000);
ident = TRUE;
break;
- }
case SV_POTION_DEATH:
- {
chg_virtue(V_VITALITY, -1);
chg_virtue(V_UNLIFE, 5);
#ifdef JP
ident = TRUE;
break;
- }
case SV_POTION_INFRAVISION:
- {
if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
{
ident = TRUE;
}
break;
- }
case SV_POTION_DETECT_INVIS:
- {
if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
{
ident = TRUE;
}
break;
- }
case SV_POTION_SLOW_POISON:
- {
if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
break;
- }
case SV_POTION_CURE_POISON:
- {
if (set_poisoned(0)) ident = TRUE;
break;
- }
case SV_POTION_BOLDNESS:
- {
if (set_afraid(0)) ident = TRUE;
break;
- }
case SV_POTION_SPEED:
- {
if (!p_ptr->fast)
{
if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
(void)set_fast(p_ptr->fast + 5, FALSE);
}
break;
- }
case SV_POTION_RESIST_HEAT:
- {
if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
{
ident = TRUE;
}
break;
- }
case SV_POTION_RESIST_COLD:
- {
if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
{
ident = TRUE;
}
break;
- }
case SV_POTION_HEROISM:
- {
if (set_afraid(0)) ident = TRUE;
if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
if (hp_player(10)) ident = TRUE;
break;
- }
case SV_POTION_BESERK_STRENGTH:
- {
if (set_afraid(0)) ident = TRUE;
if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
if (hp_player(30)) ident = TRUE;
break;
- }
case SV_POTION_CURE_LIGHT:
- {
if (hp_player(damroll(2, 8))) ident = TRUE;
if (set_blind(0)) ident = TRUE;
if (set_cut(p_ptr->cut - 10)) ident = TRUE;
if (set_shero(0,TRUE)) ident = TRUE;
break;
- }
case SV_POTION_CURE_SERIOUS:
- {
if (hp_player(damroll(4, 8))) ident = TRUE;
if (set_blind(0)) ident = TRUE;
if (set_confused(0)) ident = TRUE;
if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
if (set_shero(0,TRUE)) ident = TRUE;
break;
- }
case SV_POTION_CURE_CRITICAL:
- {
if (hp_player(damroll(6, 8))) ident = TRUE;
if (set_blind(0)) ident = TRUE;
if (set_confused(0)) ident = TRUE;
if (set_cut(0)) ident = TRUE;
if (set_shero(0,TRUE)) ident = TRUE;
break;
- }
case SV_POTION_HEALING:
- {
if (hp_player(300)) ident = TRUE;
if (set_blind(0)) ident = TRUE;
if (set_confused(0)) ident = TRUE;
if (set_cut(0)) ident = TRUE;
if (set_shero(0,TRUE)) ident = TRUE;
break;
- }
case SV_POTION_STAR_HEALING:
- {
if (hp_player(1200)) ident = TRUE;
if (set_blind(0)) ident = TRUE;
if (set_confused(0)) ident = TRUE;
if (set_cut(0)) ident = TRUE;
if (set_shero(0,TRUE)) ident = TRUE;
break;
- }
case SV_POTION_LIFE:
- {
chg_virtue(V_VITALITY, 1);
chg_virtue(V_UNLIFE, -5);
#ifdef JP
hp_player(5000);
ident = TRUE;
break;
- }
case SV_POTION_RESTORE_MANA:
- {
if (p_ptr->pclass == CLASS_MAGIC_EATER)
{
int i;
#ifdef JP
msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
#else
- msg_print("Your feel your head clear.");
+ msg_print("You feel your head clear.");
#endif
p_ptr->window |= (PW_PLAYER);
ident = TRUE;
#ifdef JP
msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
#else
- msg_print("Your feel your head clear.");
+ msg_print("You feel your head clear.");
#endif
p_ptr->redraw |= (PR_MANA);
}
if (set_shero(0,TRUE)) ident = TRUE;
break;
- }
case SV_POTION_RESTORE_EXP:
- {
if (restore_level()) ident = TRUE;
break;
- }
case SV_POTION_RES_STR:
- {
if (do_res_stat(A_STR)) ident = TRUE;
break;
- }
case SV_POTION_RES_INT:
- {
if (do_res_stat(A_INT)) ident = TRUE;
break;
- }
case SV_POTION_RES_WIS:
- {
if (do_res_stat(A_WIS)) ident = TRUE;
break;
- }
case SV_POTION_RES_DEX:
- {
if (do_res_stat(A_DEX)) ident = TRUE;
break;
- }
case SV_POTION_RES_CON:
- {
if (do_res_stat(A_CON)) ident = TRUE;
break;
- }
case SV_POTION_RES_CHR:
- {
if (do_res_stat(A_CHR)) ident = TRUE;
break;
- }
case SV_POTION_INC_STR:
- {
if (do_inc_stat(A_STR)) ident = TRUE;
break;
- }
case SV_POTION_INC_INT:
- {
if (do_inc_stat(A_INT)) ident = TRUE;
break;
- }
case SV_POTION_INC_WIS:
- {
if (do_inc_stat(A_WIS)) ident = TRUE;
break;
- }
case SV_POTION_INC_DEX:
- {
if (do_inc_stat(A_DEX)) ident = TRUE;
break;
- }
case SV_POTION_INC_CON:
- {
if (do_inc_stat(A_CON)) ident = TRUE;
break;
- }
case SV_POTION_INC_CHR:
- {
if (do_inc_stat(A_CHR)) ident = TRUE;
break;
- }
case SV_POTION_AUGMENTATION:
- {
if (do_inc_stat(A_STR)) ident = TRUE;
if (do_inc_stat(A_INT)) ident = TRUE;
if (do_inc_stat(A_WIS)) ident = TRUE;
if (do_inc_stat(A_CON)) ident = TRUE;
if (do_inc_stat(A_CHR)) ident = TRUE;
break;
- }
case SV_POTION_ENLIGHTENMENT:
- {
#ifdef JP
msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
#else
chg_virtue(V_KNOWLEDGE, 1);
chg_virtue(V_ENLIGHTEN, 1);
- wiz_lite(FALSE, FALSE);
+ wiz_lite(FALSE);
ident = TRUE;
break;
- }
case SV_POTION_STAR_ENLIGHTENMENT:
- {
#ifdef JP
msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
#else
chg_virtue(V_KNOWLEDGE, 1);
chg_virtue(V_ENLIGHTEN, 2);
msg_print(NULL);
- wiz_lite(TRUE, FALSE);
+ wiz_lite(FALSE);
(void)do_inc_stat(A_INT);
(void)do_inc_stat(A_WIS);
- (void)detect_traps(DETECT_RAD_DEFAULT);
+ (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
(void)detect_doors(DETECT_RAD_DEFAULT);
(void)detect_stairs(DETECT_RAD_DEFAULT);
(void)detect_treasure(DETECT_RAD_DEFAULT);
self_knowledge();
ident = TRUE;
break;
- }
case SV_POTION_SELF_KNOWLEDGE:
- {
#ifdef JP
msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
#else
self_knowledge();
ident = TRUE;
break;
- }
case SV_POTION_EXPERIENCE:
- {
if (p_ptr->prace == RACE_ANDROID) break;
chg_virtue(V_ENLIGHTEN, 1);
if (p_ptr->exp < PY_MAX_EXP)
ident = TRUE;
}
break;
- }
case SV_POTION_RESISTANCE:
- {
(void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
(void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
(void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
(void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
ident = TRUE;
break;
- }
case SV_POTION_CURING:
- {
if (hp_player(50)) ident = TRUE;
if (set_blind(0)) ident = TRUE;
if (set_poisoned(0)) ident = TRUE;
if (set_cut(0)) ident = TRUE;
if (set_image(0)) ident = TRUE;
break;
- }
case SV_POTION_INVULNERABILITY:
- {
(void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
ident = TRUE;
break;
- }
case SV_POTION_NEW_LIFE:
- {
do_cmd_rerate(FALSE);
get_max_stats();
p_ptr->update |= PU_BONUS;
}
ident = TRUE;
break;
- }
case SV_POTION_NEO_TSUYOSHI:
- {
(void)set_image(0);
(void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
ident = TRUE;
break;
- }
case SV_POTION_TSUYOSHI:
- {
#ifdef JP
msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
#else
}
ident = TRUE;
break;
- }
case SV_POTION_POLYMORPH:
- {
if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
{
chg_virtue(V_CHANCE, -5);
}
}
- if (p_ptr->prace == RACE_SKELETON)
+ if (prace_is_(RACE_SKELETON))
{
#ifdef JP
msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
- if (!(object_aware_p(o_ptr)))
+ if (!(object_is_aware(q_ptr)))
{
chg_virtue(V_PATIENCE, -1);
chg_virtue(V_CHANCE, 1);
object_tried(q_ptr);
/* An identification was made */
- if (ident && !object_aware_p(q_ptr))
+ if (ident && !object_is_aware(q_ptr))
{
object_aware(q_ptr);
gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
switch (p_ptr->prace)
{
case RACE_VAMPIRE:
- (void)set_food(p_ptr->food + (o_ptr->pval / 10));
+ (void)set_food(p_ptr->food + (q_ptr->pval / 10));
break;
case RACE_SKELETON:
/* Do nothing */
break;
case RACE_GOLEM:
case RACE_ZOMBIE:
- case RACE_ENT:
case RACE_DEMON:
case RACE_SPECTRE:
+ set_food(p_ptr->food + ((q_ptr->pval) / 20));
+ break;
case RACE_ANDROID:
- set_food(p_ptr->food + ((o_ptr->pval) / 20));
+ if (q_ptr->tval == TV_FLASK)
+ {
+#ifdef JP
+ msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
+#else
+ msg_print("You replenish yourself with the oil.");
+#endif
+ set_food(p_ptr->food + 5000);
+ }
+ else
+ {
+ set_food(p_ptr->food + ((q_ptr->pval) / 20));
+ }
+ break;
+ case RACE_ENT:
+#ifdef JP
+ msg_print("¿åʬ¤ò¼è¤ê¹þ¤ó¤À¡£");
+#else
+ msg_print("You are moistened.");
+#endif
+ set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
break;
default:
- (void)set_food(p_ptr->food + o_ptr->pval);
+ (void)set_food(p_ptr->food + q_ptr->pval);
break;
}
break;
case MIMIC_DEMON:
case MIMIC_DEMON_LORD:
- set_food(p_ptr->food + ((o_ptr->pval) / 20));
+ set_food(p_ptr->food + ((q_ptr->pval) / 20));
break;
case MIMIC_VAMPIRE:
- (void)set_food(p_ptr->food + (o_ptr->pval / 10));
+ (void)set_food(p_ptr->food + (q_ptr->pval / 10));
break;
default:
- (void)set_food(p_ptr->food + o_ptr->pval);
+ (void)set_food(p_ptr->food + q_ptr->pval);
break;
}
}
+/*
+ * Hook to determine if an object can be quaffed
+ */
+static bool item_tester_hook_quaff(object_type *o_ptr)
+{
+ if (o_ptr->tval == TV_POTION) return TRUE;
+
+ if (prace_is_(RACE_ANDROID))
+ {
+ if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * Quaff some potion (from the pack or floor)
+ */
void do_cmd_quaff_potion(void)
{
int item;
}
/* Restrict choices to potions */
- item_tester_tval = TV_POTION;
+ item_tester_hook = item_tester_hook_quaff;
/* Get an item */
#ifdef JP
* include scrolls with no effects but recharge or identify, which are
* cancelled before use. XXX Reading them still takes a turn, though.
*/
-static void do_cmd_read_scroll_aux(int item)
+static void do_cmd_read_scroll_aux(int item, bool known)
{
int k, used_up, ident, lev;
object_type *o_ptr;
- char Rumor[1024];
/* Get the item (in the pack) */
return;
}
- if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
- {
- stop_singing();
- }
+ if (music_singing_any()) stop_singing();
+
+ /* Hex */
+ if (hex_spelling_any() && ((p_ptr->lev < 35) || hex_spell_fully())) stop_hex_spell_all();
/* Not identified yet */
ident = FALSE;
/* Object level */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
/* Assume the scroll will get used up */
used_up = TRUE;
case SV_SCROLL_CURSE_WEAPON:
{
- if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
+ k = 0;
+ if (buki_motteruka(INVEN_RARM))
+ {
+ k = INVEN_RARM;
+ if (buki_motteruka(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
+ }
+ else if (buki_motteruka(INVEN_LARM)) k = INVEN_LARM;
+ if (k && curse_weapon(FALSE, k)) ident = TRUE;
break;
}
case SV_SCROLL_PHASE_DOOR:
{
- teleport_player(10);
+ teleport_player(10, 0L);
ident = TRUE;
break;
}
case SV_SCROLL_TELEPORT:
{
- teleport_player(100);
+ teleport_player(100, 0L);
ident = TRUE;
break;
}
case SV_SCROLL_TELEPORT_LEVEL:
{
- (void)teleport_player_level();
+ (void)teleport_level(0);
ident = TRUE;
break;
}
case SV_SCROLL_IDENTIFY:
{
+ if (!ident_spell(FALSE)) used_up = FALSE;
ident = TRUE;
- if (!ident_spell(FALSE, TRUE)) used_up = FALSE;
break;
}
case SV_SCROLL_STAR_IDENTIFY:
{
+ if (!identify_fully(FALSE)) used_up = FALSE;
ident = TRUE;
- if (!identify_fully(FALSE, TRUE)) used_up = FALSE;
break;
}
case SV_SCROLL_DETECT_TRAP:
{
- if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
break;
}
case SV_SCROLL_STAR_DESTRUCTION:
{
- if (destroy_area(py, px, 13+randint0(5), TRUE))
+ if (destroy_area(py, px, 13 + randint0(5), FALSE))
ident = TRUE;
else
#ifdef JP
case SV_SCROLL_SPELL:
{
- if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_IMITATOR) || (p_ptr->pclass == CLASS_MINDCRAFTER) || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_MAGIC_EATER) || (p_ptr->pclass == CLASS_RED_MAGE) || (p_ptr->pclass == CLASS_SAMURAI) || (p_ptr->pclass == CLASS_BLUE_MAGE) || (p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BERSERKER) || (p_ptr->pclass == CLASS_SMITH) || (p_ptr->pclass == CLASS_MIRROR_MASTER) || (p_ptr->pclass == CLASS_NINJA)) break;
+ if ((p_ptr->pclass == CLASS_WARRIOR) ||
+ (p_ptr->pclass == CLASS_IMITATOR) ||
+ (p_ptr->pclass == CLASS_MINDCRAFTER) ||
+ (p_ptr->pclass == CLASS_SORCERER) ||
+ (p_ptr->pclass == CLASS_ARCHER) ||
+ (p_ptr->pclass == CLASS_MAGIC_EATER) ||
+ (p_ptr->pclass == CLASS_RED_MAGE) ||
+ (p_ptr->pclass == CLASS_SAMURAI) ||
+ (p_ptr->pclass == CLASS_BLUE_MAGE) ||
+ (p_ptr->pclass == CLASS_CAVALRY) ||
+ (p_ptr->pclass == CLASS_BERSERKER) ||
+ (p_ptr->pclass == CLASS_SMITH) ||
+ (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
+ (p_ptr->pclass == CLASS_NINJA) ||
+ (p_ptr->pclass == CLASS_SNIPER)) break;
p_ptr->add_spells++;
p_ptr->update |= (PU_SPELLS);
ident = TRUE;
{
fire_ball(GF_FIRE, 0, 666, 4);
/* Note: "Double" damage since it is centered on the player ... */
- if (!(p_ptr->oppose_fire || p_ptr->resist_fire || p_ptr->immune_fire))
+ if (!(IS_OPPOSE_FIRE() || p_ptr->resist_fire || p_ptr->immune_fire))
#ifdef JP
take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
#else
case SV_SCROLL_ICE:
{
fire_ball(GF_ICE, 0, 777, 4);
- if (!(p_ptr->oppose_cold || p_ptr->resist_cold || p_ptr->immune_cold))
+ if (!(IS_OPPOSE_COLD() || p_ptr->resist_cold || p_ptr->immune_cold))
#ifdef JP
take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
#else
case SV_SCROLL_RUMOR:
{
- errr err = 0;
-
- switch (randint1(20))
- {
- case 1:
-#ifdef JP
-err = get_rnd_line("chainswd_j.txt", 0, Rumor);
-#else
- err = get_rnd_line("chainswd.txt", 0, Rumor);
-#endif
-
- break;
- case 2:
-#ifdef JP
-err = get_rnd_line("error_j.txt", 0, Rumor);
-#else
- err = get_rnd_line("error.txt", 0, Rumor);
-#endif
-
- break;
- case 3:
- case 4:
- case 5:
-#ifdef JP
-err = get_rnd_line("death_j.txt", 0, Rumor);
-#else
- err = get_rnd_line("death.txt", 0, Rumor);
-#endif
-
- break;
- default:
-#ifdef JP
-err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
-#else
- err = get_rnd_line("rumors.txt", 0, Rumor);
-#endif
-
- break;
- }
-
- /* An error occured */
-#ifdef JP
-if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
-#else
- if (err) strcpy(Rumor, "Some rumors are wrong.");
-#endif
-
-
#ifdef JP
-msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
+ msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
#else
msg_print("There is message on the scroll. It says:");
#endif
msg_print(NULL);
- msg_format("%s", Rumor);
+ display_rumor(TRUE);
msg_print(NULL);
#ifdef JP
-msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
+ msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
#else
msg_print("The scroll disappears in a puff of smoke!");
#endif
if (!reset_recall()) used_up = FALSE;
break;
}
+
+ case SV_SCROLL_AMUSEMENT:
+ {
+ ident = TRUE;
+ amusement(py, px, 1, FALSE);
+ break;
+ }
+
+ case SV_SCROLL_STAR_AMUSEMENT:
+ {
+ ident = TRUE;
+ amusement(py, px, randint1(2) + 1, FALSE);
+ break;
+ }
}
}
else if (o_ptr->name1 == ART_GHB)
msg_print(NULL);
msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
#else
- msg_print("'One Ring to rule them all, ");
+ msg_print("'One Ring to rule them all, ");
msg_print(NULL);
msg_print("One Ring to find them, ");
msg_print(NULL);
#endif
used_up = FALSE;
}
- else if (o_ptr->tval==TV_PARCHEMENT)
+ else if (o_ptr->tval==TV_PARCHMENT)
{
cptr q;
char o_name[MAX_NLEN];
q=format("book-%d_jp.txt",o_ptr->sval);
/* Display object description */
- object_desc(o_name, o_ptr, TRUE, 0);
+ object_desc(o_name, o_ptr, OD_NAME_ONLY);
/* Build the filename */
- path_build(buf, 1024, ANGBAND_DIR_FILE, q);
+ path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
/* Peruse the help file */
(void)show_file(TRUE, buf, o_name, 0, 0);
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
- if (!(object_aware_p(o_ptr)))
+ if (!(object_is_aware(o_ptr)))
{
chg_virtue(V_PATIENCE, -1);
chg_virtue(V_CHANCE, 1);
object_tried(o_ptr);
/* An identification was made */
- if (ident && !object_aware_p(o_ptr))
+ if (ident && !object_is_aware(o_ptr))
{
object_aware(o_ptr);
gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
floor_item_describe(0 - item);
floor_item_optimize(0 - item);
}
-
- /* Delayed optimization */
- optimize_inventry_auto_destroy();
}
*/
static bool item_tester_hook_readable(object_type *o_ptr)
{
- if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHEMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
+ if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
/* Assume not */
return (FALSE);
void do_cmd_read_scroll(void)
{
+ object_type *o_ptr;
int item;
cptr q, s;
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
+ /* Get the item (in the pack) */
+ if (item >= 0)
+ {
+ o_ptr = &inventory[item];
+ }
+
+ /* Get the item (on the floor) */
+ else
+ {
+ o_ptr = &o_list[0 - item];
+ }
+
/* Read the scroll */
- do_cmd_read_scroll_aux(item);
+ do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));
}
-static int staff_effect(int sval, bool *use_charge, bool magic)
+static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, bool known)
{
int k;
int ident = FALSE;
+ int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
+ int detect_rad = powerful ? DETECT_RAD_DEFAULT * 3 / 2 : DETECT_RAD_DEFAULT;
/* Analyze the staff */
switch (sval)
{
if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
}
- if (unlite_area(10, 3)) ident = TRUE;
+ if (unlite_area(10, (powerful ? 6 : 3))) ident = TRUE;
break;
}
case SV_STAFF_SUMMONING:
{
- for (k = 0; k < randint1(4); k++)
+ const int times = randint1(powerful ? 8 : 4);
+ for (k = 0; k < times; k++)
{
if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
case SV_STAFF_TELEPORTATION:
{
- teleport_player(100);
+ teleport_player((powerful ? 150 : 100), 0L);
ident = TRUE;
break;
}
case SV_STAFF_IDENTIFY:
{
- if (!ident_spell(FALSE, TRUE)) *use_charge = FALSE;
+ if (powerful) {
+ if (!identify_fully(FALSE)) *use_charge = FALSE;
+ } else {
+ if (!ident_spell(FALSE)) *use_charge = FALSE;
+ }
ident = TRUE;
break;
}
case SV_STAFF_REMOVE_CURSE:
{
- if (remove_curse())
+ bool result = powerful ? remove_all_curse() : remove_curse();
+ if (result)
{
if (magic)
{
}
for (k = 0; k < num; k++)
{
- attempts = 1000;
+ attempts = 1000;
- while(attempts--)
+ while (attempts--)
{
scatter(&y, &x, py, px, 4, 0);
- if (!cave_floor_bold(y, x)) continue;
+ if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
- if ((y != py) || (x != px)) break;
+ if (!player_bold(y, x)) break;
}
- project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
+ project(0, 0, y, x, damroll(6 + lev / 8, 10), GF_LITE_WEAK,
(PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
}
ident = TRUE;
case SV_STAFF_LITE:
{
- if (lite_area(damroll(2, 8), 2)) ident = TRUE;
+ if (lite_area(damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
break;
}
case SV_STAFF_MAPPING:
{
- map_area(DETECT_RAD_MAP);
+ map_area(powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
ident = TRUE;
break;
}
case SV_STAFF_DETECT_GOLD:
{
- if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
- if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_treasure(detect_rad)) ident = TRUE;
+ if (detect_objects_gold(detect_rad)) ident = TRUE;
break;
}
case SV_STAFF_DETECT_ITEM:
{
- if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_objects_normal(detect_rad)) ident = TRUE;
break;
}
case SV_STAFF_DETECT_TRAP:
{
- if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_traps(detect_rad, known)) ident = TRUE;
break;
}
case SV_STAFF_DETECT_DOOR:
{
- if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
- if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_doors(detect_rad)) ident = TRUE;
+ if (detect_stairs(detect_rad)) ident = TRUE;
break;
}
case SV_STAFF_DETECT_INVIS:
{
- if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_monsters_invis(detect_rad)) ident = TRUE;
break;
}
case SV_STAFF_DETECT_EVIL:
{
- if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_monsters_evil(detect_rad)) ident = TRUE;
break;
}
case SV_STAFF_CURE_LIGHT:
{
- if (hp_player(damroll(2, 8))) ident = TRUE;
+ if (hp_player(damroll((powerful ? 4 : 2), 8))) ident = TRUE;
+ if (powerful) {
+ if (set_blind(0)) ident = TRUE;
+ if (set_poisoned(0)) ident = TRUE;
+ if (set_cut(p_ptr->cut - 10)) ident = TRUE;
+ }
if (set_shero(0,TRUE)) ident = TRUE;
break;
}
case SV_STAFF_HEALING:
{
- if (hp_player(300)) ident = TRUE;
+ if (hp_player(powerful ? 500 : 300)) ident = TRUE;
if (set_stun(0)) ident = TRUE;
if (set_cut(0)) ident = TRUE;
if (set_shero(0,TRUE)) ident = TRUE;
#ifdef JP
msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
#else
- msg_print("Your feel your head clear.");
+ msg_print("You feel your head clear.");
#endif
p_ptr->redraw |= (PR_MANA);
case SV_STAFF_SLEEP_MONSTERS:
{
- if (sleep_monsters()) ident = TRUE;
+ if (sleep_monsters(lev)) ident = TRUE;
break;
}
case SV_STAFF_SLOW_MONSTERS:
{
- if (slow_monsters()) ident = TRUE;
+ if (slow_monsters(lev)) ident = TRUE;
break;
}
case SV_STAFF_SPEED:
{
- if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
+ if (set_fast(randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
break;
}
case SV_STAFF_DISPEL_EVIL:
{
- if (dispel_evil(80)) ident = TRUE;
+ if (dispel_evil(powerful ? 120 : 80)) ident = TRUE;
break;
}
case SV_STAFF_POWER:
{
- if (dispel_monsters(150)) ident = TRUE;
+ if (dispel_monsters(powerful ? 225 : 150)) ident = TRUE;
break;
}
case SV_STAFF_HOLINESS:
{
- if (dispel_evil(150)) ident = TRUE;
- k = 3 * p_ptr->lev;
+ if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
+ k = 3 * lev;
if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
if (set_poisoned(0)) ident = TRUE;
if (set_afraid(0)) ident = TRUE;
case SV_STAFF_GENOCIDE:
{
- (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
+ (void)symbol_genocide((magic ? lev + 50 : 200), TRUE);
ident = TRUE;
break;
}
case SV_STAFF_EARTHQUAKES:
{
- if (earthquake(py, px, 10))
+ if (earthquake(py, px, (powerful ? 15 : 10)))
ident = TRUE;
else
#ifdef JP
case SV_STAFF_DESTRUCTION:
{
- if (destroy_area(py, px, 13+randint0(5), TRUE))
+ if (destroy_area(py, px, (powerful ? 18 : 13) + randint0(5), FALSE))
ident = TRUE;
break;
#else
msg_print("Mighty magics rend your enemies!");
#endif
- project(0, 5, py, px,
- (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID | PROJECT_NO_REF, -1);
+ project(0, (powerful ? 7 : 5), py, px,
+ (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_HIGH_MAGE) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_MAGIC_EATER) && (p_ptr->pclass != CLASS_BLUE_MAGE))
{
#ifdef JP
break;
}
+
+ case SV_STAFF_NOTHING:
+ {
+#ifdef JP
+ msg_print("²¿¤âµ¯¤é¤Ê¤«¤Ã¤¿¡£");
+#else
+ msg_print("Nothing happen.");
+#endif
+ if (prace_is_(RACE_SKELETON) || prace_is_(RACE_GOLEM) ||
+ prace_is_(RACE_ZOMBIE) || prace_is_(RACE_SPECTRE))
+#ifdef JP
+ msg_print("¤â¤Ã¤¿¤¤¤Ê¤¤»ö¤ò¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£¿©¤Ùʪ¤ÏÂçÀڤˤ·¤Ê¤¯¤Æ¤Ï¡£");
+#else
+ msg_print("What a waste. It's your food!");
+#endif
+ break;
+ }
}
return ident;
}
energy_use = 100;
/* Extract the item level */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
if (lev > 50) lev = 50 + (lev - 50)/2;
/* Base chance of success */
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+ p_ptr->window |= (PW_INVEN);
return;
}
/* Sound */
sound(SOUND_ZAP);
- ident = staff_effect(o_ptr->sval, &use_charge, FALSE);
+ ident = staff_effect(o_ptr->sval, &use_charge, FALSE, FALSE, object_is_aware(o_ptr));
- if (!(object_aware_p(o_ptr)))
+ if (!(object_is_aware(o_ptr)))
{
chg_virtue(V_PATIENCE, -1);
chg_virtue(V_CHANCE, 1);
object_tried(o_ptr);
/* An identification was made */
- if (ident && !object_aware_p(o_ptr))
+ if (ident && !object_is_aware(o_ptr))
{
object_aware(o_ptr);
gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
{
floor_item_charges(0 - item);
}
-
- /* Delayed optimization */
- optimize_inventry_auto_destroy();
}
}
-static int wand_effect(int sval, int dir, bool magic)
+static int wand_effect(int sval, int dir, bool powerful, bool magic)
{
int ident = FALSE;
+ int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
+ int rad = powerful ? 3 : 2;
/* XXX Hack -- Wand of wonder can do anything before it */
if (sval == SV_WAND_WONDER)
{
case SV_WAND_HEAL_MONSTER:
{
- if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
+ int dam = damroll((powerful ? 20 : 10), 10);
+ if (heal_monster(dir, dam)) ident = TRUE;
break;
}
case SV_WAND_HASTE_MONSTER:
{
- if (speed_monster(dir)) ident = TRUE;
+ if (speed_monster(dir, lev)) ident = TRUE;
break;
}
case SV_WAND_TELEPORT_AWAY:
{
- if (teleport_monster(dir)) ident = TRUE;
+ int distance = MAX_SIGHT * (powerful ? 8 : 5);
+ if (teleport_monster(dir, distance)) ident = TRUE;
break;
}
case SV_WAND_DISARMING:
{
if (disarm_trap(dir)) ident = TRUE;
+ if (powerful && disarm_traps_touch()) ident = TRUE;
break;
}
case SV_WAND_TRAP_DOOR_DEST:
{
if (destroy_door(dir)) ident = TRUE;
+ if (powerful && destroy_doors_touch()) ident = TRUE;
break;
}
case SV_WAND_STONE_TO_MUD:
{
- if (wall_to_mud(dir)) ident = TRUE;
+ int dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
+ if (wall_to_mud(dir, dam)) ident = TRUE;
break;
}
case SV_WAND_LITE:
{
+ int dam = damroll((powerful ? 12 : 6), 8);
#ifdef JP
msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
#else
msg_print("A line of blue shimmering light appears.");
#endif
- (void)lite_line(dir);
+ (void)lite_line(dir, dam);
ident = TRUE;
break;
}
case SV_WAND_SLEEP_MONSTER:
{
- if (sleep_monster(dir)) ident = TRUE;
+ if (sleep_monster(dir, lev)) ident = TRUE;
break;
}
case SV_WAND_SLOW_MONSTER:
{
- if (slow_monster(dir)) ident = TRUE;
+ if (slow_monster(dir, lev)) ident = TRUE;
break;
}
case SV_WAND_CONFUSE_MONSTER:
{
- if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
+ if (confuse_monster(dir, lev)) ident = TRUE;
break;
}
case SV_WAND_FEAR_MONSTER:
{
- if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
+ if (fear_monster(dir, lev)) ident = TRUE;
break;
}
case SV_WAND_DRAIN_LIFE:
{
- if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
+ if (drain_life(dir, 80 + lev)) ident = TRUE;
break;
}
case SV_WAND_POLYMORPH:
{
- if (poly_monster(dir)) ident = TRUE;
+ if (poly_monster(dir, lev)) ident = TRUE;
break;
}
case SV_WAND_STINKING_CLOUD:
{
- fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
+ fire_ball(GF_POIS, dir, 12 + lev / 4, rad);
ident = TRUE;
break;
}
case SV_WAND_MAGIC_MISSILE:
{
- fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
+ fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + lev / 10, 6));
ident = TRUE;
break;
}
case SV_WAND_ACID_BOLT:
{
- fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
+ fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + lev / 7, 8));
ident = TRUE;
break;
}
case SV_WAND_CHARM_MONSTER:
{
- if (charm_monster(dir, MAX(20, p_ptr->lev)))
+ if (charm_monster(dir, MAX(20, lev)))
ident = TRUE;
break;
}
case SV_WAND_FIRE_BOLT:
{
- fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
+ fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + lev / 6, 8));
ident = TRUE;
break;
}
case SV_WAND_COLD_BOLT:
{
- fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
+ fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + lev / 8, 8));
ident = TRUE;
break;
}
case SV_WAND_ACID_BALL:
{
- fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
+ fire_ball(GF_ACID, dir, 60 + 3 * lev / 4, rad);
ident = TRUE;
break;
}
case SV_WAND_ELEC_BALL:
{
- fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
+ fire_ball(GF_ELEC, dir, 40 + 3 * lev / 4, rad);
ident = TRUE;
break;
}
case SV_WAND_FIRE_BALL:
{
- fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
+ fire_ball(GF_FIRE, dir, 70 + 3 * lev / 4, rad);
ident = TRUE;
break;
}
case SV_WAND_COLD_BALL:
{
- fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
+ fire_ball(GF_COLD, dir, 50 + 3 * lev / 4, rad);
ident = TRUE;
break;
}
case SV_WAND_DRAGON_FIRE:
{
- fire_ball(GF_FIRE, dir, 200, -3);
+ fire_ball(GF_FIRE, dir, (powerful ? 300 : 200), -3);
ident = TRUE;
break;
}
case SV_WAND_DRAGON_COLD:
{
- fire_ball(GF_COLD, dir, 180, -3);
+ fire_ball(GF_COLD, dir, (powerful ? 270 : 180), -3);
ident = TRUE;
break;
}
case SV_WAND_DRAGON_BREATH:
{
+ int dam;
+ int typ;
+
switch (randint1(5))
{
case 1:
- {
- fire_ball(GF_ACID, dir, 240, -3);
+ dam = 240;
+ typ = GF_ACID;
break;
- }
-
case 2:
- {
- fire_ball(GF_ELEC, dir, 210, -3);
+ dam = 210;
+ typ = GF_ELEC;
break;
- }
-
case 3:
- {
- fire_ball(GF_FIRE, dir, 240, -3);
+ dam = 240;
+ typ = GF_FIRE;
break;
- }
-
case 4:
- {
- fire_ball(GF_COLD, dir, 210, -3);
+ dam = 210;
+ typ = GF_COLD;
break;
- }
-
default:
- {
- fire_ball(GF_POIS, dir, 180, -3);
+ dam = 180;
+ typ = GF_POIS;
break;
- }
}
+ if (powerful) dam = (dam * 3) / 2;
+
+ fire_ball(typ, dir, dam, -3);
+
ident = TRUE;
break;
}
case SV_WAND_DISINTEGRATE:
{
- fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
+ fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(lev * 2), rad);
ident = TRUE;
break;
}
msg_print("You launch a rocket!");
#endif
- fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
+ fire_rocket(GF_ROCKET, dir, 250 + lev * 3, rad);
ident = TRUE;
break;
}
case SV_WAND_STRIKING:
{
- fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
+ fire_bolt(GF_METEOR, dir, damroll(15 + lev / 3, 13));
ident = TRUE;
break;
}
case SV_WAND_GENOCIDE:
{
- fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
+ fire_ball_hide(GF_GENOCIDE, dir, magic ? lev + 50 : 250, 0);
ident = TRUE;
break;
}
/* Allow direction to be cancelled for free */
- if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
+ if (object_is_aware(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
|| o_ptr->sval == SV_WAND_HASTE_MONSTER))
target_pet = TRUE;
if (!get_aim_dir(&dir))
energy_use = 100;
/* Get the level */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
if (lev > 50) lev = 50 + (lev - 50)/2;
/* Base chance of success */
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+ p_ptr->window |= (PW_INVEN);
return;
}
/* Sound */
sound(SOUND_ZAP);
- ident = wand_effect(o_ptr->sval, dir, FALSE);
+ ident = wand_effect(o_ptr->sval, dir, FALSE, FALSE);
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
- if (!(object_aware_p(o_ptr)))
+ if (!(object_is_aware(o_ptr)))
{
chg_virtue(V_PATIENCE, -1);
chg_virtue(V_CHANCE, 1);
object_tried(o_ptr);
/* Apply identification */
- if (ident && !object_aware_p(o_ptr))
+ if (ident && !object_is_aware(o_ptr))
{
object_aware(o_ptr);
gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
}
-static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
+static int rod_effect(int sval, int dir, bool *use_charge, bool powerful, bool magic)
{
int ident = FALSE;
+ int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
+ int detect_rad = powerful ? DETECT_RAD_DEFAULT * 3 / 2 : DETECT_RAD_DEFAULT;
+ int rad = powerful ? 3 : 2;
+
+ /* Unused */
+ (void)magic;
/* Analyze the rod */
switch (sval)
{
case SV_ROD_DETECT_TRAP:
{
- if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_traps(detect_rad, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
break;
}
case SV_ROD_DETECT_DOOR:
{
- if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
- if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
+ if (detect_doors(detect_rad)) ident = TRUE;
+ if (detect_stairs(detect_rad)) ident = TRUE;
break;
}
case SV_ROD_IDENTIFY:
{
+ if (powerful) {
+ if (!identify_fully(FALSE)) *use_charge = FALSE;
+ } else {
+ if (!ident_spell(FALSE)) *use_charge = FALSE;
+ }
ident = TRUE;
- if (!ident_spell(FALSE, FALSE)) *use_charge = FALSE;
break;
}
case SV_ROD_ILLUMINATION:
{
- if (lite_area(damroll(2, 8), 2)) ident = TRUE;
+ if (lite_area(damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
break;
}
case SV_ROD_MAPPING:
{
- map_area(DETECT_RAD_MAP);
+ map_area(powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
ident = TRUE;
break;
}
case SV_ROD_DETECTION:
{
- detect_all(DETECT_RAD_DEFAULT);
+ detect_all(detect_rad);
ident = TRUE;
break;
}
case SV_ROD_HEALING:
{
- if (hp_player(500)) ident = TRUE;
+ if (hp_player(powerful ? 750 : 500)) ident = TRUE;
if (set_stun(0)) ident = TRUE;
if (set_cut(0)) ident = TRUE;
if (set_shero(0,TRUE)) ident = TRUE;
case SV_ROD_SPEED:
{
- if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
+ if (set_fast(randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
break;
}
case SV_ROD_PESTICIDE:
{
- if (dispel_monsters(4)) ident = TRUE;
+ if (dispel_monsters(powerful ? 8 : 4)) ident = TRUE;
break;
}
case SV_ROD_TELEPORT_AWAY:
{
- if (teleport_monster(dir)) ident = TRUE;
+ int distance = MAX_SIGHT * (powerful ? 8 : 5);
+ if (teleport_monster(dir, distance)) ident = TRUE;
break;
}
case SV_ROD_DISARMING:
{
if (disarm_trap(dir)) ident = TRUE;
+ if (powerful && disarm_traps_touch()) ident = TRUE;
break;
}
case SV_ROD_LITE:
{
+ int dam = damroll((powerful ? 12 : 6), 8);
#ifdef JP
msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
#else
msg_print("A line of blue shimmering light appears.");
#endif
- (void)lite_line(dir);
+ (void)lite_line(dir, dam);
ident = TRUE;
break;
}
case SV_ROD_SLEEP_MONSTER:
{
- if (sleep_monster(dir)) ident = TRUE;
+ if (sleep_monster(dir, lev)) ident = TRUE;
break;
}
case SV_ROD_SLOW_MONSTER:
{
- if (slow_monster(dir)) ident = TRUE;
+ if (slow_monster(dir, lev)) ident = TRUE;
break;
}
case SV_ROD_DRAIN_LIFE:
{
- if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
+ if (drain_life(dir, 70 + 3 * lev / 2)) ident = TRUE;
break;
}
case SV_ROD_POLYMORPH:
{
- if (poly_monster(dir)) ident = TRUE;
+ if (poly_monster(dir, lev)) ident = TRUE;
break;
}
case SV_ROD_ACID_BOLT:
{
- fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
+ fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + lev / 7, 8));
ident = TRUE;
break;
}
case SV_ROD_ELEC_BOLT:
{
- fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
+ fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + lev / 9, 8));
ident = TRUE;
break;
}
case SV_ROD_FIRE_BOLT:
{
- fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
+ fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + lev / 6, 8));
ident = TRUE;
break;
}
case SV_ROD_COLD_BOLT:
{
- fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
+ fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + lev / 8, 8));
ident = TRUE;
break;
}
case SV_ROD_ACID_BALL:
{
- fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
+ fire_ball(GF_ACID, dir, 60 + lev, rad);
ident = TRUE;
break;
}
case SV_ROD_ELEC_BALL:
{
- fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
+ fire_ball(GF_ELEC, dir, 40 + lev, rad);
ident = TRUE;
break;
}
case SV_ROD_FIRE_BALL:
{
- fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
+ fire_ball(GF_FIRE, dir, 70 + lev, rad);
ident = TRUE;
break;
}
case SV_ROD_COLD_BALL:
{
- fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
+ fire_ball(GF_COLD, dir, 50 + lev, rad);
ident = TRUE;
break;
}
case SV_ROD_STONE_TO_MUD:
{
- if (wall_to_mud(dir)) ident = TRUE;
+ int dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
+ if (wall_to_mud(dir, dam)) ident = TRUE;
break;
}
*/
static void do_cmd_zap_rod_aux(int item)
{
- int ident, chance, dir, lev, fail;
+ int ident, chance, lev, fail;
+ int dir = 0;
object_type *o_ptr;
bool success;
/* Get a direction (unless KNOWN not to need it) */
if (((o_ptr->sval >= SV_ROD_MIN_DIRECTION) && (o_ptr->sval != SV_ROD_HAVOC) && (o_ptr->sval != SV_ROD_AGGRAVATE) && (o_ptr->sval != SV_ROD_PESTICIDE)) ||
- !object_aware_p(o_ptr))
+ !object_is_aware(o_ptr))
{
/* Get a direction, allow cancel */
if (!get_aim_dir(&dir)) return;
energy_use = 100;
/* Extract the item level */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
/* Base chance of success */
chance = p_ptr->skill_dev;
/* Sound */
sound(SOUND_ZAP);
- ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
+ ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE, FALSE);
/* Increase the timeout by the rod kind's pval. -LM- */
if (use_charge) o_ptr->timeout += k_ptr->pval;
/* Combine / Reorder the pack (later) */
p_ptr->notice |= (PN_COMBINE | PN_REORDER);
- if (!(object_aware_p(o_ptr)))
+ if (!(object_is_aware(o_ptr)))
{
chg_virtue(V_PATIENCE, -1);
chg_virtue(V_CHANCE, 1);
object_tried(o_ptr);
/* Successfully determined the object function */
- if (ident && !object_aware_p(o_ptr))
+ if (ident && !object_is_aware(o_ptr))
{
object_aware(o_ptr);
gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
*/
static bool item_tester_hook_activate(object_type *o_ptr)
{
- u32b f1, f2, f3;
+ u32b flgs[TR_FLAG_SIZE];
/* Not known */
- if (!object_known_p(o_ptr)) return (FALSE);
+ if (!object_is_known(o_ptr)) return (FALSE);
/* Extract the flags */
- object_flags(o_ptr, &f1, &f2, &f3);
+ object_flags(o_ptr, flgs);
/* Check activation flag */
- if (f3 & (TR3_ACTIVATE)) return (TRUE);
-
- if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
- {
- switch(o_ptr->xtra3)
- case ESSENCE_TMP_RES_ACID:
- case ESSENCE_TMP_RES_ELEC:
- case ESSENCE_TMP_RES_FIRE:
- case ESSENCE_TMP_RES_COLD:
- case ESSENCE_EARTHQUAKE:
- return (TRUE);
- }
+ if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
/* Assume not */
return (FALSE);
monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
+ /* Unused */
+ (void)v;
+
if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
return w1 <= w2;
}
+
/*
* Activate a wielded object. Wielded objects never stack.
* And even if they did, activatable objects never stack.
*/
static void do_cmd_activate_aux(int item)
{
- int k, dir, lev, chance, fail;
+ int dir, lev, chance, fail;
object_type *o_ptr;
bool success;
energy_use = 100;
/* Extract the item level */
- lev = get_object_level(o_ptr);
+ lev = k_info[o_ptr->k_idx].level;
/* Hack -- use artifact level instead */
- if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
- else if (o_ptr->art_name)
+ if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
+ else if (object_is_random_artifact(o_ptr))
{
- switch (o_ptr->xtra2)
- {
- case ACT_SUNLIGHT:
- case ACT_BO_MISS_1:
- case ACT_BA_POIS_1:
- case ACT_CONFUSE:
- case ACT_SLEEP:
- case ACT_CURE_LW:
- case ACT_CURE_POISON:
- case ACT_BERSERK:
- case ACT_LIGHT:
- case ACT_DEST_DOOR:
- case ACT_TELEPORT:
- lev = 10;
- break;
- case ACT_BO_ELEC_1:
- case ACT_BO_ACID_1:
- case ACT_BO_COLD_1:
- case ACT_BO_FIRE_1:
- case ACT_MAP_LIGHT:
- case ACT_STONE_MUD:
- case ACT_CURE_MW:
- case ACT_QUAKE:
- lev = 20;
- break;
- case ACT_DRAIN_1:
- case ACT_TELE_AWAY:
- case ACT_ESP:
- case ACT_RESIST_ALL:
- case ACT_DETECT_ALL:
- case ACT_RECALL:
- case ACT_SATIATE:
- case ACT_RECHARGE:
- lev = 30;
- break;
- case ACT_BA_COLD_1:
- case ACT_BA_FIRE_1:
- case ACT_TERROR:
- case ACT_PROT_EVIL:
- case ACT_ID_PLAIN:
- case ACT_REST_LIFE:
- case ACT_SPEED:
- case ACT_BANISH_EVIL:
- lev = 40;
- break;
- case ACT_DRAIN_2:
- case ACT_VAMPIRE_1:
- case ACT_BO_MISS_2:
- case ACT_BA_FIRE_2:
- case ACT_WHIRLWIND:
- case ACT_CHARM_ANIMAL:
- case ACT_SUMMON_ANIMAL:
- case ACT_DISP_EVIL:
- case ACT_DISP_GOOD:
- case ACT_XTRA_SPEED:
- case ACT_DETECT_XTRA:
- case ACT_ID_FULL:
- lev = 50;
- break;
- case ACT_VAMPIRE_2:
- case ACT_BA_COLD_3:
- case ACT_BA_ELEC_3:
- case ACT_GENOCIDE:
- case ACT_CHARM_UNDEAD:
- case ACT_CHARM_OTHER:
- case ACT_SUMMON_PHANTOM:
- case ACT_SUMMON_ELEMENTAL:
- case ACT_RUNE_EXPLO:
- lev = 60;
- break;
- case ACT_MASS_GENO:
- case ACT_CHARM_ANIMALS:
- case ACT_CHARM_OTHERS:
- case ACT_CURE_700:
- case ACT_RUNE_PROT:
- case ACT_ALCHEMY:
- case ACT_REST_ALL:
- lev = 70;
- break;
- case ACT_CALL_CHAOS:
- case ACT_ROCKET:
- case ACT_BA_MISS_3:
- case ACT_CURE_1000:
- case ACT_DIM_DOOR:
- case ACT_SUMMON_UNDEAD:
- case ACT_SUMMON_DEMON:
- lev = 80;
- break;
- case ACT_WRAITH:
- case ACT_INVULN:
- lev = 100;
- break;
- default:
- lev = 0;
+ const activation_type* const act_ptr = find_activation_info(o_ptr);
+ if (act_ptr) {
+ lev = act_ptr->level;
}
}
else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
#else
msg_print("It shows no reaction.");
#endif
-
sound(SOUND_FAIL);
return;
}
#else
msg_print("You failed to activate it properly.");
#endif
-
sound(SOUND_FAIL);
return;
}
#else
msg_print("It whines, glows and fades...");
#endif
-
return;
}
+ /* Some lights need enough fuel for activation */
+ if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
+ ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
+ {
+#ifdef JP
+ msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
+#else
+ msg_print("It has no fuel.");
+#endif
+ energy_use = 0;
+ return;
+ }
/* Activate the artifact */
#ifdef JP
/* Sound */
sound(SOUND_ZAP);
-
- if (o_ptr->art_name && o_ptr->xtra2)
+ /* Activate object */
+ if (activation_index(o_ptr))
{
(void)activate_random_artifact(o_ptr);
return;
}
- /* Artifacts */
- else if (o_ptr->name1)
+ /* Special items */
+ else if (o_ptr->tval == TV_WHISTLE)
{
- /* Choose effect */
- switch (o_ptr->name1)
+ if (music_singing_any()) stop_singing();
+ if (hex_spelling_any()) stop_hex_spell_all();
+
+#if 0
+ if (object_is_cursed(o_ptr))
{
- case ART_GALADRIEL:
- {
#ifdef JP
- msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
+ msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
#else
- msg_print("The phial wells with clear light...");
+ msg_print("You produce a shrill whistling sound.");
#endif
-
- lite_area(damroll(2, 15), 3);
- o_ptr->timeout = randint0(10) + 10;
- break;
- }
-
- case ART_ELENDIL:
- {
-#ifdef JP
- msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
-#else
- msg_print("The star shines brightly...");
+ aggravate_monsters(0);
+ }
+ else
#endif
+ {
+ int pet_ctr, i;
+ u16b *who;
+ int max_pet = 0;
+ u16b dummy_why;
- map_area(DETECT_RAD_MAP);
- lite_area(damroll(2, 15), 3);
- o_ptr->timeout = randint0(50) + 50;
- break;
- }
+ /* Allocate the "who" array */
+ C_MAKE(who, max_m_idx, u16b);
- case ART_JUDGE:
+ /* Process the monsters (backwards) */
+ for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
{
-#ifdef JP
-msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
-#else
- msg_print("The Jewel flashes bright red!");
-#endif
-
- chg_virtue(V_KNOWLEDGE, 1);
- chg_virtue(V_ENLIGHTEN, 1);
- wiz_lite(FALSE, FALSE);
-#ifdef JP
-msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
-take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
-#else
- msg_print("The Jewel drains your vitality...");
- take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
-#endif
-
- (void)detect_traps(DETECT_RAD_DEFAULT);
- (void)detect_doors(DETECT_RAD_DEFAULT);
- (void)detect_stairs(DETECT_RAD_DEFAULT);
+ if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
+ who[max_pet++] = pet_ctr;
+ }
-#ifdef JP
-if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
-#else
- if (get_check("Activate recall? "))
-#endif
+ /* Select the sort method */
+ ang_sort_comp = ang_sort_comp_pet;
+ ang_sort_swap = ang_sort_swap_hook;
- {
- (void)word_of_recall();
- }
+ ang_sort(who, &dummy_why, max_pet);
- o_ptr->timeout = randint0(20) + 20;
- break;
+ /* Process the monsters (backwards) */
+ for (i = 0; i < max_pet; i++)
+ {
+ pet_ctr = who[i];
+ teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
}
- case ART_CARLAMMAS:
+ /* Free the "who" array */
+ C_KILL(who, max_m_idx, u16b);
+ }
+ o_ptr->timeout = 100+randint1(100);
+ return;
+ }
+ else if (o_ptr->tval == TV_CAPTURE)
+ {
+ if(!o_ptr->pval)
+ {
+ bool old_target_pet = target_pet;
+ target_pet = TRUE;
+ if (!get_aim_dir(&dir))
{
-#ifdef JP
- msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
-#else
- msg_print("The amulet lets out a shrill wail...");
-#endif
-
- k = 3 * p_ptr->lev;
- (void)set_protevil(randint1(25) + k, FALSE);
- o_ptr->timeout = randint0(225) + 225;
- break;
+ target_pet = old_target_pet;
+ return;
}
+ target_pet = old_target_pet;
- case ART_INGWE:
+ if(fire_ball(GF_CAPTURE, dir, 0, 0))
{
+ o_ptr->pval = cap_mon;
+ o_ptr->xtra3 = cap_mspeed;
+ o_ptr->xtra4 = cap_hp;
+ o_ptr->xtra5 = cap_maxhp;
+ if (cap_nickname)
+ {
+ cptr t;
+ char *s;
+ char buf[80] = "";
+
+ if (o_ptr->inscription)
+ strcpy(buf, quark_str(o_ptr->inscription));
+ s = buf;
+ for (s = buf;*s && (*s != '#'); s++)
+ {
#ifdef JP
- msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
-#else
- msg_print("The amulet floods the area with goodness...");
+ if (iskanji(*s)) s++;
#endif
-
- dispel_evil(p_ptr->lev * 5);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case ART_YATA:
- {
+ }
+ *s = '#';
+ s++;
#ifdef JP
- msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
+ /*nothing*/
#else
- msg_print("The mirror floods the area with goodness...");
+ *s++ = '\'';
#endif
-
- dispel_evil(p_ptr->lev * 5);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case ART_FRAKIR:
- {
+ t = quark_str(cap_nickname);
+ while (*t)
+ {
+ *s = *t;
+ s++;
+ t++;
+ }
#ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
+ /*nothing*/
#else
- msg_print("You order Frakir to strangle your opponent.");
+ *s++ = '\'';
#endif
-
- if (!get_aim_dir(&dir)) return;
- if (drain_life(dir, 100))
- o_ptr->timeout = randint0(100) + 100;
- break;
- }
-
- case ART_TULKAS:
- {
-#ifdef JP
- msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("The ring glows brightly...");
-#endif
-
- (void)set_fast(randint1(75) + 75, FALSE);
- o_ptr->timeout = randint0(150) + 150;
- break;
- }
-
- case ART_NARYA:
- {
-#ifdef JP
- msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
-#else
- msg_print("The ring glows deep red...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_FIRE, dir, 300, 3);
- o_ptr->timeout = randint0(225) + 225;
- break;
- }
-
- case ART_NENYA:
- {
-#ifdef JP
- msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("The ring glows bright white...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_COLD, dir, 400, 3);
- o_ptr->timeout = randint0(325) + 325;
- break;
- }
-
- case ART_VILYA:
- case ART_GOURYU:
- {
-#ifdef JP
- msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
-#else
- msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_ELEC, dir, 500, 3);
- o_ptr->timeout = randint0(425) + 425;
- break;
- }
-
- case ART_POWER:
- case ART_AHO:
- {
-#ifdef JP
- msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
-#else
- msg_print("The ring glows intensely black...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- ring_of_power(dir);
- o_ptr->timeout = randint0(450) + 450;
- break;
- }
-
- case ART_RAZORBACK:
- {
- int num = damroll(5, 3);
- int y, x;
- int attempts;
-
-#ifdef JP
- msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your armor is surrounded by lightning...");
-#endif
-
-
- for (k = 0; k < num; k++)
- {
- attempts = 1000;
-
- while(attempts--)
- {
- scatter(&y, &x, py, px, 4, 0);
-
- if (!cave_floor_bold(y, x)) continue;
-
- if ((y != py) || (x != px)) break;
- }
-
- project(0, 3, y, x, 150, GF_ELEC,
- (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
- }
-
- o_ptr->timeout = 1000;
- break;
- }
-
- case ART_BLADETURNER:
- {
- if (!get_aim_dir(&dir)) return;
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe the elements.");
-#endif
-
- fire_ball(GF_MISSILE, dir, 300, 4);
-#ifdef JP
- msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your armor glows many colours...");
-#endif
-
- (void)set_afraid(0);
- (void)set_hero(randint1(50) + 50, FALSE);
- (void)hp_player(10);
- (void)set_blessed(randint1(50) + 50, FALSE);
- (void)set_oppose_acid(randint1(50) + 50, FALSE);
- (void)set_oppose_elec(randint1(50) + 50, FALSE);
- (void)set_oppose_fire(randint1(50) + 50, FALSE);
- (void)set_oppose_cold(randint1(50) + 50, FALSE);
- (void)set_oppose_pois(randint1(50) + 50, FALSE);
- o_ptr->timeout = 400;
- break;
- }
-
- case ART_SOULKEEPER:
- {
-#ifdef JP
- msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
- msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
-#else
- msg_print("Your armor glows a bright white...");
- msg_print("You feel much better...");
-#endif
-
- (void)hp_player(1000);
- (void)set_cut(0);
- o_ptr->timeout = 888;
- break;
- }
-
- case ART_LOHENGRIN:
- {
-#ifdef JP
-msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
-#else
- msg_print("A heavenly choir sings...");
-#endif
-
- (void)set_poisoned(0);
- (void)set_cut(0);
- (void)set_stun(0);
- (void)set_confused(0);
- (void)set_blind(0);
- (void)set_hero(randint1(25) + 25, FALSE);
- (void)hp_player(777);
- o_ptr->timeout = 300;
- break;
- }
-
- case ART_JULIAN:
- {
-#ifdef JP
- msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your armor glows deep blue...");
-#endif
-
- (void)symbol_genocide(200, TRUE);
- o_ptr->timeout = 500;
- break;
- }
-
- case ART_CASPANION:
- {
-#ifdef JP
- msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your armor glows bright red...");
-#endif
-
- destroy_doors_touch();
- o_ptr->timeout = 10;
- break;
- }
-
- case ART_DOR:
- case ART_TERROR:
- case ART_STONEMASK:
- {
- turn_monsters(40 + p_ptr->lev);
- o_ptr->timeout = 3 * (p_ptr->lev + 10);
-
- break;
- }
-
- case ART_HOLHENNETH:
- {
-#ifdef JP
- msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
- msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
-#else
- msg_print("Your helm glows bright white...");
- msg_print("An image forms in your mind...");
-#endif
-
- detect_all(DETECT_RAD_DEFAULT);
- o_ptr->timeout = randint0(55) + 55;
- break;
- }
-
- case ART_AMBER:
- {
-#ifdef JP
- msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
- msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
-#else
- msg_print("Your crown glows deep blue...");
- msg_print("You feel a warm tingling inside...");
-#endif
-
- (void)hp_player(700);
- (void)set_cut(0);
- o_ptr->timeout = 250;
- break;
- }
-
- case ART_COLLUIN:
- case ART_SEIRYU:
- {
-#ifdef JP
- msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
-#else
- msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
-#endif
-
- (void)set_oppose_acid(randint1(20) + 20, FALSE);
- (void)set_oppose_elec(randint1(20) + 20, FALSE);
- (void)set_oppose_fire(randint1(20) + 20, FALSE);
- (void)set_oppose_cold(randint1(20) + 20, FALSE);
- (void)set_oppose_pois(randint1(20) + 20, FALSE);
- o_ptr->timeout = 111;
- break;
- }
-
- case ART_HOLCOLLETH:
- {
-#ifdef JP
- msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your cloak glows deep blue...");
-#endif
-
- sleep_monsters_touch();
- o_ptr->timeout = 55;
- break;
- }
-
- case ART_THINGOL:
- {
-#ifdef JP
- msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your cloak glows bright yellow...");
-#endif
-
- recharge(130);
- o_ptr->timeout = 70;
- break;
- }
-
- case ART_COLANNON:
- {
-#ifdef JP
- msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
-#else
- msg_print("Your cloak twists space around you...");
-#endif
-
- teleport_player(100);
- o_ptr->timeout = 45;
- break;
- }
-
- case ART_LUTHIEN:
- {
-#ifdef JP
- msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your cloak glows a deep red...");
-#endif
-
- restore_level();
- o_ptr->timeout = 450;
- break;
- }
-
- case ART_CAMMITHRIM:
- {
-#ifdef JP
- msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your gloves glow extremely brightly...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_MISSILE, dir, damroll(2, 6));
- o_ptr->timeout = 2;
- break;
- }
-
- case ART_PAURHACH:
- {
-#ifdef JP
- msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your gauntlets are covered in fire...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_FIRE, dir, damroll(9, 8));
- o_ptr->timeout = randint0(8) + 8;
- break;
- }
-
- case ART_PAURNIMMEN:
- {
-#ifdef JP
- msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your gauntlets are covered in frost...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_COLD, dir, damroll(6, 8));
- o_ptr->timeout = randint0(7) + 7;
- break;
- }
-
- case ART_PAURAEGEN:
- {
-#ifdef JP
- msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your gauntlets are covered in sparks...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_ELEC, dir, damroll(4, 8));
- o_ptr->timeout = randint0(5) + 5;
- break;
- }
-
- case ART_PAURNEN:
- {
-#ifdef JP
- msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your gauntlets are covered in acid...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_ACID, dir, damroll(5, 8));
- o_ptr->timeout = randint0(6) + 6;
- break;
- }
-
- case ART_FINGOLFIN:
- {
-#ifdef JP
- msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
-#else
- msg_print("Your cesti grows magical spikes...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_ARROW, dir, 150);
- o_ptr->timeout = randint0(90) + 90;
- break;
- }
-
- case ART_FEANOR:
- {
-#ifdef JP
- msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your boots glow bright green...");
-#endif
-
- (void)set_fast(randint1(20) + 20, FALSE);
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_FLORA:
- {
-#ifdef JP
- msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your boots glow deep blue...");
-#endif
-
- (void)set_afraid(0);
- (void)set_poisoned(0);
- o_ptr->timeout = 5;
- break;
- }
-
- case ART_NARTHANC:
- {
-#ifdef JP
- msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your dagger is covered in fire...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_FIRE, dir, damroll(9, 8));
- o_ptr->timeout = randint0(8) + 8;
- break;
- }
-
- case ART_NIMTHANC:
- {
-#ifdef JP
- msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your dagger is covered in frost...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_COLD, dir, damroll(6, 8));
- o_ptr->timeout = randint0(7) + 7;
- break;
- }
-
- case ART_DETHANC:
- {
-#ifdef JP
- msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your dagger is covered in sparks...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_ELEC, dir, damroll(4, 8));
- o_ptr->timeout = randint0(5) + 5;
- break;
- }
-
- case ART_RILIA:
- {
-#ifdef JP
- msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
-#else
- msg_print("Your dagger throbs deep green...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_POIS, dir, 12, 3);
- o_ptr->timeout = randint0(4) + 4;
- break;
- }
-
- case ART_NUMAHOKO:
- {
-#ifdef JP
- msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
-#else
- msg_print("Your dagger throbs deep blue...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_WATER, dir, 200, 3);
- o_ptr->timeout = 250;
- break;
- }
-
- case ART_FIONA:
- {
-#ifdef JP
- msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your dagger is covered in frost...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_COLD, dir, 48, 2);
- o_ptr->timeout = randint0(5) + 5;
- break;
- }
-
- case ART_KUSANAGI:
- case ART_WEREWINDLE:
- {
- switch (randint1(13))
- {
- case 1: case 2: case 3: case 4: case 5:
- teleport_player(10);
- break;
- case 6: case 7: case 8: case 9: case 10:
- teleport_player(222);
- break;
- case 11: case 12:
- (void)stair_creation();
- break;
- default:
-#ifdef JP
-if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
-#else
- if (get_check("Leave this level? "))
-#endif
-
- {
- if (autosave_l) do_cmd_save_game(TRUE);
-
- /* Leaving */
- p_ptr->leaving = TRUE;
- }
- }
- o_ptr->timeout = 35;
- break;
- }
-
- case ART_KAMUI:
- {
- teleport_player(222);
- o_ptr->timeout = 25;
- break;
- }
-
- case ART_RINGIL:
- {
-#ifdef JP
- msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your sword glows an intense blue...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_COLD, dir, 100, 2);
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_DAWN:
- {
-#ifdef JP
-msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
-#else
- msg_print("You summon the Legion of the Dawn.");
-#endif
-
- (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
- o_ptr->timeout = 500 + randint1(500);
- break;
- }
-
- case ART_ANDURIL:
- {
-#ifdef JP
- msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your sword glows an intense red...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_FIRE, dir, 72, 2);
- o_ptr->timeout = 400;
- break;
- }
-
- case ART_THEODEN:
- {
-#ifdef JP
- msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your axe blade glows black...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- drain_life(dir, 120);
- o_ptr->timeout = 400;
- break;
- }
-
- case ART_RUNESPEAR:
- {
-#ifdef JP
-msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
-#else
- msg_print("Your spear crackles with electricity...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_ELEC, dir, 100, 3);
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_AEGLOS:
- {
-#ifdef JP
- msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your spear glows a bright white...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_COLD, dir, 100, 3);
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_DESTINY:
- {
-#ifdef JP
- msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
-#else
- msg_print("Your spear pulsates...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- wall_to_mud(dir);
- o_ptr->timeout = 5;
- break;
- }
-
- case ART_NAIN:
- {
-#ifdef JP
- msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
-#else
- msg_print("Your mattock pulsates...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- wall_to_mud(dir);
- o_ptr->timeout = 2;
- break;
- }
-
- case ART_EONWE:
- {
-#ifdef JP
- msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
-#else
- msg_print("Your axe lets out a long, shrill note...");
-#endif
-
- (void)mass_genocide(200, TRUE);
- o_ptr->timeout = 1000;
- break;
- }
-
- case ART_LOTHARANG:
- {
-#ifdef JP
- msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
-#else
- msg_print("Your battle axe radiates deep purple...");
-#endif
-
- hp_player(damroll(4, 8));
- (void)set_cut((p_ptr->cut / 2) - 50);
- o_ptr->timeout = randint0(3) + 3;
- break;
- }
-
- case ART_ULMO:
- {
-#ifdef JP
- msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your trident glows deep red...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- teleport_monster(dir);
- o_ptr->timeout = 150;
- break;
- }
-
- case ART_AVAVIR:
- {
-#ifdef JP
- msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your scythe glows soft white...");
-#endif
- if (!word_of_recall()) return;
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_MAGATAMA:
- {
-#ifdef JP
- msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your scythe glows soft white...");
-#endif
- if (!word_of_recall()) return;
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_TOTILA:
- {
-#ifdef JP
- msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
-#else
- msg_print("Your flail glows in scintillating colours...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- confuse_monster(dir, 20);
- o_ptr->timeout = 15;
- break;
- }
-
- case ART_FIRESTAR:
- {
-#ifdef JP
- msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
-#else
- msg_print("Your morning star rages in fire...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_FIRE, dir, 72, 3);
- o_ptr->timeout = 100;
- break;
- }
-
- case ART_GOTHMOG:
- {
-#ifdef JP
- msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your whip glows deep red...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_FIRE, dir, 120, 3);
- o_ptr->timeout = 15;
- break;
- }
-
- case ART_TARATOL:
- {
-#ifdef JP
- msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your mace glows bright green...");
-#endif
-
- (void)set_fast(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(100) + 100;
- break;
- }
-
- case ART_ERIRIL:
- {
-#ifdef JP
- msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your quarterstaff glows yellow...");
-#endif
-
- if (!ident_spell(FALSE, FALSE)) return;
- o_ptr->timeout = 10;
- break;
- }
-
- case ART_GANDALF:
- {
-#ifdef JP
- msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your quarterstaff glows brightly...");
-#endif
-
- detect_all(DETECT_RAD_DEFAULT);
- probing();
- identify_fully(FALSE, TRUE);
- o_ptr->timeout = 1000;
- break;
- }
-
- case ART_TURMIL:
- {
-#ifdef JP
- msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your hammer glows white...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- drain_life(dir, 90);
- o_ptr->timeout = 70;
- break;
- }
-
- case ART_BRAND:
- {
-#ifdef JP
- msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your crossbow glows deep red...");
-#endif
-
- (void)brand_bolts();
- o_ptr->timeout = 999;
- break;
- }
- case ART_CRIMSON:
- {
- int num = 1;
- int i;
- int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_NO_REF;
- int tx, ty;
-#ifdef JP
- msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
-#else
- msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
-#endif
-
- if (!get_aim_dir(&dir)) return;
-
- /* Use the given direction */
- tx = px + 99 * ddx[dir];
- ty = py + 99 * ddy[dir];
-
- /* Hack -- Use an actual "target" */
- if ((dir == 5) && target_okay())
- {
- tx = target_col;
- ty = target_row;
- }
-
- if (p_ptr->pclass == CLASS_ARCHER)
- {
- /* Extra shot at level 10 */
- if (p_ptr->lev >= 10) num++;
-
- /* Extra shot at level 30 */
- if (p_ptr->lev >= 30) num++;
-
- /* Extra shot at level 45 */
- if (p_ptr->lev >= 45) num++;
- }
-
- for (i = 0; i < num; i++)
- project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
- o_ptr->timeout = 15;
- break;
- }
- case ART_PALANTIR:
- {
- monster_type *m_ptr;
- monster_race *r_ptr;
- int i;
-
-#ifdef JP
- msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
-#else
- msg_print("Some strange places show up in your mind. And you see ...");
-#endif
-
- /* Process the monsters (backwards) */
- for (i = m_max - 1; i >= 1; i--)
- {
- /* Access the monster */
- m_ptr = &m_list[i];
-
- /* Ignore "dead" monsters */
- if (!m_ptr->r_idx) continue;
-
- r_ptr = &r_info[m_ptr->r_idx];
-
- if(r_ptr->flags1 & RF1_UNIQUE)
- {
-#ifdef JP
- msg_format("%s¡¥ ",r_name + r_ptr->name);
-#else
- msg_format("%s. ",r_name + r_ptr->name);
-#endif
- }
- }
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_STONE_LORE:
- {
-#ifdef JP
- msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
-#else
- msg_print("The stone reveals hidden mysteries...");
-#endif
- if (!ident_spell(FALSE, FALSE)) return;
-
- if (mp_ptr->spell_book)
- {
- /* Sufficient mana */
- if (20 <= p_ptr->csp)
- {
- /* Use some mana */
- p_ptr->csp -= 20;
- }
-
- /* Over-exert the player */
- else
- {
- int oops = 20 - p_ptr->csp;
-
- /* No mana left */
- p_ptr->csp = 0;
- p_ptr->csp_frac = 0;
-
- /* Message */
-#ifdef JP
- msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
-#else
- msg_print("You are too weak to control the stone!");
-#endif
-
- /* Hack -- Bypass free action */
- (void)set_paralyzed(p_ptr->paralyzed +
- randint1(5 * oops + 1));
-
- /* Confusing. */
- (void)set_confused(p_ptr->confused +
- randint1(5 * oops + 1));
- }
-
- /* Redraw mana */
- p_ptr->redraw |= (PR_MANA);
- }
-
-#ifdef JP
- take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
-#else
- take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
-#endif
-
- /* Confusing. */
- if (one_in_(5)) (void)set_confused(p_ptr->confused +
- randint1(10));
-
- /* Exercise a little care... */
- if (one_in_(20))
-#ifdef JP
- take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
-#else
- take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
-#endif
- o_ptr->timeout = 0;
- break;
- }
-
- case ART_BOROMIR:
- {
- msg_print("You wind a mighty blast; your enemies tremble!");
- (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
- o_ptr->timeout = randint0(40) + 40;
- break;
- }
- case ART_FARAMIR:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
-#else
- msg_print("You exterminate small life.");
-#endif
- (void)dispel_monsters(4);
- o_ptr->timeout = randint0(55) + 55;
- break;
- }
-
- case ART_HIMRING:
- {
-#ifdef JP
- msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
-#else
- msg_print("A shrill wailing sound surrounds you.");
-#endif
- (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case ART_ICANUS:
- {
-
-#ifdef JP
- msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
-#else
- msg_print("The robe pulsates with raw mana...");
-#endif
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_MANA, dir, 120);
- o_ptr->timeout = randint0(120) + 120;
- break;
- }
- case ART_HURIN:
- {
- (void)set_fast(randint1(50) + 50, FALSE);
- hp_player(10);
- set_afraid(0);
- set_hero(randint1(50) + 50, FALSE);
- o_ptr->timeout = randint0(200) + 100;
- break;
- }
- case ART_GIL_GALAD:
- {
-#ifdef JP
- msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
-#else
- msg_print("Your shield gleams with blinding light...");
-#endif
- fire_ball(GF_LITE, 0, 300, 6);
- confuse_monsters(3 * p_ptr->lev / 2);
- o_ptr->timeout = 250;
- break;
- }
- case ART_YENDOR:
- {
-#ifdef JP
- msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
-#else
- msg_print("Your card gleams with blinding light...");
-#endif
- if (!recharge(1000)) return;
- o_ptr->timeout = 200;
- break;
- }
- case ART_MURAMASA:
- {
-#ifdef JP
- if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
-#else
- if (get_check("Are you sure?!"))
-#endif
- {
-#ifdef JP
- msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
-#else
- msg_print("The Muramasa pulsates...");
-#endif
- do_inc_stat(A_STR);
- if (one_in_(2))
- {
-#ifdef JP
- msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
-#else
- msg_print("The Muramasa is destroyed!");
-#endif
- curse_weapon(TRUE, item);
- }
- }
- break;
- }
- case ART_FLY_STONE:
- {
-#ifdef JP
- msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
-#else
- msg_print("Your stone glows pale...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_MANA, dir, 400, 4);
- o_ptr->timeout = randint0(250) + 250;
- break;
- }
- case ART_TAIKOBO:
- {
- int x, y;
-
- if (!get_rep_dir2(&dir)) return;
- y = py+ddy[dir];
- x = px+ddx[dir];
- tsuri_dir = dir;
- if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
- {
-#ifdef JP
- msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
-#else
- msg_print("There is no fishing place.");
-#endif
- return;
- }
- else if (cave[y][x].m_idx)
- {
- char m_name[80];
- monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
-#ifdef JP
- msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
-#else
- msg_format("%^s is stand in your way.", m_name);
-#endif
- energy_use = 0;
- return;
- }
- set_action(ACTION_FISH);
- p_ptr->redraw |= (PR_STATE);
- break;
- }
- case ART_JONES:
- {
- if (!get_aim_dir(&dir)) return;
-#ifdef JP
- msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
-#else
- msg_print("You stretched your wip.");
-#endif
-
- fetch(dir, 500, TRUE);
- o_ptr->timeout = randint0(25) + 25;
- break;
- }
- case ART_ARRYU:
- {
- u32b mode = PM_ALLOW_GROUP;
- bool pet = !one_in_(5);
- if (pet) mode |= PM_FORCE_PET;
- else mode |= PM_NO_PET;
-
- if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
- {
-
- if (pet)
-#ifdef JP
- msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
-#else
- msg_print("A group of hounds appear as your servant.");
-#endif
-
- else
-#ifdef JP
- msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
-#else
- msg_print("A group of hounds appear as your enemy!");
-#endif
-
- }
-
- o_ptr->timeout = 300 + randint1(150);
- break;
- }
-
- case ART_GAEBOLG:
- {
-#ifdef JP
- msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your spear grows brightly...");
-#endif
-
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_LITE, dir, 200, 3);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case ART_INROU:
- {
- int count = 0, i;
- monster_type *m_ptr;
-#ifndef JP
- cptr kakusan = "";
-#endif
-
- if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
- {
-#ifdef JP
- msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
-#else
- msg_print("Suke-san apperars.");
- kakusan = "Suke-san";
-#endif
- count++;
- }
- if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
- {
-#ifdef JP
- msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
-#else
- msg_print("Kaku-san appears.");
- kakusan = "Kaku-san";
-#endif
- count++;
- }
- if (!count)
- {
- for (i = m_max - 1; i > 0; i--)
- {
- m_ptr = &m_list[i];
- if (!m_ptr->r_idx) continue;
- if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
- if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
- count++;
- break;
- }
- }
-
- if (count)
- {
-#ifdef JP
- msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
-#else
- msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
-#endif
-
- sukekaku = TRUE;
- stun_monsters(120);
- confuse_monsters(120);
- turn_monsters(120);
- stasis_monsters(120);
- sukekaku = FALSE;
- }
- else
- {
-#ifdef JP
- msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
-#else
- msg_print("Nothing happen.");
-#endif
- }
- o_ptr->timeout = randint0(150) + 150;
- break;
- }
-
- case ART_HYOUSIGI:
- {
-#ifdef JP
- msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
-#else
- msg_print("You beat Your wooden clappers.");
-#endif
- aggravate_monsters(0);
- break;
- }
-
- case ART_MATOI:
- case ART_AEGISFANG:
- {
- set_hero(randint1(25)+25, FALSE);
- hp_player(10);
- o_ptr->timeout = randint0(30) + 30;
- break;
- }
-
- case ART_EARENDIL:
- {
- (void)set_poisoned(0);
- (void)set_confused(0);
- (void)set_blind(0);
- (void)set_stun(0);
- (void)set_cut(0);
- (void)set_image(0);
-
- o_ptr->timeout = 100;
- break;
- }
-
- case ART_BOLISHOI:
- {
- if (!get_aim_dir(&dir)) return;
- (void)charm_animal(dir, p_ptr->lev);
-
- o_ptr->timeout = 200;
- break;
- }
-
- case ART_ARUNRUTH:
- {
-#ifdef JP
- msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
-#else
- msg_print("Your sword glows a pale blue...");
-#endif
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_COLD, dir, damroll(12, 8));
- o_ptr->timeout = 50;
- break;
- }
- case ART_BLOOD:
- {
- int dummy, i;
-#ifdef JP
- msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your scythe glows brightly!");
-#endif
- o_ptr->art_flags1 = a_info[ART_BLOOD].flags1;
- o_ptr->art_flags2 = a_info[ART_BLOOD].flags2;
- dummy = randint1(2)+randint1(2);
- for (i = 0; i < dummy; i++)
- {
- int flag = randint0(19);
- if (flag == 18) o_ptr->art_flags3 |= TR3_SLAY_HUMAN;
- else o_ptr->art_flags1 |= (TR1_CHAOTIC << flag);
- }
- dummy = randint1(2);
- for (i = 0; i < dummy; i++)
- one_resistance(o_ptr);
- dummy = 2;
- for (i = 0; i < dummy; i++)
- {
- int tmp = randint0(11);
- if (tmp < 6) o_ptr->art_flags1 |= (TR1_STR << tmp);
- else o_ptr->art_flags1 |= (TR1_STEALTH << (tmp - 6));
- }
- o_ptr->timeout = 3333;
- if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
- p_ptr->update |= (PU_BONUS | PU_HP);
- break;
- }
- case ART_KESHO:
- {
-#ifdef JP
- msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
-#else
- msg_print("You stamp. (as if you are in a ring.)");
-#endif
- (void)set_hero(randint1(20) + 20, FALSE);
- dispel_evil(p_ptr->lev * 3);
- o_ptr->timeout = 100 + randint1(100);
- break;
- }
- case ART_MOOK:
- {
-#ifdef JP
- msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
-#else
- msg_print("Your cloak grows white.");
-#endif
- (void)set_oppose_cold(randint1(20) + 20, FALSE);
- o_ptr->timeout = 40 + randint1(40);
- break;
- }
- case ART_HERMIT:
- {
-#ifdef JP
- msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
-#else
- msg_print("The whip lets out a shrill wail...");
-#endif
-
- k = 3 * p_ptr->lev;
- (void)set_protevil(randint1(25) + k, FALSE);
- o_ptr->timeout = randint0(225) + 225;
- break;
- }
- case ART_JIZO:
- {
- u32b mode = PM_ALLOW_GROUP;
- bool pet = !one_in_(5);
- if (pet) mode |= PM_FORCE_PET;
-
- if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
- {
- if (pet)
-#ifdef JP
- msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
-#else
- msg_print("A group of octopuses appear as your servant.");
-#endif
-
- else
-#ifdef JP
- msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
-#else
- msg_print("A group of octopuses appear as your enemy!");
-#endif
-
- }
-
- o_ptr->timeout = 300 + randint1(150);
- break;
- }
-
- case ART_FUNDIN:
- {
-#ifdef JP
- msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
-#else
- msg_print("The iron ball floods the area with goodness...");
-#endif
-
- dispel_evil(p_ptr->lev * 5);
- o_ptr->timeout = randint0(100) + 100;
- break;
- }
-
- case ART_NIGHT:
- {
-#ifdef JP
- msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
-#else
- msg_print("Your amulet is coverd in pitch-darkness...");
-#endif
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_DARK, dir, 250, 4);
- o_ptr->timeout = randint0(150) + 150;
- break;
- }
- }
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- /* Done */
- return;
- }
-
- else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ACID))
- {
- (void)set_oppose_acid(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- return;
- }
-
- else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ELEC))
- {
- (void)set_oppose_elec(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- return;
- }
-
- else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_FIRE))
- {
- (void)set_oppose_fire(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- return;
- }
-
- else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_COLD))
- {
- (void)set_oppose_cold(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- return;
- }
-
- else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_EARTHQUAKE))
- {
- earthquake(py, px, 5);
- o_ptr->timeout = 100 + randint1(100);
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- /* Done */
- return;
- }
-
-
- else if (o_ptr->name2 == EGO_TRUMP)
- {
- teleport_player(100);
- o_ptr->timeout = 50 + randint1(50);
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- /* Done */
- return;
- }
-
-
- else if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
- {
- if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
- {
-#ifdef JP
- msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
-#else
- msg_print("It has no fuel.");
-#endif
- energy_use = 0;
- return;
- }
- lite_area(damroll(2, 15), 3);
- o_ptr->timeout = randint0(10) + 10;
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- return;
- }
-
-
- else if (o_ptr->name2 == EGO_EARTHQUAKES)
- {
- earthquake(py, px, 5);
- o_ptr->timeout = 100 + randint1(100);
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- /* Done */
- return;
- }
-
-
- else if (o_ptr->name2 == EGO_JUMP)
- {
- teleport_player(10);
- o_ptr->timeout = 10 + randint1(10);
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- /* Done */
- return;
- }
-
-
- /* Hack -- Dragon Scale Mail can be activated as well */
- else if (o_ptr->tval == TV_DRAG_ARMOR)
- {
- /* Get a direction for breathing (or abort) */
- if (!get_aim_dir(&dir)) return;
-
- /* Branch on the sub-type */
- switch (o_ptr->sval)
- {
- case SV_DRAGON_BLUE:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe lightning.");
-#endif
-
- fire_ball(GF_ELEC, dir, 100, -2);
- o_ptr->timeout = randint0(150) + 150;
- break;
- }
-
- case SV_DRAGON_WHITE:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe frost.");
-#endif
-
- fire_ball(GF_COLD, dir, 110, -2);
- o_ptr->timeout = randint0(150) + 150;
- break;
- }
-
- case SV_DRAGON_BLACK:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe acid.");
-#endif
-
- fire_ball(GF_ACID, dir, 130, -2);
- o_ptr->timeout = randint0(150) + 150;
- break;
- }
-
- case SV_DRAGON_GREEN:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe poison gas.");
-#endif
-
- fire_ball(GF_POIS, dir, 150, -2);
- o_ptr->timeout = randint0(180) + 180;
- break;
- }
-
- case SV_DRAGON_RED:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe fire.");
-#endif
-
- fire_ball(GF_FIRE, dir, 200, -2);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case SV_DRAGON_MULTIHUED:
- {
- chance = randint0(5);
-#ifdef JP
- msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
- ((chance == 1) ? "°ðºÊ" :
- ((chance == 2) ? "Î䵤" :
- ((chance == 3) ? "»À" :
- ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
-#else
- msg_format("You breathe %s.",
- ((chance == 1) ? "lightning" :
- ((chance == 2) ? "frost" :
- ((chance == 3) ? "acid" :
- ((chance == 4) ? "poison gas" : "fire")))));
-#endif
-
- fire_ball(((chance == 1) ? GF_ELEC :
- ((chance == 2) ? GF_COLD :
- ((chance == 3) ? GF_ACID :
- ((chance == 4) ? GF_POIS : GF_FIRE)))),
- dir, 250, -2);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case SV_DRAGON_BRONZE:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe confusion.");
-#endif
-
- fire_ball(GF_CONFUSION, dir, 120, -2);
- o_ptr->timeout = randint0(180) + 180;
- break;
- }
-
- case SV_DRAGON_GOLD:
- {
-#ifdef JP
- msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe sound.");
-#endif
-
- fire_ball(GF_SOUND, dir, 130, -2);
- o_ptr->timeout = randint0(180) + 180;
- break;
- }
-
- case SV_DRAGON_CHAOS:
- {
- chance = randint0(2);
-#ifdef JP
- msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
- ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
-#else
- msg_format("You breathe %s.",
- ((chance == 1 ? "chaos" : "disenchantment")));
-#endif
-
- fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
- dir, 220, -2);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case SV_DRAGON_LAW:
- {
- chance = randint0(2);
-#ifdef JP
- msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
- ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
-#else
- msg_format("You breathe %s.",
- ((chance == 1 ? "sound" : "shards")));
-#endif
-
- fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
- dir, 230, -2);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case SV_DRAGON_BALANCE:
- {
- chance = randint0(4);
-#ifdef JP
- msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
- ((chance == 1) ? "¥«¥ª¥¹" :
- ((chance == 2) ? "Îô²½" :
- ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
-#else
- msg_format("You breathe %s.",
- ((chance == 1) ? "chaos" :
- ((chance == 2) ? "disenchantment" :
- ((chance == 3) ? "sound" : "shards"))));
-#endif
-
- fire_ball(((chance == 1) ? GF_CHAOS :
- ((chance == 2) ? GF_DISENCHANT :
- ((chance == 3) ? GF_SOUND : GF_SHARDS))),
- dir, 250, -2);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case SV_DRAGON_SHINING:
- {
- chance = randint0(2);
-#ifdef JP
- msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
- ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
-#else
- msg_format("You breathe %s.",
- ((chance == 0 ? "light" : "darkness")));
-#endif
-
- fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
-
- case SV_DRAGON_POWER:
- {
-#ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
- msg_print("You breathe the elements.");
-#endif
-
- fire_ball(GF_MISSILE, dir, 300, -3);
- o_ptr->timeout = randint0(200) + 200;
- break;
- }
- }
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- /* Success */
- return;
- }
-
- else if (o_ptr->tval == TV_RING)
- {
- if (o_ptr->name2)
- {
- bool success = TRUE;
-
- switch (o_ptr->name2)
- {
- case EGO_RING_HERO:
- (void)set_afraid(0);
- (void)set_hero(randint1(25) + 25, FALSE);
- (void)hp_player(10);
- o_ptr->timeout = randint1(100)+100;
- break;
- case EGO_RING_MAGIC_MIS:
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_MISSILE, dir, damroll(2, 6));
- o_ptr->timeout = 2;
- break;
- case EGO_RING_FIRE_BOLT:
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_FIRE, dir, damroll(9, 8));
- o_ptr->timeout = randint0(8) + 8;
- break;
- case EGO_RING_COLD_BOLT:
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_COLD, dir, damroll(6, 8));
- o_ptr->timeout = randint0(7) + 7;
- break;
- case EGO_RING_ELEC_BOLT:
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_ELEC, dir, damroll(4, 8));
- o_ptr->timeout = randint0(5) + 5;
- break;
- case EGO_RING_ACID_BOLT:
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_FIRE, dir, damroll(5, 8));
- o_ptr->timeout = randint0(6) + 6;
- break;
- case EGO_RING_MANA_BOLT:
- if (!get_aim_dir(&dir)) return;
- fire_bolt(GF_MANA, dir, 120);
- o_ptr->timeout = randint0(120)+120;
- break;
- case EGO_RING_FIRE_BALL:
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_FIRE, dir, 100, 2);
- o_ptr->timeout = randint0(80) + 80;
- break;
- case EGO_RING_COLD_BALL:
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_COLD, dir, 100, 2);
- o_ptr->timeout = randint0(80) + 80;
- break;
- case EGO_RING_ELEC_BALL:
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_ELEC, dir, 100, 2);
- o_ptr->timeout = randint0(80) + 80;
- break;
- case EGO_RING_ACID_BALL:
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_ACID, dir, 100, 2);
- o_ptr->timeout = randint0(80) + 80;
- break;
- case EGO_RING_MANA_BALL:
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_MANA, dir, 250, 2);
- o_ptr->timeout = 300;
- break;
- case EGO_RING_DRAGON_F:
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_FIRE, dir, 200, -2);
- if (o_ptr->sval == SV_RING_FLAMES)
- {
- (void)set_oppose_fire(randint1(20) + 20, FALSE);
- o_ptr->timeout = 200;
- }
- else o_ptr->timeout = 250;
- break;
- case EGO_RING_DRAGON_C:
- if (!get_aim_dir(&dir)) return;
- fire_ball(GF_COLD, dir, 200, -2);
- if (o_ptr->sval == SV_RING_ICE)
- {
- (void)set_oppose_cold(randint1(20) + 20, FALSE);
- o_ptr->timeout = 200;
- }
- else o_ptr->timeout = 250;
- break;
- case EGO_RING_M_DETECT:
- (void)detect_monsters_invis(255);
- (void)detect_monsters_normal(255);
- o_ptr->timeout = 150;
- break;
- case EGO_RING_D_SPEED:
- (void)set_fast(randint1(30) + 15, FALSE);
- o_ptr->timeout = 100;
- break;
- case EGO_RING_BERSERKER:
- (void)set_shero(randint1(25) + 25, FALSE);
- o_ptr->timeout = randint0(75)+75;
- break;
- case EGO_RING_TELE_AWAY:
- if (!get_aim_dir(&dir)) return;
- teleport_monster(dir);
- o_ptr->timeout = 150;
- break;
- case EGO_RING_TRUE:
- {
- int v = randint1(25)+25;
- (void)set_afraid(0);
- (void)set_hero(v, FALSE);
- (void)hp_player(10);
- (void)set_blessed(v, FALSE);
- (void)set_oppose_acid(v, FALSE);
- (void)set_oppose_elec(v, FALSE);
- (void)set_oppose_fire(v, FALSE);
- (void)set_oppose_cold(v, FALSE);
- (void)set_oppose_pois(v, FALSE);
- (void)set_ultimate_res(v, FALSE);
- o_ptr->timeout = 777;
- break;
- }
- default:
- success = FALSE;
- break;
- }
- if (success) return;
- }
-
- /* Get a direction for breathing (or abort) */
- if (!get_aim_dir(&dir)) return;
-
- switch (o_ptr->sval)
- {
- case SV_RING_ACID:
- {
- fire_ball(GF_ACID, dir, 100, 2);
- (void)set_oppose_acid(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- }
-
- case SV_RING_ICE:
- {
- fire_ball(GF_COLD, dir, 100, 2);
- (void)set_oppose_cold(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- }
-
- case SV_RING_FLAMES:
- {
- fire_ball(GF_FIRE, dir, 100, 2);
- (void)set_oppose_fire(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- }
-
- case SV_RING_ELEC:
- {
- fire_ball(GF_ELEC, dir, 100, 2);
- (void)set_oppose_elec(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- }
- }
-
- /* Window stuff */
- p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
- /* Success */
- return;
- }
-
- else if (o_ptr->tval == TV_AMULET)
- {
- if (o_ptr->name2)
- {
- switch (o_ptr->name2)
- {
- case EGO_AMU_IDENT:
- if (!ident_spell(FALSE, FALSE)) return;
- o_ptr->timeout = 10;
- break;
- case EGO_AMU_CHARM:
- if (!get_aim_dir(&dir)) return;
- charm_monster(dir, MAX(20, p_ptr->lev));
- o_ptr->timeout = 200;
- break;
- case EGO_AMU_JUMP:
- teleport_player(10);
- o_ptr->timeout = randint0(10) + 10;
- break;
- case EGO_AMU_TELEPORT:
- teleport_player(100);
- o_ptr->timeout = randint0(50) + 50;
- break;
- case EGO_AMU_D_DOOR:
- (void)dimension_door();
- o_ptr->timeout = 200;
- break;
- case EGO_AMU_RES_FIRE_:
- (void)set_oppose_fire(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- case EGO_AMU_RES_COLD_:
- (void)set_oppose_cold(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- case EGO_AMU_RES_ELEC_:
- (void)set_oppose_elec(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- case EGO_AMU_RES_ACID_:
- (void)set_oppose_acid(randint1(20) + 20, FALSE);
- o_ptr->timeout = randint0(50) + 50;
- break;
- case EGO_AMU_DETECTION:
- detect_all(DETECT_RAD_DEFAULT);
- o_ptr->timeout = randint0(55)+55;
- break;
- }
- }
- return;
- }
-
- else if (o_ptr->tval == TV_WHISTLE)
- {
-#if 0
- if (cursed_p(o_ptr))
- {
-#ifdef JP
- msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
-#else
- msg_print("You produce a shrill whistling sound.");
-#endif
- aggravate_monsters(0);
- }
- else
-#endif
- {
- int pet_ctr, i;
- u16b *who;
- int max_pet = 0;
- u16b dummy_why;
-
- /* Allocate the "who" array */
- C_MAKE(who, max_m_idx, u16b);
-
- /* Process the monsters (backwards) */
- for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
- {
- if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
- who[max_pet++] = pet_ctr;
- }
-
- /* Select the sort method */
- ang_sort_comp = ang_sort_comp_pet;
- ang_sort_swap = ang_sort_swap_hook;
-
- ang_sort(who, &dummy_why, max_pet);
-
- /* Process the monsters (backwards) */
- for (i = 0; i < max_pet; i++)
- {
- pet_ctr = who[i];
- teleport_to_player(pet_ctr, 100);
- }
-
- /* Free the "who" array */
- C_KILL(who, max_m_idx, u16b);
- }
- o_ptr->timeout = 100+randint1(100);
- return;
- }
- else if (o_ptr->tval == TV_CAPTURE)
- {
- if(!o_ptr->pval)
- {
- bool old_target_pet = target_pet;
- target_pet = TRUE;
- if (!get_aim_dir(&dir))
- {
- target_pet = old_target_pet;
- return;
- }
- target_pet = old_target_pet;
-
- if(fire_ball(GF_CAPTURE, dir, 0, 0))
- {
- o_ptr->pval = cap_mon;
- o_ptr->xtra3 = cap_mspeed;
- o_ptr->xtra4 = cap_hp;
- o_ptr->xtra5 = cap_maxhp;
- if (cap_nickname)
- {
- cptr t;
- char *s;
- char buf[80] = "";
-
- if (o_ptr->inscription)
- strcpy(buf, quark_str(o_ptr->inscription));
- s = buf;
- for (s = buf;*s && (*s != '#'); s++)
- {
-#ifdef JP
- if (iskanji(*s)) s++;
-#endif
- }
- *s = '#';
- s++;
-#ifdef JP
- /*nothing*/
-#else
- *s++ = '\'';
-#endif
- t = quark_str(cap_nickname);
- while (*t)
- {
- *s = *t;
- s++;
- t++;
- }
-#ifdef JP
- /*nothing*/
-#else
- *s++ = '\'';
-#endif
- *s = '\0';
- o_ptr->inscription = quark_add(buf);
- }
+ *s = '\0';
+ o_ptr->inscription = quark_add(buf);
+ }
}
}
else
{
bool success = FALSE;
if (!get_rep_dir2(&dir)) return;
- if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
+ if (monster_can_enter(py + ddy[dir], px + ddx[dir], &r_info[o_ptr->pval], 0))
{
if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
{
*/
static bool item_tester_hook_use(object_type *o_ptr)
{
- u32b f1, f2, f3;
+ u32b flgs[TR_FLAG_SIZE];
/* Ammo */
if (o_ptr->tval == p_ptr->tval_ammo)
int i;
/* Not known */
- if (!object_known_p(o_ptr)) return (FALSE);
+ if (!object_is_known(o_ptr)) return (FALSE);
/* HACK - only items from the equipment can be activated */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
if (&inventory[i] == o_ptr)
{
/* Extract the flags */
- object_flags(o_ptr, &f1, &f2, &f3);
+ object_flags(o_ptr, flgs);
/* Check activation flag */
- if (f3 & TR3_ACTIVATE) return (TRUE);
+ if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
}
}
}
return;
}
- do_cmd_read_scroll_aux(item);
+ do_cmd_read_scroll_aux(item, TRUE);
break;
}
}
}
-static bool select_magic_eater(int mode)
+static int select_magic_eater(bool only_browse)
{
int ext=0;
char choice;
- bool flag, redraw;
+ bool flag, request_list;
int tval = 0;
int ask = TRUE, i = 0;
char out_val[160];
prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
- prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
#else
prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
- prt("Which type of magic do you usu?", 0, 0);
#endif
+
+ if (only_browse) prt(_("¤É¤Î¼ïÎà¤ÎËâË¡¤ò¸«¤Þ¤¹¤«¡©", "Which type of magic do you browse?"), 0, 0);
+ else prt(_("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", "Which type of magic do you use?"), 0, 0);
+
choice = inkey();
switch(choice)
{
/* Nothing chosen yet */
flag = FALSE;
- /* No redraw yet */
- redraw = FALSE;
-
/* Build a prompt */
+ if (only_browse) strnfmt(out_val, 78, _("('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò¸«¤Þ¤¹¤«¡©",
+ "(*=List, ESC=exit) Browse which power? "));
+ else strnfmt(out_val, 78, _("('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©",
+ "(*=List, ESC=exit) Use which power? "));
+
+ /* Save the screen */
+ screen_save();
+
+ request_list = always_show_list;
+
+ /* Get a spell from the user */
+ while (!flag)
+ {
+ /* Show the list */
+ if (request_list || use_menu)
+ {
+ byte y, x = 0;
+ int ctr, chance;
+ int k_idx;
+ char dummy[80];
+ int x1, y1, level;
+ byte col;
+
+ strcpy(dummy, "");
+
+ for (y = 1; y < 20; y++)
+ prt("", y, x);
+
+ y = 1;
+
+ /* Print header(s) */
#ifdef JP
-(void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
+ prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
#else
- (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
+ prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
#endif
- if (use_menu) screen_save();
- /* Get a spell from the user */
+ /* Print list */
+ for (ctr = 0; ctr < EATER_EXT; ctr++)
+ {
+ if (!p_ptr->magic_num2[ctr+ext]) continue;
+
+ k_idx = lookup_kind(tval, ctr);
+
+ if (use_menu)
+ {
+ if (ctr == (menu_line-1))
+#ifdef JP
+ strcpy(dummy, "¡Õ");
+#else
+ strcpy(dummy, "> ");
+#endif
+ else strcpy(dummy, " ");
+
+ }
+ /* letter/number for power selection */
+ else
+ {
+ char letter;
+ if (ctr < 26)
+ letter = I2A(ctr);
+ else
+ letter = '0' + ctr - 26;
+ sprintf(dummy, "%c)",letter);
+ }
+ x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
+ y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
+ level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
+ chance = level * 4 / 5 + 20;
+ chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
+ level /= 2;
+ if (p_ptr->lev > level)
+ {
+ chance -= 3 * (p_ptr->lev - level);
+ }
+ chance = mod_spell_chance_1(chance);
+ chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
+ /* Stunning makes spells harder */
+ if (p_ptr->stun > 50) chance += 25;
+ else if (p_ptr->stun) chance += 15;
+
+ if (chance > 95) chance = 95;
+
+ chance = mod_spell_chance_2(chance);
+
+ col = TERM_WHITE;
+
+ if (k_idx)
+ {
+ if (tval == TV_ROD)
+ {
+ strcat(dummy, format(
+#ifdef JP
+ " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
+#else
+ " %-22.22s (%2d/%2d) %3d%%",
+#endif
+ k_name + k_info[k_idx].name,
+ p_ptr->magic_num1[ctr+ext] ?
+ (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
+ p_ptr->magic_num2[ctr+ext], chance));
+ if (p_ptr->magic_num1[ctr+ext] > k_info[k_idx].pval * (p_ptr->magic_num2[ctr+ext]-1) * EATER_ROD_CHARGE) col = TERM_RED;
+ }
+ else
+ {
+ strcat(dummy, format(" %-22.22s %2d/%2d %3d%%", k_name + k_info[k_idx].name, (s16b)(p_ptr->magic_num1[ctr+ext]/EATER_CHARGE), p_ptr->magic_num2[ctr+ext], chance));
+ if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
+ }
+ }
+ else
+ strcpy(dummy, "");
+ c_prt(col, dummy, y1, x1);
+ }
+ }
- choice = (always_show_list || use_menu) ? ESCAPE:1;
- while (!flag)
- {
- if( choice==ESCAPE ) choice = ' ';
- else if( !get_com(out_val, &choice, FALSE) )break;
+ if (!get_com(out_val, &choice, FALSE)) break;
if (use_menu && choice != ' ')
{
- switch(choice)
+ switch (choice)
{
case '0':
{
screen_load();
- return (FALSE);
- break;
+ return 0;
}
case '8':
}
}
}
- /* Request redraw */
- if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
- {
- /* Show the list */
- if (!redraw || use_menu)
- {
- byte y, x = 0;
- int ctr, chance;
- int k_idx;
- char dummy[80];
- int x1, y1, level;
- byte col;
-
- strcpy(dummy, "");
-
- /* Show list */
- redraw = TRUE;
-
- /* Save the screen */
- if (!use_menu) screen_save();
- for (y = 1; y < 20; y++)
- prt("", y, x);
-
- y = 1;
-
- /* Print header(s) */
-#ifdef JP
- prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
-#else
- prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
-#endif
-
- /* Print list */
- for (ctr = 0; ctr < EATER_EXT; ctr++)
- {
- if (!p_ptr->magic_num2[ctr+ext]) continue;
-
- k_idx = lookup_kind(tval, ctr);
-
- if (use_menu)
- {
- if (ctr == (menu_line-1))
-#ifdef JP
- strcpy(dummy, "¡Õ");
-#else
- strcpy(dummy, "> ");
-#endif
- else strcpy(dummy, " ");
-
- }
- /* letter/number for power selection */
- else
- {
- char letter;
- if (ctr < 26)
- letter = I2A(ctr);
- else
- letter = '0' + ctr - 26;
- sprintf(dummy, "%c)",letter);
- }
- x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
- y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
- level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
- chance = level * 4 / 5 + 20;
- chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
- level /= 2;
- if (p_ptr->lev > level)
- {
- chance -= 3 * (p_ptr->lev - level);
- }
- chance += p_ptr->to_m_chance;
- if (p_ptr->heavy_spell) chance += 20;
- if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
- else if (p_ptr->easy_spell) chance-=3;
- else if (p_ptr->dec_mana) chance-=2;
- chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
- /* Stunning makes spells harder */
- if (p_ptr->stun > 50) chance += 25;
- else if (p_ptr->stun) chance += 15;
-
- if (chance > 95) chance = 95;
-
- if(p_ptr->dec_mana) chance--;
- if (p_ptr->heavy_spell) chance += 5;
-
- col = TERM_WHITE;
-
- if (k_idx)
- {
- if (tval == TV_ROD)
- {
-strcat(dummy, format(
-#ifdef JP
- " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
-#else
- " %-22.22s (%2d/%2d) %3d%%",
-#endif
- k_name + k_info[k_idx].name,
- p_ptr->magic_num1[ctr+ext] ?
- (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
- p_ptr->magic_num2[ctr+ext], chance));
- if (p_ptr->magic_num1[ctr+ext] > k_info[k_idx].pval * (p_ptr->magic_num2[ctr+ext]-1) * EATER_ROD_CHARGE) col = TERM_RED;
- }
- else
- {
- strcat(dummy, format(" %-22.22s %2d/%2d %3d%%", k_name + k_info[k_idx].name, (s16b)(p_ptr->magic_num1[ctr+ext]/EATER_CHARGE), p_ptr->magic_num2[ctr+ext], chance));
- if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
- }
- }
- else
- strcpy(dummy, "");
- c_prt(col, dummy, y1, x1);
- }
- }
+ /* Request redraw */
+ if (use_menu && ask) continue;
+ /* Request redraw */
+ if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
+ {
/* Hide the list */
- else
+ if (request_list)
{
/* Hide list */
- redraw = FALSE;
-
+ request_list = FALSE;
+
/* Restore the screen */
screen_load();
+ screen_save();
}
+ else
+ request_list = TRUE;
/* Redo asking */
continue;
continue;
}
- if (mode == 0)
+ if (!only_browse)
{
/* Verify it */
if (ask)
}
}
+ /* Browse */
+ else
+ {
+ int line, j;
+ char temp[70 * 20];
+
+ /* Clear lines, position cursor (really should use strlen here) */
+ Term_erase(7, 23, 255);
+ Term_erase(7, 22, 255);
+ Term_erase(7, 21, 255);
+ Term_erase(7, 20, 255);
+
+ roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp, sizeof(temp));
+ for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
+ {
+ prt(&temp[j], line, 10);
+ line++;
+ }
+
+ continue;
+ }
+
/* Stop the loop */
flag = TRUE;
}
/* Restore the screen */
- if (redraw) screen_load();
+ screen_load();
if (!flag) return -1;
return ext+i;
}
-void do_cmd_magic_eater(void)
+
+/*
+ * Use eaten rod, wand or staff
+ */
+bool do_cmd_magic_eater(bool only_browse, bool powerful)
{
- int item, dir, chance, level, k_idx, tval, sval;
+ int item, chance, level, k_idx, tval, sval;
bool use_charge = TRUE;
/* Not when confused */
- if (p_ptr->confused)
+ if (!only_browse && p_ptr->confused)
{
#ifdef JP
msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
msg_print("You are too confused!");
#endif
- return;
+ return FALSE;
}
- item = select_magic_eater(0);
+ item = select_magic_eater(only_browse);
if (item == -1)
{
energy_use = 0;
- return;
+ return FALSE;
}
if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
{
chance -= 3 * (p_ptr->lev - level);
}
- chance += p_ptr->to_m_chance;
- if (p_ptr->heavy_spell) chance += 20;
- if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
- else if (p_ptr->easy_spell) chance-=3;
- else if (p_ptr->dec_mana) chance-=2;
+ chance = mod_spell_chance_1(chance);
chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
/* Stunning makes spells harder */
if (p_ptr->stun > 50) chance += 25;
if (chance > 95) chance = 95;
- if(p_ptr->dec_mana) chance--;
- if (p_ptr->heavy_spell) chance += 5;
+ chance = mod_spell_chance_2(chance);
if (randint0(100) < chance)
{
chg_virtue(V_CHANCE,-1);
energy_use = 100;
- return;
+ return TRUE;
}
else
{
+ int dir = 0;
+
if (tval == TV_ROD)
{
if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
- if (!get_aim_dir(&dir)) return;
- rod_effect(sval, dir, &use_charge, TRUE);
- if (!use_charge) return;
+ if (!get_aim_dir(&dir)) return FALSE;
+ rod_effect(sval, dir, &use_charge, powerful, TRUE);
+ if (!use_charge) return FALSE;
}
else if (tval == TV_WAND)
{
- if (!get_aim_dir(&dir)) return;
- wand_effect(sval, dir, TRUE);
+ if (!get_aim_dir(&dir)) return FALSE;
+ wand_effect(sval, dir, powerful, TRUE);
}
else
{
- staff_effect(sval, &use_charge, TRUE);
- if (!use_charge) return;
-
- /* Delayed optimization */
- optimize_inventry_auto_destroy();
+ staff_effect(sval, &use_charge, powerful, TRUE, TRUE);
+ if (!use_charge) return FALSE;
}
if (randint1(100) < chance)
chg_virtue(V_CHANCE,1);
energy_use = 100;
if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
else p_ptr->magic_num1[item] -= EATER_CHARGE;
+
+ return TRUE;
}