|
|
|
@@ -230,40 +230,44 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor |
|
|
|
|
|
|
|
const tickedEntryList: LogEntry[] = [] |
|
|
|
|
|
|
|
const victimList = victims ?? this.contents |
|
|
|
victimList.forEach(prey => { |
|
|
|
const scaled = this.damage.calc(this.owner, prey).scale(dt / 60) |
|
|
|
const modified = this.owner.effects.reduce((damage, effect) => effect.modDigestionDamage(this.owner, prey, this, damage), scaled) |
|
|
|
tickedEntryList.push(this.tickLine(this.owner, prey, { damage: modified })) |
|
|
|
|
|
|
|
damageResults.push(prey.takeDamage(modified)) |
|
|
|
|
|
|
|
if (prey.vigors[Vigor.Health] <= 0) { |
|
|
|
prey.destroyed = true |
|
|
|
this.digested.push(prey) |
|
|
|
justDigested.push(prey) |
|
|
|
damageResults.push(this.onDigest(prey)) |
|
|
|
this.contents.forEach(prey => { |
|
|
|
if (victims === undefined || victims.indexOf(prey) >= 0) { |
|
|
|
const scaled = this.damage.calc(this.owner, prey).scale(dt / 60) |
|
|
|
const modified = this.owner.effects.reduce((damage, effect) => effect.modDigestionDamage(this.owner, prey, this, damage), scaled) |
|
|
|
if (modified.nonzero()) { |
|
|
|
tickedEntryList.push(this.tickLine(this.owner, prey, { damage: modified })) |
|
|
|
damageResults.push(prey.takeDamage(modified)) |
|
|
|
} |
|
|
|
|
|
|
|
if (prey.vigors[Vigor.Health] <= 0) { |
|
|
|
prey.destroyed = true |
|
|
|
this.digested.push(prey) |
|
|
|
justDigested.push(prey) |
|
|
|
damageResults.push(this.onDigest(prey)) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
const tickedEntries = new LogLines(...tickedEntryList) |
|
|
|
|
|
|
|
this.digested.forEach(prey => { |
|
|
|
const scaled = this.damage.calc(this.owner, prey).scale(dt / 60) |
|
|
|
const damageTotal: number = prey.effectiveDamage(scaled).damages.filter(instance => instance.target === Vigor.Health).reduce( |
|
|
|
(total: number, instance: DamageInstance) => total + instance.amount, |
|
|
|
0 |
|
|
|
) |
|
|
|
|
|
|
|
const massStolen = Math.min(damageTotal / 100, prey.voreStats.Mass) |
|
|
|
|
|
|
|
prey.voreStats.Mass -= massStolen |
|
|
|
this.owner.voreStats.Mass += massStolen |
|
|
|
|
|
|
|
if (prey.voreStats.Mass === 0) { |
|
|
|
this.absorbed.push(prey) |
|
|
|
justAbsorbed.push(prey) |
|
|
|
damageResults.push(this.onAbsorb(prey)) |
|
|
|
if (victims === undefined || victims.indexOf(prey) >= 0) { |
|
|
|
const scaled = this.damage.calc(this.owner, prey).scale(dt / 60) |
|
|
|
const damageTotal: number = prey.effectiveDamage(scaled).damages.filter(instance => instance.target === Vigor.Health).reduce( |
|
|
|
(total: number, instance: DamageInstance) => total + instance.amount, |
|
|
|
0 |
|
|
|
) |
|
|
|
|
|
|
|
const massStolen = Math.min(damageTotal / 100, prey.voreStats.Mass) |
|
|
|
|
|
|
|
prey.voreStats.Mass -= massStolen |
|
|
|
this.owner.voreStats.Mass += massStolen |
|
|
|
|
|
|
|
if (prey.voreStats.Mass === 0) { |
|
|
|
this.absorbed.push(prey) |
|
|
|
justAbsorbed.push(prey) |
|
|
|
damageResults.push(this.onAbsorb(prey)) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|