Skip to content

Commit

Permalink
[Refactor] hengband#1498 Habu氏から頂いたコメントを反映させた
Browse files Browse the repository at this point in the history
  • Loading branch information
Hourier committed Sep 18, 2021
1 parent ad97a5c commit 0cfe580
Show file tree
Hide file tree
Showing 44 changed files with 146 additions and 57 deletions.
2 changes: 2 additions & 0 deletions src/action/action-limited.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"

/*!
Expand Down
2 changes: 2 additions & 0 deletions src/action/movement-execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
#include "system/object-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#ifdef JP
Expand Down
2 changes: 2 additions & 0 deletions src/action/racial-execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"

/*!
Expand Down
2 changes: 2 additions & 0 deletions src/blue-magic/blue-magic-checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "status/experience.h"
#include "system/angband.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"

/*!
Expand Down
4 changes: 3 additions & 1 deletion src/blue-magic/learnt-power-getter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "spell/spell-info.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/enum-converter.h"
#include "util/flag-group.h"
#include "util/int-char-converter.h"
Expand Down Expand Up @@ -275,7 +277,7 @@ static void calculate_blue_magic_success_probability(player_type *player_ptr, le
lm_ptr->chance = minfail;

auto player_stun = player_ptr->effects()->stun();
lm_ptr->chance += player_stun->decrease_chance();
lm_ptr->chance += player_stun->get_chance_penalty();
if (lm_ptr->chance > 95) {
lm_ptr->chance = 95;
}
Expand Down
2 changes: 2 additions & 0 deletions src/cmd-action/cmd-attack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#include "system/monster-type-definition.h"
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "wizard/wizard-messages.h"
Expand Down
6 changes: 4 additions & 2 deletions src/cmd-action/cmd-mane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
#include "target/target-setter.h"
#include "target/target-types.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/enum-converter.h"
#include "util/int-char-converter.h"
#include "view/display-messages.h"
Expand Down Expand Up @@ -213,7 +215,7 @@ static int get_mane_power(player_type *player_ptr, int *sn, bool baigaesi)
chance = minfail;

auto player_stun = player_ptr->effects()->stun();
chance += player_stun->decrease_chance();
chance += player_stun->get_chance_penalty();
if (chance > 95) {
chance = 95;
}
Expand Down Expand Up @@ -1113,7 +1115,7 @@ bool do_cmd_mane(player_type *player_ptr, bool baigaesi)
chance = minfail;

auto player_stun = player_ptr->effects()->stun();
chance += player_stun->decrease_chance();
chance += player_stun->get_chance_penalty();
if (chance > 95) {
chance = 95;
}
Expand Down
4 changes: 3 additions & 1 deletion src/cmd-action/cmd-mind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
#include "system/grid-type-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/buffer-shaper.h"
#include "util/enum-converter.h"
#include "view/display-messages.h"
Expand Down Expand Up @@ -176,7 +178,7 @@ static void decide_mind_chance(player_type *player_ptr, cm_type *cm_ptr)
cm_ptr->chance = cm_ptr->minfail;

auto player_stun = player_ptr->effects()->stun();
cm_ptr->chance += player_stun->decrease_chance();
cm_ptr->chance += player_stun->get_chance_penalty();

if (cm_ptr->use_mind != mind_kind_type::KI)
return;
Expand Down
2 changes: 2 additions & 0 deletions src/cmd-action/cmd-move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "system/grid-type-definition.h"
#include "system/player-type-definition.h"
#include "target/target-getter.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"

Expand Down
2 changes: 2 additions & 0 deletions src/cmd-action/cmd-shoot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"

/*!
Expand Down
2 changes: 2 additions & 0 deletions src/cmd-building/cmd-inn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "status/bad-status-setter.h"
#include "store/rumor.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"
#include "world/world.h"

Expand Down
6 changes: 4 additions & 2 deletions src/cmd-item/cmd-magiceat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
#include "target/target-getter.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/buffer-shaper.h"
#include "util/int-char-converter.h"
#include "view/display-messages.h"
Expand Down Expand Up @@ -279,7 +281,7 @@ static OBJECT_SUBTYPE_VALUE select_magic_eater(player_type *player_ptr, bool onl
chance = mod_spell_chance_1(player_ptr, chance);
chance = MAX(chance, adj_mag_fail[player_ptr->stat_index[mp_ptr->spell_stat]]);
auto player_stun = player_ptr->effects()->stun();
chance += player_stun->decrease_chance();
chance += player_stun->get_chance_penalty();
if (chance > 95) {
chance = 95;
}
Expand Down Expand Up @@ -530,7 +532,7 @@ bool do_cmd_magic_eater(player_type *player_ptr, bool only_browse, bool powerful
chance = mod_spell_chance_1(player_ptr, chance);
chance = MAX(chance, adj_mag_fail[player_ptr->stat_index[mp_ptr->spell_stat]]);
auto player_stun = player_ptr->effects()->stun();
chance += player_stun->decrease_chance();
chance += player_stun->get_chance_penalty();
if (chance > 95) {
chance = 95;
}
Expand Down
2 changes: 2 additions & 0 deletions src/core/magic-effects-timeout-reducer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "status/sight-setter.h"
#include "status/temporary-resistance.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"

/*!
* @brief 10ゲームターンが進行するごとに魔法効果の残りターンを減らしていく処理
Expand Down
4 changes: 3 additions & 1 deletion src/core/player-processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#include "system/monster-race-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "window/display-sub-windows.h"
Expand Down Expand Up @@ -270,7 +272,7 @@ void process_player(player_type *player_ptr)
PlayerEnergy energy(player_ptr);
energy.reset_player_turn();
auto effects = player_ptr->effects();
auto is_unconscious = effects->stun()->get_rank() == StunRank::UNCONSCIOUS;
auto is_unconscious = effects->stun()->get_rank() == PlayerStunRank::UNCONSCIOUS;
if (player_ptr->phase_out) {
move_cursor_relative(player_ptr->y, player_ptr->x);
command_cmd = SPECIAL_KEY_BUILDING;
Expand Down
2 changes: 2 additions & 0 deletions src/effect/effect-monster-charm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "system/monster-race-definition.h"
#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"

Expand Down
2 changes: 2 additions & 0 deletions src/effect/effect-monster-psi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "system/monster-race-definition.h"
#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "world/world.h"
Expand Down
2 changes: 2 additions & 0 deletions src/effect/effect-player-resist-hurt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "status/shape-changer.h"
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"
#include "world/world.h"

Expand Down
2 changes: 2 additions & 0 deletions src/floor/pattern-walk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "world/world-movement-processor.h"
Expand Down
2 changes: 2 additions & 0 deletions src/load/player-info-loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "spell-realm/spells-song.h"
#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "world/world.h"

/*!
Expand Down
4 changes: 3 additions & 1 deletion src/mind/mind-blue-mage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "status/base-status.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"

/*!
Expand Down Expand Up @@ -71,7 +73,7 @@ bool do_cmd_cast_learned(player_type *player_ptr)
chance = minfail;

auto player_stun = player_ptr->effects()->stun();
chance += player_stun->decrease_chance();
chance += player_stun->get_chance_penalty();
if (chance > 95) {
chance = 95;
}
Expand Down
4 changes: 3 additions & 1 deletion src/mind/mind-elementalist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#include "target/target-getter.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/buffer-shaper.h"
#include "util/enum-converter.h"
Expand Down Expand Up @@ -634,7 +636,7 @@ static PERCENTAGE decide_element_chance(player_type *player_ptr, mind_type spell
chance = minfail;

auto player_stun = player_ptr->effects()->stun();
chance += player_stun->decrease_chance();
chance += player_stun->get_chance_penalty();
if (heavy_armor(player_ptr))
chance += 5;

Expand Down
2 changes: 2 additions & 0 deletions src/mind/mind-ninja.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
#include "target/projection-path-calculator.h"
#include "target/target-checker.h"
#include "target/target-getter.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"

Expand Down
4 changes: 3 additions & 1 deletion src/mind/mind-power-getter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "player/player-status-table.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/enum-converter.h"
#include "util/int-char-converter.h"

Expand Down Expand Up @@ -301,7 +303,7 @@ void MindPowerGetter::calculate_mind_chance(bool *has_weapon)
}

auto player_stun = this->player_ptr->effects()->stun();
this->chance += player_stun->decrease_chance();
this->chance += player_stun->get_chance_penalty();
add_ki_chance();
if (this->chance > 95) {
this->chance = 95;
Expand Down
2 changes: 2 additions & 0 deletions src/mind/mind-samurai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/int-char-converter.h"
#include "view/display-messages.h"
Expand Down
2 changes: 2 additions & 0 deletions src/mind/monk-attack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
#include "target/target-getter.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/string-processor.h"
#include "view/display-messages.h"
#include "world/world.h"
Expand Down
2 changes: 2 additions & 0 deletions src/monster-attack/monster-attack-player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
#include "system/monster-type-definition.h"
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"

Expand Down
2 changes: 2 additions & 0 deletions src/monster-attack/monster-attack-status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include "system/monster-race-definition.h"
#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"

void process_blind_attack(player_type *player_ptr, monap_type *monap_ptr)
Expand Down
2 changes: 2 additions & 0 deletions src/object-use/quaff-execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"

/*!
Expand Down
2 changes: 2 additions & 0 deletions src/player-info/self-info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "player/player-status.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-self-info.h"

static void set_bad_status_info(player_type *player_ptr, self_info_type *self_ptr)
Expand Down

0 comments on commit 0cfe580

Please sign in to comment.