From: Hourier <66951241+Hourier@users.noreply.github.com> Date: Fri, 17 Sep 2021 09:56:12 +0000 (+0900) Subject: [Refactor] #1498 Defined is_stunned() X-Git-Tag: vmacos3.0.0-alpha52~97^2^2~9 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=44081f316b6b26129ba45e6ece3aff1b74312c77;p=hengbandforosx%2Fhengbandosx.git [Refactor] #1498 Defined is_stunned() --- diff --git a/src/timed-effect/player-stun.cpp b/src/timed-effect/player-stun.cpp index 49873ce59..7e28b8bbc 100644 --- a/src/timed-effect/player-stun.cpp +++ b/src/timed-effect/player-stun.cpp @@ -67,6 +67,11 @@ int PlayerStun::decrease_chance() const } } +bool PlayerStun::is_stunned() const +{ + return this->get_rank() > StunRank::NONE; +} + void PlayerStun::set(short value) { this->stun = value; diff --git a/src/timed-effect/player-stun.h b/src/timed-effect/player-stun.h index 27503a673..3bd01ed65 100644 --- a/src/timed-effect/player-stun.h +++ b/src/timed-effect/player-stun.h @@ -19,6 +19,7 @@ public: StunRank get_rank(short value) const; std::string_view get_stun_mes(StunRank stun_rank) const; int decrease_chance() const; + bool is_stunned() const; void reset(); void set(short value);