2 #include "projection.h"
6 * Potions "smash open" and cause an area effect when
7 * @param who 薬破損の主体ID(プレイヤー所持アイテムが壊れた場合0、床上のアイテムの場合モンスターID)
10 * @param k_idx 破損した薬のアイテムID
11 * @return 薬を浴びたモンスターが起こるならばTRUEを返す
14 * (1) they are shattered while in the player's inventory,
15 * due to cold (etc) attacks;
16 * (2) they are thrown at a monster, or obstacle;
17 * (3) they are shattered by a "cold ball" or other such spell
18 * while lying on the floor.
21 * who --- who caused the potion to shatter (0=player)
22 * potions that smash on the floor are assumed to
23 * be caused by no-one (who = 1), as are those that
24 * shatter inside the player inventory.
25 * (Not anymore -- I changed this; TY)
26 * y, x --- coordinates of the potion (or player if
27 * the potion was in her inventory);
28 * o_ptr --- pointer to the potion object.
31 bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx)
38 object_kind *k_ptr = &k_info[k_idx];
42 case SV_POTION_SALT_WATER:
43 case SV_POTION_SLIME_MOLD:
44 case SV_POTION_LOSE_MEMORIES:
45 case SV_POTION_DEC_STR:
46 case SV_POTION_DEC_INT:
47 case SV_POTION_DEC_WIS:
48 case SV_POTION_DEC_DEX:
49 case SV_POTION_DEC_CON:
50 case SV_POTION_DEC_CHR:
51 case SV_POTION_WATER: /* perhaps a 'water' attack? */
52 case SV_POTION_APPLE_JUICE:
55 case SV_POTION_INFRAVISION:
56 case SV_POTION_DETECT_INVIS:
57 case SV_POTION_SLOW_POISON:
58 case SV_POTION_CURE_POISON:
59 case SV_POTION_BOLDNESS:
60 case SV_POTION_RESIST_HEAT:
61 case SV_POTION_RESIST_COLD:
62 case SV_POTION_HEROISM:
63 case SV_POTION_BESERK_STRENGTH:
64 case SV_POTION_RES_STR:
65 case SV_POTION_RES_INT:
66 case SV_POTION_RES_WIS:
67 case SV_POTION_RES_DEX:
68 case SV_POTION_RES_CON:
69 case SV_POTION_RES_CHR:
70 case SV_POTION_INC_STR:
71 case SV_POTION_INC_INT:
72 case SV_POTION_INC_WIS:
73 case SV_POTION_INC_DEX:
74 case SV_POTION_INC_CON:
75 case SV_POTION_INC_CHR:
76 case SV_POTION_AUGMENTATION:
77 case SV_POTION_ENLIGHTENMENT:
78 case SV_POTION_STAR_ENLIGHTENMENT:
79 case SV_POTION_SELF_KNOWLEDGE:
80 case SV_POTION_EXPERIENCE:
81 case SV_POTION_RESISTANCE:
82 case SV_POTION_INVULNERABILITY:
83 case SV_POTION_NEW_LIFE:
84 /* All of the above potions have no effect when shattered */
86 case SV_POTION_SLOWNESS:
91 case SV_POTION_POISON:
96 case SV_POTION_BLINDNESS:
100 case SV_POTION_BOOZE: /* Booze */
104 case SV_POTION_SLEEP:
108 case SV_POTION_RUINATION:
109 case SV_POTION_DETONATIONS:
111 dam = damroll(25, 25);
114 case SV_POTION_DEATH:
115 dt = GF_DEATH_RAY; /* !! */
116 dam = k_ptr->level * 10;
120 case SV_POTION_SPEED:
123 case SV_POTION_CURE_LIGHT:
127 case SV_POTION_CURE_SERIOUS:
131 case SV_POTION_CURE_CRITICAL:
132 case SV_POTION_CURING:
136 case SV_POTION_HEALING:
138 dam = damroll(10, 10);
140 case SV_POTION_RESTORE_EXP:
147 dam = damroll(50, 50);
150 case SV_POTION_STAR_HEALING:
152 dam = damroll(50, 50);
155 case SV_POTION_RESTORE_MANA: /* MANA */
157 dam = damroll(10, 10);
164 (void)project(who, radius, y, x, dam, dt, (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL), -1);
166 /* XXX those potions that explode need to become "known" */