API merge final
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
# Game import
|
||||
from serializable import Serializable
|
||||
|
||||
# Native imports
|
||||
from enum import Enum, IntEnum
|
||||
from enum import Enum
|
||||
|
||||
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 TurnAction(Enum):
|
||||
DAMAGE = 'deal_damage'
|
||||
STATS = 'modify_stat'
|
||||
BASIC = 'basic_action'
|
||||
|
||||
class BonusAction(IntEnum):
|
||||
EQUIP_ITEM = 0
|
||||
USE_CONSUMMABLE = 1
|
||||
class Turn(Serializable):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.actions = {}
|
||||
|
||||
def add_action(self, action_type:TurnAction, entity_id:str, description:str):
|
||||
self.actions[entity_id] = f'[{action_type.value}]: ' + description
|
||||
|
||||
def is_finished(self, nb_entities:int):
|
||||
return len(self.actions.keys()) == nb_entities
|
||||
Reference in New Issue
Block a user