OSDN Git Service

[Refactor] #38997 berserk() に player_type * 引数を追加. / Add player_type * argument to...
authordeskull <deskull@users.sourceforge.jp>
Thu, 12 Sep 2019 10:14:51 +0000 (19:14 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 12 Sep 2019 10:14:51 +0000 (19:14 +0900)
src/cmd/cmd-activate.c
src/cmd/cmd-quaff.c
src/mutation.c
src/racial.c
src/realm-craft.c
src/realm-death.c
src/spells-status.c
src/spells-status.h

index 54c9818..522675b 100644 (file)
@@ -1311,7 +1311,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_BERSERK:
        {
-               (void)berserk(randint1(25) + 25);
+               (void)berserk(p_ptr, randint1(25) + 25);
                break;
        }
 
index 49d7d07..306bc32 100644 (file)
@@ -300,7 +300,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
                        break;
 
                case SV_POTION_BESERK_STRENGTH:
-                       ident = berserk(randint1(25) + 25);
+                       ident = berserk(p_ptr, randint1(25) + 25);
                        break;
 
                case SV_POTION_CURE_LIGHT:
index 35bd8c7..4af4692 100644 (file)
@@ -2195,7 +2195,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                        break;
 
                case MUT1_BERSERK:
-                       (void)berserk(randint1(25) + 25);
+                       (void)berserk(p_ptr, randint1(25) + 25);
                        break;
 
                case MUT1_POLYMORPH:
index cd06888..a0643c2 100644 (file)
@@ -670,7 +670,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
 
                case RACE_HALF_TROLL:
                        msg_print(_("うがぁぁ!", "RAAAGH!"));
-                       (void)berserk(10 + randint1(plev));
+                       (void)berserk(p_ptr, 10 + randint1(plev));
                        break;
 
                case RACE_AMBERITE:
@@ -691,7 +691,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
 
                case RACE_BARBARIAN:
                        msg_print(_("うぉぉおお!", "Raaagh!"));
-                       (void)berserk(10 + randint1(plev));
+                       (void)berserk(p_ptr, 10 + randint1(plev));
                        break;
 
                case RACE_HALF_OGRE:
index 0e88091..fb51096 100644 (file)
@@ -211,7 +211,7 @@ concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               (void)berserk(base + randint1(base));
+                               (void)berserk(p_ptr, base + randint1(base));
                        }
                }
                break;
index 3353614..652cb23 100644 (file)
@@ -376,7 +376,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               (void)berserk(base + randint1(base));
+                               (void)berserk(p_ptr, base + randint1(base));
                        }
                }
                break;
@@ -430,7 +430,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               (void)berserk(b_base + randint1(b_base));
+                               (void)berserk(p_ptr, b_base + randint1(b_base));
                                set_fast(caster_ptr, randint1(sp_sides) + sp_base, FALSE);
                        }
                }
index a144f00..8794dbc 100644 (file)
@@ -300,12 +300,12 @@ bool_hack heroism(player_type *creature_ptr, int base)
        return ident;
 }
 
-bool_hack berserk(int base)
+bool_hack berserk(player_type *creature_ptr, int base)
 {
        bool_hack ident = FALSE;
-       if (set_afraid(p_ptr, 0)) ident = TRUE;
-       if (set_shero(p_ptr, p_ptr->shero + randint1(base) + base, FALSE)) ident = TRUE;
-       if (hp_player(p_ptr, 30)) ident = TRUE;
+       if (set_afraid(creature_ptr, 0)) ident = TRUE;
+       if (set_shero(creature_ptr, creature_ptr->shero + randint1(base) + base, FALSE)) ident = TRUE;
+       if (hp_player(creature_ptr, 30)) ident = TRUE;
        return ident;
 }
 
index c826c6d..fbadd4d 100644 (file)
@@ -15,7 +15,7 @@ extern bool time_walk(player_type *creature_ptr);
 extern void roll_hitdice(player_type *creature_ptr, SPOP_FLAGS options);
 extern bool_hack life_stream(player_type *creature_ptr, bool_hack message, bool_hack virtue_change);
 extern bool_hack heroism(player_type *creature_ptr, int base);
-extern bool_hack berserk(int base);
+extern bool_hack berserk(player_type *creature_ptr, int base);
 extern bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides);
 extern bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides);
 extern bool_hack cure_critical_wounds(HIT_POINT pow);