OSDN Git Service

[Refactor] #1498 Defined is_stunned()
authorHourier <66951241+Hourier@users.noreply.github.com>
Fri, 17 Sep 2021 09:56:12 +0000 (18:56 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sat, 18 Sep 2021 13:10:04 +0000 (22:10 +0900)
src/timed-effect/player-stun.cpp
src/timed-effect/player-stun.h

index 49873ce..7e28b8b 100644 (file)
@@ -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;
index 27503a6..3bd01ed 100644 (file)
@@ -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);