Differential D2227 Diff 9510 binaries/data/mods/public/simulation/components/tests/test_Promotion.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_Promotion.js
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
TS_ASSERT_EQUALS(cmpPromotion.entity, 61); | TS_ASSERT_EQUALS(cmpPromotion.entity, 61); | ||||
TS_ASSERT_EQUALS(cmpPromotion.GetCurrentXp(), 0); | TS_ASSERT_EQUALS(cmpPromotion.GetCurrentXp(), 0); | ||||
TS_ASSERT_EQUALS(cmpPromotion.GetRequiredXp(), 1000); | TS_ASSERT_EQUALS(cmpPromotion.GetRequiredXp(), 1000); | ||||
cmpPromotion.IncreaseXp(4200); | cmpPromotion.IncreaseXp(4200); | ||||
TS_ASSERT_EQUALS(cmpPromotion.entity, 62); | TS_ASSERT_EQUALS(cmpPromotion.entity, 62); | ||||
TS_ASSERT_EQUALS(cmpPromotion.template.Entity, "end"); | TS_ASSERT_EQUALS(cmpPromotion.template.Entity, "end"); | ||||
TS_ASSERT_EQUALS(cmpPromotion.GetCurrentXp(), 200); | TS_ASSERT_EQUALS(cmpPromotion.GetCurrentXp(), 200); | ||||
cmpPromotion = ConstructComponent(ENT_ID, "Promotion", { | |||||
"Entity": "template_b", | |||||
"RequiredXp": 1000 | |||||
}); | |||||
let cmpHealth = AddMock(ENT_ID, IID_Health, { | |||||
"GetHitpoints": () => 0, | |||||
}); | |||||
cmpPromotion.IncreaseXp(1000); | |||||
})(); | })(); |
Wildfire Games · Phabricator