56 lines
1.0 KiB
Python
56 lines
1.0 KiB
Python
from attrs import define
|
|
from enum import Enum, auto
|
|
|
|
|
|
class Traits(Enum):
|
|
Charisma = auto()
|
|
Insight = auto()
|
|
Willpower = auto()
|
|
Crafting = auto()
|
|
Sense = auto()
|
|
Charm = auto()
|
|
|
|
|
|
@define(auto_attribs=True, kw_only=True, init=True)
|
|
class Character(object):
|
|
idx: int
|
|
name: str
|
|
gender: int
|
|
skin: int
|
|
face: int
|
|
hair: int
|
|
level: int
|
|
job: int
|
|
strn: int
|
|
dex: int
|
|
intl: int
|
|
luk: int
|
|
hp: int
|
|
max_hp: int
|
|
mp: int
|
|
max_mp: int
|
|
sp: int
|
|
ap: int
|
|
exp: int
|
|
fame: int
|
|
gach_exp: int
|
|
map_id: int
|
|
spawn: int
|
|
sub_job: int
|
|
fatigue: int
|
|
pvp_exp: int
|
|
pvp_rank: int
|
|
battle_points: int
|
|
traits_xp: dict[Traits, int] = {}
|
|
traits_daily_xp: dict[Traits, int] = {}
|
|
equips: list[tuple[int, int]] = []
|
|
cash_equips: list[tuple[int, int]] = []
|
|
weapon: int = 0
|
|
rank: int = 0
|
|
rank_move: int = 0
|
|
job_rank: int = 0
|
|
job_rank_move: int = 0
|
|
|
|
@classmethod
|
|
def fill(cls, values: dict):
|
|
return cls(**values) |