OSDN Git Service

[Refactor] #39963 Separated effect-monster-lite-dark.c/h from effect-monster-switcher.c
[hengbandforosx/hengbandosx.git] / src / effect / effect-monster-lite-dark.c
1 #include "angband.h"
2 #include "effect/effect-monster-util.h"
3 #include "effect/effect-monster-lite-dark.h"
4
5 gf_switch_result effect_monster_lite_weak(player_type *caster_ptr, effect_monster_type *em_ptr)
6 {
7         if (!em_ptr->dam)
8         {
9                 em_ptr->skipped = TRUE;
10                 return GF_SWITCH_CONTINUE;
11         }
12
13         if ((em_ptr->r_ptr->flags3 & RF3_HURT_LITE) == 0)
14         {
15                 em_ptr->dam = 0;
16                 return GF_SWITCH_CONTINUE;
17         }
18
19         if (em_ptr->seen) em_ptr->obvious = TRUE;
20
21         if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
22                 em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
23
24         em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
25         em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
26         return GF_SWITCH_CONTINUE;
27 }
28
29
30 gf_switch_result effect_monster_lite(player_type *caster_ptr, effect_monster_type *em_ptr)
31 {
32         if (em_ptr->seen) em_ptr->obvious = TRUE;
33
34         if (em_ptr->r_ptr->flagsr & RFR_RES_LITE)
35         {
36                 em_ptr->note = _("には耐性がある!", " resists!");
37                 em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
38                 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
39                         em_ptr->r_ptr->r_flagsr |= (RFR_RES_LITE);
40         }
41         else if (em_ptr->r_ptr->flags3 & (RF3_HURT_LITE))
42         {
43                 if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
44                         em_ptr->r_ptr->r_flags3 |= (RF3_HURT_LITE);
45
46                 em_ptr->note = _("は光に身をすくめた!", " cringes from the light!");
47                 em_ptr->note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
48                 em_ptr->dam *= 2;
49         }
50
51         return GF_SWITCH_CONTINUE;
52 }
53
54
55 gf_switch_result effect_monster_dark(player_type *caster_ptr, effect_monster_type *em_ptr)
56 {
57         if (em_ptr->seen) em_ptr->obvious = TRUE;
58
59         if ((em_ptr->r_ptr->flagsr & RFR_RES_DARK) == 0)
60                 return GF_SWITCH_CONTINUE;
61
62         em_ptr->note = _("には耐性がある!", " resists!");
63         em_ptr->dam *= 2; em_ptr->dam /= (randint1(6) + 6);
64         if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
65                 em_ptr->r_ptr->r_flagsr |= (RFR_RES_DARK);
66
67         return GF_SWITCH_CONTINUE;
68 }