Differential D1815 Diff 7801 binaries/data/mods/public/simulation/components/tests/test_Technologies.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_Technologies.js
Show First 20 Lines • Show All 508 Lines • ▼ Show 20 Lines | |||||
TS_ASSERT_UNEVAL_EQUALS(DeriveTechnologyRequirements(template, "civC"), [{ "techs": ["tech2"] }]); | TS_ASSERT_UNEVAL_EQUALS(DeriveTechnologyRequirements(template, "civC"), [{ "techs": ["tech2"] }]); | ||||
TS_ASSERT_UNEVAL_EQUALS(DeriveTechnologyRequirements(template, "civD"), false); | TS_ASSERT_UNEVAL_EQUALS(DeriveTechnologyRequirements(template, "civD"), false); | ||||
// Test DeriveModificationsFromTech | // Test DeriveModificationsFromTech | ||||
template = { | template = { | ||||
"modifications": [{ | "modifications": [{ | ||||
"value": "ResourceGatherer/Rates/food.grain", | "value": "ResourceGatherer/Rates/food.grain", | ||||
"multiply": 15, | "multiply": 15, | ||||
"affects": "Spear Sword" | "affects": "Spearman Swordsman" | ||||
Nescio: Shouldn't this actually be ` "affects": ["Spearman", "Swordsman"]`? | |||||
}, | }, | ||||
{ | { | ||||
"value": "ResourceGatherer/Rates/food.meat", | "value": "ResourceGatherer/Rates/food.meat", | ||||
"multiply": 10 | "multiply": 10 | ||||
}], | }], | ||||
"affects": ["Female", "CitizenSoldier Melee"] | "affects": ["FemaleCitizen", "CitizenSoldier Melee"] | ||||
elexisUnsubmitted Not Done Inline ActionsChanging the Female identity class rings a bell, that broke the lobby bot once who records the number of trained women in rated games. rP19457 (But it looks like this diff doesn't break the bot, would have to look more closely) elexis: Changing the `Female` identity class rings a bell, that broke the lobby bot once who records… | |||||
NescioAuthorUnsubmitted Done Inline Actionstemplate_unit_support_female_citizen.xml has a FemaleCitizen class, not Female. Nescio: `template_unit_support_female_citizen.xml` has a FemaleCitizen class, not Female. | |||||
}; | }; | ||||
let techMods = { | let techMods = { | ||||
"ResourceGatherer/Rates/food.grain": [{ | "ResourceGatherer/Rates/food.grain": [{ | ||||
"affects": [ | "affects": [ | ||||
["Female", "Spear", "Sword"], | ["FemaleCitizen", "Spearman", "Swordsman"], | ||||
["CitizenSoldier", "Melee", "Spear", "Sword"] | ["CitizenSoldier", "Melee", "Spearman", "Swordsman"] | ||||
], | ], | ||||
"multiply": 15 | "multiply": 15 | ||||
}], | }], | ||||
"ResourceGatherer/Rates/food.meat": [{ | "ResourceGatherer/Rates/food.meat": [{ | ||||
"affects": [ | "affects": [ | ||||
["Female"], | ["FemaleCitizen"], | ||||
["CitizenSoldier", "Melee"] | ["CitizenSoldier", "Melee"] | ||||
], | ], | ||||
"multiply": 10 | "multiply": 10 | ||||
}] | }] | ||||
}; | }; | ||||
TS_ASSERT_UNEVAL_EQUALS(DeriveModificationsFromTech(template), techMods); | TS_ASSERT_UNEVAL_EQUALS(DeriveModificationsFromTech(template), techMods); | ||||
template = { | template = { | ||||
"modifications": [{ | "modifications": [{ | ||||
"value": "ResourceGatherer/Rates/food.grain", | "value": "ResourceGatherer/Rates/food.grain", | ||||
"multiply": 15, | "multiply": 15, | ||||
"affects": "Spear" | "affects": "Spearman" | ||||
}, | }, | ||||
{ | { | ||||
"value": "ResourceGatherer/Rates/food.grain", | "value": "ResourceGatherer/Rates/food.grain", | ||||
"multiply": 15, | "multiply": 15, | ||||
"affects": "Sword" | "affects": "Swordsman" | ||||
}, | }, | ||||
{ | { | ||||
"value": "ResourceGatherer/Rates/food.meat", | "value": "ResourceGatherer/Rates/food.meat", | ||||
"multiply": 10 | "multiply": 10 | ||||
}], | }], | ||||
"affects": ["Female", "CitizenSoldier Melee"] | "affects": ["FemaleCitizen", "CitizenSoldier Melee"] | ||||
}; | }; | ||||
techMods = { | techMods = { | ||||
"ResourceGatherer/Rates/food.grain": [{ | "ResourceGatherer/Rates/food.grain": [{ | ||||
"affects": [ | "affects": [ | ||||
["Female", "Spear"], | ["FemaleCitizen", "Spearman"], | ||||
["CitizenSoldier", "Melee", "Spear"] | ["CitizenSoldier", "Melee", "Spearman"] | ||||
], | ], | ||||
"multiply": 15 | "multiply": 15 | ||||
}, | }, | ||||
{ | { | ||||
"affects": [ | "affects": [ | ||||
["Female", "Sword"], | ["FemaleCitizen", "Swordsman"], | ||||
["CitizenSoldier", "Melee", "Sword"] | ["CitizenSoldier", "Melee", "Swordsman"] | ||||
], | ], | ||||
"multiply": 15 | "multiply": 15 | ||||
}], | }], | ||||
"ResourceGatherer/Rates/food.meat": [{ | "ResourceGatherer/Rates/food.meat": [{ | ||||
"affects": [ | "affects": [ | ||||
["Female"], | ["FemaleCitizen"], | ||||
["CitizenSoldier", "Melee"] | ["CitizenSoldier", "Melee"] | ||||
], | ], | ||||
"multiply": 10 | "multiply": 10 | ||||
}] | }] | ||||
}; | }; | ||||
TS_ASSERT_UNEVAL_EQUALS(DeriveModificationsFromTech(template), techMods); | TS_ASSERT_UNEVAL_EQUALS(DeriveModificationsFromTech(template), techMods); |
Wildfire Games · Phabricator
Shouldn't this actually be "affects": ["Spearman", "Swordsman"]?