Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@serializable(list(object(Item)))
@observable
items: Item[] = [];
@serializable @observable hunger: number = 0;
@serializable @observable classInfoStatsScale = 1;
@serializable @observable buffSourceName: string;
@serializable(object(TurnStats))
@observable
buff: TurnStats;
@serializable(map(object(TurnStats)))
@observable
dots = new Map();
@serializable(object(Stats))
@observable mutableStats = new Stats();
@serializable(map(primitive()))
@observable
private skillLevels = new Map();
@serializable(map(primitive()))
@observable
private skillSelections = new Map();
get skills () {
return this.classInfo.skills.map((info) => new Skill(this.skillLevels, this.skillSelections, info));
function map(s) {
return serializr_1.map(object(s));
}
exports.types = { object: object, list: list, map: map };
@serializable(StatItem.serializr())
public speed = StatItem.declare('Spd', 'Speed');
@serializable(StatItem.serializr())
public accuracy = StatItem.declare('Acc', 'Accuracy');
@serializable(StatItem.serializr())
public criticalChance = StatItem.declare('Crt', 'Critical Hit Chance', true);
@serializable(StatItem.serializr())
public damage = StatItem.declare(' Dmg', ' Damage');
@serializable(map(StatItem.serializr()))
public resistances = declareStatuses(' Res', ' Resistance');
@serializable(map(StatItem.serializr()))
public statuses = declareStatuses('', ' Chance');
@serializable(map(StatItem.serializr()))
public statusDamageScales = declareStatuses(' Dmg', ' Damage Modifier');
get battle () {
return [this.dodge, this.protect, this.speed, this.accuracy, this.criticalChance, this.damage];
}
get base () {
return [this.maxHealth, this.maxStress, ...this.battle];
}
get all () {
return [
this.health, this.stress,
@serializable @observable classInfoStatsScale = 1;
@serializable @observable buffSourceName: string;
@serializable(object(TurnStats))
@observable
buff: TurnStats;
@serializable(map(object(TurnStats)))
@observable
dots = new Map();
@serializable(object(Stats))
@observable mutableStats = new Stats();
@serializable(map(primitive()))
@observable
private skillLevels = new Map();
@serializable(map(primitive()))
@observable
private skillSelections = new Map();
get skills () {
return this.classInfo.skills.map((info) => new Skill(this.skillLevels, this.skillSelections, info));
}
get selectedSkills () {
return this.skills.filter((skill) => skill.isSelected);
}
@computed get scaledClassInfo () {
function map(s: any) {
return _map(object(s))
}