• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision275517e9b01541a1b62e195776601139fcf0009c (tree)
Time2019-06-24 23:19:52
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1848,7 +1848,7 @@ static void process_world_aux_timeout(void)
18481848 p_ptr->ele_attack--;
18491849
18501850 /* Clear all temporary elemental brands. */
1851- if (!p_ptr->ele_attack) set_ele_attack(0, 0);
1851+ if (!p_ptr->ele_attack) set_ele_attack(p_ptr, 0, 0);
18521852 }
18531853
18541854 /* Timed temporary elemental immune. -LM- */
--- a/src/object2.c
+++ b/src/object2.c
@@ -4991,7 +4991,7 @@ void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
49914991 if (!has_melee_weapon(INVEN_RARM + INVEN_LARM - item))
49924992 {
49934993 /* Clear all temporary elemental brands */
4994- set_ele_attack(0, 0);
4994+ set_ele_attack(p_ptr, 0, 0);
49954995 }
49964996 }
49974997 }
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -328,7 +328,7 @@ void dispel_player(void)
328328 (void)set_oppose_pois(0, TRUE);
329329 (void)set_ultimate_res(0, TRUE);
330330 (void)set_mimic(p_ptr, 0, 0, TRUE);
331- (void)set_ele_attack(0, 0);
331+ (void)set_ele_attack(p_ptr, 0, 0);
332332 (void)set_ele_immune(0, 0);
333333
334334 /* Cancel glowing hands */
@@ -2295,44 +2295,44 @@ bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
22952295 * @param v 継続時間
22962296 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
22972297 */
2298-bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
2298+bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
22992299 {
23002300 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
23012301
23022302 /* Clear all elemental attacks (only one is allowed at a time). */
2303- if ((p_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
2303+ if ((creature_ptr->special_attack & (ATTACK_ACID)) && (attack_type != ATTACK_ACID))
23042304 {
2305- p_ptr->special_attack &= ~(ATTACK_ACID);
2305+ creature_ptr->special_attack &= ~(ATTACK_ACID);
23062306 msg_print(_("酸で攻撃できなくなった。", "Your temporary acidic brand fades away."));
23072307 }
2308- if ((p_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
2308+ if ((creature_ptr->special_attack & (ATTACK_ELEC)) && (attack_type != ATTACK_ELEC))
23092309 {
2310- p_ptr->special_attack &= ~(ATTACK_ELEC);
2310+ creature_ptr->special_attack &= ~(ATTACK_ELEC);
23112311 msg_print(_("電撃で攻撃できなくなった。", "Your temporary electrical brand fades away."));
23122312 }
2313- if ((p_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
2313+ if ((creature_ptr->special_attack & (ATTACK_FIRE)) && (attack_type != ATTACK_FIRE))
23142314 {
2315- p_ptr->special_attack &= ~(ATTACK_FIRE);
2315+ creature_ptr->special_attack &= ~(ATTACK_FIRE);
23162316 msg_print(_("火炎で攻撃できなくなった。", "Your temporary fiery brand fades away."));
23172317 }
2318- if ((p_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
2318+ if ((creature_ptr->special_attack & (ATTACK_COLD)) && (attack_type != ATTACK_COLD))
23192319 {
2320- p_ptr->special_attack &= ~(ATTACK_COLD);
2320+ creature_ptr->special_attack &= ~(ATTACK_COLD);
23212321 msg_print(_("冷気で攻撃できなくなった。", "Your temporary frost brand fades away."));
23222322 }
2323- if ((p_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
2323+ if ((creature_ptr->special_attack & (ATTACK_POIS)) && (attack_type != ATTACK_POIS))
23242324 {
2325- p_ptr->special_attack &= ~(ATTACK_POIS);
2325+ creature_ptr->special_attack &= ~(ATTACK_POIS);
23262326 msg_print(_("毒で攻撃できなくなった。", "Your temporary poison brand fades away."));
23272327 }
23282328
23292329 if ((v) && (attack_type))
23302330 {
23312331 /* Set attack type. */
2332- p_ptr->special_attack |= (attack_type);
2332+ creature_ptr->special_attack |= (attack_type);
23332333
23342334 /* Set duration. */
2335- p_ptr->ele_attack = v;
2335+ creature_ptr->ele_attack = v;
23362336
23372337 #ifdef JP
23382338 msg_format("%sで攻撃できるようになった!",
@@ -2354,9 +2354,9 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
23542354 }
23552355
23562356 if (disturb_state) disturb(FALSE, FALSE);
2357- p_ptr->redraw |= (PR_STATUS);
2357+ creature_ptr->redraw |= (PR_STATUS);
23582358
2359- p_ptr->update |= (PU_BONUS);
2359+ creature_ptr->update |= (PU_BONUS);
23602360 handle_stuff();
23612361
23622362 return (TRUE);
@@ -4263,15 +4263,15 @@ bool choose_ele_attack(void)
42634263 choice = inkey();
42644264
42654265 if ((choice == 'a') || (choice == 'A'))
4266- set_ele_attack(ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4266+ set_ele_attack(p_ptr, ATTACK_FIRE, p_ptr->lev/2 + randint1(p_ptr->lev/2));
42674267 else if (((choice == 'b') || (choice == 'B')) && (num >= 2))
4268- set_ele_attack(ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4268+ set_ele_attack(p_ptr, ATTACK_COLD, p_ptr->lev/2 + randint1(p_ptr->lev/2));
42694269 else if (((choice == 'c') || (choice == 'C')) && (num >= 3))
4270- set_ele_attack(ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4270+ set_ele_attack(p_ptr, ATTACK_POIS, p_ptr->lev/2 + randint1(p_ptr->lev/2));
42714271 else if (((choice == 'd') || (choice == 'D')) && (num >= 4))
4272- set_ele_attack(ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4272+ set_ele_attack(p_ptr, ATTACK_ACID, p_ptr->lev/2 + randint1(p_ptr->lev/2));
42734273 else if (((choice == 'e') || (choice == 'E')) && (num >= 5))
4274- set_ele_attack(ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
4274+ set_ele_attack(p_ptr, ATTACK_ELEC, p_ptr->lev/2 + randint1(p_ptr->lev/2));
42754275 else
42764276 {
42774277 msg_print(_("魔法剣を使うのをやめた。", "You cancel the temporary branding."));
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -47,7 +47,7 @@ extern bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_de
4747 extern bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4848 extern bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4949 extern bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
50-extern bool set_ele_attack(u32b attack_type, TIME_EFFECT v);
50+extern bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v);
5151 extern bool set_ele_immune(u32b immune_type, TIME_EFFECT v);
5252 extern bool set_oppose_acid(TIME_EFFECT v, bool do_dec);
5353 extern bool set_oppose_elec(TIME_EFFECT v, bool do_dec);
Show on old repository browser