diff --git a/binaries/data/mods/_test.sim/simulation/templates/special/filter/foundation.xml b/binaries/data/mods/_test.sim/simulation/templates/special/filter/foundation.xml index e17ff9b10a..faa98018a1 100644 --- a/binaries/data/mods/_test.sim/simulation/templates/special/filter/foundation.xml +++ b/binaries/data/mods/_test.sim/simulation/templates/special/filter/foundation.xml @@ -1,7 +1,6 @@ - @@ -27,6 +26,7 @@ + diff --git a/binaries/data/mods/public/globalscripts/Templates.js b/binaries/data/mods/public/globalscripts/Templates.js index e698bb75c0..8d14dfdce5 100644 --- a/binaries/data/mods/public/globalscripts/Templates.js +++ b/binaries/data/mods/public/globalscripts/Templates.js @@ -160,12 +160,23 @@ function GetTemplateDataHelper(template, player, auraTemplates, modifiers = {}) let ret = {}; - if (template.Armour) + if (template.Resistance) { - ret.armour = {}; - for (let damageType in template.Armour) - if (damageType != "Foundation") - ret.armour[damageType] = getEntityValue("Armour/" + damageType); + // Don't show Foundation resistance. + ret.resistance = {}; + if (template.Resistance.Entity) + { + if (template.Resistance.Entity.Damage) + { + ret.resistance.Damage = {}; + for (let damageType in template.Resistance.Entity.Damage) + ret.resistance.Damage[damageType] = getEntityValue("Resistance/Entity/Damage/" + damageType); + } + if (template.Resistance.Entity.Capture) + ret.resistance.Capture = getEntityValue("Resistance/Entity/Capture"); + + // ToDo: Resistance against StatusEffects. + } } let getAttackEffects = (temp, path) => { diff --git a/binaries/data/mods/public/gui/common/tooltips.js b/binaries/data/mods/public/gui/common/tooltips.js index b4d7c746e1..72bf6aa9cb 100644 --- a/binaries/data/mods/public/gui/common/tooltips.js +++ b/binaries/data/mods/public/gui/common/tooltips.js @@ -155,37 +155,76 @@ function getCurrentHealthTooltip(entState, label) } /** - * Converts an armor level into the actual reduction percentage + * Converts an resistance level into the actual reduction percentage. */ -function armorLevelToPercentageString(level) +function resistanceLevelToPercentageString(level) { return sprintf(translate("%(percentage)s%%"), { "percentage": (100 - Math.round(Math.pow(0.9, level) * 100)) }); } -function getArmorTooltip(template) +function getResistanceTooltip(template) { - if (!template.armour) + if (!template.resistance) + return ""; + + let details = []; + if (template.resistance.Damage) + details.push(getDamageResistanceTooltip(template.resistance.Damage)); + + if (template.resistance.Capture) + details.push(getCaptureResistanceTooltip(template.resistance.Capture)); + + // ToDo: Status effects resistance. + + return sprintf(translate("%(label)s\n %(details)s"), { + "label": headerFont(translate("Resistance:")), + "details": details.join("\n ") + }); +} + +function getDamageResistanceTooltip(resistanceTypeTemplate) +{ + if (!resistanceTypeTemplate) return ""; return sprintf(translate("%(label)s %(details)s"), { - "label": headerFont(translate("Armor:")), + "label": headerFont(translate("Damage Resistance:")), "details": - g_DamageTypesMetadata.sort(Object.keys(template.armour)).map( - dmgType => sprintf(translate("%(damage)s %(damageType)s %(armorPercentage)s"), { - "damage": template.armour[dmgType].toFixed(1), + g_DamageTypesMetadata.sort(Object.keys(resistanceTypeTemplate)).map( + dmgType => sprintf(translate("%(damage)s %(damageType)s %(resistancePercentage)s"), { + "damage": resistanceTypeTemplate[dmgType].toFixed(1), "damageType": unitFont(translateWithContext("damage type", g_DamageTypesMetadata.getName(dmgType))), - "armorPercentage": + "resistancePercentage": '[font="sans-10"]' + - sprintf(translate("(%(armorPercentage)s)"), { - "armorPercentage": armorLevelToPercentageString(template.armour[dmgType]) + sprintf(translate("(%(resistancePercentage)s)"), { + "resistancePercentage": resistanceLevelToPercentageString(resistanceTypeTemplate[dmgType]) }) + '[/font]' }) ).join(commaFont(translate(", "))) }); } +function getCaptureResistanceTooltip(resistanceTypeTemplate) +{ + if (!resistanceTypeTemplate) + return ""; + return sprintf(translate("%(label)s %(details)s"), { + "label": headerFont(translate("Capture Resistance:")), + "details": + sprintf(translate("%(damage)s %(damageType)s %(resistancePercentage)s"), { + "damage": resistanceTypeTemplate.toFixed(1), + "damageType": unitFont(translateWithContext("damage type", "Capture")), + "resistancePercentage": + '[font="sans-10"]' + + sprintf(translate("(%(resistancePercentage)s)"), { + "resistancePercentage": resistanceLevelToPercentageString(resistanceTypeTemplate) + }) + '[/font]' + }) + }); +} + function attackRateDetails(interval, projectiles) { if (!interval) diff --git a/binaries/data/mods/public/gui/reference/common/ReferencePage.js b/binaries/data/mods/public/gui/reference/common/ReferencePage.js index 025d9a4c97..8ff0687e66 100644 --- a/binaries/data/mods/public/gui/reference/common/ReferencePage.js +++ b/binaries/data/mods/public/gui/reference/common/ReferencePage.js @@ -55,7 +55,7 @@ ReferencePage.prototype.StatsFunctions = [ getHealerTooltip, getAttackTooltip, getSplashDamageTooltip, - getArmorTooltip, + getResistanceTooltip, getGarrisonTooltip, getProjectilesTooltip, getSpeedTooltip, diff --git a/binaries/data/mods/public/gui/reference/common/TemplateParser.js b/binaries/data/mods/public/gui/reference/common/TemplateParser.js index 13cdad41e2..32ba0abdc4 100644 --- a/binaries/data/mods/public/gui/reference/common/TemplateParser.js +++ b/binaries/data/mods/public/gui/reference/common/TemplateParser.js @@ -76,9 +76,9 @@ class TemplateParser if (!parsed.upgrades) parsed.upgrades = []; - // Note: An assumption is made here that wall segments all have the same armor and auras + // Note: An assumption is made here that wall segments all have the same resistance and auras let struct = this.getEntity(parsed.wallSet.templates.long, civCode); - parsed.armour = struct.armour; + parsed.resistance = struct.resistance; parsed.auras = struct.auras; // For technology cost multiplier, we need to use the tower diff --git a/binaries/data/mods/public/gui/session/PanelEntity.js b/binaries/data/mods/public/gui/session/PanelEntity.js index 6c21a45441..9438af76ef 100644 --- a/binaries/data/mods/public/gui/session/PanelEntity.js +++ b/binaries/data/mods/public/gui/session/PanelEntity.js @@ -86,7 +86,7 @@ PanelEntity.prototype.PortraitDirectory = "session/portraits/"; PanelEntity.prototype.Tooltips = [ getCurrentHealthTooltip, getAttackTooltip, - getArmorTooltip, + getResistanceTooltip, getEntityTooltip, getAurasTooltip ]; diff --git a/binaries/data/mods/public/gui/session/selection_details.js b/binaries/data/mods/public/gui/session/selection_details.js index b12b3154ef..d481c1c688 100644 --- a/binaries/data/mods/public/gui/session/selection_details.js +++ b/binaries/data/mods/public/gui/session/selection_details.js @@ -311,11 +311,11 @@ function displaySingle(entState) showTemplateDetails(entState.template); }; - Engine.GetGUIObjectByName("attackAndArmorStats").tooltip = [ + Engine.GetGUIObjectByName("attackAndResistanceStats").tooltip = [ getAttackTooltip, getSplashDamageTooltip, getHealerTooltip, - getArmorTooltip, + getResistanceTooltip, getGatherTooltip, getSpeedTooltip, getGarrisonTooltip, diff --git a/binaries/data/mods/public/gui/session/selection_panels.js b/binaries/data/mods/public/gui/session/selection_panels.js index a962c21c7b..cf56712de1 100644 --- a/binaries/data/mods/public/gui/session/selection_panels.js +++ b/binaries/data/mods/public/gui/session/selection_panels.js @@ -980,7 +980,7 @@ g_SelectionPanels.Training = { getAttackTooltip, getSplashDamageTooltip, getHealerTooltip, - getArmorTooltip, + getResistanceTooltip, getGarrisonTooltip, getProjectilesTooltip, getSpeedTooltip diff --git a/binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml b/binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml index 9d9299e100..0112ee28c7 100644 --- a/binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml +++ b/binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml @@ -55,9 +55,9 @@ - - - Attack and Armor + + + Attack and Resistance @@ -94,7 +94,7 @@ - + diff --git a/binaries/data/mods/public/simulation/ai/common-api/entity.js b/binaries/data/mods/public/simulation/ai/common-api/entity.js index b6d3b1fedb..8e5e780f97 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/entity.js +++ b/binaries/data/mods/public/simulation/ai/common-api/entity.js @@ -196,17 +196,25 @@ m.Template = m.Class({ "getPopulationBonus": function() { return +this.get("Cost/PopulationBonus"); }, - "armourStrengths": function() { - let armourDamageTypes = this.get("Armour"); - if (!armourDamageTypes) + "resistanceStrengths": function() { + let resistanceTypes = this.get("Resistance"); + if (!resistanceTypes || !resistanceTypes.Entity) return undefined; - let armour = {}; - for (let damageType in armourDamageTypes) - if (damageType != "Foundation") - armour[damageType] = +armourDamageTypes[damageType]; + let resistance = {}; + if (resistanceTypes.Entity.Capture) + resistance.Capture = +this.get("Resistance/Entity/Capture"); - return armour; + if (resistanceTypes.Entity.Damage) + { + resistance.Damage = {}; + for (let damageType in resistanceTypes.Entity.Damage) + resistance.Damage[damageType] = +this.get("Resistance/Entity/Damage/" + damageType); + } + + // ToDo: Resistance to StatusEffects. + + return resistance; }, "attackTypes": function() { @@ -754,8 +762,8 @@ m.Entity = m.Class({ return false; let canCapture = allowCapture && this.canCapture(target); - let armourStrengths = target.get("Armour"); - if (!armourStrengths) + let health = target.get("Health"); + if (!health) return canCapture; for (let type in attackTypes) diff --git a/binaries/data/mods/public/simulation/ai/petra/entityExtend.js b/binaries/data/mods/public/simulation/ai/petra/entityExtend.js index fd9e61d66c..5dfb73f4ce 100644 --- a/binaries/data/mods/public/simulation/ai/petra/entityExtend.js +++ b/binaries/data/mods/public/simulation/ai/petra/entityExtend.js @@ -59,15 +59,19 @@ PETRA.getMaxStrength = function(ent, debugLevel, DamageTypeImportance, againstCl } } - let armourStrength = ent.armourStrengths(); - for (let str in armourStrength) - { - let val = parseFloat(armourStrength[str]); - if (DamageTypeImportance[str]) - strength += DamageTypeImportance[str] * val / damageTypes.length; - else if (debugLevel > 0) - API3.warn("Petra: " + str + " unknown armourStrength in getMaxStrength (please add " + str + " to config.js)."); - } + let resistanceStrength = ent.resistanceStrengths(); + + if (resistanceStrength.Damage) + for (let str in resistanceStrength.Damage) + { + let val = +resistanceStrength.Damage[str]; + if (DamageTypeImportance[str]) + strength += DamageTypeImportance[str] * val / damageTypes.length; + else if (debugLevel > 0) + API3.warn("Petra: " + str + " unknown resistanceStrength in getMaxStrength (please add " + str + " to config.js)."); + } + + // ToDo: Add support for StatusEffects and Capture. return strength * ent.maxHitpoints() / 100.0; }; diff --git a/binaries/data/mods/public/simulation/components/Armour.js b/binaries/data/mods/public/simulation/components/Armour.js deleted file mode 100644 index bbb18b2585..0000000000 --- a/binaries/data/mods/public/simulation/components/Armour.js +++ /dev/null @@ -1,73 +0,0 @@ -function Armour() {} - -Armour.prototype.DamageResistanceSchema = "" + - "" + - "" + - "" + - "Foundation" + - "" + - "" + - "" + - ""; - -Armour.prototype.Schema = - "Controls the damage resistance of the unit." + - "" + - "10.0" + - "0.0" + - "5.0" + - "" + - Armour.prototype.DamageResistanceSchema + - "" + - "" + - Armour.prototype.DamageResistanceSchema + - "" + - ""; - -Armour.prototype.Init = function() -{ - this.invulnerable = false; -}; - -Armour.prototype.IsInvulnerable = function() -{ - return this.invulnerable; -}; - -Armour.prototype.SetInvulnerability = function(invulnerability) -{ - this.invulnerable = invulnerability; - Engine.PostMessage(this.entity, MT_InvulnerabilityChanged, { "entity": this.entity, "invulnerability": invulnerability }); -}; - -Armour.prototype.GetArmourStrengths = function(effectType) -{ - // Work out the armour values with technology effects. - let applyMods = (type, foundation) => { - let strength; - if (foundation) - { - strength = +this.template.Foundation[type]; - type = "Foundation/" + type; - } - else - strength = +this.template[type]; - - return ApplyValueModificationsToEntity("Armour/" + type, strength, this.entity); - }; - - let foundation = Engine.QueryInterface(this.entity, IID_Foundation) && this.template.Foundation; - - let ret = {}; - - if (effectType != "Damage") - return ret; - - for (let damageType in this.template) - if (damageType != "Foundation") - ret[damageType] = applyMods(damageType, foundation); - - return ret; -}; - -Engine.RegisterComponentType(IID_Resistance, "Armour", Armour); diff --git a/binaries/data/mods/public/simulation/components/Attack.js b/binaries/data/mods/public/simulation/components/Attack.js index 4be1e97f8b..8c88b7838c 100644 --- a/binaries/data/mods/public/simulation/components/Attack.js +++ b/binaries/data/mods/public/simulation/components/Attack.js @@ -556,7 +556,7 @@ Attack.prototype.PerformAttack = function(type, target) cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_DelayedDamage, "MissileHit", +this.template[type].Delay + timeToTarget * 1000, data); } else - Attacking.HandleAttackEffects(type, this.GetAttackEffectsData(type), target, this.entity, attackerOwner); + Attacking.HandleAttackEffects(target, type, this.GetAttackEffectsData(type), this.entity, attackerOwner); }; /** diff --git a/binaries/data/mods/public/simulation/components/Capturable.js b/binaries/data/mods/public/simulation/components/Capturable.js index c347311f20..bbba64f5fc 100644 --- a/binaries/data/mods/public/simulation/components/Capturable.js +++ b/binaries/data/mods/public/simulation/components/Capturable.js @@ -52,28 +52,19 @@ Capturable.prototype.SetCapturePoints = function(capturePointsArray) /** * Compute the amount of capture points to be reduced and reduce them. - * @param {number} effectData - Base number of capture points to be taken. + * @param {number} amount - Number of capture points to be taken. * @param {number} captor - The entity capturing us. * @param {number} captorOwner - Owner of the captor. - * @param {number} bonusMultiplier - Multiplier to be multiplied with effectData. * @return {Object} - Object of the form { "captureChange": number }, where number indicates the actual amount of capture points taken. */ -Capturable.prototype.Capture = function(effectData, captor, captorOwner, bonusMultiplier) +Capturable.prototype.Capture = function(amount, captor, captorOwner) { - let cmpHealth = Engine.QueryInterface(this.entity, IID_Health); - - let hitpoints = cmpHealth && cmpHealth.GetHitpoints(); - if (captorOwner == INVALID_PLAYER || !this.CanCapture(captorOwner) || !hitpoints) + if (captorOwner == INVALID_PLAYER || !this.CanCapture(captorOwner)) return {}; - bonusMultiplier /= 0.1 + 0.9 * hitpoints / cmpHealth.GetMaxHitpoints(); - - let total = Attacking.GetTotalAttackEffects({ "Capture": effectData }, "Capture") * bonusMultiplier; - - let change = this.Reduce(total, captorOwner); // TODO: implement loot - return { "captureChange": change }; + return { "captureChange": this.Reduce(amount, captorOwner) }; }; /** diff --git a/binaries/data/mods/public/simulation/components/DelayedDamage.js b/binaries/data/mods/public/simulation/components/DelayedDamage.js index 3678d7a9c2..e54b038131 100644 --- a/binaries/data/mods/public/simulation/components/DelayedDamage.js +++ b/binaries/data/mods/public/simulation/components/DelayedDamage.js @@ -43,9 +43,8 @@ DelayedDamage.prototype.MissileHit = function(data, lateness) if (cmpSoundManager && data.attackImpactSound) cmpSoundManager.PlaySoundGroupAtPosition(data.attackImpactSound, data.position); - // Do this first in case the direct hit kills the target + // Do this first in case the direct hit kills the target. if (data.splash) - { Attacking.CauseDamageOverArea({ "type": data.type, "attackData": data.splash.attackData, @@ -57,17 +56,15 @@ DelayedDamage.prototype.MissileHit = function(data, lateness) "direction": data.direction, "friendlyFire": data.splash.friendlyFire }); - } let cmpProjectileManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ProjectileManager); // Deal direct damage if we hit the main target - // and if the target has Resistance (not the case for a mirage for example) - if (Attacking.TestCollision(data.target, data.position, lateness)) + // and we could handle the attack. + if (Attacking.TestCollision(data.target, data.position, lateness) && + Attacking.HandleAttackEffects(data.target, data.type, data.attackData, data.attacker, data.attackerOwner)) { cmpProjectileManager.RemoveProjectile(data.projectileId); - - Attacking.HandleAttackEffects(data.type, data.attackData, data.target, data.attacker, data.attackerOwner); return; } @@ -81,11 +78,10 @@ DelayedDamage.prototype.MissileHit = function(data, lateness) for (let ent of ents) { - if (!Attacking.TestCollision(ent, data.position, lateness)) + if (!Attacking.TestCollision(ent, data.position, lateness) || + !Attacking.HandleAttackEffects(ent, data.type, data.attackData, data.attacker, data.attackerOwner)) continue; - Attacking.HandleAttackEffects(data.type, data.attackData, ent, data.attacker, data.attackerOwner); - cmpProjectileManager.RemoveProjectile(data.projectileId); break; } diff --git a/binaries/data/mods/public/simulation/components/GuiInterface.js b/binaries/data/mods/public/simulation/components/GuiInterface.js index fee641df90..64cdb64d00 100644 --- a/binaries/data/mods/public/simulation/components/GuiInterface.js +++ b/binaries/data/mods/public/simulation/components/GuiInterface.js @@ -454,9 +454,9 @@ GuiInterface.prototype.GetEntityState = function(player, ent) } } - let cmpArmour = Engine.QueryInterface(ent, IID_Resistance); - if (cmpArmour) - ret.armour = cmpArmour.GetArmourStrengths("Damage"); + let cmpResistance = Engine.QueryInterface(ent, IID_Resistance); + if (cmpResistance) + ret.resistance = cmpResistance.GetResistanceOfForm(cmpFoundation ? "Foundation" : "Entity"); let cmpBuildingAI = Engine.QueryInterface(ent, IID_BuildingAI); if (cmpBuildingAI) diff --git a/binaries/data/mods/public/simulation/components/Health.js b/binaries/data/mods/public/simulation/components/Health.js index 477b2e3da0..da56f2dfee 100644 --- a/binaries/data/mods/public/simulation/components/Health.js +++ b/binaries/data/mods/public/simulation/components/Health.js @@ -178,22 +178,15 @@ Health.prototype.Kill = function() }; /** - * Take damage according to the entity's resistance. - * @param {Object} strengths - { "hack": number, "pierce": number, "crush": number } or something like that. - * @param {number} bonusMultiplier - the damage multiplier. - * Returns object of the form { "healthChange": -12 }. + * @param {number} amount - The amount of damage to be taken. + * @param {number} attacker - The entityID of the attacker. + * @param {number} attackerOwner - The playerID of the owner of the attacker. + * + * @eturn {Object} - Object of the form { "healthChange": number }. */ -Health.prototype.TakeDamage = function(effectData, attacker, attackerOwner, bonusMultiplier) +Health.prototype.TakeDamage = function(amount, attacker, attackerOwner) { - let cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance); - - if (!this.hitpoints || cmpResistance && cmpResistance.IsInvulnerable()) - return { "healthChange": 0 }; - - let total = Attacking.GetTotalAttackEffects(effectData, "Damage", cmpResistance) * bonusMultiplier; - - // Reduce health - let change = this.Reduce(total); + let change = this.Reduce(amount); let cmpLoot = Engine.QueryInterface(this.entity, IID_Loot); if (cmpLoot && cmpLoot.GetXp() > 0 && change.healthChange < 0) diff --git a/binaries/data/mods/public/simulation/components/Resistance.js b/binaries/data/mods/public/simulation/components/Resistance.js new file mode 100644 index 0000000000..9eaa2a6025 --- /dev/null +++ b/binaries/data/mods/public/simulation/components/Resistance.js @@ -0,0 +1,128 @@ +function Resistance() {} + +/** + * Builds a RelaxRNG schema of possible attack effects. + * ToDo: Resistance to StatusEffects. + * + * @return {string} - RelaxNG schema string. + */ +Resistance.prototype.BuildResistanceSchema = function() +{ + return "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; +}; + +Resistance.prototype.Schema = + "Controls the damage resistance of the unit." + + "" + + "" + + "" + + "10.0" + + "0.0" + + "5.0" + + "" + + "10" + + "" + + "" + + "" + + "5" + + "" + + "" + + "" + + "" + + "" + + "" + + Resistance.prototype.BuildResistanceSchema() + + "" + + "" + + Resistance.prototype.BuildResistanceSchema() + + "" + + "" + + ""; + +Resistance.prototype.Init = function() +{ + this.invulnerable = false; +}; + +Resistance.prototype.IsInvulnerable = function() +{ + return this.invulnerable; +}; + +Resistance.prototype.SetInvulnerability = function(invulnerability) +{ + this.invulnerable = invulnerability; + Engine.PostMessage(this.entity, MT_InvulnerabilityChanged, { "entity": this.entity, "invulnerability": invulnerability }); +}; + +/** + * Calculate the effective resistance of an entity to a particular effect. + * ToDo: Support resistance against status effects. + * @param {string} effectType - The type of attack effect the resistance has to be calculated for (e.g. "Damage", "Capture"). + * @return {Object} - An object of the type { "Damage": { "Crush": number, "Hack": number }, "Capture": number }. + */ +Resistance.prototype.GetEffectiveResistanceAgainst = function(effectType) +{ + let ret = {}; + + let template = this.GetResistanceOfForm(Engine.QueryInterface(this.entity, IID_Foundation) ? "Foundation" : "Entity"); + if (template[effectType]) + ret[effectType] = template[effectType]; + + return ret; +}; + +/** + * Get all separate resistances for showing in the GUI. + * @return {Object} - All resistances ordered by type. + */ +Resistance.prototype.GetFullResistance = function() +{ + let ret = {}; + for (let entityForm in this.template) + ret[entityForm] = this.GetResistanceOfForm(entityForm); + + return ret; +}; + +/** + * Get the resistance of a particular type, i.e. Foundation or Entity. + * @param {string} entityForm - The form of the entity to query. + * @return {Object} - An object containing the resistances. + */ +Resistance.prototype.GetResistanceOfForm = function(entityForm) +{ + let ret = {}; + let template = this.template[entityForm]; + if (!template) + return ret; + + if (template.Damage) + { + ret.Damage = {}; + for (let damageType in template.Damage) + ret.Damage[damageType] = ApplyValueModificationsToEntity("Resistance/" + entityForm + "/Damage/" + damageType, +this.template[entityForm].Damage[damageType], this.entity); + } + + if (template.Capture) + ret.Capture = ApplyValueModificationsToEntity("Resistance/" + entityForm + "/Capture", +this.template[entityForm].Capture, this.entity); + + return ret; +}; + +Engine.RegisterComponentType(IID_Resistance, "Resistance", Resistance); diff --git a/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js b/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js index 28aac6590f..bf53421da5 100755 --- a/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js +++ b/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js @@ -30,7 +30,7 @@ StatusEffectsReceiver.prototype.GetActiveStatuses = function() * * @return {Object} - The names of the status effects which were processed. */ -StatusEffectsReceiver.prototype.ApplyStatus = function(effectData, attacker, attackerOwner, bonusMultiplier) +StatusEffectsReceiver.prototype.ApplyStatus = function(effectData, attacker, attackerOwner) { let attackerData = { "entity": attacker, "owner": attackerOwner }; for (let effect in effectData) diff --git a/binaries/data/mods/public/simulation/components/interfaces/Attack.js b/binaries/data/mods/public/simulation/components/interfaces/Attack.js deleted file mode 100644 index bfd6979c69..0000000000 --- a/binaries/data/mods/public/simulation/components/interfaces/Attack.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Message of the form { "attacker": number, "target": number, "type": string, "damage": number, "attackerOwner": number } - * sent from Attack component and by Damage component to the target entity, each time the target is attacked or damaged. - */ -Engine.RegisterMessageType("Attacked"); diff --git a/binaries/data/mods/public/simulation/components/interfaces/Resistance.js b/binaries/data/mods/public/simulation/components/interfaces/Resistance.js index 0226ee06f5..7e8a73b95c 100644 --- a/binaries/data/mods/public/simulation/components/interfaces/Resistance.js +++ b/binaries/data/mods/public/simulation/components/interfaces/Resistance.js @@ -4,3 +4,17 @@ Engine.RegisterInterface("Resistance"); * Message of the form { "entity": entity, "invulnerability": true/false } */ Engine.RegisterMessageType("InvulnerabilityChanged"); + +/** + * Message of the form { + * "type": string, + * "target": number, + * "attacker": attacker, + * "attackerOwner": number, + * "damage": number, + * "capture": number, + * "statusEffects": Object[], + * "fromStatusEffect": boolean } + * sent from Attacking.js-helper to the target entity, each time the target is damaged. + */ +Engine.RegisterMessageType("Attacked"); diff --git a/binaries/data/mods/public/simulation/components/tests/test_Attack.js b/binaries/data/mods/public/simulation/components/tests/test_Attack.js index 926d783a94..17296a0f02 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_Attack.js +++ b/binaries/data/mods/public/simulation/components/tests/test_Attack.js @@ -1,7 +1,6 @@ Engine.LoadHelperScript("Attacking.js"); Engine.LoadHelperScript("Player.js"); Engine.LoadHelperScript("ValueModification.js"); -Engine.LoadComponentScript("interfaces/Attack.js"); Engine.LoadComponentScript("interfaces/Auras.js"); Engine.LoadComponentScript("interfaces/Capturable.js"); Engine.LoadComponentScript("interfaces/ModifiersManager.js"); diff --git a/binaries/data/mods/public/simulation/components/tests/test_Damage.js b/binaries/data/mods/public/simulation/components/tests/test_Damage.js index a50cb435ce..f940252b2f 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_Damage.js +++ b/binaries/data/mods/public/simulation/components/tests/test_Damage.js @@ -1,17 +1,12 @@ Engine.LoadHelperScript("Attacking.js"); Engine.LoadHelperScript("Player.js"); -Engine.LoadHelperScript("Sound.js"); Engine.LoadHelperScript("ValueModification.js"); -Engine.LoadComponentScript("interfaces/Attack.js"); -Engine.LoadComponentScript("interfaces/AttackDetection.js"); Engine.LoadComponentScript("interfaces/DelayedDamage.js"); -Engine.LoadComponentScript("interfaces/Resistance.js"); Engine.LoadComponentScript("interfaces/Health.js"); Engine.LoadComponentScript("interfaces/Loot.js"); -Engine.LoadComponentScript("interfaces/Player.js"); Engine.LoadComponentScript("interfaces/Promotion.js"); -Engine.LoadComponentScript("interfaces/StatusEffectsReceiver.js"); Engine.LoadComponentScript("interfaces/ModifiersManager.js"); +Engine.LoadComponentScript("interfaces/Resistance.js"); Engine.LoadComponentScript("interfaces/Timer.js"); Engine.LoadComponentScript("Attack.js"); Engine.LoadComponentScript("DelayedDamage.js"); @@ -89,9 +84,9 @@ function Test_Generic() }); AddMock(target, IID_Health, { - "TakeDamage": (effectData, __, ___, bonusMultiplier) => { + "TakeDamage": (amount, __, ___) => { damageTaken = true; - return { "healthChange": -bonusMultiplier * effectData.Crush }; + return { "healthChange": -amount }; }, }); @@ -136,12 +131,12 @@ function Test_Generic() damageTaken = false; } - Attacking.HandleAttackEffects(data.type, data.attackData, data.target, data.attacker, data.attackerOwner); + Attacking.HandleAttackEffects(target, data.type, data.attackData, data.attacker, data.attackerOwner); TestDamage(); data.type = "Ranged"; type = data.type; - Attacking.HandleAttackEffects(data.type, data.attackData, data.target, data.attacker, data.attackerOwner); + Attacking.HandleAttackEffects(target, data.type, data.attackData, data.attacker, data.attackerOwner); TestDamage(); // Check for damage still being dealt if the attacker dies @@ -214,26 +209,26 @@ function TestLinearSplashDamage() }); AddMock(60, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(60); - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100 * fallOff(2.2, -0.4)); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 100 * fallOff(2.2, -0.4)); + return { "healthChange": -amount }; } }); AddMock(61, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(61); - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100 * fallOff(0, 0)); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 100 * fallOff(0, 0)); + return { "healthChange": -amount }; } }); AddMock(62, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(62); - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 0); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 0); + return { "healthChange": -amount }; } }); @@ -246,10 +241,10 @@ function TestLinearSplashDamage() data.direction = new Vector3D(0.6, 747, 0.8); AddMock(60, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(60); - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100 * fallOff(1, 2)); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 100 * fallOff(1, 2)); + return { "healthChange": -amount }; } }); @@ -310,36 +305,36 @@ function TestCircularSplashDamage() }); AddMock(60, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100 * fallOff(0)); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, 100 * fallOff(0)); + return { "healthChange": -amount }; } }); AddMock(61, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100 * fallOff(5)); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, 100 * fallOff(5)); + return { "healthChange": -amount }; } }); AddMock(62, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100 * fallOff(1)); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, 100 * fallOff(1)); + return { "healthChange": -amount }; } }); AddMock(63, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { TS_ASSERT(false); } }); let cmphealth = AddMock(64, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 0); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, 0); + return { "healthChange": -amount }; } }); let spy = new Spy(cmphealth, "TakeDamage"); @@ -408,10 +403,10 @@ function Test_MissileHit() }); AddMock(60, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(60); - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 100); + return { "healthChange": -amount }; } }); @@ -447,9 +442,9 @@ function Test_MissileHit() }); AddMock(60, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { TS_ASSERT_EQUALS(false); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + return { "healthChange": -amount }; } }); @@ -465,10 +460,10 @@ function Test_MissileHit() }); AddMock(61, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(61); - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 100); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 100); + return { "healthChange": -amount }; } }); @@ -493,10 +488,10 @@ function Test_MissileHit() let dealtDamage = 0; AddMock(61, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(61); - dealtDamage += mult * (effectData.Hack + effectData.Pierce + effectData.Crush); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + dealtDamage += amount; + return { "healthChange": -amount }; } }); @@ -508,10 +503,10 @@ function Test_MissileHit() }); AddMock(62, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(62); - TS_ASSERT_EQUALS(mult * (effectData.Hack + effectData.Pierce + effectData.Crush), 200 * 0.75); - return { "healthChange": -mult * (effectData.Hack + effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 200 * 0.75); + return { "healthChange": -amount }; } }); @@ -589,10 +584,10 @@ function Test_MissileHit() dealtDamage = 0; AddMock(61, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(61); - dealtDamage += mult * (effectData.Pierce + effectData.Crush); - return { "healthChange": -mult * (effectData.Pierce + effectData.Crush) }; + dealtDamage += amount; + return { "healthChange": -amount }; } }); @@ -604,10 +599,10 @@ function Test_MissileHit() }); AddMock(62, IID_Health, { - "TakeDamage": (effectData, __, ___, mult) => { + "TakeDamage": (amount, __, ___) => { hitEnts.add(62); - TS_ASSERT_EQUALS(mult * (effectData.Pierce + effectData.Crush), 200 * 0.75); - return { "healtChange": -mult * (effectData.Pierce + effectData.Crush) }; + TS_ASSERT_EQUALS(amount, 200 * 0.75); + return { "healtChange": -amount }; } }); diff --git a/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js b/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js index efcbbfe794..37c169e1f2 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js +++ b/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js @@ -1,6 +1,5 @@ Engine.LoadHelperScript("ObstructionSnap.js"); Engine.LoadHelperScript("Player.js"); -Engine.LoadComponentScript("interfaces/Attack.js"); Engine.LoadComponentScript("interfaces/AlertRaiser.js"); Engine.LoadComponentScript("interfaces/Auras.js"); Engine.LoadComponentScript("interfaces/Barter.js"); diff --git a/binaries/data/mods/public/simulation/components/tests/test_Resistance.js b/binaries/data/mods/public/simulation/components/tests/test_Resistance.js new file mode 100644 index 0000000000..ebecd7cbdd --- /dev/null +++ b/binaries/data/mods/public/simulation/components/tests/test_Resistance.js @@ -0,0 +1,250 @@ +Engine.LoadHelperScript("Attacking.js"); +Engine.LoadHelperScript("Player.js"); +Engine.LoadHelperScript("ValueModification.js"); +Engine.LoadComponentScript("interfaces/Capturable.js"); +Engine.LoadComponentScript("interfaces/Foundation.js"); +Engine.LoadComponentScript("interfaces/Health.js"); +Engine.LoadComponentScript("interfaces/Looter.js"); +Engine.LoadComponentScript("interfaces/ModifiersManager.js"); +Engine.LoadComponentScript("interfaces/PlayerManager.js"); +Engine.LoadComponentScript("interfaces/Promotion.js"); +Engine.LoadComponentScript("interfaces/Resistance.js"); +Engine.LoadComponentScript("interfaces/StatisticsTracker.js"); +Engine.LoadComponentScript("Resistance.js"); + +class testResistance +{ + constructor() + { + this.cmpResistance = null; + this.PlayerID = 1; + this.EnemyID = 2; + this.EntityID = 3; + this.AttackerID = 4; + } + + Reset(schema = {}) + { + this.cmpResistance = ConstructComponent(this.EntityID, "Resistance", schema); + DeleteMock(this.EntityID, IID_Health); + DeleteMock(this.EntityID, IID_Capturable); + DeleteMock(this.EntityID, IID_Identity); + } + + TestInvulnerability() + { + this.Reset(); + + let damage = 5; + let attackData = { "Damage": { "Name": damage } }; + let attackType = "Test"; + + TS_ASSERT(!this.cmpResistance.IsInvulnerable()); + + let cmpHealth = AddMock(this.EntityID, IID_Health, { + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, damage); + return { "healthChange": -amount }; + } + }); + let spy = new Spy(cmpHealth, "TakeDamage"); + + Attacking.HandleAttackEffects(this.EntityID, attackType, attackData, this.AttackerID, this.EnemyID); + TS_ASSERT_EQUALS(spy._called, 1); + + this.cmpResistance.SetInvulnerability(true); + + TS_ASSERT(this.cmpResistance.IsInvulnerable()); + Attacking.HandleAttackEffects(this.EntityID, attackType, attackData, this.AttackerID, this.EnemyID); + TS_ASSERT_EQUALS(spy._called, 1); + } + + TestBonus() + { + this.Reset(); + + let damage = 5; + let bonus = 2; + let classes = "Entity"; + let attackData = { + "Damage": { "Name": damage }, + "Bonuses": { + "bonus": { + "Classes": classes, + "Multiplier": bonus + } + } + }; + + AddMock(this.EntityID, IID_Identity, { + "GetClassesList": () => [classes], + "GetCiv": () => "civ" + }); + + let cmpHealth = AddMock(this.EntityID, IID_Health, { + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, damage * bonus); + return { "healthChange": -amount }; + } + }); + let spy = new Spy(cmpHealth, "TakeDamage"); + + Attacking.HandleAttackEffects(this.EntityID, "Test", attackData, this.AttackerID, this.EnemyID); + TS_ASSERT_EQUALS(spy._called, 1); + } + + TestDamageResistanceApplies() + { + let resistanceValue = 2; + let damageType = "Name"; + this.Reset({ + "Entity": { + "Damage": { + [damageType]: resistanceValue + } + } + }); + + let damage = 5; + let attackData = { + "Damage": { "Name": damage } + }; + + let cmpHealth = AddMock(this.EntityID, IID_Health, { + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, damage * Math.pow(0.9, resistanceValue)); + return { "healthChange": -amount }; + } + }); + let spy = new Spy(cmpHealth, "TakeDamage"); + + Attacking.HandleAttackEffects(this.EntityID, "Test", attackData, this.AttackerID, this.EnemyID); + TS_ASSERT_EQUALS(spy._called, 1); + } + + TestCaptureResistanceApplies() + { + let resistanceValue = 2; + this.Reset({ + "Entity": { + "Capture": resistanceValue + } + }); + + let damage = 5; + let attackData = { + "Capture": damage + }; + + let cmpCapturable = AddMock(this.EntityID, IID_Capturable, { + "Capture": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, damage * Math.pow(0.9, resistanceValue)); + return { "captureChange": amount }; + } + }); + let spy = new Spy(cmpCapturable, "Capture"); + + Attacking.HandleAttackEffects(this.EntityID, "Test", attackData, this.AttackerID, this.EnemyID); + TS_ASSERT_EQUALS(spy._called, 1); + } + + TestResistanceAndBonus() + { + let resistanceValue = 2; + let damageType = "Name"; + this.Reset({ + "Entity": { + "Damage": { + [damageType]: resistanceValue + } + } + }); + + let damage = 5; + let bonus = 2; + let classes = "Entity"; + let attackData = { + "Damage": { "Name": damage }, + "Bonuses": { + "bonus": { + "Classes": classes, + "Multiplier": bonus + } + } + }; + + AddMock(this.EntityID, IID_Identity, { + "GetClassesList": () => [classes], + "GetCiv": () => "civ" + }); + + let cmpHealth = AddMock(this.EntityID, IID_Health, { + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, damage * bonus * Math.pow(0.9, resistanceValue)); + return { "healthChange": -amount }; + } + }); + let spy = new Spy(cmpHealth, "TakeDamage"); + + Attacking.HandleAttackEffects(this.EntityID, "Test", attackData, this.AttackerID, this.EnemyID); + TS_ASSERT_EQUALS(spy._called, 1); + } + + TestMultipleEffects() + { + let captureResistanceValue = 2; + this.Reset({ + "Entity": { + "Capture": captureResistanceValue + } + }); + + let damage = 5; + let bonus = 2; + let classes = "Entity"; + let attackData = { + "Damage": { "Name": damage }, + "Capture": damage, + "Bonuses": { + "bonus": { + "Classes": classes, + "Multiplier": bonus + } + } + }; + + AddMock(this.EntityID, IID_Identity, { + "GetClassesList": () => [classes], + "GetCiv": () => "civ" + }); + + let cmpCapturable = AddMock(this.EntityID, IID_Capturable, { + "Capture": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, damage * bonus * Math.pow(0.9, captureResistanceValue)); + return { "captureChange": amount }; + } + }); + let cmpHealth = AddMock(this.EntityID, IID_Health, { + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, damage * bonus); + return { "healthChange": -amount }; + }, + "GetHitpoints": () => 1, + "GetMaxHitpoints": () => 1 + }); + let healthSpy = new Spy(cmpHealth, "TakeDamage"); + let captureSpy = new Spy(cmpCapturable, "Capture"); + + Attacking.HandleAttackEffects(this.EntityID, "Test", attackData, this.AttackerID, this.EnemyID); + TS_ASSERT_EQUALS(healthSpy._called, 1); + TS_ASSERT_EQUALS(captureSpy._called, 1); + } +} + +let cmp = new testResistance(); +cmp.TestInvulnerability(); +cmp.TestBonus(); +cmp.TestDamageResistanceApplies(); +cmp.TestCaptureResistanceApplies(); +cmp.TestResistanceAndBonus(); +cmp.TestMultipleEffects(); diff --git a/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js b/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js index 8ae94233dc..0e2742fdb2 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js +++ b/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js @@ -2,7 +2,6 @@ Engine.LoadHelperScript("FSM.js"); Engine.LoadHelperScript("Entity.js"); Engine.LoadHelperScript("Player.js"); Engine.LoadHelperScript("Sound.js"); -Engine.LoadComponentScript("interfaces/Attack.js"); Engine.LoadComponentScript("interfaces/Auras.js"); Engine.LoadComponentScript("interfaces/Builder.js"); Engine.LoadComponentScript("interfaces/BuildingAI.js"); diff --git a/binaries/data/mods/public/simulation/data/auras/structures/kush_pyramids_military.json b/binaries/data/mods/public/simulation/data/auras/structures/kush_pyramids_military.json index 9c97022eeb..ff5900111a 100644 --- a/binaries/data/mods/public/simulation/data/auras/structures/kush_pyramids_military.json +++ b/binaries/data/mods/public/simulation/data/auras/structures/kush_pyramids_military.json @@ -3,9 +3,9 @@ "radius": 70, "affects": ["Soldier"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 }, { "value": "Attack/Melee/Damage/Hack", "multiply": 1.1 }, { "value": "Attack/Melee/Damage/Pierce", "multiply": 1.1 }, { "value": "Attack/Melee/Damage/Crush", "multiply": 1.1 }, diff --git a/binaries/data/mods/public/simulation/data/auras/structures/wall_garrisoned.json b/binaries/data/mods/public/simulation/data/auras/structures/wall_garrisoned.json index a6601195ca..85a41212cb 100644 --- a/binaries/data/mods/public/simulation/data/auras/structures/wall_garrisoned.json +++ b/binaries/data/mods/public/simulation/data/auras/structures/wall_garrisoned.json @@ -2,9 +2,9 @@ "type": "garrisonedUnits", "affects": ["Soldier"], "modifications": [ - { "value": "Armour/Hack", "add": 3 }, - { "value": "Armour/Pierce", "add": 3 }, - { "value": "Armour/Crush", "add": 3 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 3 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 3 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 3 }, { "value": "Vision/Range", "add": 20 } ], "auraName": "Wall Protection", diff --git a/binaries/data/mods/public/simulation/data/auras/units/catafalques/cart_catafalque.json b/binaries/data/mods/public/simulation/data/auras/units/catafalques/cart_catafalque.json index 16272adf4e..a423ebec67 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/catafalques/cart_catafalque.json +++ b/binaries/data/mods/public/simulation/data/auras/units/catafalques/cart_catafalque.json @@ -2,9 +2,9 @@ "type": "global", "affects": ["Melee Cavalry"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 }, { "value": "Health/Max", "multiply": 1.1 } ], "auraName": "Commander of Heavy Cavalry", diff --git a/binaries/data/mods/public/simulation/data/auras/units/catafalques/rome_catafalque_2.json b/binaries/data/mods/public/simulation/data/auras/units/catafalques/rome_catafalque_2.json index f7614e2789..c6a60a4b96 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/catafalques/rome_catafalque_2.json +++ b/binaries/data/mods/public/simulation/data/auras/units/catafalques/rome_catafalque_2.json @@ -2,9 +2,9 @@ "type": "global", "affects": ["Human", "Siege"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 } + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 } ], "auraName": "Founder and Defender of the Republic", "auraDescription": "Brutus was one of the key figures in the overthrow of the monarchy and the founding of the Roman Republic. Later, as consul he led a Roman army to victory against the Etruscan King Tarquinius who sought to retake the throne.\nHumans and Siege Engines +1 armor." diff --git a/binaries/data/mods/public/simulation/data/auras/units/heroes/athen_hero_iphicrates_1.json b/binaries/data/mods/public/simulation/data/auras/units/heroes/athen_hero_iphicrates_1.json index 05ef6a24be..7263f12735 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/heroes/athen_hero_iphicrates_1.json +++ b/binaries/data/mods/public/simulation/data/auras/units/heroes/athen_hero_iphicrates_1.json @@ -2,9 +2,9 @@ "type": "formation", "affects": ["Soldier"], "modifications": [ - { "value": "Armour/Hack", "add": 3 }, - { "value": "Armour/Pierce", "add": 3 }, - { "value": "Armour/Crush", "add": 3 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 3 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 3 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 3 }, { "value": "UnitMotion/WalkSpeed", "multiply": 1.15 } ], "auraName": "Formation Reforms", diff --git a/binaries/data/mods/public/simulation/data/auras/units/heroes/brit_hero_caratacos.json b/binaries/data/mods/public/simulation/data/auras/units/heroes/brit_hero_caratacos.json index f2457b3c90..8eeeff81ad 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/heroes/brit_hero_caratacos.json +++ b/binaries/data/mods/public/simulation/data/auras/units/heroes/brit_hero_caratacos.json @@ -2,9 +2,9 @@ "type": "global", "affects": ["Soldier", "Siege"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 }, { "value": "UnitMotion/WalkSpeed", "multiply": 1.15 } ], "auraName": "Guerrilla Chief", diff --git a/binaries/data/mods/public/simulation/data/auras/units/heroes/iber_hero_caros_2.json b/binaries/data/mods/public/simulation/data/auras/units/heroes/iber_hero_caros_2.json index ebceb972dd..8d4279136e 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/heroes/iber_hero_caros_2.json +++ b/binaries/data/mods/public/simulation/data/auras/units/heroes/iber_hero_caros_2.json @@ -3,9 +3,9 @@ "radius": 50, "affects": ["Soldier"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 } + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 } ], "auraDescription": "Soldiers +1 armor.", "auraName": "Battle Fervor", diff --git a/binaries/data/mods/public/simulation/data/auras/units/heroes/mace_hero_demetrius.json b/binaries/data/mods/public/simulation/data/auras/units/heroes/mace_hero_demetrius.json index 9f030a4b7b..debf048f47 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/heroes/mace_hero_demetrius.json +++ b/binaries/data/mods/public/simulation/data/auras/units/heroes/mace_hero_demetrius.json @@ -3,9 +3,9 @@ "radius": 60, "affects": ["Siege"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 }, { "value": "Attack/Melee/Damage/Hack", "multiply": 1.2 }, { "value": "Attack/Melee/Damage/Pierce", "multiply": 1.2 }, { "value": "Attack/Melee/Damage/Crush", "multiply": 1.2 }, diff --git a/binaries/data/mods/public/simulation/data/auras/units/heroes/rome_hero_maximus.json b/binaries/data/mods/public/simulation/data/auras/units/heroes/rome_hero_maximus.json index eaa316e50b..403b4c79a9 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/heroes/rome_hero_maximus.json +++ b/binaries/data/mods/public/simulation/data/auras/units/heroes/rome_hero_maximus.json @@ -2,9 +2,9 @@ "type": "global", "affects": ["Human", "Structure"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 } + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 } ], "auraName": "Shield of Rome", "auraDescription": "Humans and Structures +1 armor." diff --git a/binaries/data/mods/public/simulation/data/auras/units/heroes/sele_hero_antiochus_great.json b/binaries/data/mods/public/simulation/data/auras/units/heroes/sele_hero_antiochus_great.json index 56030fb0f9..3c6711eacc 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/heroes/sele_hero_antiochus_great.json +++ b/binaries/data/mods/public/simulation/data/auras/units/heroes/sele_hero_antiochus_great.json @@ -3,9 +3,9 @@ "radius": 45, "affects": ["Cavalry"], "modifications": [ - { "value": "Armour/Hack", "add": 2 }, - { "value": "Armour/Pierce", "add": 2 }, - { "value": "Armour/Crush", "add": 2 } + { "value": "Resistance/Entity/Damage/Hack", "add": 2 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 2 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 2 } ], "auraName": "Ilarchès", "auraDescription": "Cavalry +2 armor." diff --git a/binaries/data/mods/public/simulation/data/auras/units/heroes/spart_hero_brasidas.json b/binaries/data/mods/public/simulation/data/auras/units/heroes/spart_hero_brasidas.json index 05ae7816a5..8fa132c906 100644 --- a/binaries/data/mods/public/simulation/data/auras/units/heroes/spart_hero_brasidas.json +++ b/binaries/data/mods/public/simulation/data/auras/units/heroes/spart_hero_brasidas.json @@ -3,9 +3,9 @@ "radius": 60, "affects": ["Citizen Infantry Javelineer"], "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 }, { "value": "Attack/Ranged/Damage/Pierce", "multiply": 1.25 } ], "auraName": "Helot Reforms", diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_cav_01.json b/binaries/data/mods/public/simulation/data/technologies/armor_cav_01.json index 9fb7cc7003..65c95be85f 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_cav_01.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_cav_01.json @@ -15,8 +15,8 @@ "researchTime": 40, "tooltip": "Cavalry +1 hack and pierce armor.", "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 } + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 } ], "affects": ["Cavalry"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_cav_02.json b/binaries/data/mods/public/simulation/data/technologies/armor_cav_02.json index ca4dd8c99b..5f4f073024 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_cav_02.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_cav_02.json @@ -9,8 +9,8 @@ "researchTime": 40, "tooltip": "Cavalry +1 hack and pierce armor.", "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 } + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 } ], "affects": ["Cavalry"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_hero_01.json b/binaries/data/mods/public/simulation/data/technologies/armor_hero_01.json index 01e0166ca9..0ac8b18500 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_hero_01.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_hero_01.json @@ -16,8 +16,8 @@ "researchTime": 40, "tooltip": "Heroes +50 metal cost, +2 hack and pierce armor.", "modifications": [ - { "value": "Armour/Hack", "add": 2 }, - { "value": "Armour/Pierce", "add": 2 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 2 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 2 }, { "value": "Cost/Resources/metal", "add": 50 } ], "affects": ["Hero"], diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_infantry_01.json b/binaries/data/mods/public/simulation/data/technologies/armor_infantry_01.json index 286ee918b0..5215e275bf 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_infantry_01.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_infantry_01.json @@ -21,8 +21,8 @@ "researchTime": 40, "tooltip": "Infantry +1 hack and pierce armor.", "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 } + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 } ], "affects": ["Infantry"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_infantry_02.json b/binaries/data/mods/public/simulation/data/technologies/armor_infantry_02.json index 74a6ed192a..777170cce7 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_infantry_02.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_infantry_02.json @@ -19,8 +19,8 @@ "researchTime": 40, "tooltip": "Infantry +1 hack and pierce armor.", "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 } + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 } ], "affects": ["Infantry"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_ship_hullsheathing.json b/binaries/data/mods/public/simulation/data/technologies/armor_ship_hullsheathing.json index 8ce33b4e07..4afb1ed14f 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_ship_hullsheathing.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_ship_hullsheathing.json @@ -9,9 +9,9 @@ "researchTime": 40, "tooltip": "Ships +2 armor.", "modifications": [ - { "value": "Armour/Hack", "add": 2 }, - { "value": "Armour/Pierce", "add": 2 }, - { "value": "Armour/Crush", "add": 2 } + { "value": "Resistance/Entity/Damage/Hack", "add": 2 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 2 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 2 } ], "affects": ["Ship"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_ship_hypozomata.json b/binaries/data/mods/public/simulation/data/technologies/armor_ship_hypozomata.json index f9908982fc..0e6c2cfb0a 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_ship_hypozomata.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_ship_hypozomata.json @@ -9,9 +9,9 @@ "researchTime": 40, "tooltip": "Ships +2 armor.", "modifications": [ - { "value": "Armour/Hack", "add": 2 }, - { "value": "Armour/Pierce", "add": 2 }, - { "value": "Armour/Crush", "add": 2 } + { "value": "Resistance/Entity/Damage/Hack", "add": 2 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 2 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 2 } ], "affects": ["Ship"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/armor_ship_reinforcedhull.json b/binaries/data/mods/public/simulation/data/technologies/armor_ship_reinforcedhull.json index 34390f85ba..c48279bfc2 100644 --- a/binaries/data/mods/public/simulation/data/technologies/armor_ship_reinforcedhull.json +++ b/binaries/data/mods/public/simulation/data/technologies/armor_ship_reinforcedhull.json @@ -8,9 +8,9 @@ "researchTime": 40, "tooltip": "Ships +2 armor.", "modifications": [ - { "value": "Armour/Hack", "add": 2 }, - { "value": "Armour/Pierce", "add": 2 }, - { "value": "Armour/Crush", "add": 2 } + { "value": "Resistance/Entity/Damage/Hack", "add": 2 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 2 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 2 } ], "affects": ["Ship"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/siege_armor.json b/binaries/data/mods/public/simulation/data/technologies/siege_armor.json index 2fdbe90643..ed37c66acc 100644 --- a/binaries/data/mods/public/simulation/data/technologies/siege_armor.json +++ b/binaries/data/mods/public/simulation/data/technologies/siege_armor.json @@ -8,7 +8,7 @@ "researchTime": 40, "tooltip": "Siege Engines +2 hack armor.", "modifications": [ - { "value": "Armour/Hack", "add": 2 } + { "value": "Resistance/Entity/Damage/Hack", "add": 2 } ], "affects": ["Siege"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/tower_armour.json b/binaries/data/mods/public/simulation/data/technologies/tower_armour.json index a8c9a8247d..73309632c6 100644 --- a/binaries/data/mods/public/simulation/data/technologies/tower_armour.json +++ b/binaries/data/mods/public/simulation/data/technologies/tower_armour.json @@ -8,9 +8,9 @@ "researchTime": 40, "tooltip": "Towers +2 armor.", "modifications": [ - { "value": "Armour/Hack", "add": 2 }, - { "value": "Armour/Pierce", "add": 2 }, - { "value": "Armour/Crush", "add": 2 } + { "value": "Resistance/Entity/Damage/Hack", "add": 2 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 2 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 2 } ], "affects": ["Tower"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/trade_convoys_armor.json b/binaries/data/mods/public/simulation/data/technologies/trade_convoys_armor.json index 3b6c57ed1e..11e29fd495 100644 --- a/binaries/data/mods/public/simulation/data/technologies/trade_convoys_armor.json +++ b/binaries/data/mods/public/simulation/data/technologies/trade_convoys_armor.json @@ -9,8 +9,8 @@ "researchTime": 40, "tooltip": "Traders +2 hack and pierce armor.", "modifications": [ - { "value": "Armour/Hack", "add": 2 }, - { "value": "Armour/Pierce", "add": 2 } + { "value": "Resistance/Entity/Damage/Hack", "add": 2 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 2 } ], "affects": ["Trader"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/unit_advanced.json b/binaries/data/mods/public/simulation/data/technologies/unit_advanced.json index bc940bc943..cee83d999d 100644 --- a/binaries/data/mods/public/simulation/data/technologies/unit_advanced.json +++ b/binaries/data/mods/public/simulation/data/technologies/unit_advanced.json @@ -3,9 +3,9 @@ "icon": "upgrade_advanced.png", "tooltip": "Advanced and Elite units +20% training time, +1 armor, +10% health, +0.7 capture attack strength, +20% loot, and −30% gather speed; Healers +5 healing strength and +3 healing range; Melee units +20% attack damage; Ranged units +4 attack range and −10% spread.", "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 }, { "value": "Attack/Capture/Capture", "add": 0.7 }, { "value": "Attack/Melee/Damage/Hack", "multiply": 1.2, "affects": "Melee" }, { "value": "Attack/Melee/Damage/Pierce", "multiply": 1.2, "affects": "Melee" }, diff --git a/binaries/data/mods/public/simulation/data/technologies/unit_elite.json b/binaries/data/mods/public/simulation/data/technologies/unit_elite.json index 8de66b46de..f2e6bf1e18 100644 --- a/binaries/data/mods/public/simulation/data/technologies/unit_elite.json +++ b/binaries/data/mods/public/simulation/data/technologies/unit_elite.json @@ -3,9 +3,9 @@ "icon": "upgrade_elite.png", "tooltip": "Elite units +20% training time, +1 armor, +10% health, +0.8 capture attack strength, +20% loot, and −30% gather speed; Healers +5 healing strength and +3 healing range; Melee units +20% attack damage; Ranged units +4 attack range and −10% spread.", "modifications": [ - { "value": "Armour/Hack", "add": 1 }, - { "value": "Armour/Pierce", "add": 1 }, - { "value": "Armour/Crush", "add": 1 }, + { "value": "Resistance/Entity/Damage/Hack", "add": 1 }, + { "value": "Resistance/Entity/Damage/Pierce", "add": 1 }, + { "value": "Resistance/Entity/Damage/Crush", "add": 1 }, { "value": "Attack/Capture/Capture", "add": 0.8 }, { "value": "Attack/Melee/Damage/Hack", "multiply": 1.2, "affects": "Melee" }, { "value": "Attack/Melee/Damage/Pierce", "multiply": 1.2, "affects": "Melee" }, diff --git a/binaries/data/mods/public/simulation/helpers/Attacking.js b/binaries/data/mods/public/simulation/helpers/Attacking.js index e84fc40893..a785be2c99 100644 --- a/binaries/data/mods/public/simulation/helpers/Attacking.js +++ b/binaries/data/mods/public/simulation/helpers/Attacking.js @@ -7,10 +7,7 @@ const DirectEffectsSchema = "" + "" + "" + - "" + - // Armour requires Foundation to not be a damage type. - "Foundation" + - "" + + "" + "" + "" + "" + @@ -168,15 +165,41 @@ Attacking.prototype.GetStatusEffectsModifications = function(valueModifRoot, tem return modifiers; }; -Attacking.prototype.GetTotalAttackEffects = function(effectData, effectType, cmpResistance) +/** + * Calculate the total effect taking bonus and resistance into account. + * + * @param {number} target - The target of the attack. + * @param {Object} effectData - The effects calculate the effect for. + * @param {string} effectType - The type of effect to apply (e.g. Damage, Capture or StatusEffect). + * @param {number} bonusMultiplier - The factor to multiply the total effect with. + * @param {Object} cmpResistance - Optionally the resistance component of the target. + * + * @return {number} - The total value of the effect. + */ +Attacking.prototype.GetTotalAttackEffects = function(target, effectData, effectType, bonusMultiplier, cmpResistance) { let total = 0; - let armourStrengths = cmpResistance ? cmpResistance.GetArmourStrengths(effectType) : {}; + if (!cmpResistance) + cmpResistance = Engine.QueryInterface(target, IID_Resistance); - for (let type in effectData) - total += effectData[type] * Math.pow(0.9, armourStrengths[type] || 0); + let resistanceStrengths = cmpResistance ? cmpResistance.GetEffectiveResistanceAgainst(effectType) : {}; - return total; + if (effectType == "Damage") + for (let type in effectData.Damage) + total += effectData.Damage[type] * Math.pow(0.9, resistanceStrengths.Damage ? resistanceStrengths.Damage[type] || 0 : 0); + else if (effectType == "Capture") + { + total = effectData.Capture * Math.pow(0.9, resistanceStrengths.Capture || 0); + + // If Health is lower we are more susceptible to capture attacks. + let cmpHealth = Engine.QueryInterface(target, IID_Health); + if (cmpHealth) + total /= 0.1 + 0.9 * cmpHealth.GetHitpoints() / cmpHealth.GetMaxHitpoints(); + } + else if (effectType == "StatusEffect") + return effectData[effectType]; + + return total * bonusMultiplier; }; /** @@ -302,12 +325,27 @@ Attacking.prototype.CauseDamageOverArea = function(data) warn("The " + data.shape + " splash damage shape is not implemented!"); } - this.HandleAttackEffects(data.type + ".Splash", data.attackData, ent, data.attacker, data.attackerOwner, damageMultiplier); + this.HandleAttackEffects(ent, data.type + ".Splash", data.attackData, data.attacker, data.attackerOwner, damageMultiplier); } }; - -Attacking.prototype.HandleAttackEffects = function(attackType, attackData, target, attacker, attackerOwner, bonusMultiplier = 1) +/** + * Handle an attack peformed on an entity. + * + * @param {number} target - The targetted entityID. + * @param {string} attackType - The type of attack that was performed (e.g. "Melee" or "Capture"). + * @param {Object} effectData - The effects use. + * @param {number} attacker - The entityID that attacked us. + * @param {number} attackerOwner - The playerID that owned the attacker when the attack was performed. + * @param {number} bonusMultiplier - The factor to multiply the total effect with, defaults to 1. + * + * @return {boolean} - Whether we handled the attack. + */ +Attacking.prototype.HandleAttackEffects = function(target, attackType, attackData, attacker, attackerOwner, bonusMultiplier = 1) { + let cmpResistance = Engine.QueryInterface(target, IID_Resistance); + if (cmpResistance && cmpResistance.IsInvulnerable()) + return false; + bonusMultiplier *= !attackData.Bonuses ? 1 : this.GetAttackBonus(attacker, target, attackType, attackData.Bonuses); let targetState = {}; @@ -321,10 +359,11 @@ Attacking.prototype.HandleAttackEffects = function(attackType, attackData, targe if (!cmpReceiver) continue; - Object.assign(targetState, cmpReceiver[receiver.method](attackData[effectType], attacker, attackerOwner, bonusMultiplier)); + Object.assign(targetState, cmpReceiver[receiver.method](this.GetTotalAttackEffects(target, attackData, effectType, bonusMultiplier, cmpResistance), attacker, attackerOwner)); } + if (!Object.keys(targetState).length) - return; + return false; Engine.PostMessage(target, MT_Attacked, { "type": attackType, @@ -339,11 +378,13 @@ Attacking.prototype.HandleAttackEffects = function(attackType, attackData, targe // We do not want an entity to get XP from active Status Effects. if (!!attackData.StatusEffect) - return; + return true; let cmpPromotion = Engine.QueryInterface(attacker, IID_Promotion); if (cmpPromotion && targetState.xp) cmpPromotion.IncreaseXp(targetState.xp); + + return true; }; /** diff --git a/binaries/data/mods/public/simulation/helpers/tests/test_Attacking.js b/binaries/data/mods/public/simulation/helpers/tests/test_Attacking.js old mode 100755 new mode 100644 index b0e47de8bf..f600c3c020 --- a/binaries/data/mods/public/simulation/helpers/tests/test_Attacking.js +++ b/binaries/data/mods/public/simulation/helpers/tests/test_Attacking.js @@ -1,8 +1,8 @@ Engine.LoadHelperScript("Attacking.js"); -Engine.LoadComponentScript("interfaces/Attack.js"); Engine.LoadComponentScript("interfaces/Capturable.js"); Engine.LoadComponentScript("interfaces/Health.js"); Engine.LoadComponentScript("interfaces/Promotion.js"); +Engine.LoadComponentScript("interfaces/Resistance.js"); // Unit tests for the Attacking helper. // TODO: Some of it is tested in components/test_Damage.js, which should be spliced and moved. @@ -13,8 +13,8 @@ class testHandleAttackEffects { this.TESTED_ENTITY_ID = 5; this.attackData = { - "Damage": "Uniquely Hashed Value", - "Capture": "Something Else Entirely", + "Damage": "1", + "Capture": "2" }; } @@ -24,13 +24,15 @@ class testHandleAttackEffects { testMultipleEffects() { AddMock(this.TESTED_ENTITY_ID, IID_Health, { "TakeDamage": x => { this.resultString += x; }, + "GetHitpoints": () => 1, + "GetMaxHitpoints": () => 1, }); AddMock(this.TESTED_ENTITY_ID, IID_Capturable, { "Capture": x => { this.resultString += x; }, }); - Attacking.HandleAttackEffects("Test", this.attackData, this.TESTED_ENTITY_ID, INVALID_ENTITY, INVALID_PLAYER); + Attacking.HandleAttackEffects(this.TESTED_ENTITY_ID, "Test", this.attackData, INVALID_ENTITY, INVALID_PLAYER); TS_ASSERT(this.resultString.indexOf(this.attackData.Damage) !== -1); TS_ASSERT(this.resultString.indexOf(this.attackData.Capture) !== -1); @@ -44,7 +46,7 @@ class testHandleAttackEffects { "Capture": x => { this.resultString += x; }, }); - Attacking.HandleAttackEffects("Test", this.attackData, this.TESTED_ENTITY_ID, INVALID_ENTITY, INVALID_PLAYER); + Attacking.HandleAttackEffects(this.TESTED_ENTITY_ID, "Test", this.attackData, INVALID_ENTITY, INVALID_PLAYER); TS_ASSERT(this.resultString.indexOf(this.attackData.Damage) === -1); TS_ASSERT(this.resultString.indexOf(this.attackData.Capture) !== -1); @@ -52,9 +54,11 @@ class testHandleAttackEffects { DeleteMock(this.TESTED_ENTITY_ID, IID_Capturable); AddMock(this.TESTED_ENTITY_ID, IID_Health, { "TakeDamage": x => { this.resultString += x; }, + "GetHitpoints": () => 1, + "GetMaxHitpoints": () => 1, }); - Attacking.HandleAttackEffects("Test", this.attackData, this.TESTED_ENTITY_ID, INVALID_ENTITY, INVALID_PLAYER); + Attacking.HandleAttackEffects(this.TESTED_ENTITY_ID, "Test", this.attackData, INVALID_ENTITY, INVALID_PLAYER); TS_ASSERT(this.resultString.indexOf(this.attackData.Damage) !== -1); TS_ASSERT(this.resultString.indexOf(this.attackData.Capture) === -1); } @@ -64,22 +68,24 @@ class testHandleAttackEffects { */ testAttackedMessage() { Engine.PostMessage = () => TS_ASSERT(false); - Attacking.HandleAttackEffects("Test", this.attackData, this.TESTED_ENTITY_ID, INVALID_ENTITY, INVALID_PLAYER); + Attacking.HandleAttackEffects(this.TESTED_ENTITY_ID, "Test", this.attackData, INVALID_ENTITY, INVALID_PLAYER); AddMock(this.TESTED_ENTITY_ID, IID_Capturable, { "Capture": () => ({ "captureChange": 0 }), }); let count = 0; Engine.PostMessage = () => count++; - Attacking.HandleAttackEffects("Test", this.attackData, this.TESTED_ENTITY_ID, INVALID_ENTITY, INVALID_PLAYER); + Attacking.HandleAttackEffects(this.TESTED_ENTITY_ID, "Test", this.attackData, INVALID_ENTITY, INVALID_PLAYER); TS_ASSERT_EQUALS(count, 1); AddMock(this.TESTED_ENTITY_ID, IID_Health, { "TakeDamage": () => ({ "healthChange": 0 }), + "GetHitpoints": () => 1, + "GetMaxHitpoints": () => 1, }); count = 0; Engine.PostMessage = () => count++; - Attacking.HandleAttackEffects("Test", this.attackData, this.TESTED_ENTITY_ID, INVALID_ENTITY, INVALID_PLAYER); + Attacking.HandleAttackEffects(this.TESTED_ENTITY_ID, "Test", this.attackData, INVALID_ENTITY, INVALID_PLAYER); TS_ASSERT_EQUALS(count, 1); } @@ -88,13 +94,19 @@ class testHandleAttackEffects { */ testBonusMultiplier() { AddMock(this.TESTED_ENTITY_ID, IID_Health, { - "TakeDamage": (_, __, ___, mult) => { TS_ASSERT_EQUALS(mult, 2); }, + "TakeDamage": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, this.attackData.Damage * 2); + }, + "GetHitpoints": () => 1, + "GetMaxHitpoints": () => 1, }); AddMock(this.TESTED_ENTITY_ID, IID_Capturable, { - "Capture": (_, __, ___, mult) => { TS_ASSERT_EQUALS(mult, 2); }, + "Capture": (amount, __, ___) => { + TS_ASSERT_EQUALS(amount, this.attackData.Capture * 2); + }, }); - Attacking.HandleAttackEffects("Test", this.attackData, this.TESTED_ENTITY_ID, INVALID_ENTITY, INVALID_PLAYER, 2); + Attacking.HandleAttackEffects(this.TESTED_ENTITY_ID, "Test", this.attackData, INVALID_ENTITY, INVALID_PLAYER, 2); } } diff --git a/binaries/data/mods/public/simulation/templates/campaigns/army_mace_hero_alexander.xml b/binaries/data/mods/public/simulation/templates/campaigns/army_mace_hero_alexander.xml index 89b34ccfd6..02a77eb0cd 100644 --- a/binaries/data/mods/public/simulation/templates/campaigns/army_mace_hero_alexander.xml +++ b/binaries/data/mods/public/simulation/templates/campaigns/army_mace_hero_alexander.xml @@ -1,8 +1,12 @@ - - 20 - + + + + 20 + + + 7.0 diff --git a/binaries/data/mods/public/simulation/templates/campaigns/army_spart_hero_leonidas.xml b/binaries/data/mods/public/simulation/templates/campaigns/army_spart_hero_leonidas.xml index 03b3eca1cf..2a5d1290b6 100644 --- a/binaries/data/mods/public/simulation/templates/campaigns/army_spart_hero_leonidas.xml +++ b/binaries/data/mods/public/simulation/templates/campaigns/army_spart_hero_leonidas.xml @@ -1,8 +1,12 @@ - - 20 - + + + + 20 + + + 7.0 diff --git a/binaries/data/mods/public/simulation/templates/gaia/fauna_hippopotamus.xml b/binaries/data/mods/public/simulation/templates/gaia/fauna_hippopotamus.xml index 7a89b756d8..27f21e96cf 100644 --- a/binaries/data/mods/public/simulation/templates/gaia/fauna_hippopotamus.xml +++ b/binaries/data/mods/public/simulation/templates/gaia/fauna_hippopotamus.xml @@ -1,10 +1,14 @@ - - 3 - 4 - 5 - + + + + 3 + 4 + 5 + + + diff --git a/binaries/data/mods/public/simulation/templates/gaia/fauna_walrus.xml b/binaries/data/mods/public/simulation/templates/gaia/fauna_walrus.xml index c89091af4c..61c83812ad 100644 --- a/binaries/data/mods/public/simulation/templates/gaia/fauna_walrus.xml +++ b/binaries/data/mods/public/simulation/templates/gaia/fauna_walrus.xml @@ -1,10 +1,14 @@ - - 3 - 4 - 5 - + + + + 3 + 4 + 5 + + + diff --git a/binaries/data/mods/public/simulation/templates/other/bench.xml b/binaries/data/mods/public/simulation/templates/other/bench.xml index 83a71c495e..c58b90201d 100644 --- a/binaries/data/mods/public/simulation/templates/other/bench.xml +++ b/binaries/data/mods/public/simulation/templates/other/bench.xml @@ -1,10 +1,14 @@ - - 1 - 10 - 1 - + + + + 1 + 10 + 1 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/column_doric.xml b/binaries/data/mods/public/simulation/templates/other/column_doric.xml index a97183b5e8..106a8402ee 100644 --- a/binaries/data/mods/public/simulation/templates/other/column_doric.xml +++ b/binaries/data/mods/public/simulation/templates/other/column_doric.xml @@ -1,10 +1,14 @@ - - 2 - 5 - 2 - + + + + 2 + 5 + 2 + + + Fence diff --git a/binaries/data/mods/public/simulation/templates/other/column_doric_fallen.xml b/binaries/data/mods/public/simulation/templates/other/column_doric_fallen.xml index ad21199d87..487e04b231 100644 --- a/binaries/data/mods/public/simulation/templates/other/column_doric_fallen.xml +++ b/binaries/data/mods/public/simulation/templates/other/column_doric_fallen.xml @@ -1,10 +1,14 @@ - - 2 - 5 - 2 - + + + + 2 + 5 + 2 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/column_doric_fallen_b.xml b/binaries/data/mods/public/simulation/templates/other/column_doric_fallen_b.xml index bc81db9598..1da43b18a7 100644 --- a/binaries/data/mods/public/simulation/templates/other/column_doric_fallen_b.xml +++ b/binaries/data/mods/public/simulation/templates/other/column_doric_fallen_b.xml @@ -1,10 +1,14 @@ - - 2 - 5 - 2 - + + + + 2 + 5 + 2 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/fence_long.xml b/binaries/data/mods/public/simulation/templates/other/fence_long.xml index cb15f076b1..c1a1fd5ae7 100644 --- a/binaries/data/mods/public/simulation/templates/other/fence_long.xml +++ b/binaries/data/mods/public/simulation/templates/other/fence_long.xml @@ -1,10 +1,14 @@ - - 1 - 10 - 1 - + + + + 1 + 10 + 1 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/fence_short.xml b/binaries/data/mods/public/simulation/templates/other/fence_short.xml index 75f744ab68..9e0310aeae 100644 --- a/binaries/data/mods/public/simulation/templates/other/fence_short.xml +++ b/binaries/data/mods/public/simulation/templates/other/fence_short.xml @@ -1,10 +1,14 @@ - - 1 - 10 - 1 - + + + + 1 + 10 + 1 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/fence_stone.xml b/binaries/data/mods/public/simulation/templates/other/fence_stone.xml index df961dec76..3d77e8cbfc 100644 --- a/binaries/data/mods/public/simulation/templates/other/fence_stone.xml +++ b/binaries/data/mods/public/simulation/templates/other/fence_stone.xml @@ -1,10 +1,14 @@ - - 2 - 10 - 2 - + + + + 2 + 10 + 2 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/obelisk.xml b/binaries/data/mods/public/simulation/templates/other/obelisk.xml index cad94a8973..bdb6438f5d 100644 --- a/binaries/data/mods/public/simulation/templates/other/obelisk.xml +++ b/binaries/data/mods/public/simulation/templates/other/obelisk.xml @@ -1,10 +1,14 @@ - - 2 - 10 - 2 - + + + + 2 + 10 + 2 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/sele_colonnade.xml b/binaries/data/mods/public/simulation/templates/other/sele_colonnade.xml index 4539204b0c..4e8da0f4a3 100644 --- a/binaries/data/mods/public/simulation/templates/other/sele_colonnade.xml +++ b/binaries/data/mods/public/simulation/templates/other/sele_colonnade.xml @@ -1,10 +1,14 @@ - - 2 - 5 - 2 - + + + + 2 + 5 + 2 + + + Fence diff --git a/binaries/data/mods/public/simulation/templates/other/table_rectangle.xml b/binaries/data/mods/public/simulation/templates/other/table_rectangle.xml index 71ccfa6fa9..a8477beff9 100644 --- a/binaries/data/mods/public/simulation/templates/other/table_rectangle.xml +++ b/binaries/data/mods/public/simulation/templates/other/table_rectangle.xml @@ -1,10 +1,14 @@ - - 1 - 10 - 1 - + + + + 1 + 10 + 1 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/other/table_square.xml b/binaries/data/mods/public/simulation/templates/other/table_square.xml index f68c61f1b8..bacf07268f 100644 --- a/binaries/data/mods/public/simulation/templates/other/table_square.xml +++ b/binaries/data/mods/public/simulation/templates/other/table_square.xml @@ -1,10 +1,14 @@ - - 1 - 10 - 1 - + + + + 1 + 10 + 1 + + + Special diff --git a/binaries/data/mods/public/simulation/templates/special/filter/foundation.xml b/binaries/data/mods/public/simulation/templates/special/filter/foundation.xml index 0e6a4c6d80..f3c567ce4c 100644 --- a/binaries/data/mods/public/simulation/templates/special/filter/foundation.xml +++ b/binaries/data/mods/public/simulation/templates/special/filter/foundation.xml @@ -1,7 +1,7 @@ - + diff --git a/binaries/data/mods/public/simulation/templates/structures/cart_super_dock.xml b/binaries/data/mods/public/simulation/templates/structures/cart_super_dock.xml index e8ef13862f..9e5e26775b 100644 --- a/binaries/data/mods/public/simulation/templates/structures/cart_super_dock.xml +++ b/binaries/data/mods/public/simulation/templates/structures/cart_super_dock.xml @@ -1,8 +1,12 @@ - - 35 - + + + + 35 + + + structures/cart_super_dock_repair diff --git a/binaries/data/mods/public/simulation/templates/structures/rome_army_camp.xml b/binaries/data/mods/public/simulation/templates/structures/rome_army_camp.xml index eec909100c..bd59b03375 100644 --- a/binaries/data/mods/public/simulation/templates/structures/rome_army_camp.xml +++ b/binaries/data/mods/public/simulation/templates/structures/rome_army_camp.xml @@ -1,15 +1,21 @@ - - 15 - 25 - 2 + + + + 15 + 25 + 2 + + - 1 - 5 - 1 + + 1 + 5 + 1 + - + diff --git a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_gate.xml b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_gate.xml index 9e05827e38..5d8dc1f7e2 100644 --- a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_gate.xml +++ b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_gate.xml @@ -1,15 +1,21 @@ - - 15 - 35 - 5 + + + + 15 + 35 + 5 + + - 4 - 7 - 3 + + 4 + 7 + 3 + - + own neutral enemy diff --git a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_long.xml b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_long.xml index 4d444230e4..e180ce168d 100644 --- a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_long.xml +++ b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_long.xml @@ -1,15 +1,21 @@ - - 15 - 35 - 5 + + + + 15 + 35 + 5 + + - 4 - 7 - 3 + + 4 + 7 + 3 + - + own neutral enemy diff --git a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_medium.xml b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_medium.xml index 61907ad5ff..2c3bd8d4e4 100644 --- a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_medium.xml +++ b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_medium.xml @@ -1,15 +1,21 @@ - - 15 - 35 - 5 + + + + 15 + 35 + 5 + + - 4 - 7 - 3 + + 4 + 7 + 3 + - + own neutral enemy diff --git a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_short.xml b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_short.xml index 7e5da85a58..81c00a52e8 100644 --- a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_short.xml +++ b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_short.xml @@ -1,15 +1,21 @@ - - 15 - 35 - 5 + + + + 15 + 35 + 5 + + - 4 - 7 - 3 + + 4 + 7 + 3 + - + own neutral enemy diff --git a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_tower.xml b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_tower.xml index e649992762..5c96349b3f 100644 --- a/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_tower.xml +++ b/binaries/data/mods/public/simulation/templates/structures/rome_siege_wall_tower.xml @@ -1,15 +1,21 @@ - - 15 - 35 - 5 + + + + 15 + 35 + 5 + + - 4 - 7 - 3 + + 4 + 7 + 3 + - + own neutral enemy diff --git a/binaries/data/mods/public/simulation/templates/template_structure.xml b/binaries/data/mods/public/simulation/templates/template_structure.xml index 8891cd6f8f..0dbd70c903 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure.xml @@ -1,16 +1,22 @@ - - 1 - 1 - 1 + + + + 1 + 1 + 1 + + - 1 - 1 - 1 + + 1 + 1 + 1 + - + 0 0 diff --git a/binaries/data/mods/public/simulation/templates/template_structure_civic.xml b/binaries/data/mods/public/simulation/templates/template_structure_civic.xml index c8e5a9e333..41617b6282 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_civic.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_civic.xml @@ -1,15 +1,21 @@ - - 20 - 30 - 3 + + + + 20 + 30 + 3 + + - 1 - 5 - 1 + + 1 + 5 + 1 + - + ConquestCritical Civic Structure diff --git a/binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml b/binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml index 89810842b8..51b18bbeeb 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_civic_civil_centre.xml @@ -6,15 +6,21 @@ 190 100 - - 5 - 5 + + + + 5 + 5 + + - 5 - 15 - 3 + + 5 + 15 + 3 + - + diff --git a/binaries/data/mods/public/simulation/templates/template_structure_defensive.xml b/binaries/data/mods/public/simulation/templates/template_structure_defensive.xml index 7665ac0c45..e792d3d7e7 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_defensive.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_defensive.xml @@ -1,15 +1,21 @@ - - 25 - 30 - 3 + + + + 25 + 30 + 3 + + - 1 - 5 - 1 + + 1 + 5 + 1 + - + Defensive Structure Defensive diff --git a/binaries/data/mods/public/simulation/templates/template_structure_defensive_palisade.xml b/binaries/data/mods/public/simulation/templates/template_structure_defensive_palisade.xml index ff5c7020a7..d50c28da7d 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_defensive_palisade.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_defensive_palisade.xml @@ -1,10 +1,14 @@ - - 4 - 25 - 2 - + + + + 4 + 25 + 2 + + + land-shore Wall diff --git a/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_outpost.xml b/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_outpost.xml index ebcbaf8ad9..668590e493 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_outpost.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_outpost.xml @@ -1,15 +1,21 @@ - - 5 - 20 - 1 + + + + 5 + 20 + 1 + + - 1 - 5 - 1 + + 1 + 5 + 1 + - + diff --git a/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_sentry.xml b/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_sentry.xml index d2bdf135ef..382026dc1e 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_sentry.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_defensive_tower_sentry.xml @@ -1,10 +1,14 @@ - - -5 - -5 - -2 - + + + + -5 + -5 + -2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_structure_economic.xml b/binaries/data/mods/public/simulation/templates/template_structure_economic.xml index 6eeb637cf7..85d480407b 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_economic.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_economic.xml @@ -1,15 +1,21 @@ - - 5 - 20 - 1 + + + + 5 + 20 + 1 + + - 1 - 5 - 1 + + 1 + 5 + 1 + - + Economic Structure Economic diff --git a/binaries/data/mods/public/simulation/templates/template_structure_military.xml b/binaries/data/mods/public/simulation/templates/template_structure_military.xml index 7256201568..01ed8feace 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_military.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_military.xml @@ -1,15 +1,21 @@ - - 20 - 35 - 3 + + + + 20 + 35 + 3 + + - 1 - 5 - 1 + + 1 + 5 + 1 + - + Military diff --git a/binaries/data/mods/public/simulation/templates/template_structure_military_embassy.xml b/binaries/data/mods/public/simulation/templates/template_structure_military_embassy.xml index d4ed6a409b..219f083bc1 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_military_embassy.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_military_embassy.xml @@ -1,13 +1,19 @@ - - 30 + + + + 30 + + - 3 - 10 - 3 + + 3 + 10 + 3 + - + Embassy diff --git a/binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml b/binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml index d74b4071fa..3620a5e4e2 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_military_fortress.xml @@ -1,10 +1,14 @@ - - 5 - 5 - 3 - + + + + 5 + 5 + 3 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_structure_resource.xml b/binaries/data/mods/public/simulation/templates/template_structure_resource.xml index a1e09af02b..348ffb3a97 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_resource.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_resource.xml @@ -1,15 +1,21 @@ - - 1 - 20 - 1 + + + + 1 + 20 + 1 + + - 1 - 10 - 1 + + 1 + 10 + 1 + - + Resource diff --git a/binaries/data/mods/public/simulation/templates/template_structure_resource_field.xml b/binaries/data/mods/public/simulation/templates/template_structure_resource_field.xml index adb7c79774..1e8b0d92ac 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_resource_field.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_resource_field.xml @@ -1,10 +1,14 @@ - - 15 - 40 - 5 - + + + + 15 + 40 + 5 + + + Field diff --git a/binaries/data/mods/public/simulation/templates/template_structure_special.xml b/binaries/data/mods/public/simulation/templates/template_structure_special.xml index 57d55c3718..5c43e1a35f 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_special.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_special.xml @@ -1,15 +1,21 @@ - - 20 - 30 - 3 + + + + 20 + 30 + 3 + + - 3 - 10 - 3 + + 3 + 10 + 3 + - + Special diff --git a/binaries/data/mods/public/simulation/templates/template_structure_wonder.xml b/binaries/data/mods/public/simulation/templates/template_structure_wonder.xml index 62cc277afe..efcfb58677 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_wonder.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_wonder.xml @@ -1,15 +1,21 @@ - - 15 - 25 - 3 + + + + 15 + 25 + 3 + + - 2 - 10 - 2 + + 2 + 10 + 2 + - + structures/wonder_pop_1 structures/wonder_pop_2 diff --git a/binaries/data/mods/public/simulation/templates/template_unit.xml b/binaries/data/mods/public/simulation/templates/template_unit.xml index bfc2ffbded..5578aa7b8c 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit.xml @@ -1,11 +1,15 @@ - - 1 - 1 - 15 - + + + + 1 + 1 + 15 + + + 1 0 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml b/binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml index 0ffc2a92fe..658cd3ade4 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml @@ -1,10 +1,14 @@ - - 3 - 1 - 15 - + + + + 3 + 1 + 15 + + + 2.5 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_axeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_axeman.xml index 4361583bfa..a2ecb4497d 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_axeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_axeman.xml @@ -1,9 +1,13 @@ - - 3 - 2 - + + + + 3 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_spearman.xml b/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_spearman.xml index deeff1fc50..064ec28bee 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_spearman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_spearman.xml @@ -1,9 +1,13 @@ - - 4 - 3 - + + + + 4 + 3 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_swordsman.xml b/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_swordsman.xml index 14f38b52b2..703f06fb38 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_swordsman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_cavalry_melee_swordsman.xml @@ -1,9 +1,13 @@ - - 4 - 2 - + + + + 4 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry.xml index 0f734db78e..8658f1a37e 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry.xml @@ -1,10 +1,14 @@ - - 7 - 5 - 20 - + + + + 7 + 5 + 20 + + + 1 30 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_axeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_axeman.xml index 64f244a88f..70eba57494 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_axeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_axeman.xml @@ -1,8 +1,12 @@ - - 2 - + + + + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_spearman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_spearman.xml index 5d99fda0bb..34d6d3e0d4 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_spearman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_spearman.xml @@ -1,9 +1,13 @@ - - 1 - 2 - + + + + 1 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_swordsman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_swordsman.xml index 954490d19e..85be41b4bc 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_swordsman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry_swordsman.xml @@ -1,9 +1,13 @@ - - 1 - 2 - + + + + 1 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_elephant.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_elephant.xml index 507ef42cfb..0b747cc907 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_elephant.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_elephant.xml @@ -1,10 +1,14 @@ - - 10 - 10 - 25 - + + + + 10 + 10 + 25 + + + 3 30 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry.xml index 27a1c4e35e..dcffa662ce 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry.xml @@ -1,10 +1,14 @@ - - 5 - 5 - 20 - + + + + 5 + 5 + 20 + + + 20 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_axeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_axeman.xml index d6d561122e..375cc52e8f 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_axeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_axeman.xml @@ -1,9 +1,13 @@ - - 2 - 3 - + + + + 2 + 3 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_maceman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_maceman.xml index ba06c764cf..98949cb4ee 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_maceman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_maceman.xml @@ -1,9 +1,13 @@ - - 1 - 1 - + + + + 1 + 1 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_pikeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_pikeman.xml index e7d6b2af13..1081226480 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_pikeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_pikeman.xml @@ -1,10 +1,14 @@ - - 8 - 8 - 20 - + + + + 8 + 8 + 20 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_spearman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_spearman.xml index aa4dc45996..6e76a0839d 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_spearman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_spearman.xml @@ -1,9 +1,13 @@ - - 3 - 3 - + + + + 3 + 3 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_swordsman.xml b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_swordsman.xml index 23d83733a0..0d52347a41 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_swordsman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_champion_infantry_swordsman.xml @@ -1,9 +1,13 @@ - - 3 - 3 - + + + + 3 + 3 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_dog.xml b/binaries/data/mods/public/simulation/templates/template_unit_dog.xml index 8ee45479db..9fbd11b5be 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_dog.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_dog.xml @@ -1,10 +1,14 @@ - - 1 - 2 - 1 - + + + + 1 + 2 + 1 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_defensive_elephant.xml b/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_defensive_elephant.xml index 25975e81ea..533a763d21 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_defensive_elephant.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_defensive_elephant.xml @@ -1,10 +1,14 @@ - - 3 - 4 - 5 - + + + + 3 + 4 + 5 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_skittish_elephant_infant.xml b/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_skittish_elephant_infant.xml index 3e90b7332d..1d10d02927 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_skittish_elephant_infant.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_fauna_hunt_skittish_elephant_infant.xml @@ -1,10 +1,14 @@ - - 1 - 3 - 1 - + + + + 1 + 3 + 1 + + + Elephant diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero.xml index c083668d9e..83d71dfc30 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero.xml @@ -1,10 +1,14 @@ - - 10 - 20 - 15 - + + + + 10 + 20 + 15 + + + 10 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry.xml index b7e06e9981..96a7d6ee30 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry.xml @@ -1,10 +1,14 @@ - - 10 - 8 - 25 - + + + + 10 + 8 + 25 + + + 50 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_axeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_axeman.xml index 66ed65d771..1e890a30ff 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_axeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_axeman.xml @@ -1,8 +1,12 @@ - - 1 - + + + + 1 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_spearman.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_spearman.xml index 8402006d2a..38b3587dab 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_spearman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_spearman.xml @@ -1,9 +1,13 @@ - - 1 - 2 - + + + + 1 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_swordsman.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_swordsman.xml index 16b6b1e8e4..aa5b047858 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_swordsman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry_swordsman.xml @@ -1,9 +1,13 @@ - - 1 - 1 - + + + + 1 + 1 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_elephant_melee.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_elephant_melee.xml index 29c67ddc39..2fe67f1e85 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_elephant_melee.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_elephant_melee.xml @@ -1,10 +1,14 @@ - - 10 - 10 - 25 - + + + + 10 + 10 + 25 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_healer.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_healer.xml index f23017d246..a0a813d8d8 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_healer.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_healer.xml @@ -1,10 +1,14 @@ - - 4 - 8 - 4 - + + + + 4 + 8 + 4 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry.xml index 9058556ee3..3fad6de5ed 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry.xml @@ -1,10 +1,14 @@ - - 8 - 8 - 25 - + + + + 8 + 8 + 25 + + + 40 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_axeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_axeman.xml index acd34ccc97..ab8c88e1bb 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_axeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_axeman.xml @@ -1,9 +1,13 @@ - - 3 - 4 - + + + + 3 + 4 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_pikeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_pikeman.xml index e38fa9eb2f..5a5691ae9f 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_pikeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_pikeman.xml @@ -1,9 +1,13 @@ - - 9 - 9 - + + + + 9 + 9 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_spearman.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_spearman.xml index ad97aaf61f..f6169feaed 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_spearman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_spearman.xml @@ -1,9 +1,13 @@ - - 4 - 4 - + + + + 4 + 4 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_swordsman.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_swordsman.xml index 5607a716dc..a5e08d91a0 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_swordsman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero_infantry_swordsman.xml @@ -1,9 +1,13 @@ - - 4 - 4 - + + + + 4 + 4 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry.xml index a2ca97b5a5..943e262814 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry.xml @@ -1,10 +1,14 @@ - - 2 - 4 - 15 - + + + + 2 + 4 + 15 + + + 2.5 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_axeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_axeman.xml index 65d255884f..26e191ef07 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_axeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_axeman.xml @@ -1,9 +1,13 @@ - - 4 - 5 - + + + + 4 + 5 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_pikeman.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_pikeman.xml index 2c8fb89c36..ab95d6c7cd 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_pikeman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_pikeman.xml @@ -1,9 +1,13 @@ - - 10 - 10 - + + + + 10 + 10 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_spearman.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_spearman.xml index 3acef8ff6e..0e1d40a7ac 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_spearman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_spearman.xml @@ -1,9 +1,13 @@ - - 5 - 5 - + + + + 5 + 5 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_swordsman.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_swordsman.xml index d79ec84102..3a252e77cb 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_swordsman.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_melee_swordsman.xml @@ -1,9 +1,13 @@ - - 5 - 5 - + + + + 5 + 5 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged.xml index a7652edf17..f62bb393f1 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged.xml @@ -1,10 +1,14 @@ - - 1 - 1 - 10 - + + + + 1 + 1 + 10 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_archer.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_archer.xml index 7995fa044f..1179d6e4f0 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_archer.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_archer.xml @@ -1,9 +1,13 @@ - - 1 - 1 - + + + + 1 + 1 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_javelineer.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_javelineer.xml index 1c5c1e61bc..2c0ff4a275 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_javelineer.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_javelineer.xml @@ -1,9 +1,13 @@ - - 1 - 1 - + + + + 1 + 1 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_slinger.xml b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_slinger.xml index 22d8c2ab14..e00b79cbaa 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_slinger.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_infantry_ranged_slinger.xml @@ -1,9 +1,13 @@ - - 1 - 1 - + + + + 1 + 1 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_ship.xml b/binaries/data/mods/public/simulation/templates/template_unit_ship.xml index 91b1863205..660ae49729 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_ship.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_ship.xml @@ -1,10 +1,14 @@ - - 5 - 10 - 5 - + + + + 5 + 10 + 5 + + + true 0.0 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_ship_fishing.xml b/binaries/data/mods/public/simulation/templates/template_unit_ship_fishing.xml index 5ff19efb1e..af40288d91 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_ship_fishing.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_ship_fishing.xml @@ -1,10 +1,14 @@ - - 2 - 5 - 2 - + + + + 2 + 5 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/template_unit_ship_merchant.xml b/binaries/data/mods/public/simulation/templates/template_unit_ship_merchant.xml index 3992010e89..ed9886f19f 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_ship_merchant.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_ship_merchant.xml @@ -1,10 +1,14 @@ - - 2 - 5 - 2 - + + + + 2 + 5 + 2 + + + 20 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_siege.xml b/binaries/data/mods/public/simulation/templates/template_unit_siege.xml index c5a4df62b0..d8ab972b2e 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_siege.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_siege.xml @@ -1,10 +1,14 @@ - - 1 - 50 - 5 - + + + + 1 + 50 + 5 + + + 500 10 diff --git a/binaries/data/mods/public/simulation/templates/template_unit_support.xml b/binaries/data/mods/public/simulation/templates/template_unit_support.xml index 4ea8608738..f72c7e2236 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_support.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_support.xml @@ -1,10 +1,14 @@ - - 1 - 1 - 1 - + + + + 1 + 1 + 1 + + + 8 diff --git a/binaries/data/mods/public/simulation/templates/units/gaul_champion_fanatic.xml b/binaries/data/mods/public/simulation/templates/units/gaul_champion_fanatic.xml index 15ba0fb353..b09475205e 100644 --- a/binaries/data/mods/public/simulation/templates/units/gaul_champion_fanatic.xml +++ b/binaries/data/mods/public/simulation/templates/units/gaul_champion_fanatic.xml @@ -1,9 +1,13 @@ - - -4 - -4 - + + + + -4 + -4 + + + gaul Naked Fanatic diff --git a/binaries/data/mods/public/simulation/templates/units/kush_infantry_clubman_b.xml b/binaries/data/mods/public/simulation/templates/units/kush_infantry_clubman_b.xml index 172420220c..1e215867bb 100644 --- a/binaries/data/mods/public/simulation/templates/units/kush_infantry_clubman_b.xml +++ b/binaries/data/mods/public/simulation/templates/units/kush_infantry_clubman_b.xml @@ -1,8 +1,12 @@ - - -1 - + + + + -1 + + + diff --git a/binaries/data/mods/public/simulation/templates/units/maur_elephant_archer_b.xml b/binaries/data/mods/public/simulation/templates/units/maur_elephant_archer_b.xml index 503ee4b505..9c790f2342 100644 --- a/binaries/data/mods/public/simulation/templates/units/maur_elephant_archer_b.xml +++ b/binaries/data/mods/public/simulation/templates/units/maur_elephant_archer_b.xml @@ -1,9 +1,13 @@ - - 1 - 2 - + + + + 1 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/units/maur_support_elephant.xml b/binaries/data/mods/public/simulation/templates/units/maur_support_elephant.xml index 01aba050bf..71b82ac6a1 100644 --- a/binaries/data/mods/public/simulation/templates/units/maur_support_elephant.xml +++ b/binaries/data/mods/public/simulation/templates/units/maur_support_elephant.xml @@ -1,10 +1,14 @@ - - 5 - 8 - 10 - + + + + 5 + 8 + 10 + + + units/elephant_worker diff --git a/binaries/data/mods/public/simulation/templates/units/merc_thorakites.xml b/binaries/data/mods/public/simulation/templates/units/merc_thorakites.xml index 09881e5cb2..6289a3dae6 100644 --- a/binaries/data/mods/public/simulation/templates/units/merc_thorakites.xml +++ b/binaries/data/mods/public/simulation/templates/units/merc_thorakites.xml @@ -1,9 +1,13 @@ - - 2 - 2 - + + + + 2 + 2 + + + diff --git a/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_spear_gladiator.xml b/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_spear_gladiator.xml index cd3c3b615d..6af1b3de9b 100644 --- a/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_spear_gladiator.xml +++ b/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_spear_gladiator.xml @@ -1,8 +1,12 @@ - - -2 - + + + + -2 + + + structures/rome_army_camp diff --git a/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_sword_gladiator.xml b/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_sword_gladiator.xml index 3fa4781139..e78c281eda 100644 --- a/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_sword_gladiator.xml +++ b/binaries/data/mods/public/simulation/templates/units/rome_champion_infantry_sword_gladiator.xml @@ -1,9 +1,13 @@ - - -1 - -1 - + + + + -1 + -1 + + + structures/rome_army_camp