Index: binaries/data/mods/public/art/actors/props/units/weapons/rock_explosion.xml =================================================================== --- binaries/data/mods/public/art/actors/props/units/weapons/rock_explosion.xml +++ binaries/data/mods/public/art/actors/props/units/weapons/rock_explosion.xml @@ -0,0 +1,13 @@ + + + + + + props/onager_projectile.dae + + + + + + + Index: binaries/data/mods/public/art/actors/units/athenians/siege_rock.xml =================================================================== --- binaries/data/mods/public/art/actors/units/athenians/siege_rock.xml +++ binaries/data/mods/public/art/actors/units/athenians/siege_rock.xml @@ -11,6 +11,7 @@ + Index: binaries/data/mods/public/globalscripts/Templates.js =================================================================== --- binaries/data/mods/public/globalscripts/Templates.js +++ binaries/data/mods/public/globalscripts/Templates.js @@ -166,15 +166,18 @@ } ret.attack[type].repeatTime = getAttackStat("RepeatTime"); - if (template.Attack[type].Splash) + if (template.Attack[type].Splash) { ret.attack[type].splash = { "hack": getAttackStat("Splash/Hack"), "pierce": getAttackStat("Splash/Pierce"), "crush": getAttackStat("Splash/Crush"), // true if undefined "friendlyFire": template.Attack[type].Splash.FriendlyFire != "false", - "shape": template.Attack[type].Splash.Shape + "shape": template.Attack[type].Splash.Shape, }; + if (template.Attack[type].Splash.Delay) + ret.attack[type].splash.delay = template.Attack[type].Splash.Delay; + } } } Index: binaries/data/mods/public/simulation/components/Attack.js =================================================================== --- binaries/data/mods/public/simulation/components/Attack.js +++ binaries/data/mods/public/simulation/components/Attack.js @@ -88,6 +88,7 @@ "0.0" + "10.0" + "0.0" + + "1000" + "" + "" + "" + @@ -149,6 +150,7 @@ "" + "" + "" + + "" + Attack.prototype.bonusesSchema + "" + "" + @@ -532,6 +534,7 @@ "isSplash": false, "attackerOwner": attackerOwner }; + let delay = 0; if (this.template.Ranged.Splash) { data.friendlyFire = this.template.Ranged.Splash.FriendlyFire != "false"; @@ -539,8 +542,10 @@ data.shape = this.template.Ranged.Splash.Shape; data.isSplash = true; data.splashStrengths = this.GetAttackStrengths(type+".Splash"); + if (this.template.Ranged.Splash.Delay) + delay = +this.template.Ranged.Splash.Delay; } - cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_Damage, "MissileHit", timeToTarget * 1000, data); + cmpTimer.SetTimeout(SYSTEM_ENTITY, IID_Damage, "MissileHit", timeToTarget * 1000 + delay, data); } else if (type == "Capture") { Index: binaries/data/mods/public/simulation/components/Damage.js =================================================================== --- binaries/data/mods/public/simulation/components/Damage.js +++ binaries/data/mods/public/simulation/components/Damage.js @@ -87,6 +87,8 @@ if (!data.position) return; + let cmpProjectileManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ProjectileManager); + // Do this first in case the direct hit kills the target if (data.isSplash) { @@ -111,10 +113,11 @@ "type": data.type, "attackerOwner": data.attackerOwner }); + + //TODO: create cpp function to start the explosion animation definded in the unit's actor file + //cmpProjectileManager->PlayProjectileHitAnimation(data.attacker, data.position); } - let cmpProjectileManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ProjectileManager); - // Deal direct damage if we hit the main target // and if the target has DamageReceiver (not the case for a mirage for example) let cmpDamageReceiver = Engine.QueryInterface(data.target, IID_DamageReceiver); Index: binaries/data/mods/public/simulation/templates/template_unit_mechanical_siege_onager.xml =================================================================== --- binaries/data/mods/public/simulation/templates/template_unit_mechanical_siege_onager.xml +++ binaries/data/mods/public/simulation/templates/template_unit_mechanical_siege_onager.xml @@ -18,6 +18,7 @@ 0.0 15.0 35.0 + 2000 Structure