You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fabula/enums.py

101 lines
2.1 KiB

from enum import Enum
class Affinity(Enum):
Absorb = "absorb"
Immune = "immune"
Resistant = "resistant"
Normal = "normal"
Vulnerable = "vulnerable"
class Element(Enum):
NonElemental = "non-elemental"
Physical = "physical"
Poison = "poison"
Fire = "fire"
Water = "water"
Lightning = "lightning"
Earth = "earth"
Wind = "wind"
Ice = "ice"
Light = "light"
Dark = "dark"
class CharacterType(Enum):
PlayerCharacter = "pc"
NonPlayerCharacter = "npc"
@property
def sp_name_abbr(self):
if self is CharacterType.PlayerCharacter:
return "FP"
elif self is CharacterType.NonPlayerCharacter:
return "UP"
else:
return "SP"
@property
def sp_name(self):
if self is CharacterType.PlayerCharacter:
return "Fabula Points"
elif self is CharacterType.NonPlayerCharacter:
return "Ultima Points"
else:
return "Special Points"
class Visibility(Enum):
ShowEvenIfKO = "show_even_if_ko"
ShowAll = "show"
MaskStats = "mask_stats"
MaskName = "mask_name"
Hide = "hide"
@property
def show_name(self):
return self not in (Visibility.MaskName, Visibility.Hide)
@property
def show_stats(self):
return self not in (Visibility.MaskStats, Visibility.MaskName, Visibility.Hide)
def show_in_party_list(self, down=False):
if down:
return self == Visibility.ShowEvenIfKO
else:
return self != Visibility.Hide
class Counter(Enum):
HP = "HP"
MP = "MP"
IP = "IP"
SP = "SP"
class MissType(Enum):
Missed = "missed"
Blocked = "blocked"
Avoided = "avoided"
Repelled = "repelled"
Resisted = "resisted"
class CombatSide(Enum):
Heroes = "heroes"
Villains = "villains"
@property
def opposite(self):
if self == CombatSide.Heroes:
return CombatSide.Villains
else:
return CombatSide.Heroes
class StatusChange(Enum):
Added = "added"
Removed = "removed"
Changed = "changed"