• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionac1116a225ba5cee569228249df9ac119df2419c (tree)
Time2019-06-29 19:28:29
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2090,10 +2090,10 @@ int calc_mutant_regenerate_mod(void)
20902090 * @param power 発動させる突然変異レイシャルのID
20912091 * @return レイシャルを実行した場合TRUE、キャンセルした場合FALSEを返す
20922092 */
2093-bool mutation_power_aux(int power)
2093+bool mutation_power_aux(player_type *creature_ptr, int power)
20942094 {
20952095 DIRECTION dir = 0;
2096- PLAYER_LEVEL lvl = p_ptr->lev;
2096+ PLAYER_LEVEL lvl = creature_ptr->lev;
20972097
20982098 switch (power)
20992099 {
@@ -2188,7 +2188,7 @@ bool mutation_power_aux(int power)
21882188
21892189 for (i = 0; i < INVEN_TOTAL; i++)
21902190 {
2191- object_type *o_ptr = &p_ptr->inventory_list[i];
2191+ object_type *o_ptr = &creature_ptr->inventory_list[i];
21922192
21932193 if (!o_ptr->k_idx) continue;
21942194 if (!object_is_cursed(o_ptr)) continue;
@@ -2204,7 +2204,7 @@ bool mutation_power_aux(int power)
22042204
22052205 case MUT1_POLYMORPH:
22062206 if (!get_check(_("変身します。よろしいですか?", "You will polymorph your self. Are you sure? "))) return FALSE;
2207- do_poly_self(p_ptr);
2207+ do_poly_self(creature_ptr);
22082208 break;
22092209
22102210 case MUT1_MIDAS_TCH:
@@ -2217,7 +2217,7 @@ bool mutation_power_aux(int power)
22172217 DIRECTION i;
22182218 for (i = 0; i < 8; i++)
22192219 {
2220- summon_specific(-1, p_ptr->y, p_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
2220+ summon_specific(-1, creature_ptr->y, creature_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
22212221 }
22222222 }
22232223 break;
@@ -2229,38 +2229,38 @@ bool mutation_power_aux(int power)
22292229
22302230 if (randint0(5) < num)
22312231 {
2232- (void)set_oppose_acid(p_ptr, dur, FALSE);
2232+ (void)set_oppose_acid(creature_ptr, dur, FALSE);
22332233 num--;
22342234 }
22352235 if (randint0(4) < num)
22362236 {
2237- (void)set_oppose_elec(p_ptr, dur, FALSE);
2237+ (void)set_oppose_elec(creature_ptr, dur, FALSE);
22382238 num--;
22392239 }
22402240 if (randint0(3) < num)
22412241 {
2242- (void)set_oppose_fire(p_ptr, dur, FALSE);
2242+ (void)set_oppose_fire(creature_ptr, dur, FALSE);
22432243 num--;
22442244 }
22452245 if (randint0(2) < num)
22462246 {
2247- (void)set_oppose_cold(p_ptr, dur, FALSE);
2247+ (void)set_oppose_cold(creature_ptr, dur, FALSE);
22482248 num--;
22492249 }
22502250 if (num)
22512251 {
2252- (void)set_oppose_pois(p_ptr, dur, FALSE);
2252+ (void)set_oppose_pois(creature_ptr, dur, FALSE);
22532253 num--;
22542254 }
22552255 }
22562256 break;
22572257
22582258 case MUT1_EARTHQUAKE:
2259- (void)earthquake(p_ptr->y, p_ptr->x, 10, 0);
2259+ (void)earthquake(creature_ptr->y, creature_ptr->x, 10, 0);
22602260 break;
22612261
22622262 case MUT1_EAT_MAGIC:
2263- if (!eat_magic(p_ptr->lev * 2)) return FALSE;
2263+ if (!eat_magic(creature_ptr->lev * 2)) return FALSE;
22642264 break;
22652265
22662266 case MUT1_WEIGH_MAG:
@@ -2289,7 +2289,7 @@ bool mutation_power_aux(int power)
22892289 break;
22902290
22912291 case MUT1_RECALL:
2292- if (!recall_player(p_ptr, randint0(21) + 15)) return FALSE;
2292+ if (!recall_player(creature_ptr, randint0(21) + 15)) return FALSE;
22932293 break;
22942294
22952295 case MUT1_BANISH:
@@ -2299,8 +2299,8 @@ bool mutation_power_aux(int power)
22992299 monster_type *m_ptr;
23002300 monster_race *r_ptr;
23012301 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
2302- y = p_ptr->y + ddy[dir];
2303- x = p_ptr->x + ddx[dir];
2302+ y = creature_ptr->y + ddy[dir];
2303+ x = creature_ptr->x + ddx[dir];
23042304 g_ptr = &current_floor_ptr->grid_array[y][x];
23052305
23062306 if (!g_ptr->m_idx)
@@ -2316,8 +2316,8 @@ bool mutation_power_aux(int power)
23162316 if ((r_ptr->flags3 & RF3_EVIL) &&
23172317 !(r_ptr->flags1 & RF1_QUESTOR) &&
23182318 !(r_ptr->flags1 & RF1_UNIQUE) &&
2319- !p_ptr->inside_arena && !p_ptr->inside_quest &&
2320- (r_ptr->level < randint1(p_ptr->lev+50)) &&
2319+ !creature_ptr->inside_arena && !creature_ptr->inside_quest &&
2320+ (r_ptr->level < randint1(creature_ptr->lev+50)) &&
23212321 !(m_ptr->mflag2 & MFLAG2_NOGENO))
23222322 {
23232323 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
@@ -2344,8 +2344,8 @@ bool mutation_power_aux(int power)
23442344 POSITION x, y;
23452345 grid_type *g_ptr;
23462346 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
2347- y = p_ptr->y + ddy[dir];
2348- x = p_ptr->x + ddx[dir];
2347+ y = creature_ptr->y + ddy[dir];
2348+ x = creature_ptr->x + ddx[dir];
23492349 g_ptr = &current_floor_ptr->grid_array[y][x];
23502350 if (!g_ptr->m_idx)
23512351 {
@@ -2364,7 +2364,7 @@ bool mutation_power_aux(int power)
23642364 break;
23652365
23662366 default:
2367- free_turn(p_ptr);
2367+ free_turn(creature_ptr);
23682368 msg_format(_("能力 %s は実装されていません。", "Power %s not implemented. Oops."), power);
23692369 }
23702370
--- a/src/mutation.h
+++ b/src/mutation.h
@@ -5,5 +5,5 @@ extern void lose_all_mutations(void);
55 extern void dump_mutations(FILE *OutFile);
66 extern void do_cmd_knowledge_mutations(void);
77 extern int calc_mutant_regenerate_mod(void);
8-extern bool mutation_power_aux(int power);
8+extern bool mutation_power_aux(player_type *creature_ptr, int power);
99 extern void become_living_trump(player_type *creature_ptr);
--- a/src/racial.c
+++ b/src/racial.c
@@ -2005,7 +2005,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
20052005 if (power_desc[i].number < 0)
20062006 cast = cmd_racial_power_aux(power_desc[i].number);
20072007 else
2008- cast = mutation_power_aux(power_desc[i].number);
2008+ cast = mutation_power_aux(p_ptr, power_desc[i].number);
20092009 break;
20102010 case 0:
20112011 cast = FALSE;
Show on old repository browser