Index: ps/trunk/binaries/data/mods/public/simulation/components/Damage.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/Damage.js +++ ps/trunk/binaries/data/mods/public/simulation/components/Damage.js @@ -80,10 +80,10 @@ let playersToDamage = []; let numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); for (let i = 0; i < numPlayers; ++i) - playersToDamage.push(i) + playersToDamage.push(i); return playersToDamage; -} +}; /** * Handles hit logic after the projectile travel time has passed. Index: ps/trunk/binaries/data/mods/public/simulation/components/DeathDamage.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/DeathDamage.js +++ ps/trunk/binaries/data/mods/public/simulation/components/DeathDamage.js @@ -28,7 +28,7 @@ "10.0" + "50.0" + "" + - "" + + "" + "" + "" + "" + Index: ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Attack.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Attack.js +++ ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Attack.js @@ -82,7 +82,13 @@ "FriendlyFire": "false", "Hack": 0.0, "Pierce": 15.0, - "Crush": 35.0 + "Crush": 35.0, + "Bonuses": { + "BonusCav": { + "Classes": "Cavalry", + "Multiplier": 2 + } + } } }, "Capture" : { @@ -135,6 +141,12 @@ "pierce": 10, "crush": 0 }); + + TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackStrengths("Ranged.Splash"), { + "hack": 0.0, + "pierce": 15.0, + "crush": 35.0 + }); TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetTimers("Ranged"), { "prepare": 300, @@ -153,6 +165,7 @@ attackComponentTest(className, true, (attacker, cmpAttack, defender) => { TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackBonus("Melee", defender), className == "Cavalry" ? 2 : 1); TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackBonus("Ranged", defender), 1); + TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackBonus("Ranged.Splash", defender), className == "Cavalry" ? 2 : 1); TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackBonus("Capture", defender), 1); TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackBonus("Slaughter", defender), 1); }); @@ -216,7 +229,7 @@ if (!isBuilding) allowCapturing.push(false); - let attack = undefined; + let attack; if (defenderClass == "Domestic") attack = "Slaughter"; else if (defenderClass == "Structure") @@ -234,6 +247,7 @@ function testPredictTimeToTarget(selfPosition, horizSpeed, targetPosition, targetVelocity) { + ResetState(); let cmpAttack = ConstructComponent(1, "Attack", {}); let timeToTarget = cmpAttack.PredictTimeToTarget(selfPosition, horizSpeed, targetPosition, targetVelocity); if (timeToTarget === false)