Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_Attack.js
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | "Ranged": { | ||||
"Crush": 35.0 | "Crush": 35.0 | ||||
}, | }, | ||||
"Bonuses": { | "Bonuses": { | ||||
"BonusCav": { | "BonusCav": { | ||||
"Classes": "Cavalry", | "Classes": "Cavalry", | ||||
"Multiplier": 3 | "Multiplier": 3 | ||||
} | } | ||||
} | } | ||||
} | }, | ||||
"AttackGround": {} | |||||
}, | }, | ||||
"Capture": { | "Capture": { | ||||
"Capture": 8, | "Capture": 8, | ||||
"MaxRange": 10, | "MaxRange": 10, | ||||
}, | }, | ||||
"Slaughter": {} | "Slaughter": {} | ||||
}); | }); | ||||
Show All 34 Lines | attackComponentTest(undefined, true, (attacker, cmpAttack, defender) => { | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackTypes(["Capture", "!Ranged"]), ["Capture"]); | TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackTypes(["Capture", "!Ranged"]), ["Capture"]); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackTypes(["Capture", "Melee", "!Ranged"]), ["Melee", "Capture"]); | TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackTypes(["Capture", "Melee", "!Ranged"]), ["Melee", "Capture"]); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetPreferredClasses("Melee"), ["FemaleCitizen"]); | TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetPreferredClasses("Melee"), ["FemaleCitizen"]); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetRestrictedClasses("Melee"), ["Elephant", "Archer"]); | TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetRestrictedClasses("Melee"), ["Elephant", "Archer"]); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetFullAttackRange(), { "min": 0, "max": 80 }); | TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetFullAttackRange(), { "min": 0, "max": 80 }); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackEffectsData("Capture"), { "Capture": 8 }); | TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackEffectsData("Capture"), { "Capture": 8 }); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.CanAttackGround("Capture"), false); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.CanAttackGround("Ranged"), true); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.CanAttackGround(), true); | |||||
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackEffectsData("Ranged"), { | TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackEffectsData("Ranged"), { | ||||
"Damage": { | "Damage": { | ||||
"Hack": 0, | "Hack": 0, | ||||
"Pierce": 10, | "Pierce": 10, | ||||
"Crush": 0 | "Crush": 0 | ||||
} | } | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator