30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
from serializable import Serializable
|
|
from enum import Enum, IntEnum
|
|
|
|
class Action(Enum):
|
|
ATTACK = 'strength' # Physical Battle action
|
|
FORCE = 'strength' # Actions that requires physical effort
|
|
SPELL = 'intelligence' # Many kind of spell (battle or not)
|
|
SCAN = 'wisdom' # Danger in environment or NPC's lies
|
|
SPEECH = 'charisma' # To persuade or deceive
|
|
AGILE = 'dexterity' # Avoid traps or incoming attacks & spell
|
|
|
|
class BonusAction(IntEnum):
|
|
EQUIP_ITEM = 0
|
|
USE_CONSUMMABLE = 1
|
|
|
|
class Entity(Serializable):
|
|
def __init__(self, name, strength, dexterity, intelligence, wisdom, charisma, hp, armor, speed, equipped_item=None):
|
|
self.name =name
|
|
self.strength = strength
|
|
self.dexterity = dexterity
|
|
self.intelligence = intelligence
|
|
self.wisdom = wisdom
|
|
self.charisma = charisma
|
|
self.hp =hp
|
|
self.armor = armor
|
|
self.speed = speed
|
|
self.equipped_item = equipped_item
|
|
|
|
def make_a_turn(self, action:Action, bonus_action:BonusAction):
|
|
pass |