• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionab4d3a1be78fe193a2495626e9087494db25cdbd (tree)
Time2019-08-11 00:22:51
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-magiceat.c
+++ b/src/cmd-magiceat.c
@@ -576,7 +576,7 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
576576 else if (tval == TV_WAND)
577577 {
578578 if (!get_aim_dir(&dir)) return FALSE;
579- wand_effect(sval, dir, powerful, TRUE);
579+ wand_effect(p_ptr, sval, dir, powerful, TRUE);
580580 }
581581 else
582582 {
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -22,33 +22,33 @@
2222 * @param magic 魔道具術上の処理ならばTRUE
2323 * @return 発動により効果内容が確定したならばTRUEを返す
2424 */
25-bool wand_effect(OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic)
25+bool wand_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic)
2626 {
2727 bool ident = FALSE;
28- PLAYER_LEVEL lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
28+ PLAYER_LEVEL lev = powerful ? creature_ptr->lev * 2 : creature_ptr->lev;
2929 POSITION rad = powerful ? 3 : 2;
3030
3131 /* XXX Hack -- Wand of wonder can do anything before it */
3232 if (sval == SV_WAND_WONDER)
3333 {
34- int vir = virtue_number(p_ptr, V_CHANCE);
34+ int vir = virtue_number(creature_ptr, V_CHANCE);
3535 sval = (OBJECT_SUBTYPE_VALUE)randint0(SV_WAND_WONDER);
3636
3737 if (vir)
3838 {
39- if (p_ptr->virtues[vir - 1] > 0)
39+ if (creature_ptr->virtues[vir - 1] > 0)
4040 {
41- while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
41+ while (randint1(300) < creature_ptr->virtues[vir - 1]) sval++;
4242 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
4343 }
4444 else
4545 {
46- while (randint1(300) < (0 - p_ptr->virtues[vir - 1])) sval--;
46+ while (randint1(300) < (0 - creature_ptr->virtues[vir - 1])) sval--;
4747 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
4848 }
4949 }
5050 if (sval < SV_WAND_TELEPORT_AWAY)
51- chg_virtue(p_ptr, V_CHANCE, 1);
51+ chg_virtue(creature_ptr, V_CHANCE, 1);
5252 }
5353
5454 /* Analyze the wand */
@@ -401,7 +401,7 @@ void exe_aim_wand(INVENTORY_IDX item)
401401
402402 sound(SOUND_ZAP);
403403
404- ident = wand_effect(o_ptr->sval, dir, FALSE, FALSE);
404+ ident = wand_effect(p_ptr, o_ptr->sval, dir, FALSE, FALSE);
405405 p_ptr->update |= (PU_COMBINE | PU_REORDER);
406406
407407 if (!(object_is_aware(o_ptr)))
--- a/src/cmd-zapwand.h
+++ b/src/cmd-zapwand.h
@@ -1,3 +1,3 @@
1-extern bool wand_effect(OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic);
1+extern bool wand_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic);
22 extern void exe_aim_wand(INVENTORY_IDX item);
33 extern void do_cmd_aim_wand(void);
Show on old repository browser