rance/skill.py

16 lines
452 B
Python
Raw Permalink Normal View History

from dataclasses import dataclass
from enum import Enum
slot=Enum("Slot",["Buff","Attack","Special","Rest","Passive","Class"])
@dataclass
class Skill():
name:str
slot:slot
hooks:dict={}
def __getitem__(self,item):
return self.hooks.get(item)
attack=Skill('attack',slot.Attack,{'action':actions.attack})
shikigami=Skill('shikigami',slot.Attack,{'action':actions.allattack})
retaliate=Skill('retaliate',slot.Class,{'attacked':reactions.counter})