From e73771d01903378d81c7d251cc8bd9a4120c88a5 Mon Sep 17 00:00:00 2001 From: deskull Date: Sun, 6 Sep 2020 11:20:42 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#40514=20is=5Fvuln=5Ffire()?= =?utf8?q?=E3=82=92=E5=AE=9F=E8=A3=85=EF=BC=8E=20/=20Implement=20is=5Fvuln?= =?utf8?q?=5Ffire().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/player/player-status-flags.c | 17 +++++++++++++++++ src/player/player-status-flags.h | 1 + 2 files changed, 18 insertions(+) diff --git a/src/player/player-status-flags.c b/src/player/player-status-flags.c index b66cde74f..0003bb813 100644 --- a/src/player/player-status-flags.c +++ b/src/player/player-status-flags.c @@ -1004,6 +1004,23 @@ BIT_FLAGS is_resist_fire(player_type *creature_ptr) return result; } +BIT_FLAGS is_vuln_fire(player_type *creature_ptr) +{ + BIT_FLAGS result = 0L; + if (creature_ptr->muta3 & MUT3_VULN_ELEM) { + result |= FLAG_CAUSE_MUTATION; + } + + if (is_specific_player_race(creature_ptr, RACE_ENT)) { + result |= FLAG_CAUSE_RACE; + } + + if (creature_ptr->special_defense & KATA_KOUKIJIN) { + result |= FLAG_CAUSE_BATTLE_FORM; + } + return result; +} + BIT_FLAGS is_resist_cold(player_type *creature_ptr) { BIT_FLAGS result = 0L; diff --git a/src/player/player-status-flags.h b/src/player/player-status-flags.h index b2ff73c16..6d94dbcc6 100644 --- a/src/player/player-status-flags.h +++ b/src/player/player-status-flags.h @@ -75,6 +75,7 @@ BIT_FLAGS is_vuln_acid(player_type *creature_ptr); BIT_FLAGS is_resist_elec(player_type *creature_ptr); BIT_FLAGS is_vuln_elec(player_type *creature_ptr); BIT_FLAGS is_resist_fire(player_type *creature_ptr); +BIT_FLAGS is_vuln_fire(player_type *creature_ptr); BIT_FLAGS is_resist_cold(player_type *creature_ptr); BIT_FLAGS is_resist_pois(player_type *creature_ptr); BIT_FLAGS is_resist_conf(player_type *creature_ptr); -- 2.11.0