YATTRS/WebApp/Character.py
2025-04-19 20:54:54 -04:00

52 lines
1.4 KiB
Python

from Skill import Skill
from Item import Item
from DicePool import DicePool
class Character:
def __init__(self, max_hp: int):
self.Body = Skill("Body")
self.Mental = Skill("Mental")
self.Profound = Skill("Profound")
self.Aura = Skill("Aura")
self.Setting = Skill("Setting")
self.NaturalVisualDescription = ""
self.WithBelongsVisualDescription = ""
self.Personality = ""
self.Ideals = ""
self.Bonds = ""
self.Flaws = ""
self.Inventory = list[Item]()
self.Backstory = ""
self.Armor = ""
self.LegalTender = 0
self.MaxHp = 0
self.CurrentHp = 0
def spend_money(self, amount_to_spend : int ) -> bool:
if amount_to_spend <= 0:
return False
elif self.LegalTender >= amount_to_spend:
self.LegalTender -= amount_to_spend
return True
else:
return False
def earn_money(self, amount_earned: int) -> bool:
if amount_earned <= 0:
return False
else:
self.LegalTender += amount_earned
return True
def action(self, primary_skill: Skill, secondary_skill: Skill = None) ->:
action_pool = DicePool()
primary_skill.use(action_pool)
if seondary_skill is not None:
secondary_skill.use(action_pool)
action_pool.roll()
action_pool.clear()
except: