Compare commits
No commits in common. "Features/WebApp" and "main" have entirely different histories.
Features/W
...
main
|
@ -1,15 +0,0 @@
|
||||||
from enum import Enum
|
|
||||||
from Item import Item
|
|
||||||
class ArmorLocation(Enum):
|
|
||||||
head = 0,
|
|
||||||
left_arm = 1
|
|
||||||
torso = 2
|
|
||||||
right_arm = 3
|
|
||||||
left_leg = 4
|
|
||||||
right_leg = 5
|
|
||||||
class Armor(Item):
|
|
||||||
def __init__(self, name:str, description:str, location : ArmorLocation):
|
|
||||||
self.BodyPart = location
|
|
||||||
Item.__init__(name, description)
|
|
||||||
|
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
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:
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
import Die
|
|
||||||
class DicePool:
|
|
||||||
def __init__(self):
|
|
||||||
self.pool = list[Die]()
|
|
||||||
def add_to_pool(self, die : Die):
|
|
||||||
self.pool.append(die)
|
|
||||||
def remove_from_pool(self, die : Die):
|
|
||||||
self.pool.remove(die)
|
|
||||||
def clear_pool(self):
|
|
||||||
self.pool.clear()
|
|
||||||
def roll(self) -> int:
|
|
||||||
result:int = 0
|
|
||||||
for die in self.Pool:
|
|
||||||
result = result + die.roll()
|
|
||||||
return result
|
|
|
@ -1,6 +0,0 @@
|
||||||
from random import randint
|
|
||||||
class Die:
|
|
||||||
def __init__(self, diemax: int):
|
|
||||||
self.Max = diemax
|
|
||||||
def roll(self):
|
|
||||||
return randint(1, self.Max)
|
|
|
@ -1,4 +0,0 @@
|
||||||
class Item:
|
|
||||||
def __init__(self, name: str, description: str):
|
|
||||||
self.Name = name
|
|
||||||
self.description = description
|
|
|
@ -1,47 +0,0 @@
|
||||||
import DicePool
|
|
||||||
from Die import Die
|
|
||||||
from enum import Enum
|
|
||||||
from DicePool import DicePool
|
|
||||||
class Skill:
|
|
||||||
class ProficiencyLevel(Enum):
|
|
||||||
novice = 0
|
|
||||||
studied = 1
|
|
||||||
proficient = 2
|
|
||||||
advanced = 3
|
|
||||||
expert = 4
|
|
||||||
legendary = 5
|
|
||||||
def __init__(self, name):
|
|
||||||
self.Proficiency = self.ProficiencyLevel.novice
|
|
||||||
self.SubSkills = list[Skill]()
|
|
||||||
self.Name = name
|
|
||||||
self.SkillDice = Die(4)
|
|
||||||
self.ProficiencyPool = list[Die]()
|
|
||||||
self.ProficiencyPool.append(Die(1))
|
|
||||||
def use(self, pool : DicePool):
|
|
||||||
pool.add_to_pool(self.SkillDice)
|
|
||||||
def upgrade_skill(self):
|
|
||||||
num_pass = 0
|
|
||||||
if len(self.ProficiencyPool)>0:
|
|
||||||
for die in self.ProficiencyPool:
|
|
||||||
if die.roll() < die.Max:
|
|
||||||
return
|
|
||||||
if self.Proficiency == self.ProficiencyLevel.novice:
|
|
||||||
# Because novice is the only D1 available, clear dice pool
|
|
||||||
# before adding to pool
|
|
||||||
self.Proficiency = self.ProficiencyLevel.studied
|
|
||||||
self.ProficiencyPool.clear()
|
|
||||||
self.ProficiencyPool.append(Die(20))
|
|
||||||
elif self.Proficiency == self.ProficiencyLevel.studied:
|
|
||||||
self.Proficiency = self.ProficiencyLevel.proficient
|
|
||||||
self.ProficiencyPool.append(Die(20))
|
|
||||||
elif self.Proficiency == self.ProficiencyLevel.proficient:
|
|
||||||
self.Proficiency = self.ProficiencyLevel.advanced
|
|
||||||
self.ProficiencyPool.append(Die(20))
|
|
||||||
elif self.Proficiency == self.ProficiencyLevel.advanced:
|
|
||||||
self.Proficiency = self.ProficiencyLevel.expert
|
|
||||||
self.ProficiencyPool.append(Die(20))
|
|
||||||
elif self.Proficiency == self.ProficiencyLevel.expert:
|
|
||||||
self.Proficiency = self.ProficiencyLevel.legendary
|
|
||||||
self.ProficiencyPool.clear()
|
|
||||||
for skill in self.SubSkills:
|
|
||||||
skill.upgrade_skill()
|
|
Loading…
Reference in a new issue