Add customizable rolls to items

This commit is contained in:
mstein
2022-07-23 18:50:08 +02:00
parent 58ed9d7d74
commit b3e2771e91
24 changed files with 361 additions and 155 deletions
+4 -13
View File
@@ -28,7 +28,7 @@ export default class M5ModAggregate {
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.PA, operation: M5ModOperation.ADD_100, value: data.attributes.pa.bonus }, characterString)
this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.WK, operation: M5ModOperation.ADD_100, value: data.attributes.wk.bonus }, characterString)
this.push({ type: M5ModType.STAT, id: M5Stats.DEFENSE, operation: M5ModOperation.SET, value: calc.stats.defense.value }, characterString)
this.push({ type: M5ModType.STAT, id: M5Stats.DEFENSE, operation: M5ModOperation.SET, value: calc.stats.defenseBonus.value }, characterString)
this.push({ type: M5ModType.STAT, id: M5Stats.ATTACK, operation: M5ModOperation.SET, value: calc.stats.attackBonus.value }, characterString)
this.push({ type: M5ModType.STAT, id: M5Stats.DAMAGE, operation: M5ModOperation.SET, value: calc.stats.damageBonus.value }, characterString)
this.push({ type: M5ModType.STAT, id: M5Stats.MOVEMENT, operation: M5ModOperation.SET, value: calc.stats.movementBonus.value }, characterString)
@@ -59,19 +59,10 @@ export default class M5ModAggregate {
source: source
}
let key = mod.id
// if (mod.type === M5ModType.ATTRIBUTE) {
// key = M5Attributes[mod.id] as string
// console.log("M5ModType.ATTRIBUTE", mod.id, key)
// } else if (mod.type === M5ModType.STAT) {
// key = M5Stats[mod.id] as string
// console.log("M5ModType.STAT", mod.id, key)
// }
if (map.has(key))
map.get(key).push(pair)
if (map.has(mod.id))
map.get(mod.id).push(pair)
else
map.set(key, [pair])
map.set(mod.id, [pair])
}
}