OSDN Git Service

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