OSDN Git Service

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

index f29cff2..54c9818 100644 (file)
@@ -1362,14 +1362,14 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_HERO:
        {
-               (void)heroism(25);
+               (void)heroism(p_ptr, 25);
                break;
        }
 
        case ACT_HERO_SPEED:
        {
                (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
-               (void)heroism(50);
+               (void)heroism(p_ptr, 50);
                break;
        }
 
index 4bd806f..49d7d07 100644 (file)
@@ -296,7 +296,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
                        break;
 
                case SV_POTION_HEROISM:
-                       ident = heroism(25);
+                       ident = heroism(p_ptr, 25);
                        break;
 
                case SV_POTION_BESERK_STRENGTH:
index f559dd9..0e88091 100644 (file)
@@ -119,7 +119,7 @@ concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               (void)heroism(base);
+                               (void)heroism(p_ptr, base);
                        }
                }
                break;
index 3513c06..436f117 100644 (file)
@@ -427,7 +427,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
 
                        if (cast)
                        {
-                               (void)heroism(base);
+                               (void)heroism(p_ptr, base);
                        }
                }
                break;
index 6327730..bf7d625 100644 (file)
@@ -468,7 +468,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        int base = 25;
                        if (info) return info_duration(base, base);
-                       if (cast)heroism(base);
+                       if (cast)heroism(p_ptr, base);
                }
                break;
 
index 5ef66ed..a144f00 100644 (file)
@@ -291,12 +291,12 @@ bool_hack life_stream(player_type *creature_ptr, bool_hack message, bool_hack vi
        return TRUE;
 }
 
-bool_hack heroism(int base)
+bool_hack heroism(player_type *creature_ptr, int base)
 {
        bool_hack ident = FALSE;
-       if (set_afraid(p_ptr, 0)) ident = TRUE;
-       if (set_hero(p_ptr, p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
-       if (hp_player(p_ptr, 10)) ident = TRUE;
+       if (set_afraid(creature_ptr, 0)) ident = TRUE;
+       if (set_hero(creature_ptr, creature_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if (hp_player(creature_ptr, 10)) ident = TRUE;
        return ident;
 }
 
index da37cf1..c826c6d 100644 (file)
@@ -14,7 +14,7 @@ extern void stop_singing(player_type *creature_ptr);
 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(int base);
+extern bool_hack heroism(player_type *creature_ptr, int base);
 extern bool_hack berserk(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);