• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision60a94d93edb3bf4a320c15862900a0025ed97e0e (tree)
Time2019-07-13 12:55:21
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/bldg.c
+++ b/src/bldg.c
@@ -2056,7 +2056,7 @@ static bool inn_comm(int cmd)
20562056 /* Have some nightmares */
20572057 while(1)
20582058 {
2059- sanity_blast(NULL, FALSE);
2059+ sanity_blast(p_ptr, NULL, FALSE);
20602060 if (!one_in_(3)) break;
20612061 }
20622062
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -184,7 +184,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
184184 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
185185
186186 /* Have some nightmares */
187- sanity_blast(NULL, FALSE);
187+ sanity_blast(p_ptr, NULL, FALSE);
188188 }
189189 if (set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4))
190190 {
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -1255,7 +1255,7 @@ void do_cmd_cast(void)
12551255 {
12561256 if ((sval == 3) && one_in_(2))
12571257 {
1258- sanity_blast(0, TRUE);
1258+ sanity_blast(p_ptr, 0, TRUE);
12591259 }
12601260 else
12611261 {
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -2129,7 +2129,7 @@ void update_monster(MONSTER_IDX m_idx, bool full)
21292129
21302130 if (r_info[m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR)
21312131 {
2132- sanity_blast(m_ptr, FALSE);
2132+ sanity_blast(p_ptr, m_ptr, FALSE);
21332133 }
21342134
21352135 /* Disturb on appearance */
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5201,11 +5201,11 @@ void wreck_the_pattern(player_type *creature_ptr)
52015201 * @param necro 暗黒領域魔法の詠唱失敗によるものならばTRUEを返す
52025202 * @return なし
52035203 */
5204-void sanity_blast(monster_type *m_ptr, bool necro)
5204+void sanity_blast(player_type *creature_ptr, monster_type *m_ptr, bool necro)
52055205 {
52065206 int power = 100;
52075207
5208- if (p_ptr->phase_out || !current_world_ptr->character_dungeon) return;
5208+ if (creature_ptr->phase_out || !current_world_ptr->character_dungeon) return;
52095209
52105210 if (!necro && m_ptr)
52115211 {
@@ -5237,12 +5237,12 @@ void sanity_blast(monster_type *m_ptr, bool necro)
52375237
52385238 if (randint1(100) > power) return;
52395239
5240- if (saving_throw(p_ptr->skill_sav - power))
5240+ if (saving_throw(creature_ptr->skill_sav - power))
52415241 {
52425242 return; /* Save, no adverse effects */
52435243 }
52445244
5245- if (p_ptr->image)
5245+ if (creature_ptr->image)
52465246 {
52475247 /* Something silly happens... */
52485248 msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"),
@@ -5251,7 +5251,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
52515251 if (one_in_(3))
52525252 {
52535253 msg_print(funny_comments[randint0(MAX_SAN_COMMENT)]);
5254- p_ptr->image = p_ptr->image + randint1(r_ptr->level);
5254+ creature_ptr->image = creature_ptr->image + randint1(r_ptr->level);
52555255 }
52565256
52575257 return; /* Never mind; we can't see it clearly enough */
@@ -5264,15 +5264,15 @@ void sanity_blast(monster_type *m_ptr, bool necro)
52645264 r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
52655265
52665266 /* Demon characters are unaffected */
5267- if (PRACE_IS_(p_ptr, RACE_IMP) || PRACE_IS_(p_ptr, RACE_DEMON) || (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) return;
5268- if (p_ptr->wizard) return;
5267+ if (PRACE_IS_(creature_ptr, RACE_IMP) || PRACE_IS_(creature_ptr, RACE_DEMON) || (mimic_info[creature_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) return;
5268+ if (creature_ptr->wizard) return;
52695269
52705270 /* Undead characters are 50% likely to be unaffected */
5271- if (PRACE_IS_(p_ptr, RACE_SKELETON) || PRACE_IS_(p_ptr, RACE_ZOMBIE)
5272- || PRACE_IS_(p_ptr, RACE_VAMPIRE) || PRACE_IS_(p_ptr, RACE_SPECTRE) ||
5273- (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_UNDEAD))
5271+ if (PRACE_IS_(creature_ptr, RACE_SKELETON) || PRACE_IS_(creature_ptr, RACE_ZOMBIE)
5272+ || PRACE_IS_(creature_ptr, RACE_VAMPIRE) || PRACE_IS_(creature_ptr, RACE_SPECTRE) ||
5273+ (mimic_info[creature_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_UNDEAD))
52745274 {
5275- if (saving_throw(25 + p_ptr->lev)) return;
5275+ if (saving_throw(25 + creature_ptr->lev)) return;
52765276 }
52775277 }
52785278 else if (!necro)
@@ -5302,14 +5302,14 @@ void sanity_blast(monster_type *m_ptr, bool necro)
53025302 }
53035303 else power *= 2;
53045304
5305- if (saving_throw(p_ptr->skill_sav * 100 / power))
5305+ if (saving_throw(creature_ptr->skill_sav * 100 / power))
53065306 {
53075307 msg_format(_("夢の中で%sに追いかけられた。", "%^s chases you through your dreams."), m_name);
53085308 /* Safe */
53095309 return;
53105310 }
53115311
5312- if (p_ptr->image)
5312+ if (creature_ptr->image)
53135313 {
53145314 /* Something silly happens... */
53155315 msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"),
@@ -5318,7 +5318,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
53185318 if (one_in_(3))
53195319 {
53205320 msg_print(funny_comments[randint0(MAX_SAN_COMMENT)]);
5321- p_ptr->image = p_ptr->image + randint1(r_ptr->level);
5321+ creature_ptr->image = creature_ptr->image + randint1(r_ptr->level);
53225322 }
53235323
53245324 /* Never mind; we can't see it clearly enough */
@@ -5331,35 +5331,35 @@ void sanity_blast(monster_type *m_ptr, bool necro)
53315331
53325332 r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR;
53335333
5334- if (!p_ptr->mimic_form)
5334+ if (!creature_ptr->mimic_form)
53355335 {
5336- switch (p_ptr->prace)
5336+ switch (creature_ptr->prace)
53375337 {
53385338 /* Demons may make a saving throw */
53395339 case RACE_IMP:
53405340 case RACE_DEMON:
5341- if (saving_throw(20 + p_ptr->lev)) return;
5341+ if (saving_throw(20 + creature_ptr->lev)) return;
53425342 break;
53435343 /* Undead may make a saving throw */
53445344 case RACE_SKELETON:
53455345 case RACE_ZOMBIE:
53465346 case RACE_SPECTRE:
53475347 case RACE_VAMPIRE:
5348- if (saving_throw(10 + p_ptr->lev)) return;
5348+ if (saving_throw(10 + creature_ptr->lev)) return;
53495349 break;
53505350 }
53515351 }
53525352 else
53535353 {
53545354 /* Demons may make a saving throw */
5355- if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)
5355+ if (mimic_info[creature_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)
53565356 {
5357- if (saving_throw(20 + p_ptr->lev)) return;
5357+ if (saving_throw(20 + creature_ptr->lev)) return;
53585358 }
53595359 /* Undead may make a saving throw */
5360- else if (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_UNDEAD)
5360+ else if (mimic_info[creature_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_UNDEAD)
53615361 {
5362- if (saving_throw(10 + p_ptr->lev)) return;
5362+ if (saving_throw(10 + creature_ptr->lev)) return;
53635363 }
53645364 }
53655365 }
@@ -5368,25 +5368,25 @@ void sanity_blast(monster_type *m_ptr, bool necro)
53685368 msg_print(_("ネクロノミコンを読んで正気を失った!", "Your sanity is shaken by reading the Necronomicon!"));
53695369 }
53705370
5371- if (saving_throw(p_ptr->skill_sav - power))
5371+ if (saving_throw(creature_ptr->skill_sav - power))
53725372 {
53735373 return;
53745374 }
53755375
53765376 do {
5377- (void)do_dec_stat(p_ptr, A_INT);
5378- } while (randint0(100) > p_ptr->skill_sav && one_in_(2));
5377+ (void)do_dec_stat(creature_ptr, A_INT);
5378+ } while (randint0(100) > creature_ptr->skill_sav && one_in_(2));
53795379
53805380 do {
5381- (void)do_dec_stat(p_ptr, A_WIS);
5382- } while (randint0(100) > p_ptr->skill_sav && one_in_(2));
5381+ (void)do_dec_stat(creature_ptr, A_WIS);
5382+ } while (randint0(100) > creature_ptr->skill_sav && one_in_(2));
53835383
53845384 switch (randint1(21))
53855385 {
53865386 case 1:
5387- if (!(p_ptr->muta3 & MUT3_MORONIC) && one_in_(5))
5387+ if (!(creature_ptr->muta3 & MUT3_MORONIC) && one_in_(5))
53885388 {
5389- if ((p_ptr->stat_use[A_INT] < 4) && (p_ptr->stat_use[A_WIS] < 4))
5389+ if ((creature_ptr->stat_use[A_INT] < 4) && (creature_ptr->stat_use[A_WIS] < 4))
53905390 {
53915391 msg_print(_("あなたは完璧な馬鹿になったような気がした。しかしそれは元々だった。", "You current_world_ptr->game_turn into an utter moron!"));
53925392 }
@@ -5395,47 +5395,47 @@ void sanity_blast(monster_type *m_ptr, bool necro)
53955395 msg_print(_("あなたは完璧な馬鹿になった!", "You current_world_ptr->game_turn into an utter moron!"));
53965396 }
53975397
5398- if (p_ptr->muta3 & MUT3_HYPER_INT)
5398+ if (creature_ptr->muta3 & MUT3_HYPER_INT)
53995399 {
54005400 msg_print(_("あなたの脳は生体コンピュータではなくなった。", "Your brain is no longer a living computer."));
5401- p_ptr->muta3 &= ~(MUT3_HYPER_INT);
5401+ creature_ptr->muta3 &= ~(MUT3_HYPER_INT);
54025402 }
5403- p_ptr->muta3 |= MUT3_MORONIC;
5403+ creature_ptr->muta3 |= MUT3_MORONIC;
54045404 }
54055405 break;
54065406 case 2:
54075407 case 3:
54085408 case 4:
5409- if (!(p_ptr->muta2 & MUT2_COWARDICE) && !p_ptr->resist_fear)
5409+ if (!(creature_ptr->muta2 & MUT2_COWARDICE) && !creature_ptr->resist_fear)
54105410 {
54115411 msg_print(_("あなたはパラノイアになった!", "You become paranoid!"));
54125412
54135413 /* Duh, the following should never happen, but anyway... */
5414- if (p_ptr->muta3 & MUT3_FEARLESS)
5414+ if (creature_ptr->muta3 & MUT3_FEARLESS)
54155415 {
54165416 msg_print(_("あなたはもう恐れ知らずではなくなった。", "You are no longer fearless."));
5417- p_ptr->muta3 &= ~(MUT3_FEARLESS);
5417+ creature_ptr->muta3 &= ~(MUT3_FEARLESS);
54185418 }
54195419
5420- p_ptr->muta2 |= MUT2_COWARDICE;
5420+ creature_ptr->muta2 |= MUT2_COWARDICE;
54215421 }
54225422 break;
54235423 case 5:
54245424 case 6:
54255425 case 7:
5426- if (!(p_ptr->muta2 & MUT2_HALLU) && !p_ptr->resist_chaos)
5426+ if (!(creature_ptr->muta2 & MUT2_HALLU) && !creature_ptr->resist_chaos)
54275427 {
54285428 msg_print(_("幻覚をひき起こす精神錯乱に陥った!", "You are afflicted by a hallucinatory insanity!"));
5429- p_ptr->muta2 |= MUT2_HALLU;
5429+ creature_ptr->muta2 |= MUT2_HALLU;
54305430 }
54315431 break;
54325432 case 8:
54335433 case 9:
54345434 case 10:
5435- if (!(p_ptr->muta2 & MUT2_BERS_RAGE))
5435+ if (!(creature_ptr->muta2 & MUT2_BERS_RAGE))
54365436 {
54375437 msg_print(_("激烈な感情の発作におそわれるようになった!", "You become subject to fits of berserk rage!"));
5438- p_ptr->muta2 |= MUT2_BERS_RAGE;
5438+ creature_ptr->muta2 |= MUT2_BERS_RAGE;
54395439 }
54405440 break;
54415441 case 11:
@@ -5445,17 +5445,17 @@ void sanity_blast(monster_type *m_ptr, bool necro)
54455445 case 15:
54465446 case 16:
54475447 /* Brain smash */
5448- if (!p_ptr->resist_conf)
5448+ if (!creature_ptr->resist_conf)
54495449 {
5450- (void)set_confused(p_ptr, p_ptr->confused + randint0(4) + 4);
5450+ (void)set_confused(creature_ptr, creature_ptr->confused + randint0(4) + 4);
54515451 }
5452- if (!p_ptr->free_act)
5452+ if (!creature_ptr->free_act)
54535453 {
5454- (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4);
5454+ (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed + randint0(4) + 4);
54555455 }
5456- if (!p_ptr->resist_chaos)
5456+ if (!creature_ptr->resist_chaos)
54575457 {
5458- (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150);
5458+ (void)set_image(creature_ptr, creature_ptr->image + randint0(250) + 150);
54595459 }
54605460 break;
54615461 case 17:
@@ -5464,12 +5464,12 @@ void sanity_blast(monster_type *m_ptr, bool necro)
54645464 case 20:
54655465 case 21:
54665466 /* Amnesia */
5467- if (lose_all_info(p_ptr))
5467+ if (lose_all_info(creature_ptr))
54685468 msg_print(_("あまりの恐怖に全てのことを忘れてしまった!", "You forget everything in your utmost terror!"));
54695469 break;
54705470 }
54715471
5472- p_ptr->update |= PU_BONUS;
5472+ creature_ptr->update |= PU_BONUS;
54735473 handle_stuff();
54745474 }
54755475
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -745,7 +745,7 @@ extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
745745 extern void free_turn(player_type *creature_ptr);
746746
747747 extern bool player_place(player_type *creature_ptr, POSITION y, POSITION x);
748-extern void sanity_blast(monster_type *m_ptr, bool necro);
748+extern void sanity_blast(player_type *creature_ptr, monster_type *m_ptr, bool necro);
749749
750750 extern void check_experience(player_type *creature_ptr);
751751 extern void wreck_the_pattern(player_type *creature_ptr);
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4697,7 +4697,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46974697 {
46984698 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
46994699 /* Have some nightmares */
4700- sanity_blast(NULL, FALSE);
4700+ sanity_blast(p_ptr, NULL, FALSE);
47014701 }
47024702
47034703 set_paralyzed(p_ptr, p_ptr->paralyzed + dam);
--- a/src/trap.c
+++ b/src/trap.c
@@ -566,7 +566,7 @@ void hit_trap(bool break_trap)
566566 msg_print(_("身の毛もよだつ光景が頭に浮かんだ。", "A horrible vision enters your mind."));
567567
568568 /* Have some nightmares */
569- sanity_blast(NULL, FALSE);
569+ sanity_blast(p_ptr, NULL, FALSE);
570570
571571 }
572572 (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(10) + 5);
--- a/src/world.h
+++ b/src/world.h
@@ -21,7 +21,7 @@ typedef struct {
2121 u32b seed_flavor; /* Hack -- consistent object colors */
2222 u32b seed_town; /* Hack -- consistent town layout */
2323
24- bool is_loading_now; /*!< ロード処理中フラグ...ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
24+ bool is_loading_now; /*!< ロード処理中フラグ...ロード直後にcalc_bonus()時の徳変化、及びsanity_blast(p_ptr, )による異常を抑止する */
2525
2626 /*
2727 * Savefile version
Show on old repository browser