Skip to content

Commit

Permalink
created has_mood and is_threatened
Browse files Browse the repository at this point in the history
  • Loading branch information
KiloOscarSix committed May 2, 2023
1 parent dbd23b3 commit 17df284
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CharacterService_ren.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def set_relationship(
def get_mood(character: NonPlayableCharacter) -> Moods:
return character.mood

@staticmethod
def has_mood(character: NonPlayableCharacter, mood: Moods) -> bool:
return mood == character.mood or character.mood & mood == mood

@staticmethod
def set_mood(character: NonPlayableCharacter, mood: Moods) -> None:
if mood == character.mood:
Expand Down Expand Up @@ -164,4 +168,8 @@ def is_ex(

@staticmethod
def is_mad(character: NonPlayableCharacter) -> bool:
return Moods.MAD in character.mood
return CharacterService.has_mood(character, Moods.MAD)

@staticmethod
def is_threatened(character: NonPlayableCharacter) -> bool:
return CharacterService.has_mood(character, Moods.THREATENED)

0 comments on commit 17df284

Please sign in to comment.