変愚蛮怒のメインリポジトリです
Revision | 60a94d93edb3bf4a320c15862900a0025ed97e0e (tree) |
---|---|
Time | 2019-07-13 12:55:21 |
Author | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #38997 sanity_blast() に player_type * 引数を追加.
@@ -2056,7 +2056,7 @@ static bool inn_comm(int cmd) | ||
2056 | 2056 | /* Have some nightmares */ |
2057 | 2057 | while(1) |
2058 | 2058 | { |
2059 | - sanity_blast(NULL, FALSE); | |
2059 | + sanity_blast(p_ptr, NULL, FALSE); | |
2060 | 2060 | if (!one_in_(3)) break; |
2061 | 2061 | } |
2062 | 2062 |
@@ -184,7 +184,7 @@ void exe_quaff_potion(INVENTORY_IDX item) | ||
184 | 184 | msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind.")); |
185 | 185 | |
186 | 186 | /* Have some nightmares */ |
187 | - sanity_blast(NULL, FALSE); | |
187 | + sanity_blast(p_ptr, NULL, FALSE); | |
188 | 188 | } |
189 | 189 | if (set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4)) |
190 | 190 | { |
@@ -1255,7 +1255,7 @@ void do_cmd_cast(void) | ||
1255 | 1255 | { |
1256 | 1256 | if ((sval == 3) && one_in_(2)) |
1257 | 1257 | { |
1258 | - sanity_blast(0, TRUE); | |
1258 | + sanity_blast(p_ptr, 0, TRUE); | |
1259 | 1259 | } |
1260 | 1260 | else |
1261 | 1261 | { |
@@ -2129,7 +2129,7 @@ void update_monster(MONSTER_IDX m_idx, bool full) | ||
2129 | 2129 | |
2130 | 2130 | if (r_info[m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR) |
2131 | 2131 | { |
2132 | - sanity_blast(m_ptr, FALSE); | |
2132 | + sanity_blast(p_ptr, m_ptr, FALSE); | |
2133 | 2133 | } |
2134 | 2134 | |
2135 | 2135 | /* Disturb on appearance */ |
@@ -5201,11 +5201,11 @@ void wreck_the_pattern(player_type *creature_ptr) | ||
5201 | 5201 | * @param necro 暗黒領域魔法の詠唱失敗によるものならばTRUEを返す |
5202 | 5202 | * @return なし |
5203 | 5203 | */ |
5204 | -void sanity_blast(monster_type *m_ptr, bool necro) | |
5204 | +void sanity_blast(player_type *creature_ptr, monster_type *m_ptr, bool necro) | |
5205 | 5205 | { |
5206 | 5206 | int power = 100; |
5207 | 5207 | |
5208 | - if (p_ptr->phase_out || !current_world_ptr->character_dungeon) return; | |
5208 | + if (creature_ptr->phase_out || !current_world_ptr->character_dungeon) return; | |
5209 | 5209 | |
5210 | 5210 | if (!necro && m_ptr) |
5211 | 5211 | { |
@@ -5237,12 +5237,12 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5237 | 5237 | |
5238 | 5238 | if (randint1(100) > power) return; |
5239 | 5239 | |
5240 | - if (saving_throw(p_ptr->skill_sav - power)) | |
5240 | + if (saving_throw(creature_ptr->skill_sav - power)) | |
5241 | 5241 | { |
5242 | 5242 | return; /* Save, no adverse effects */ |
5243 | 5243 | } |
5244 | 5244 | |
5245 | - if (p_ptr->image) | |
5245 | + if (creature_ptr->image) | |
5246 | 5246 | { |
5247 | 5247 | /* Something silly happens... */ |
5248 | 5248 | msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"), |
@@ -5251,7 +5251,7 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5251 | 5251 | if (one_in_(3)) |
5252 | 5252 | { |
5253 | 5253 | 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); | |
5255 | 5255 | } |
5256 | 5256 | |
5257 | 5257 | return; /* Never mind; we can't see it clearly enough */ |
@@ -5264,15 +5264,15 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5264 | 5264 | r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR; |
5265 | 5265 | |
5266 | 5266 | /* 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; | |
5269 | 5269 | |
5270 | 5270 | /* 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)) | |
5274 | 5274 | { |
5275 | - if (saving_throw(25 + p_ptr->lev)) return; | |
5275 | + if (saving_throw(25 + creature_ptr->lev)) return; | |
5276 | 5276 | } |
5277 | 5277 | } |
5278 | 5278 | else if (!necro) |
@@ -5302,14 +5302,14 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5302 | 5302 | } |
5303 | 5303 | else power *= 2; |
5304 | 5304 | |
5305 | - if (saving_throw(p_ptr->skill_sav * 100 / power)) | |
5305 | + if (saving_throw(creature_ptr->skill_sav * 100 / power)) | |
5306 | 5306 | { |
5307 | 5307 | msg_format(_("夢の中で%sに追いかけられた。", "%^s chases you through your dreams."), m_name); |
5308 | 5308 | /* Safe */ |
5309 | 5309 | return; |
5310 | 5310 | } |
5311 | 5311 | |
5312 | - if (p_ptr->image) | |
5312 | + if (creature_ptr->image) | |
5313 | 5313 | { |
5314 | 5314 | /* Something silly happens... */ |
5315 | 5315 | msg_format(_("%s%sの顔を見てしまった!", "You behold the %s visage of %s!"), |
@@ -5318,7 +5318,7 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5318 | 5318 | if (one_in_(3)) |
5319 | 5319 | { |
5320 | 5320 | 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); | |
5322 | 5322 | } |
5323 | 5323 | |
5324 | 5324 | /* Never mind; we can't see it clearly enough */ |
@@ -5331,35 +5331,35 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5331 | 5331 | |
5332 | 5332 | r_ptr->r_flags2 |= RF2_ELDRITCH_HORROR; |
5333 | 5333 | |
5334 | - if (!p_ptr->mimic_form) | |
5334 | + if (!creature_ptr->mimic_form) | |
5335 | 5335 | { |
5336 | - switch (p_ptr->prace) | |
5336 | + switch (creature_ptr->prace) | |
5337 | 5337 | { |
5338 | 5338 | /* Demons may make a saving throw */ |
5339 | 5339 | case RACE_IMP: |
5340 | 5340 | case RACE_DEMON: |
5341 | - if (saving_throw(20 + p_ptr->lev)) return; | |
5341 | + if (saving_throw(20 + creature_ptr->lev)) return; | |
5342 | 5342 | break; |
5343 | 5343 | /* Undead may make a saving throw */ |
5344 | 5344 | case RACE_SKELETON: |
5345 | 5345 | case RACE_ZOMBIE: |
5346 | 5346 | case RACE_SPECTRE: |
5347 | 5347 | case RACE_VAMPIRE: |
5348 | - if (saving_throw(10 + p_ptr->lev)) return; | |
5348 | + if (saving_throw(10 + creature_ptr->lev)) return; | |
5349 | 5349 | break; |
5350 | 5350 | } |
5351 | 5351 | } |
5352 | 5352 | else |
5353 | 5353 | { |
5354 | 5354 | /* 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) | |
5356 | 5356 | { |
5357 | - if (saving_throw(20 + p_ptr->lev)) return; | |
5357 | + if (saving_throw(20 + creature_ptr->lev)) return; | |
5358 | 5358 | } |
5359 | 5359 | /* 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) | |
5361 | 5361 | { |
5362 | - if (saving_throw(10 + p_ptr->lev)) return; | |
5362 | + if (saving_throw(10 + creature_ptr->lev)) return; | |
5363 | 5363 | } |
5364 | 5364 | } |
5365 | 5365 | } |
@@ -5368,25 +5368,25 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5368 | 5368 | msg_print(_("ネクロノミコンを読んで正気を失った!", "Your sanity is shaken by reading the Necronomicon!")); |
5369 | 5369 | } |
5370 | 5370 | |
5371 | - if (saving_throw(p_ptr->skill_sav - power)) | |
5371 | + if (saving_throw(creature_ptr->skill_sav - power)) | |
5372 | 5372 | { |
5373 | 5373 | return; |
5374 | 5374 | } |
5375 | 5375 | |
5376 | 5376 | 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)); | |
5379 | 5379 | |
5380 | 5380 | 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)); | |
5383 | 5383 | |
5384 | 5384 | switch (randint1(21)) |
5385 | 5385 | { |
5386 | 5386 | case 1: |
5387 | - if (!(p_ptr->muta3 & MUT3_MORONIC) && one_in_(5)) | |
5387 | + if (!(creature_ptr->muta3 & MUT3_MORONIC) && one_in_(5)) | |
5388 | 5388 | { |
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)) | |
5390 | 5390 | { |
5391 | 5391 | msg_print(_("あなたは完璧な馬鹿になったような気がした。しかしそれは元々だった。", "You current_world_ptr->game_turn into an utter moron!")); |
5392 | 5392 | } |
@@ -5395,47 +5395,47 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5395 | 5395 | msg_print(_("あなたは完璧な馬鹿になった!", "You current_world_ptr->game_turn into an utter moron!")); |
5396 | 5396 | } |
5397 | 5397 | |
5398 | - if (p_ptr->muta3 & MUT3_HYPER_INT) | |
5398 | + if (creature_ptr->muta3 & MUT3_HYPER_INT) | |
5399 | 5399 | { |
5400 | 5400 | msg_print(_("あなたの脳は生体コンピュータではなくなった。", "Your brain is no longer a living computer.")); |
5401 | - p_ptr->muta3 &= ~(MUT3_HYPER_INT); | |
5401 | + creature_ptr->muta3 &= ~(MUT3_HYPER_INT); | |
5402 | 5402 | } |
5403 | - p_ptr->muta3 |= MUT3_MORONIC; | |
5403 | + creature_ptr->muta3 |= MUT3_MORONIC; | |
5404 | 5404 | } |
5405 | 5405 | break; |
5406 | 5406 | case 2: |
5407 | 5407 | case 3: |
5408 | 5408 | case 4: |
5409 | - if (!(p_ptr->muta2 & MUT2_COWARDICE) && !p_ptr->resist_fear) | |
5409 | + if (!(creature_ptr->muta2 & MUT2_COWARDICE) && !creature_ptr->resist_fear) | |
5410 | 5410 | { |
5411 | 5411 | msg_print(_("あなたはパラノイアになった!", "You become paranoid!")); |
5412 | 5412 | |
5413 | 5413 | /* Duh, the following should never happen, but anyway... */ |
5414 | - if (p_ptr->muta3 & MUT3_FEARLESS) | |
5414 | + if (creature_ptr->muta3 & MUT3_FEARLESS) | |
5415 | 5415 | { |
5416 | 5416 | msg_print(_("あなたはもう恐れ知らずではなくなった。", "You are no longer fearless.")); |
5417 | - p_ptr->muta3 &= ~(MUT3_FEARLESS); | |
5417 | + creature_ptr->muta3 &= ~(MUT3_FEARLESS); | |
5418 | 5418 | } |
5419 | 5419 | |
5420 | - p_ptr->muta2 |= MUT2_COWARDICE; | |
5420 | + creature_ptr->muta2 |= MUT2_COWARDICE; | |
5421 | 5421 | } |
5422 | 5422 | break; |
5423 | 5423 | case 5: |
5424 | 5424 | case 6: |
5425 | 5425 | case 7: |
5426 | - if (!(p_ptr->muta2 & MUT2_HALLU) && !p_ptr->resist_chaos) | |
5426 | + if (!(creature_ptr->muta2 & MUT2_HALLU) && !creature_ptr->resist_chaos) | |
5427 | 5427 | { |
5428 | 5428 | msg_print(_("幻覚をひき起こす精神錯乱に陥った!", "You are afflicted by a hallucinatory insanity!")); |
5429 | - p_ptr->muta2 |= MUT2_HALLU; | |
5429 | + creature_ptr->muta2 |= MUT2_HALLU; | |
5430 | 5430 | } |
5431 | 5431 | break; |
5432 | 5432 | case 8: |
5433 | 5433 | case 9: |
5434 | 5434 | case 10: |
5435 | - if (!(p_ptr->muta2 & MUT2_BERS_RAGE)) | |
5435 | + if (!(creature_ptr->muta2 & MUT2_BERS_RAGE)) | |
5436 | 5436 | { |
5437 | 5437 | msg_print(_("激烈な感情の発作におそわれるようになった!", "You become subject to fits of berserk rage!")); |
5438 | - p_ptr->muta2 |= MUT2_BERS_RAGE; | |
5438 | + creature_ptr->muta2 |= MUT2_BERS_RAGE; | |
5439 | 5439 | } |
5440 | 5440 | break; |
5441 | 5441 | case 11: |
@@ -5445,17 +5445,17 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5445 | 5445 | case 15: |
5446 | 5446 | case 16: |
5447 | 5447 | /* Brain smash */ |
5448 | - if (!p_ptr->resist_conf) | |
5448 | + if (!creature_ptr->resist_conf) | |
5449 | 5449 | { |
5450 | - (void)set_confused(p_ptr, p_ptr->confused + randint0(4) + 4); | |
5450 | + (void)set_confused(creature_ptr, creature_ptr->confused + randint0(4) + 4); | |
5451 | 5451 | } |
5452 | - if (!p_ptr->free_act) | |
5452 | + if (!creature_ptr->free_act) | |
5453 | 5453 | { |
5454 | - (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4); | |
5454 | + (void)set_paralyzed(creature_ptr, creature_ptr->paralyzed + randint0(4) + 4); | |
5455 | 5455 | } |
5456 | - if (!p_ptr->resist_chaos) | |
5456 | + if (!creature_ptr->resist_chaos) | |
5457 | 5457 | { |
5458 | - (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150); | |
5458 | + (void)set_image(creature_ptr, creature_ptr->image + randint0(250) + 150); | |
5459 | 5459 | } |
5460 | 5460 | break; |
5461 | 5461 | case 17: |
@@ -5464,12 +5464,12 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5464 | 5464 | case 20: |
5465 | 5465 | case 21: |
5466 | 5466 | /* Amnesia */ |
5467 | - if (lose_all_info(p_ptr)) | |
5467 | + if (lose_all_info(creature_ptr)) | |
5468 | 5468 | msg_print(_("あまりの恐怖に全てのことを忘れてしまった!", "You forget everything in your utmost terror!")); |
5469 | 5469 | break; |
5470 | 5470 | } |
5471 | 5471 | |
5472 | - p_ptr->update |= PU_BONUS; | |
5472 | + creature_ptr->update |= PU_BONUS; | |
5473 | 5473 | handle_stuff(); |
5474 | 5474 | } |
5475 | 5475 |
@@ -745,7 +745,7 @@ extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost); | ||
745 | 745 | extern void free_turn(player_type *creature_ptr); |
746 | 746 | |
747 | 747 | 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); | |
749 | 749 | |
750 | 750 | extern void check_experience(player_type *creature_ptr); |
751 | 751 | extern void wreck_the_pattern(player_type *creature_ptr); |
@@ -4697,7 +4697,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI | ||
4697 | 4697 | { |
4698 | 4698 | msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind.")); |
4699 | 4699 | /* Have some nightmares */ |
4700 | - sanity_blast(NULL, FALSE); | |
4700 | + sanity_blast(p_ptr, NULL, FALSE); | |
4701 | 4701 | } |
4702 | 4702 | |
4703 | 4703 | set_paralyzed(p_ptr, p_ptr->paralyzed + dam); |
@@ -566,7 +566,7 @@ void hit_trap(bool break_trap) | ||
566 | 566 | msg_print(_("身の毛もよだつ光景が頭に浮かんだ。", "A horrible vision enters your mind.")); |
567 | 567 | |
568 | 568 | /* Have some nightmares */ |
569 | - sanity_blast(NULL, FALSE); | |
569 | + sanity_blast(p_ptr, NULL, FALSE); | |
570 | 570 | |
571 | 571 | } |
572 | 572 | (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(10) + 5); |
@@ -21,7 +21,7 @@ typedef struct { | ||
21 | 21 | u32b seed_flavor; /* Hack -- consistent object colors */ |
22 | 22 | u32b seed_town; /* Hack -- consistent town layout */ |
23 | 23 | |
24 | - bool is_loading_now; /*!< ロード処理中フラグ...ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */ | |
24 | + bool is_loading_now; /*!< ロード処理中フラグ...ロード直後にcalc_bonus()時の徳変化、及びsanity_blast(p_ptr, )による異常を抑止する */ | |
25 | 25 | |
26 | 26 | /* |
27 | 27 | * Savefile version |