From: Hourier Date: Fri, 26 Jun 2020 13:28:35 +0000 (+0900) Subject: [Refactor] #40483 Changed macro functions to normal functions IS_FAST(), IS_INVULN... X-Git-Tag: vmacos3.0.0-alpha52~782^2~652 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=277f4711c110faabc9d1a595dd77c5f928576238;p=hengbandforosx%2Fhengbandosx.git [Refactor] #40483 Changed macro functions to normal functions IS_FAST(), IS_INVULN(), IS_HERO() and IS_ECHIZEN() --- diff --git a/src/cmd-io/cmd-dump.c b/src/cmd-io/cmd-dump.c index c03fd4954..8ba1bf562 100644 --- a/src/cmd-io/cmd-dump.c +++ b/src/cmd-io/cmd-dump.c @@ -10,7 +10,6 @@ */ #include "cmd-io/cmd-dump.h" -#include "art-definition/art-bow-types.h" #include "cmd-io/feeling-table.h" #include "core/asking-player.h" #include "dungeon/quest.h" @@ -235,7 +234,7 @@ void do_cmd_feeling(player_type *creature_ptr) if (creature_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[creature_ptr->feeling]); - else if (IS_ECHIZEN(creature_ptr)) + else if (is_echizen(creature_ptr)) msg_print(do_cmd_feeling_text_combat[creature_ptr->feeling]); else msg_print(do_cmd_feeling_text[creature_ptr->feeling]); diff --git a/src/cmd/cmd-basic.c b/src/cmd/cmd-basic.c index 5c86b2667..c6f92dede 100644 --- a/src/cmd/cmd-basic.c +++ b/src/cmd/cmd-basic.c @@ -10,7 +10,6 @@ */ #include "cmd/cmd-basic.h" -#include "art-definition/art-bow-types.h" #include "art-definition/art-weapon-types.h" #include "cmd-action/cmd-attack.h" #include "cmd-io/cmd-dump.h" @@ -239,7 +238,7 @@ void do_cmd_go_up(player_type *creature_ptr) if (!confirm_leave_level(creature_ptr, FALSE)) return; /* Success */ - if (IS_ECHIZEN(creature_ptr)) + if (is_echizen(creature_ptr)) msg_print(_("なんだこの階段は!", "What's this STAIRWAY!")); else msg_print(_("上の階に登った。", "You enter the up staircase.")); @@ -336,7 +335,7 @@ void do_cmd_go_up(player_type *creature_ptr) if (record_stair) exe_write_diary(creature_ptr, DIARY_STAIR, 0-up_num, _("階段を上った", "climbed up the stairs to")); /* Success */ - if (IS_ECHIZEN(creature_ptr)) + if (is_echizen(creature_ptr)) msg_print(_("なんだこの階段は!", "What's this STAIRWAY!")); else if (up_num == creature_ptr->current_floor_ptr->dun_level) msg_print(_("地上に戻った。", "You go back to the surface.")); @@ -385,7 +384,7 @@ void do_cmd_go_down(player_type *creature_ptr) /* Confirm Leaving */ if(!confirm_leave_level(creature_ptr, TRUE)) return; - if (IS_ECHIZEN(creature_ptr)) + if (is_echizen(creature_ptr)) msg_print(_("なんだこの階段は!", "What's this STAIRWAY!")); else msg_print(_("下の階に降りた。", "You enter the down staircase.")); @@ -483,7 +482,7 @@ void do_cmd_go_down(player_type *creature_ptr) } else { - if (IS_ECHIZEN(creature_ptr)) + if (is_echizen(creature_ptr)) msg_print(_("なんだこの階段は!", "What's this STAIRWAY!")); else msg_print(_("階段を下りて新たなる迷宮へと足を踏み入れた。", "You enter a maze of down staircases.")); diff --git a/src/core/hp-mp-processor.c b/src/core/hp-mp-processor.c index 6a4186073..7f2c8ab3f 100644 --- a/src/core/hp-mp-processor.c +++ b/src/core/hp-mp-processor.c @@ -15,7 +15,6 @@ #include "player/player-effects.h" #include "player/player-race-types.h" #include "player/player-race.h" -#include "realm/realm-song-numbers.h" #include "util/bit-flags-calculator.h" #include "view/display-messages.h" #include "world/world.h" @@ -31,11 +30,11 @@ void process_player_hp_mp(player_type *creature_ptr) bool cave_no_regen = FALSE; int upkeep_factor = 0; int regen_amount = PY_REGEN_NORMAL; - if (creature_ptr->poisoned && !IS_INVULN(creature_ptr)) { + if (creature_ptr->poisoned && !is_invuln(creature_ptr)) { take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison"), -1); } - if (creature_ptr->cut && !IS_INVULN(creature_ptr)) { + if (creature_ptr->cut && !is_invuln(creature_ptr)) { HIT_POINT dam; if (creature_ptr->cut > 1000) { dam = 200; @@ -57,7 +56,7 @@ void process_player_hp_mp(player_type *creature_ptr) } if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE)) { - if (!creature_ptr->current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN(creature_ptr) && is_daytime()) { + if (!creature_ptr->current_floor_ptr->dun_level && !creature_ptr->resist_lite && !is_invuln(creature_ptr) && is_daytime()) { if ((creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) { msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!")); take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1); @@ -77,12 +76,12 @@ void process_player_hp_mp(player_type *creature_ptr) object_desc(creature_ptr, o_name, o_ptr, OD_NAME_ONLY); sprintf(ouch, _("%sを装備したダメージ", "wielding %s"), o_name); - if (!IS_INVULN(creature_ptr)) + if (!is_invuln(creature_ptr)) take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, ouch, -1); } } - if (have_flag(f_ptr->flags, FF_LAVA) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_fire) { + if (have_flag(f_ptr->flags, FF_LAVA) && !is_invuln(creature_ptr) && !creature_ptr->immune_fire) { int damage = 0; if (have_flag(f_ptr->flags, FF_DEEP)) { @@ -119,7 +118,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_cold) { + if (have_flag(f_ptr->flags, FF_COLD_PUDDLE) && !is_invuln(creature_ptr) && !creature_ptr->immune_cold) { int damage = 0; if (have_flag(f_ptr->flags, FF_DEEP)) { @@ -154,7 +153,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_elec) { + if (have_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !is_invuln(creature_ptr) && !creature_ptr->immune_elec) { int damage = 0; if (have_flag(f_ptr->flags, FF_DEEP)) { @@ -189,7 +188,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !IS_INVULN(creature_ptr) && !creature_ptr->immune_acid) { + if (have_flag(f_ptr->flags, FF_ACID_PUDDLE) && !is_invuln(creature_ptr) && !creature_ptr->immune_acid) { int damage = 0; if (have_flag(f_ptr->flags, FF_DEEP)) { @@ -224,7 +223,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !IS_INVULN(creature_ptr)) { + if (have_flag(f_ptr->flags, FF_POISON_PUDDLE) && !is_invuln(creature_ptr)) { int damage = 0; if (have_flag(f_ptr->flags, FF_DEEP)) { @@ -315,7 +314,7 @@ void process_player_hp_mp(player_type *creature_ptr) * WILL BE! */ if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) { - if (!IS_INVULN(creature_ptr) && !creature_ptr->wraith_form && !creature_ptr->kabenuke + if (!is_invuln(creature_ptr) && !creature_ptr->wraith_form && !creature_ptr->kabenuke && ((creature_ptr->chp > (creature_ptr->lev / 5)) || !creature_ptr->pass_wall)) { concptr dam_desc; cave_no_regen = TRUE; diff --git a/src/dungeon/quest.c b/src/dungeon/quest.c index 82382c758..765dc8b49 100644 --- a/src/dungeon/quest.c +++ b/src/dungeon/quest.c @@ -1,5 +1,4 @@ #include "dungeon/quest.h" -#include "art-definition/art-bow-types.h" #include "cmd-io/cmd-dump.h" #include "core/asking-player.h" #include "dungeon/dungeon.h" @@ -539,7 +538,7 @@ void do_cmd_quest(player_type *player_ptr) msg_print(_("ここにはクエストへの入口があります。", "There is an entry of a quest.")); if (!get_check(_("クエストに入りますか?", "Do you enter? "))) return; - if (IS_ECHIZEN(player_ptr)) + if (is_echizen(player_ptr)) msg_print(_("『とにかく入ってみようぜぇ。』", "")); else if (player_ptr->pseikaku == PERSONALITY_CHARGEMAN) msg_print("『全滅してやるぞ!』"); diff --git a/src/floor/pattern-walk.c b/src/floor/pattern-walk.c index 750d9edaf..38ef3da3f 100644 --- a/src/floor/pattern-walk.c +++ b/src/floor/pattern-walk.c @@ -14,7 +14,6 @@ #include "player/player-move.h" #include "player/player-race-types.h" #include "player/player-race.h" -#include "realm/realm-song-numbers.h" #include "spell/spells-status.h" #include "spell-kind/spells-teleport.h" #include "view/display-messages.h" @@ -126,14 +125,14 @@ bool pattern_effect(player_type *creature_ptr) break; case PATTERN_TILE_WRECKED: - if (!IS_INVULN(creature_ptr)) + if (!is_invuln(creature_ptr)) take_hit(creature_ptr, DAMAGE_NOESCAPE, 200, _("壊れた「パターン」を歩いたダメージ", "walking the corrupted Pattern"), -1); break; default: if (is_specific_player_race(creature_ptr, RACE_AMBERITE) && !one_in_(2)) return TRUE; - else if (!IS_INVULN(creature_ptr)) + else if (!is_invuln(creature_ptr)) take_hit(creature_ptr, DAMAGE_NOESCAPE, damroll(1, 3), _("「パターン」を歩いたダメージ", "walking the Pattern"), -1); break; } diff --git a/src/grid/grid.c b/src/grid/grid.c index c6523c80d..9820c0a83 100644 --- a/src/grid/grid.c +++ b/src/grid/grid.c @@ -36,7 +36,6 @@ #include "player/player-class.h" #include "player/player-effects.h" #include "player/player-status.h" -#include "realm/realm-song-numbers.h" #include "room/rooms.h" #include "spell/process-effect.h" #include "spell/spell-types.h" @@ -476,7 +475,7 @@ void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, POSITION y if (!use_graphics) { if (current_world_ptr->timewalk_m_idx) a = TERM_DARK; - else if (IS_INVULN(subject_ptr) || subject_ptr->timewalk) a = TERM_WHITE; + else if (is_invuln(subject_ptr) || subject_ptr->timewalk) a = TERM_WHITE; else if (subject_ptr->wraith_form) a = TERM_L_DARK; } @@ -633,7 +632,7 @@ void lite_spot(player_type *player_ptr, POSITION y, POSITION x) if (!use_graphics) { if (current_world_ptr->timewalk_m_idx) a = TERM_DARK; - else if (IS_INVULN(player_ptr) || player_ptr->timewalk) a = TERM_WHITE; + else if (is_invuln(player_ptr) || player_ptr->timewalk) a = TERM_WHITE; else if (player_ptr->wraith_form) a = TERM_L_DARK; } @@ -1170,7 +1169,7 @@ bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION if (!player_ptr->levitation && !player_ptr->can_swim) return FALSE; } - if (have_flag(f_ptr->flags, FF_LAVA) && !player_ptr->immune_fire && !IS_INVULN(player_ptr)) + if (have_flag(f_ptr->flags, FF_LAVA) && !player_ptr->immune_fire && !is_invuln(player_ptr)) { /* Always forbid deep lava */ if (have_flag(f_ptr->flags, FF_DEEP)) return FALSE; diff --git a/src/grid/trap.c b/src/grid/trap.c index 49dcf603a..4a5008ddd 100644 --- a/src/grid/trap.c +++ b/src/grid/trap.c @@ -1,5 +1,4 @@ #include "grid/trap.h" -#include "art-definition/art-bow-types.h" #include "cmd-io/cmd-dump.h" #include "cmd-io/cmd-save.h" #include "dungeon/dungeon.h" @@ -440,7 +439,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap) else { msg_print(_("落とし戸に落ちた!", "You have fallen through a trap door!")); - if (IS_ECHIZEN(trapped_ptr)) + if (is_echizen(trapped_ptr)) msg_print(_("くっそ~!", "")); else if((trapped_ptr->pseikaku == PERSONALITY_CHARGEMAN)) msg_print(_("ジュラル星人の仕業に違いない!", "")); diff --git a/src/inventory/inventory-damage.c b/src/inventory/inventory-damage.c index 8d1b98fb9..1a98964c6 100644 --- a/src/inventory/inventory-damage.c +++ b/src/inventory/inventory-damage.c @@ -1,5 +1,4 @@ #include "inventory/inventory-damage.h" -#include "art-definition/art-bow-types.h" #include "floor/floor.h" #include "inventory/inventory-object.h" #include "mind/mind-mirror-master.h" @@ -67,7 +66,7 @@ void inventory_damage(player_type *player_ptr, inven_func typ, int perc) #endif #ifdef JP - if (IS_ECHIZEN(player_ptr)) + if (is_echizen(player_ptr)) msg_print("やりやがったな!"); else if ((player_ptr->pseikaku == PERSONALITY_CHARGEMAN)) { if (randint0(2) == 0) diff --git a/src/mind/mind.c b/src/mind/mind.c index 57d2c78e0..e141e6203 100644 --- a/src/mind/mind.c +++ b/src/mind/mind.c @@ -47,7 +47,6 @@ #include "player/player-effects.h" #include "player/player-move.h" #include "player/player-status.h" -#include "realm/realm-song-numbers.h" #include "spell/process-effect.h" #include "spell-kind/earthquake.h" #include "spell-kind/spells-detection.h" @@ -1161,7 +1160,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell) * Only heal when Adrenalin Channeling is not active. We check * that by checking if the player isn't fast and 'heroed' atm. */ - if (!IS_FAST(caster_ptr) || !IS_HERO(caster_ptr)) + if (!is_fast(caster_ptr) || !is_hero(caster_ptr)) { hp_player(caster_ptr, plev); } diff --git a/src/monster/monster-status.c b/src/monster/monster-status.c index b52dae146..a22b9e230 100644 --- a/src/monster/monster-status.c +++ b/src/monster/monster-status.c @@ -1,5 +1,4 @@ #include "monster/monster-status.h" -#include "art-definition/art-bow-types.h" #include "autopick/autopick-pref-processor.h" #include "cmd-io/cmd-dump.h" #include "cmd/cmd-draw.h" @@ -1349,7 +1348,7 @@ bool mon_take_hit(player_type *target_ptr, MONSTER_IDX m_idx, HIT_POINT dam, boo else if (!m_ptr->ml) { #ifdef JP - if (IS_ECHIZEN(target_ptr)) + if (is_echizen(target_ptr)) msg_format("せっかくだから%sを殺した。", m_name); else msg_format("%sを殺した。", m_name); @@ -1375,7 +1374,7 @@ bool mon_take_hit(player_type *target_ptr, MONSTER_IDX m_idx, HIT_POINT dam, boo else { #ifdef JP - if (IS_ECHIZEN(target_ptr)) + if (is_echizen(target_ptr)) msg_format("せっかくだから%sを倒した。", m_name); else msg_format("%sを倒した。", m_name); @@ -1389,7 +1388,7 @@ bool mon_take_hit(player_type *target_ptr, MONSTER_IDX m_idx, HIT_POINT dam, boo else { #ifdef JP - if (IS_ECHIZEN(target_ptr)) + if (is_echizen(target_ptr)) msg_format("せっかくだから%sを葬り去った。", m_name); else msg_format("%sを葬り去った。", m_name); diff --git a/src/mspell/mspell-floor.c b/src/mspell/mspell-floor.c index 1596cd74b..c1eeda562 100644 --- a/src/mspell/mspell-floor.c +++ b/src/mspell/mspell-floor.c @@ -5,7 +5,6 @@ */ #include "mspell/mspell-floor.h" -#include "art-definition/art-bow-types.h" #include "effect/effect-characteristics.h" #include "mind/drs-types.h" #include "monster-race/monster-race.h" @@ -210,7 +209,7 @@ void spell_RF6_TELE_AWAY(player_type *target_ptr, MONSTER_IDX m_idx, MONSTER_IDX _("%^sは%sをテレポートさせた。", "%^s teleports %s away."), TARGET_TYPE); if (TARGET_TYPE == MONSTER_TO_PLAYER) { - if (IS_ECHIZEN(target_ptr)) + if (is_echizen(target_ptr)) msg_print(_("くっそ~", "")); else if ((target_ptr->pseikaku == PERSONALITY_CHARGEMAN)) { if (randint0(2) == 0) diff --git a/src/mspell/mspell-status.c b/src/mspell/mspell-status.c index cb0b4e4cb..e24cac5cc 100644 --- a/src/mspell/mspell-status.c +++ b/src/mspell/mspell-status.c @@ -6,7 +6,6 @@ */ #include "mspell/mspell-status.h" -#include "art-definition/art-bow-types.h" #include "mind/drs-types.h" #include "monster-race/monster-race.h" #include "monster-race/race-flags1.h" @@ -113,7 +112,7 @@ void spell_RF4_DISPEL(MONSTER_IDX m_idx, player_type *target_ptr, MONSTER_IDX t_ if (target_ptr->riding) dispel_monster_status(target_ptr, target_ptr->riding); - if (IS_ECHIZEN(target_ptr)) + if (is_echizen(target_ptr)) msg_print(_("やりやがったな!", "")); else if ((target_ptr->pseikaku == PERSONALITY_CHARGEMAN)) { if (randint0(2) == 0) diff --git a/src/mspell/mspells1.c b/src/mspell/mspells1.c index e3b0f6d43..dc51d3220 100644 --- a/src/mspell/mspells1.c +++ b/src/mspell/mspells1.c @@ -871,7 +871,7 @@ static bool spell_dispel(byte spell) */ bool dispel_check(player_type *creature_ptr, MONSTER_IDX m_idx) { - if (IS_INVULN(creature_ptr)) + if (is_invuln(creature_ptr)) return TRUE; if (creature_ptr->wraith_form) @@ -954,7 +954,7 @@ bool dispel_check(player_type *creature_ptr, MONSTER_IDX m_idx) return TRUE; if (creature_ptr->pspeed < 145) { - if (IS_FAST(creature_ptr)) + if (is_fast(creature_ptr)) return TRUE; } @@ -1126,7 +1126,7 @@ static int choose_attack_spell(player_type *target_ptr, MONSTER_IDX m_idx, byte return (raise[randint0(raise_num)]); } - if (IS_INVULN(target_ptr)) { + if (is_invuln(target_ptr)) { if (psy_spe_num && (randint0(100) < 50)) { return (psy_spe[randint0(psy_spe_num)]); } else if (attack_num && (randint0(100) < 40)) { diff --git a/src/player/digestion-processor.c b/src/player/digestion-processor.c index 2b582943d..b9c5d06fa 100644 --- a/src/player/digestion-processor.c +++ b/src/player/digestion-processor.c @@ -4,7 +4,6 @@ #include "player/player-damage.h" #include "player/player-effects.h" #include "player/player-move.h" -#include "realm/realm-song-numbers.h" #include "view/display-messages.h" #include "world/world.h" @@ -51,7 +50,7 @@ void starve_player(player_type *creature_ptr) if (creature_ptr->food < PY_FOOD_STARVE) { HIT_POINT dam = (PY_FOOD_STARVE - creature_ptr->food) / 10; - if (!IS_INVULN(creature_ptr)) + if (!is_invuln(creature_ptr)) take_hit(creature_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"), -1); } } diff --git a/src/player/player-damage.c b/src/player/player-damage.c index a657289dd..184f7729e 100644 --- a/src/player/player-damage.c +++ b/src/player/player-damage.c @@ -43,7 +43,6 @@ #include "player/player-personalities-types.h" #include "player/player-race-types.h" #include "player/player-status.h" -#include "realm/realm-song-numbers.h" #include "term/screen-processor.h" #include "term/term-color-types.h" #include "util/bit-flags-calculator.h" @@ -348,7 +347,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp /* Mega-Hack -- Apply "invulnerability" */ if ((damage_type != DAMAGE_USELIFE) && (damage_type != DAMAGE_LOSELIFE)) { - if (IS_INVULN(creature_ptr) && (damage < 9000)) + if (is_invuln(creature_ptr) && (damage < 9000)) { if (damage_type == DAMAGE_FORCE) { diff --git a/src/player/player-effects.c b/src/player/player-effects.c index b732b53f6..d07dc8937 100644 --- a/src/player/player-effects.c +++ b/src/player/player-effects.c @@ -768,7 +768,7 @@ bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec) { if (creature_ptr->fast > v) return FALSE; } - else if (!IS_FAST(creature_ptr) && !creature_ptr->lightspeed) + else if (!is_fast(creature_ptr) && !creature_ptr->lightspeed) { msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!")); notice = TRUE; @@ -1091,7 +1091,7 @@ bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec) { if (creature_ptr->hero > v) return FALSE; } - else if (!IS_HERO(creature_ptr)) + else if (!is_hero(creature_ptr)) { msg_print(_("ヒーローになった気がする!", "You feel like a hero!")); notice = TRUE; @@ -1290,7 +1290,7 @@ bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec) { if (creature_ptr->invuln > v) return FALSE; } - else if (!IS_INVULN(creature_ptr)) + else if (!is_invuln(creature_ptr)) { msg_print(_("無敵だ!", "Invulnerability!")); notice = TRUE; diff --git a/src/player/player-move.c b/src/player/player-move.c index 9ccb86daa..6d890b460 100644 --- a/src/player/player-move.c +++ b/src/player/player-move.c @@ -1592,7 +1592,7 @@ static bool run_test(player_type *creature_ptr) } /* Lava */ - else if (have_flag(f_ptr->flags, FF_LAVA) && (creature_ptr->immune_fire || IS_INVULN(creature_ptr))) + else if (have_flag(f_ptr->flags, FF_LAVA) && (creature_ptr->immune_fire || is_invuln(creature_ptr))) { /* Ignore */ notice = FALSE; diff --git a/src/player/player-status.c b/src/player/player-status.c index a247fad86..fe31cd76b 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -1,4 +1,5 @@ #include "system/angband.h" +#include "art-definition/art-bow-types.h" #include "player/player-status.h" #include "art-definition/art-sword-types.h" #include "art-definition/art-weapon-types.h" @@ -2236,7 +2237,7 @@ void calc_bonuses(player_type *creature_ptr) creature_ptr->levitation = TRUE; } - if (IS_HERO(creature_ptr)) + if (is_hero(creature_ptr)) { creature_ptr->to_h[0] += 12; creature_ptr->to_h[1] += 12; @@ -2272,7 +2273,7 @@ void calc_bonuses(player_type *creature_ptr) creature_ptr->skill_dig += 30; } - if (IS_FAST(creature_ptr)) + if (is_fast(creature_ptr)) { creature_ptr->pspeed += 10; } @@ -2324,7 +2325,7 @@ void calc_bonuses(player_type *creature_ptr) creature_ptr->reflect = TRUE; } - if (IS_HERO(creature_ptr) || creature_ptr->shero) + if (is_hero(creature_ptr) || creature_ptr->shero) { creature_ptr->resist_fear = TRUE; } @@ -3275,7 +3276,7 @@ static void calc_hitpoints(player_type *creature_ptr) } if (mhp < creature_ptr->lev + 1) mhp = creature_ptr->lev + 1; - if (IS_HERO(creature_ptr)) mhp += 10; + if (is_hero(creature_ptr)) mhp += 10; if (creature_ptr->shero && (creature_ptr->pclass != CLASS_BERSERKER)) mhp += 30; if (creature_ptr->tsuyoshi) mhp += 50; if (hex_spelling(creature_ptr, HEX_XTRA_MIGHT)) mhp += 15; @@ -4188,7 +4189,7 @@ void wreck_the_pattern(player_type *creature_ptr) msg_print(_("パターンを血で汚してしまった!", "You bleed on the Pattern!")); msg_print(_("何か恐ろしい事が起こった!", "Something terrible happens!")); - if (!IS_INVULN(creature_ptr)) + if (!is_invuln(creature_ptr)) take_hit(creature_ptr, DAMAGE_NOESCAPE, damroll(10, 8), _("パターン損壊", "corrupting the Pattern"), -1); int to_ruin = randint1(45) + 35; @@ -4741,3 +4742,14 @@ bool music_singing(player_type *caster_ptr, int music_songs) { return (caster_ptr->pclass == CLASS_BARD) && (caster_ptr->magic_num1[0] == music_songs); } + +bool is_fast(player_type *creature_ptr) { return creature_ptr->fast || music_singing(creature_ptr, MUSIC_SPEED) || music_singing(creature_ptr, MUSIC_SHERO); } + +bool is_invuln(player_type *creature_ptr) { return creature_ptr->invuln || music_singing(creature_ptr, MUSIC_INVULN); } + +bool is_hero(player_type *creature_ptr) { return creature_ptr->hero || music_singing(creature_ptr, MUSIC_HERO) || music_singing(creature_ptr, MUSIC_SHERO); } + +bool is_echizen(player_type *creature_ptr) +{ + return (creature_ptr->pseikaku == PERSONALITY_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON); +} diff --git a/src/player/player-status.h b/src/player/player-status.h index 4ac1f3ccf..e319e31c5 100644 --- a/src/player/player-status.h +++ b/src/player/player-status.h @@ -796,14 +796,6 @@ extern long calc_score(player_type *creature_ptr); extern const s32b player_exp[PY_MAX_LEVEL]; extern const s32b player_exp_a[PY_MAX_LEVEL]; - -/* Temporary flags macro */ -#define IS_FAST(C) (C->fast || music_singing(C, MUSIC_SPEED) || music_singing(C, MUSIC_SHERO)) -#define IS_INVULN(C) (C->invuln || music_singing(C, MUSIC_INVULN)) -#define IS_HERO(C) (C->hero || music_singing(C, MUSIC_HERO) || music_singing(C, MUSIC_SHERO)) - -#define IS_ECHIZEN(C) (((C)->pseikaku == PERSONALITY_COMBAT) || ((C)->inventory_list[INVEN_BOW].name1 == ART_CRIMSON)) - extern bool is_blessed(player_type *creature_ptr); extern bool is_oppose_acid(player_type *creature_ptr); extern bool is_oppose_elec(player_type *creature_ptr); @@ -813,6 +805,10 @@ extern bool is_oppose_pois(player_type *creature_ptr); extern bool is_time_limit_esp(player_type *creature_ptr); extern bool is_time_limit_stealth(player_type *creature_ptr); extern bool can_two_hands_wielding(player_type *creature_ptr); +bool is_fast(player_type *creature_ptr); +bool is_invuln(player_type *creature_ptr); +bool is_hero(player_type *creature_ptr); +bool is_echizen(player_type *creature_ptr); /* * Player "food" crucial values diff --git a/src/player/selfinfo.c b/src/player/selfinfo.c index 7b0bee941..6d5dfa13b 100644 --- a/src/player/selfinfo.c +++ b/src/player/selfinfo.c @@ -1029,7 +1029,7 @@ void self_knowledge(player_type *creature_ptr) { info[i++] = _("あなたは高潔さを感じている。", "You feel rightous."); } - if (IS_HERO(creature_ptr)) + if (is_hero(creature_ptr)) { info[i++] = _("あなたはヒーロー気分だ。", "You feel heroic."); } @@ -1045,7 +1045,7 @@ void self_knowledge(player_type *creature_ptr) { info[i++] = _("あなたは神秘のシールドで守られている。", "You are protected by a mystic shield."); } - if (IS_INVULN(creature_ptr)) + if (is_invuln(creature_ptr)) { info[i++] = _("あなたは現在傷つかない。", "You are temporarily invulnerable."); } diff --git a/src/player/temporary-resistances.c b/src/player/temporary-resistances.c index 565009ea9..b7eba7e12 100644 --- a/src/player/temporary-resistances.c +++ b/src/player/temporary-resistances.c @@ -23,7 +23,7 @@ void tim_player_flags(player_type *creature_ptr, BIT_FLAGS *flags) for (int i = 0; i < TR_FLAG_SIZE; i++) flags[i] = 0L; - if (IS_HERO(creature_ptr) || creature_ptr->shero) + if (is_hero(creature_ptr) || creature_ptr->shero) add_flag(flags, TR_RES_FEAR); if (creature_ptr->tim_invis) add_flag(flags, TR_SEE_INVIS); @@ -31,7 +31,7 @@ void tim_player_flags(player_type *creature_ptr, BIT_FLAGS *flags) add_flag(flags, TR_REGEN); if (is_time_limit_esp(creature_ptr)) add_flag(flags, TR_TELEPATHY); - if (IS_FAST(creature_ptr) || creature_ptr->slow) + if (is_fast(creature_ptr) || creature_ptr->slow) add_flag(flags, TR_SPEED); if (is_oppose_acid(creature_ptr) && !(creature_ptr->special_defense & DEFENSE_ACID) && !(is_specific_player_race(creature_ptr, RACE_YEEK) && (creature_ptr->lev > 19))) diff --git a/src/spell-kind/spells-teleport.c b/src/spell-kind/spells-teleport.c index 25fce7326..cc3f130f9 100644 --- a/src/spell-kind/spells-teleport.c +++ b/src/spell-kind/spells-teleport.c @@ -6,7 +6,6 @@ */ #include "spell-kind/spells-teleport.h" -#include "art-definition/art-bow-types.h" #include "cmd-io/cmd-save.h" #include "core/asking-player.h" #include "core/speed-table.h" @@ -361,7 +360,7 @@ bool teleport_player_aux(player_type *creature_ptr, POSITION dis, bool is_quantu sound(SOUND_TELEPORT); #ifdef JP - if (IS_ECHIZEN(creature_ptr)) + if (is_echizen(creature_ptr)) msg_format("『こっちだぁ、%s』", creature_ptr->name); #endif (void)move_player_effect(creature_ptr, yy, xx, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP); diff --git a/src/view/display-main-window.c b/src/view/display-main-window.c index 73fd12c0e..9e350674f 100644 --- a/src/view/display-main-window.c +++ b/src/view/display-main-window.c @@ -55,7 +55,6 @@ #include "player/player-race-types.h" #include "player/player-status.h" #include "realm/realm-hex-numbers.h" -#include "realm/realm-song-numbers.h" #include "spell-realm/spells-hex.h" #include "spell/spells3.h" #include "system/system-variables.h" @@ -242,7 +241,7 @@ static void print_status(player_type *creature_ptr) if (creature_ptr->protevil) ADD_BAR_FLAG(BAR_PROTEVIL); - if (IS_INVULN(creature_ptr)) + if (is_invuln(creature_ptr)) ADD_BAR_FLAG(BAR_INVULN); if (creature_ptr->wraith_form) @@ -254,7 +253,7 @@ static void print_status(player_type *creature_ptr) if (creature_ptr->tim_reflect) ADD_BAR_FLAG(BAR_REFLECTION); - if (IS_HERO(creature_ptr)) + if (is_hero(creature_ptr)) ADD_BAR_FLAG(BAR_HEROISM); if (creature_ptr->shero) @@ -836,7 +835,7 @@ static void print_speed(player_type *player_ptr) i += 10; floor_type *floor_ptr = player_ptr->current_floor_ptr; - bool is_fast = IS_FAST(player_ptr); + bool is_player_fast = is_fast(player_ptr); char buf[32] = ""; TERM_COLOR attr = TERM_WHITE; if (i > 110) { @@ -848,9 +847,9 @@ static void print_speed(player_type *player_ptr) attr = TERM_VIOLET; else attr = TERM_GREEN; - } else if ((is_fast && !player_ptr->slow) || player_ptr->lightspeed) + } else if ((is_player_fast && !player_ptr->slow) || player_ptr->lightspeed) attr = TERM_YELLOW; - else if (player_ptr->slow && !is_fast) + else if (player_ptr->slow && !is_player_fast) attr = TERM_VIOLET; else attr = TERM_L_GREEN; @@ -864,9 +863,9 @@ static void print_speed(player_type *player_ptr) attr = TERM_VIOLET; else attr = TERM_RED; - } else if (is_fast && !player_ptr->slow) + } else if (is_player_fast && !player_ptr->slow) attr = TERM_YELLOW; - else if (player_ptr->slow && !is_fast) + else if (player_ptr->slow && !is_player_fast) attr = TERM_VIOLET; else attr = TERM_L_UMBER; @@ -1474,7 +1473,7 @@ static void display_dungeon(player_type *player_ptr) if (!use_graphics) { if (current_world_ptr->timewalk_m_idx) a = TERM_DARK; - else if (IS_INVULN(player_ptr) || player_ptr->timewalk) + else if (is_invuln(player_ptr) || player_ptr->timewalk) a = TERM_WHITE; else if (player_ptr->wraith_form) a = TERM_L_DARK; @@ -1966,7 +1965,7 @@ void print_map(player_type *player_ptr) if (!use_graphics) { if (current_world_ptr->timewalk_m_idx) a = TERM_DARK; - else if (IS_INVULN(player_ptr) || player_ptr->timewalk) + else if (is_invuln(player_ptr) || player_ptr->timewalk) a = TERM_WHITE; else if (player_ptr->wraith_form) a = TERM_L_DARK; @@ -2582,7 +2581,7 @@ void display_map(player_type *player_ptr, int *cy, int *cx) if (!use_graphics) { if (current_world_ptr->timewalk_m_idx) ta = TERM_DARK; - else if (IS_INVULN(player_ptr) || player_ptr->timewalk) + else if (is_invuln(player_ptr) || player_ptr->timewalk) ta = TERM_WHITE; else if (player_ptr->wraith_form) ta = TERM_L_DARK; @@ -2764,7 +2763,7 @@ void print_path(player_type *player_ptr, POSITION y, POSITION x) if (!use_graphics) { if (current_world_ptr->timewalk_m_idx) a = TERM_DARK; - else if (IS_INVULN(player_ptr) || player_ptr->timewalk) + else if (is_invuln(player_ptr) || player_ptr->timewalk) a = TERM_WHITE; else if (player_ptr->wraith_form) a = TERM_L_DARK; diff --git a/src/view/display-player-middle.c b/src/view/display-player-middle.c index 37b47469b..042a25fb3 100644 --- a/src/view/display-player-middle.c +++ b/src/view/display-player-middle.c @@ -9,7 +9,6 @@ #include "player/player-effects.h" #include "player/player-race-types.h" #include "player/player-skill.h" -#include "realm/realm-song-numbers.h" #include "sv-definition/sv-bow-types.h" #include "term/term-color-types.h" #include "view/display-util.h" @@ -170,7 +169,7 @@ static int calc_temporary_speed(player_type *creature_ptr) int tmp_speed = 0; if (!creature_ptr->riding) { - if (IS_FAST(creature_ptr)) tmp_speed += 10; + if (is_fast(creature_ptr)) tmp_speed += 10; if (creature_ptr->slow) tmp_speed -= 10; if (creature_ptr->lightspeed) tmp_speed = 99; }