You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.9 KiB
83 lines
1.9 KiB
import { extra_entry_num } from './constant'; |
|
|
|
export class Entry { |
|
type: string; |
|
value: number; |
|
showVal: string; |
|
percent: number; |
|
max: number; |
|
min: number; |
|
|
|
constructor(type: string, value: number, showVal: string, max: number, min: number) { |
|
this.type = type; |
|
this.value = value; |
|
this.showVal = showVal; |
|
this.max = max; |
|
this.min = min; |
|
this.percent = value == max ? 100 : Math.round(((value - min) / (max - min)) * 100); |
|
} |
|
} |
|
|
|
export class Quality { |
|
quality: string; |
|
qualityCoefficient: number; |
|
extraEntryNum: number; |
|
extraQuality: string; |
|
constructor(quality: string, coefficient: number, extraQuality: string) { |
|
this.quality = quality; |
|
this.qualityCoefficient = coefficient; |
|
this.extraEntryNum = extra_entry_num[quality]; |
|
this.extraQuality = extraQuality; |
|
} |
|
} |
|
|
|
export class EquipBase { |
|
name: string; |
|
icon: string; |
|
entry: Entry[]; |
|
skill?: string; |
|
constructor(name: string, icon: string, entry: Entry[], skill?: string) { |
|
this.name = name; |
|
this.icon = icon; |
|
this.entry = entry; |
|
this.skill = skill; |
|
} |
|
} |
|
|
|
export class Equip { |
|
id?: string; |
|
type: string; |
|
lv: number; |
|
locked: boolean = false; |
|
strengthenLv: number = 0; |
|
quality: Quality; |
|
base: EquipBase; |
|
extraEntry: Entry[]; |
|
reRoll?: number; |
|
fusion:number = 0; |
|
fusionEntry?:Entry; |
|
constructor(type: string, lv, quality: Quality, base: EquipBase, extraEntry: Entry[]) { |
|
this.type = type; |
|
this.lv = lv; |
|
this.quality = quality; |
|
this.base = base; |
|
this.extraEntry = extraEntry; |
|
} |
|
} |
|
|
|
export abstract class Categorys { |
|
abstract type: string; |
|
name: string; |
|
icon: string; |
|
entry: any[]; |
|
skill?: string; |
|
reRoll: number; |
|
|
|
constructor(name: string, icon: string, entry: any[], skill?: string, reRoll?: number) { |
|
this.name = name; |
|
this.icon = icon; |
|
this.entry = entry; |
|
this.skill = skill; |
|
this.reRoll = reRoll || 0; |
|
} |
|
}
|
|
|