• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision4bebca0e789d72f11b7dfe10d1b5329743cd6b0a (tree)
Time2019-06-29 19:37:25
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 calc_mutant_regenerate_mod() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/load.c
+++ b/src/load.c
@@ -2211,7 +2211,7 @@ static void rd_extra(void)
22112211 }
22122212
22132213 /* Calc the regeneration modifier for mutations */
2214- p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
2214+ p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(p_ptr);
22152215
22162216 if (z_older_than(10,0,9))
22172217 {
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -867,7 +867,7 @@ bool gain_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut)
867867 }
868868 }
869869
870- p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
870+ p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(p_ptr);
871871 creature_ptr->update |= PU_BONUS;
872872 handle_stuff();
873873 return TRUE;
@@ -1496,7 +1496,7 @@ bool lose_mutation(MUTATION_IDX choose_mut)
14961496
14971497 p_ptr->update |= PU_BONUS;
14981498 handle_stuff();
1499- p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
1499+ p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(p_ptr);
15001500 return TRUE;
15011501 }
15021502 }
@@ -1510,7 +1510,7 @@ void lose_all_mutations(player_type *creature_ptr)
15101510 creature_ptr->muta1 = creature_ptr->muta2 = creature_ptr->muta3 = 0;
15111511 creature_ptr->update |= PU_BONUS;
15121512 handle_stuff();
1513- creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
1513+ creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(p_ptr);
15141514 }
15151515 }
15161516
@@ -2055,7 +2055,7 @@ static int count_mutations(void)
20552055 * Return the modifier to the regeneration rate (in percent)
20562056 * @return ペナルティ修正(%)
20572057 */
2058-int calc_mutant_regenerate_mod(void)
2058+int calc_mutant_regenerate_mod(player_type *creature_ptr)
20592059 {
20602060 int regen;
20612061 int mod = 10;
@@ -2066,8 +2066,8 @@ int calc_mutant_regenerate_mod(void)
20662066 * only 5% decrease per additional mutation
20672067 */
20682068
2069- if (p_ptr->pseikaku == SEIKAKU_LUCKY) count--;
2070- if (p_ptr->prace == RACE_BEASTMAN)
2069+ if (creature_ptr->pseikaku == SEIKAKU_LUCKY) count--;
2070+ if (creature_ptr->prace == RACE_BEASTMAN)
20712071 {
20722072 count -= 10;
20732073 mod = 5;
--- a/src/mutation.h
+++ b/src/mutation.h
@@ -4,6 +4,6 @@ extern bool lose_mutation(MUTATION_IDX choose_mut);
44 extern void lose_all_mutations(player_type *creature_ptr);
55 extern void dump_mutations(player_type *creature_ptr, FILE *OutFile);
66 extern void do_cmd_knowledge_mutations(void);
7-extern int calc_mutant_regenerate_mod(void);
7+extern int calc_mutant_regenerate_mod(player_type *creature_ptr);
88 extern bool mutation_power_aux(player_type *creature_ptr, int power);
99 extern void become_living_trump(player_type *creature_ptr);
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -169,7 +169,7 @@ void stop_singing(player_type *creature_ptr)
169169 /* The player is singing? */
170170 if (!SINGING_SONG_EFFECT(creature_ptr)) return;
171171
172- /* Hack -- if called from set_action(p_ptr, ), avoid recursive loop */
172+ /* Hack -- if called from set_action(p_ptr), avoid recursive loop */
173173 if (creature_ptr->action == ACTION_SING) set_action(p_ptr, ACTION_NONE);
174174
175175 /* Message text of each song or etc. */
Show on old repository browser