OSDN Git Service

Merge remote-tracking branch 'remotes/origin/For2.2.2-Fix-Hourier' into For2.2.2...
[hengband/hengband.git] / src / object-use / quaff-execution.c
1 /*!
2  * todo 少し長い。switch/case文と効果処理を分離してもいいかも
3  * @brief 薬を飲んだ時の各種効果処理
4  * @date 2020/07/04
5  * @author Hourier
6  */
7
8 #include "object-use/quaff-execution.h"
9 #include "birth/birth-stat.h"
10 #include "core/player-update-types.h"
11 #include "core/window-redrawer.h"
12 #include "game-option/birth-options.h"
13 #include "game-option/disturbance-options.h"
14 #include "inventory/inventory-object.h"
15 #include "main/sound-definitions-table.h"
16 #include "main/sound-of-music.h"
17 #include "mutation/mutation-investor-remover.h"
18 #include "object/object-broken.h"
19 #include "object/object-generator.h"
20 #include "object/object-info.h"
21 #include "object/object-kind.h"
22 #include "perception/object-perception.h"
23 #include "player-info/self-info.h"
24 #include "player/attack-defense-types.h"
25 #include "player-info/avatar.h"
26 #include "player/digestion-processor.h"
27 #include "player/eldritch-horror.h"
28 #include "player/mimic-info-table.h"
29 #include "player/player-damage.h"
30 #include "realm/realm-hex-numbers.h"
31 #include "spell-kind/spells-detection.h"
32 #include "spell-kind/spells-floor.h"
33 #include "spell-kind/spells-perception.h"
34 #include "spell-kind/spells-teleport.h"
35 #include "spell-realm/spells-hex.h"
36 #include "spell/spells-status.h"
37 #include "status/bad-status-setter.h"
38 #include "status/base-status.h"
39 #include "status/body-improvement.h"
40 #include "status/buff-setter.h"
41 #include "status/element-resistance.h"
42 #include "status/experience.h"
43 #include "status/shape-changer.h"
44 #include "status/sight-setter.h"
45 #include "sv-definition/sv-potion-types.h"
46 #include "system/object-type-definition.h"
47 #include "term/screen-processor.h"
48 #include "view/display-messages.h"
49
50 /*!
51  * @brief 酔っ払いの薬
52  * @param creature_ptr プレーヤーへの参照ポインタ
53  * @return カオス耐性があるかその他の一部確率でFALSE、それ以外はTRUE
54  */
55 static bool booze(player_type *creature_ptr)
56 {
57     bool ident = FALSE;
58     if (creature_ptr->pclass != CLASS_MONK)
59         chg_virtue(creature_ptr, V_HARMONY, -1);
60     else if (!creature_ptr->resist_conf)
61         creature_ptr->special_attack |= ATTACK_SUIKEN;
62
63     if (!creature_ptr->resist_conf && set_confused(creature_ptr, randint0(20) + 15)) {
64         ident = TRUE;
65     }
66
67     if (creature_ptr->resist_chaos) {
68         return ident;
69     }
70
71     if (one_in_(2) && set_image(creature_ptr, creature_ptr->image + randint0(150) + 150)) {
72         ident = TRUE;
73     }
74
75     if (one_in_(13) && (creature_ptr->pclass != CLASS_MONK)) {
76         ident = TRUE;
77         if (one_in_(3))
78             lose_all_info(creature_ptr);
79         else
80             wiz_dark(creature_ptr);
81
82         (void)teleport_player_aux(creature_ptr, 100, FALSE, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
83         wiz_dark(creature_ptr);
84         msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
85         msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing or how you got here!"));
86     }
87
88     return ident;
89 }
90
91 /*!
92  * @brief 爆発の薬の効果処理 / Fumble ramble
93  * @param creature_ptr プレーヤーへの参照ポインタ
94  * @return 常にTRUE
95  */
96 static bool detonation(player_type *creature_ptr)
97 {
98     msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
99     take_hit(creature_ptr, DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
100     (void)set_stun(creature_ptr, creature_ptr->stun + 75);
101     (void)set_cut(creature_ptr, creature_ptr->cut + 5000);
102     return TRUE;
103 }
104
105 /*!
106  * @brief 薬を飲むコマンドのサブルーチン /
107  * Quaff a potion (from the pack or the floor)
108  * @param creature_ptr プレーヤーへの参照ポインタ
109  * @param item 飲む薬オブジェクトの所持品ID
110  * @return なし
111  */
112 void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
113 {
114     object_type *o_ptr;
115     object_type forge;
116     object_type *q_ptr;
117
118     take_turn(creature_ptr, 100);
119
120     if (creature_ptr->timewalk) {
121         if (flush_failure)
122             flush();
123
124         msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from the bottle."));
125         sound(SOUND_FAIL);
126         return;
127     }
128
129     if (music_singing_any(creature_ptr))
130         stop_singing(creature_ptr);
131
132     if (hex_spelling_any(creature_ptr) && !hex_spelling(creature_ptr, HEX_INHAIL))
133         stop_hex_spell_all(creature_ptr);
134
135     o_ptr = ref_item(creature_ptr, item);
136     q_ptr = &forge;
137     object_copy(q_ptr, o_ptr);
138     q_ptr->number = 1;
139     vary_item(creature_ptr, item, -1);
140     sound(SOUND_QUAFF);
141     bool ident = FALSE;
142     DEPTH lev = k_info[q_ptr->k_idx].level;
143     if (q_ptr->tval == TV_POTION) {
144         switch (q_ptr->sval) {
145             /* 飲みごたえをオリジナルより細かく表現 */
146         case SV_POTION_WATER:
147             msg_print(_("口の中がさっぱりした。", ""));
148             msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
149             ident = TRUE;
150             break;
151
152         case SV_POTION_APPLE_JUICE:
153             msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
154             msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
155             ident = TRUE;
156             break;
157
158         case SV_POTION_SLIME_MOLD:
159             msg_print(_("なんとも不気味な味だ。", ""));
160             msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
161             ident = TRUE;
162             break;
163
164         case SV_POTION_SLOWNESS:
165             if (set_slow(creature_ptr, randint1(25) + 15, FALSE))
166                 ident = TRUE;
167             break;
168
169         case SV_POTION_SALT_WATER:
170             msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
171
172             if (!(is_specific_player_race(creature_ptr, RACE_GOLEM) || is_specific_player_race(creature_ptr, RACE_ZOMBIE)
173                     || is_specific_player_race(creature_ptr, RACE_BALROG) || is_specific_player_race(creature_ptr, RACE_ANDROID)
174                     || is_specific_player_race(creature_ptr, RACE_SPECTRE) || (mimic_info[creature_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))) {
175                 /* Only living creatures get thirsty */
176                 (void)set_food(creature_ptr, PY_FOOD_STARVE - 1);
177             }
178
179             (void)set_poisoned(creature_ptr, 0);
180             (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed + 4);
181             ident = TRUE;
182             break;
183
184         case SV_POTION_POISON:
185             if (!(creature_ptr->resist_pois || is_oppose_pois(creature_ptr))) {
186                 if (set_poisoned(creature_ptr, creature_ptr->poisoned + randint0(15) + 10)) {
187                     ident = TRUE;
188                 }
189             }
190             break;
191
192         case SV_POTION_BLINDNESS:
193             if (!creature_ptr->resist_blind) {
194                 if (set_blind(creature_ptr, creature_ptr->blind + randint0(100) + 100)) {
195                     ident = TRUE;
196                 }
197             }
198             break;
199
200         case SV_POTION_BOOZE:
201             ident = booze(creature_ptr);
202             break;
203
204         case SV_POTION_SLEEP:
205             if (!creature_ptr->free_act) {
206                 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
207
208                 if (ironman_nightmare) {
209                     msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
210
211                     /* Have some nightmares */
212                     sanity_blast(creature_ptr, NULL, FALSE);
213                 }
214                 if (set_paralyzed(creature_ptr, creature_ptr->paralyzed + randint0(4) + 4)) {
215                     ident = TRUE;
216                 }
217             }
218             break;
219
220         case SV_POTION_LOSE_MEMORIES:
221             if (!creature_ptr->hold_exp && (creature_ptr->exp > 0)) {
222                 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
223                 chg_virtue(creature_ptr, V_KNOWLEDGE, -5);
224
225                 lose_exp(creature_ptr, creature_ptr->exp / 4);
226                 ident = TRUE;
227             }
228             break;
229
230         case SV_POTION_RUINATION:
231             msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
232             take_hit(creature_ptr, DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
233
234             (void)dec_stat(creature_ptr, A_DEX, 25, TRUE);
235             (void)dec_stat(creature_ptr, A_WIS, 25, TRUE);
236             (void)dec_stat(creature_ptr, A_CON, 25, TRUE);
237             (void)dec_stat(creature_ptr, A_STR, 25, TRUE);
238             (void)dec_stat(creature_ptr, A_CHR, 25, TRUE);
239             (void)dec_stat(creature_ptr, A_INT, 25, TRUE);
240             ident = TRUE;
241             break;
242
243         case SV_POTION_DEC_STR:
244             if (do_dec_stat(creature_ptr, A_STR))
245                 ident = TRUE;
246             break;
247
248         case SV_POTION_DEC_INT:
249             if (do_dec_stat(creature_ptr, A_INT))
250                 ident = TRUE;
251             break;
252
253         case SV_POTION_DEC_WIS:
254             if (do_dec_stat(creature_ptr, A_WIS))
255                 ident = TRUE;
256             break;
257
258         case SV_POTION_DEC_DEX:
259             if (do_dec_stat(creature_ptr, A_DEX))
260                 ident = TRUE;
261             break;
262
263         case SV_POTION_DEC_CON:
264             if (do_dec_stat(creature_ptr, A_CON))
265                 ident = TRUE;
266             break;
267
268         case SV_POTION_DEC_CHR:
269             if (do_dec_stat(creature_ptr, A_CHR))
270                 ident = TRUE;
271             break;
272
273         case SV_POTION_DETONATIONS:
274             ident = detonation(creature_ptr);
275             break;
276
277         case SV_POTION_DEATH:
278             chg_virtue(creature_ptr, V_VITALITY, -1);
279             chg_virtue(creature_ptr, V_UNLIFE, 5);
280             msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
281             take_hit(creature_ptr, DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
282             ident = TRUE;
283             break;
284
285         case SV_POTION_INFRAVISION:
286             if (set_tim_infra(creature_ptr, creature_ptr->tim_infra + 100 + randint1(100), FALSE)) {
287                 ident = TRUE;
288             }
289             break;
290
291         case SV_POTION_DETECT_INVIS:
292             if (set_tim_invis(creature_ptr, creature_ptr->tim_invis + 12 + randint1(12), FALSE)) {
293                 ident = TRUE;
294             }
295             break;
296
297         case SV_POTION_SLOW_POISON:
298             if (set_poisoned(creature_ptr, creature_ptr->poisoned / 2))
299                 ident = TRUE;
300             break;
301
302         case SV_POTION_CURE_POISON:
303             if (set_poisoned(creature_ptr, 0))
304                 ident = TRUE;
305             break;
306
307         case SV_POTION_BOLDNESS:
308             if (set_afraid(creature_ptr, 0))
309                 ident = TRUE;
310             break;
311
312         case SV_POTION_SPEED:
313             if (!creature_ptr->fast) {
314                 if (set_fast(creature_ptr, randint1(25) + 15, FALSE))
315                     ident = TRUE;
316             } else {
317                 (void)set_fast(creature_ptr, creature_ptr->fast + 5, FALSE);
318             }
319             break;
320
321         case SV_POTION_RESIST_HEAT:
322             if (set_oppose_fire(creature_ptr, creature_ptr->oppose_fire + randint1(10) + 10, FALSE)) {
323                 ident = TRUE;
324             }
325             break;
326
327         case SV_POTION_RESIST_COLD:
328             if (set_oppose_cold(creature_ptr, creature_ptr->oppose_cold + randint1(10) + 10, FALSE)) {
329                 ident = TRUE;
330             }
331             break;
332
333         case SV_POTION_HEROISM:
334             ident = heroism(creature_ptr, 25);
335             break;
336
337         case SV_POTION_BESERK_STRENGTH:
338             ident = berserk(creature_ptr, randint1(25) + 25);
339             break;
340
341         case SV_POTION_CURE_LIGHT:
342             ident = cure_light_wounds(creature_ptr, 2, 8);
343             break;
344
345         case SV_POTION_CURE_SERIOUS:
346             ident = cure_serious_wounds(creature_ptr, 4, 8);
347             break;
348
349         case SV_POTION_CURE_CRITICAL:
350             ident = cure_critical_wounds(creature_ptr, damroll(6, 8));
351             break;
352
353         case SV_POTION_HEALING:
354             ident = cure_critical_wounds(creature_ptr, 300);
355             break;
356
357         case SV_POTION_STAR_HEALING:
358             ident = cure_critical_wounds(creature_ptr, 1200);
359             break;
360
361         case SV_POTION_LIFE:
362             ident = life_stream(creature_ptr, TRUE, TRUE);
363             break;
364
365         case SV_POTION_RESTORE_MANA:
366             ident = restore_mana(creature_ptr, TRUE);
367             break;
368
369         case SV_POTION_RESTORE_EXP:
370             if (restore_level(creature_ptr))
371                 ident = TRUE;
372             break;
373
374         case SV_POTION_RES_STR:
375             if (do_res_stat(creature_ptr, A_STR))
376                 ident = TRUE;
377             break;
378
379         case SV_POTION_RES_INT:
380             if (do_res_stat(creature_ptr, A_INT))
381                 ident = TRUE;
382             break;
383
384         case SV_POTION_RES_WIS:
385             if (do_res_stat(creature_ptr, A_WIS))
386                 ident = TRUE;
387             break;
388
389         case SV_POTION_RES_DEX:
390             if (do_res_stat(creature_ptr, A_DEX))
391                 ident = TRUE;
392             break;
393
394         case SV_POTION_RES_CON:
395             if (do_res_stat(creature_ptr, A_CON))
396                 ident = TRUE;
397             break;
398
399         case SV_POTION_RES_CHR:
400             if (do_res_stat(creature_ptr, A_CHR))
401                 ident = TRUE;
402             break;
403
404         case SV_POTION_INC_STR:
405             if (do_inc_stat(creature_ptr, A_STR))
406                 ident = TRUE;
407             break;
408
409         case SV_POTION_INC_INT:
410             if (do_inc_stat(creature_ptr, A_INT))
411                 ident = TRUE;
412             break;
413
414         case SV_POTION_INC_WIS:
415             if (do_inc_stat(creature_ptr, A_WIS))
416                 ident = TRUE;
417             break;
418
419         case SV_POTION_INC_DEX:
420             if (do_inc_stat(creature_ptr, A_DEX))
421                 ident = TRUE;
422             break;
423
424         case SV_POTION_INC_CON:
425             if (do_inc_stat(creature_ptr, A_CON))
426                 ident = TRUE;
427             break;
428
429         case SV_POTION_INC_CHR:
430             if (do_inc_stat(creature_ptr, A_CHR))
431                 ident = TRUE;
432             break;
433
434         case SV_POTION_AUGMENTATION:
435             if (do_inc_stat(creature_ptr, A_STR))
436                 ident = TRUE;
437             if (do_inc_stat(creature_ptr, A_INT))
438                 ident = TRUE;
439             if (do_inc_stat(creature_ptr, A_WIS))
440                 ident = TRUE;
441             if (do_inc_stat(creature_ptr, A_DEX))
442                 ident = TRUE;
443             if (do_inc_stat(creature_ptr, A_CON))
444                 ident = TRUE;
445             if (do_inc_stat(creature_ptr, A_CHR))
446                 ident = TRUE;
447             break;
448
449         case SV_POTION_ENLIGHTENMENT:
450             msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
451             chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
452             chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
453             wiz_lite(creature_ptr, FALSE);
454             ident = TRUE;
455             break;
456
457         case SV_POTION_STAR_ENLIGHTENMENT:
458             msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
459             chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
460             chg_virtue(creature_ptr, V_ENLIGHTEN, 2);
461             msg_print(NULL);
462             wiz_lite(creature_ptr, FALSE);
463             (void)do_inc_stat(creature_ptr, A_INT);
464             (void)do_inc_stat(creature_ptr, A_WIS);
465             (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
466             (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
467             (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
468             (void)detect_treasure(creature_ptr, DETECT_RAD_DEFAULT);
469             (void)detect_objects_gold(creature_ptr, DETECT_RAD_DEFAULT);
470             (void)detect_objects_normal(creature_ptr, DETECT_RAD_DEFAULT);
471             identify_pack(creature_ptr);
472             self_knowledge(creature_ptr);
473             ident = TRUE;
474             break;
475
476         case SV_POTION_SELF_KNOWLEDGE:
477             msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
478             msg_print(NULL);
479             self_knowledge(creature_ptr);
480             ident = TRUE;
481             break;
482
483         case SV_POTION_EXPERIENCE:
484             if (creature_ptr->prace == RACE_ANDROID)
485                 break;
486             chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
487             if (creature_ptr->exp < PY_MAX_EXP) {
488                 EXP ee = (creature_ptr->exp / 2) + 10;
489                 if (ee > 100000L)
490                     ee = 100000L;
491                 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
492                 gain_exp(creature_ptr, ee);
493                 ident = TRUE;
494             }
495             break;
496
497         case SV_POTION_RESISTANCE:
498             (void)set_oppose_acid(creature_ptr, creature_ptr->oppose_acid + randint1(20) + 20, FALSE);
499             (void)set_oppose_elec(creature_ptr, creature_ptr->oppose_elec + randint1(20) + 20, FALSE);
500             (void)set_oppose_fire(creature_ptr, creature_ptr->oppose_fire + randint1(20) + 20, FALSE);
501             (void)set_oppose_cold(creature_ptr, creature_ptr->oppose_cold + randint1(20) + 20, FALSE);
502             (void)set_oppose_pois(creature_ptr, creature_ptr->oppose_pois + randint1(20) + 20, FALSE);
503             ident = TRUE;
504             break;
505
506         case SV_POTION_CURING:
507             if (true_healing(creature_ptr, 50))
508                 ident = TRUE;
509             break;
510
511         case SV_POTION_INVULNERABILITY:
512             (void)set_invuln(creature_ptr, creature_ptr->invuln + randint1(4) + 4, FALSE);
513             ident = TRUE;
514             break;
515
516         case SV_POTION_NEW_LIFE:
517             roll_hitdice(creature_ptr, 0L);
518             get_max_stats(creature_ptr);
519             creature_ptr->update |= PU_BONUS;
520             lose_all_mutations(creature_ptr);
521             ident = TRUE;
522             break;
523
524         case SV_POTION_NEO_TSUYOSHI:
525             (void)set_image(creature_ptr, 0);
526             (void)set_tsuyoshi(creature_ptr, creature_ptr->tsuyoshi + randint1(100) + 100, FALSE);
527             ident = TRUE;
528             break;
529
530         case SV_POTION_TSUYOSHI:
531             msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
532             msg_print(NULL);
533             creature_ptr->tsuyoshi = 1;
534             (void)set_tsuyoshi(creature_ptr, 0, TRUE);
535             if (!creature_ptr->resist_chaos) {
536                 (void)set_image(creature_ptr, 50 + randint1(50));
537             }
538             ident = TRUE;
539             break;
540
541         case SV_POTION_POLYMORPH:
542             if ((creature_ptr->muta1 || creature_ptr->muta2 || creature_ptr->muta3) && one_in_(23)) {
543                 lose_all_mutations(creature_ptr);
544             } else {
545                 do {
546                     if (one_in_(2)) {
547                         if (gain_mutation(creature_ptr, 0))
548                             ident = TRUE;
549                     } else if (lose_mutation(creature_ptr, 0))
550                         ident = TRUE;
551                 } while (!ident || one_in_(2));
552             }
553             break;
554         }
555     }
556
557     if (is_specific_player_race(creature_ptr, RACE_SKELETON)) {
558         msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
559         (void)potion_smash_effect(creature_ptr, 0, creature_ptr->y, creature_ptr->x, q_ptr->k_idx);
560     }
561     creature_ptr->update |= (PU_COMBINE | PU_REORDER);
562
563     if (!(object_is_aware(q_ptr))) {
564         chg_virtue(creature_ptr, V_PATIENCE, -1);
565         chg_virtue(creature_ptr, V_CHANCE, 1);
566         chg_virtue(creature_ptr, V_KNOWLEDGE, -1);
567     }
568
569     /* The item has been tried */
570     object_tried(q_ptr);
571
572     /* An identification was made */
573     if (ident && !object_is_aware(q_ptr)) {
574         object_aware(creature_ptr, q_ptr);
575         gain_exp(creature_ptr, (lev + (creature_ptr->lev >> 1)) / creature_ptr->lev);
576     }
577
578     creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
579
580     /* Potions can feed the player */
581     switch (creature_ptr->mimic_form) {
582     case MIMIC_NONE:
583         switch (creature_ptr->prace) {
584         case RACE_VAMPIRE:
585             (void)set_food(creature_ptr, creature_ptr->food + (q_ptr->pval / 10));
586             break;
587         case RACE_SKELETON:
588             /* Do nothing */
589             break;
590         case RACE_GOLEM:
591         case RACE_ZOMBIE:
592         case RACE_BALROG:
593         case RACE_SPECTRE:
594             set_food(creature_ptr, creature_ptr->food + ((q_ptr->pval) / 20));
595             break;
596         case RACE_ANDROID:
597             if (q_ptr->tval == TV_FLASK) {
598                 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
599                 set_food(creature_ptr, creature_ptr->food + 5000);
600             } else {
601                 set_food(creature_ptr, creature_ptr->food + ((q_ptr->pval) / 20));
602             }
603             break;
604         case RACE_ENT:
605             msg_print(_("水分を取り込んだ。", "You are moistened."));
606             set_food(creature_ptr, MIN(creature_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
607             break;
608         default:
609             (void)set_food(creature_ptr, creature_ptr->food + q_ptr->pval);
610             break;
611         }
612         break;
613     case MIMIC_DEMON:
614     case MIMIC_DEMON_LORD:
615         set_food(creature_ptr, creature_ptr->food + ((q_ptr->pval) / 20));
616         break;
617     case MIMIC_VAMPIRE:
618         (void)set_food(creature_ptr, creature_ptr->food + (q_ptr->pval / 10));
619         break;
620     default:
621         (void)set_food(creature_ptr, creature_ptr->food + q_ptr->pval);
622         break;
623     }
624 }