• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision3255486ab42407e7359bf92a3f8c0b81634b34d3 (tree)
Time2019-06-27 12:20:36
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -4217,7 +4217,7 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
42174217 /*
42184218 * Choose a warrior-mage elemental attack. -LM-
42194219 */
4220-bool choose_ele_attack(void)
4220+bool choose_ele_attack(player_type *creature_ptr)
42214221 {
42224222 int num;
42234223
@@ -4230,7 +4230,7 @@ bool choose_ele_attack(void)
42304230 }
42314231 screen_save();
42324232
4233- num = (p_ptr->lev - 20) / 5;
4233+ num = (creature_ptr->lev - 20) / 5;
42344234 c_prt(TERM_RED, _(" a) 焼棄", " a) Fire Brand"), 2, 14);
42354235
42364236 if (num >= 2)
@@ -4263,15 +4263,15 @@ bool choose_ele_attack(void)
42634263 choice = inkey();
42644264
42654265 if ((choice == 'a') || (choice == 'A'))
4266- set_ele_attack(p_ptr, ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4266+ set_ele_attack(creature_ptr, ATTACK_FIRE, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
42674267 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
4268- set_ele_attack(p_ptr, ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4268+ set_ele_attack(creature_ptr, ATTACK_COLD, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
42694269 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
4270- set_ele_attack(p_ptr, ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4270+ set_ele_attack(creature_ptr, ATTACK_POIS, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
42714271 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
4272- set_ele_attack(p_ptr, ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4272+ set_ele_attack(creature_ptr, ATTACK_ACID, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
42734273 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
4274- set_ele_attack(p_ptr, ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4274+ set_ele_attack(creature_ptr, ATTACK_ELEC, creature_ptr->lev/2 + randint1(creature_ptr->lev/2));
42754275 else
42764276 {
42774277 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -75,7 +75,7 @@ extern void do_poly_self(player_type *creature_ptr);
7575 extern bool set_ultimate_res(TIME_EFFECT v, bool do_dec);
7676 extern bool set_tim_res_nether(TIME_EFFECT v, bool do_dec);
7777 extern bool set_tim_res_time(TIME_EFFECT v, bool do_dec);
78-extern bool choose_ele_attack(void);
78+extern bool choose_ele_attack(player_type *creature_ptr);
7979 extern bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT turn);
8080 extern bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
8181 extern bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -270,7 +270,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
270270
271271 if (cast)
272272 {
273- if (!choose_ele_attack()) return NULL;
273+ if (!choose_ele_attack(p_ptr)) return NULL;
274274 }
275275 }
276276 break;
Show on old repository browser