Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/DeathDamage.js
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
DeathDamage.prototype.GetDeathDamageStrengths = function() | DeathDamage.prototype.GetDeathDamageStrengths = function() | ||||
{ | { | ||||
// Work out the damage values with technology effects | // Work out the damage values with technology effects | ||||
let applyMods = damageType => | let applyMods = damageType => | ||||
ApplyValueModificationsToEntity("DeathDamage/" + damageType, +(this.template[damageType] || 0), this.entity); | ApplyValueModificationsToEntity("DeathDamage/" + damageType, +(this.template[damageType] || 0), this.entity); | ||||
let ret = {}; | let ret = {}; | ||||
for (let damageType of DamageTypes.GetTypes()) | for (let damageType in this.template) | ||||
if (DamageTypes.GetTypes().some(x => x == damageType)) | |||||
ret[damageType] = applyMods(damageType); | ret[damageType] = applyMods(damageType); | ||||
return ret; | return ret; | ||||
}; | }; | ||||
DeathDamage.prototype.GetBonusTemplate = function() | DeathDamage.prototype.GetBonusTemplate = function() | ||||
{ | { | ||||
return this.template.Bonuses || null; | return this.template.Bonuses || null; | ||||
}; | }; | ||||
Show All 32 Lines |
Wildfire Games · Phabricator