mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-24 17:19:25 +00:00
26 lines
502 B
JavaScript
26 lines
502 B
JavaScript
export default class AttrItem {
|
|
constructor (ds) {
|
|
this.base = ds.base * 1 || 0
|
|
this.plus = ds.plus * 1 || 0
|
|
this.pct = ds.pct * 1 || 0
|
|
this.inc = ds.inc * 1 || 0
|
|
}
|
|
|
|
static create (ds) {
|
|
return new AttrItem(ds)
|
|
/*
|
|
return {
|
|
base: ds.base * 1 || 0,
|
|
plus: ds.plus * 1 || 0,
|
|
pct: ds.pct * 1 || 0,
|
|
inc: ds.inc * 1 || 0
|
|
} */
|
|
}
|
|
|
|
toString () {
|
|
return (this.base || 0) + (this.plus || 0) + ((this.base || 0) * (this.pct || 0) / 100)
|
|
}
|
|
}
|
|
|
|
|