Item & Inventory
This commit is contained in:
21
entity.py
21
entity.py
@@ -1,7 +1,20 @@
|
||||
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):
|
||||
def __init__(self, name, strength, dexterity, intelligence, wisdom, charisma, hp, armor, speed, equipped_item=None):
|
||||
self.name =name
|
||||
self.strength = strength
|
||||
self.dexterity = dexterity
|
||||
@@ -10,4 +23,8 @@ class Entity(Serializable):
|
||||
self.charisma = charisma
|
||||
self.hp =hp
|
||||
self.armor = armor
|
||||
self.speed = speed
|
||||
self.speed = speed
|
||||
self.equipped_item = equipped_item
|
||||
|
||||
def make_a_turn(self, action:Action, bonus_action:BonusAction):
|
||||
pass
|
||||
Reference in New Issue
Block a user