• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionbba249f2a5931c64e95f803ea717513367543e0c (tree)
Time2019-08-17 00:01:35
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd/cmd-hissatsu.c
+++ b/src/cmd/cmd-hissatsu.c
@@ -44,14 +44,14 @@
4444 * when you run it. It's probably easy to fix but I haven't tried,\n
4545 * sorry.\n
4646 */
47-static int get_hissatsu_power(SPELL_IDX *sn)
47+static int get_hissatsu_power(player_type *creature_ptr, SPELL_IDX *sn)
4848 {
4949 SPELL_IDX i;
5050 int j = 0;
5151 int num = 0;
5252 POSITION y = 1;
5353 POSITION x = 15;
54- PLAYER_LEVEL plev = p_ptr->lev;
54+ PLAYER_LEVEL plev = creature_ptr->lev;
5555 int ask = TRUE;
5656 char choice;
5757 char out_val[160];
@@ -120,7 +120,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
120120 {
121121 menu_line += 31;
122122 if (menu_line > 32) menu_line -= 32;
123- } while(!(p_ptr->spell_learned1 & (1L << (menu_line-1))));
123+ } while(!(creature_ptr->spell_learned1 & (1L << (menu_line-1))));
124124 break;
125125 }
126126
@@ -132,7 +132,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
132132 {
133133 menu_line++;
134134 if (menu_line > 32) menu_line -= 32;
135- } while(!(p_ptr->spell_learned1 & (1L << (menu_line-1))));
135+ } while(!(creature_ptr->spell_learned1 & (1L << (menu_line-1))));
136136 break;
137137 }
138138
@@ -151,7 +151,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
151151 reverse = TRUE;
152152 }
153153 else menu_line+=16;
154- while(!(p_ptr->spell_learned1 & (1L << (menu_line-1))))
154+ while(!(creature_ptr->spell_learned1 & (1L << (menu_line-1))))
155155 {
156156 if (reverse)
157157 {
@@ -201,11 +201,11 @@ static int get_hissatsu_power(SPELL_IDX *sn)
201201
202202 if (spell.slevel > PY_MAX_LEVEL) continue;
203203 line++;
204- if (!(p_ptr->spell_learned1 >> i)) break;
204+ if (!(creature_ptr->spell_learned1 >> i)) break;
205205
206206 /* Access the spell */
207207 if (spell.slevel > plev) continue;
208- if (!(p_ptr->spell_learned1 & (1L << i))) continue;
208+ if (!(creature_ptr->spell_learned1 & (1L << i))) continue;
209209 if (use_menu)
210210 {
211211 if (i == (menu_line-1))
@@ -266,7 +266,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
266266 }
267267
268268 /* Totally Illegal */
269- if ((i < 0) || (i >= 32) || !(p_ptr->spell_learned1 & (1 << sentaku[i])))
269+ if ((i < 0) || (i >= 32) || !(creature_ptr->spell_learned1 & (1 << sentaku[i])))
270270 {
271271 bell();
272272 continue;
@@ -291,7 +291,7 @@ static int get_hissatsu_power(SPELL_IDX *sn)
291291 }
292292 if (redraw) screen_load();
293293
294- p_ptr->window |= (PW_SPELL);
294+ creature_ptr->window |= (PW_SPELL);
295295 handle_stuff();
296296
297297 /* Abort if needed */
@@ -334,7 +334,7 @@ void do_cmd_hissatsu(player_type *creature_ptr)
334334 set_action(creature_ptr, ACTION_NONE);
335335 }
336336
337- if (!get_hissatsu_power(&n)) return;
337+ if (!get_hissatsu_power(creature_ptr, &n)) return;
338338
339339 spell = technic_info[TECHNIC_HISSATSU][n];
340340
--- a/src/core.c
+++ b/src/core.c
@@ -1745,7 +1745,7 @@ static void process_world_aux_hp_and_sp(void)
17451745 regen_amount = regen_amount * 2;
17461746 }
17471747
1748- upkeep_factor = calculate_upkeep();
1748+ upkeep_factor = calculate_upkeep(p_ptr);
17491749
17501750 /* No regeneration while special action */
17511751 if ((p_ptr->action == ACTION_LEARN) ||
@@ -1773,7 +1773,7 @@ static void process_world_aux_hp_and_sp(void)
17731773 msg_print(NULL);
17741774 do_cmd_pet_dismiss();
17751775
1776- upkeep_factor = calculate_upkeep();
1776+ upkeep_factor = calculate_upkeep(p_ptr);
17771777
17781778 msg_format(_("維持MPは %d%%", "Upkeep: %d%% mana."), upkeep_factor);
17791779 msg_print(NULL);
@@ -4962,7 +4962,7 @@ static void dungeon(bool load_game)
49624962 if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, current_floor_ptr->dun_level, NULL);
49634963 }
49644964
4965- (void)calculate_upkeep();
4965+ (void)calculate_upkeep(p_ptr);
49664966
49674967 /* Validate the panel */
49684968 panel_bounds_center();
Show on old repository browser