Rename the Female identity class to FemaleCitizen, because it is intended for female support units only.

Thus prevent template editors from adding that tag to female military
units and
allow modders to add a Female class for wider purposes.
Remove the FemaleCitizen training restriction category that was added
for debug purposes but forgotton to be removed in 7e21db08d5.

Differential Revision: https://code.wildfiregames.com/D244
Reviewed By: fatherbushido
Refs: #1432 #4490

This was SVN commit r19329.
This commit is contained in:
elexis 2017-03-23 17:54:36 +00:00
parent 9f018c48e0
commit ad17e320be
17 changed files with 30 additions and 29 deletions

View file

@ -159,7 +159,8 @@ var g_Heroes = [];
/**
* Unit classes to be checked for the idle-worker-hotkey.
*/
var g_WorkerTypes = ["Female+Support", "Trader", "FishingBoat", "CitizenSoldier"];
var g_WorkerTypes = ["FemaleCitizen", "Trader", "FishingBoat", "CitizenSoldier"];
/**
* Unit classes to be checked for the military-only-selection modifier and for the idle-warrior-hotkey.
*/
@ -1379,7 +1380,7 @@ function reportGame()
"total",
"Infantry",
"Worker",
"Female",
"FemaleCitizen",
"Cavalry",
"Champion",
"Hero",

View file

@ -75,7 +75,7 @@ function calculateTeamCounters(playerState)
g_TeamHelperData[playerState.team] = {
"food": 0,
"vegetarianFood": 0,
"female": 0,
"femaleCitizen": 0,
"worker": 0,
"enemyUnitsKilled": 0,
"unitsLost": 0,
@ -89,7 +89,7 @@ function calculateTeamCounters(playerState)
g_TeamHelperData[playerState.team].food += playerState.statistics.resourcesGathered.food;
g_TeamHelperData[playerState.team].vegetarianFood += playerState.statistics.resourcesGathered.vegetarianFood;
g_TeamHelperData[playerState.team].female += playerState.statistics.unitsTrained.Female;
g_TeamHelperData[playerState.team].femaleCitizen += playerState.statistics.unitsTrained.FemaleCitizen;
g_TeamHelperData[playerState.team].worker += playerState.statistics.unitsTrained.Worker;
g_TeamHelperData[playerState.team].enemyUnitsKilled += playerState.statistics.enemyUnitsKilled.total;
@ -439,7 +439,7 @@ function calculateVegetarianRatio(playerState)
function calculateFeminization(playerState)
{
return formatPercent(
playerState.statistics.unitsTrained.Female,
playerState.statistics.unitsTrained.FemaleCitizen,
playerState.statistics.unitsTrained.Worker);
}
@ -479,7 +479,7 @@ function calculateMiscellaneous(counters)
if (w == 0)
teamTotal = formatPercent(g_TeamHelperData[t].vegetarianFood, g_TeamHelperData[t].food);
else if (w == 1)
teamTotal = formatPercent(g_TeamHelperData[t].female, g_TeamHelperData[t].worker);
teamTotal = formatPercent(g_TeamHelperData[t].femaleCitizen, g_TeamHelperData[t].worker);
else if (w == 2)
teamTotal = formatRatio(g_TeamHelperData[t].enemyUnitsKilled, g_TeamHelperData[t].unitsLost);
else if (w == 3)

View file

@ -171,7 +171,7 @@ Trigger.prototype.InitGame = function()
{
if (TriggerHelper.EntityHasClass(entity, "CivilCentre"))
this.playerCivicCenter[i] = entity;
else if (TriggerHelper.EntityHasClass(entity, "Female"))
else if (TriggerHelper.EntityHasClass(entity, "FemaleCitizen"))
{
let cmpDamageReceiver = Engine.QueryInterface(entity, IID_DamageReceiver);
cmpDamageReceiver.SetInvulnerability(true);

View file

@ -1374,7 +1374,7 @@ m.AttackPlan.prototype.update = function(gameState, events)
else if (target.hasClass("Ship") && !ent.hasClass("Ship"))
maybeUpdate = true;
else if (!ent.hasClass("Cavalry") && !ent.hasClass("Ranged") &&
target.hasClass("Female") && target.unitAIState().split(".")[1] == "FLEEING")
target.hasClass("FemaleCitizen") && target.unitAIState().split(".")[1] == "FLEEING")
maybeUpdate = true;
}
@ -1467,7 +1467,7 @@ m.AttackPlan.prototype.update = function(gameState, events)
return false;
if (enemy.hasClass("Animal"))
return false;
if (nearby && enemy.hasClass("Female") && enemy.unitAIState().split(".")[1] == "FLEEING")
if (nearby && enemy.hasClass("FemaleCitizen") && enemy.unitAIState().split(".")[1] == "FLEEING")
return false;
let dist = API3.SquareVectorDistance(enemy.position(), ent.position());
if (dist > range)

View file

@ -611,8 +611,8 @@ m.BaseManager.prototype.setWorkersIdleByPriority = function(gameState)
if (lessNeed.type === "food" && gatherers.filter(API3.Filters.byClass("CitizenSoldier")).hasEntities())
only = "CitizenSoldier";
else if ((lessNeed.type === "stone" || lessNeed.type === "metal") && moreNeed.type !== "stone" && moreNeed.type !== "metal" &&
gatherers.filter(API3.Filters.byClass("Female")).hasEntities())
only = "Female";
gatherers.filter(API3.Filters.byClass("FemaleCitizen")).hasEntities())
only = "FemaleCitizen";
gatherers.forEach( function (ent) {
if (!ent.canGather(moreNeed.type))

View file

@ -54,7 +54,7 @@ Identity.prototype.Schema =
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Classes' a:help='Optional list of space-separated classes applying to this entity. Choices include: Animal, Apadana, ArmyCamp, Ashoka, BarterMarket, Celt, CitizenSoldier, CivCentre, Colony, ConquestCritical, Defensive, Domestic, DropsiteFood, DropsiteMetal, DropsiteStone, DropsiteWood, Elephant, Female, FishingBoat, ForestPlant, Fortress, GarrisonFortress, GarrisonTower, Gates, Human, Iberian, Immortal, Italian, Juggernaut, Kennel, Lighthouse, LongWall, MercenaryCamp, Naval, NavalMarket, Organic, Palace, Palisade, Player, PtolemyIV, SeaCreature, SiegeWall, SpecialBuilding, StoneWall, Structure, Syssiton, Theater, Tower, Unit'>" +
"<element name='Classes' a:help='Optional list of space-separated classes applying to this entity. Choices include: Animal, Apadana, ArmyCamp, Ashoka, BarterMarket, Celt, CitizenSoldier, CivCentre, Colony, ConquestCritical, Defensive, Domestic, DropsiteFood, DropsiteMetal, DropsiteStone, DropsiteWood, Elephant, FemaleCitizen, FishingBoat, ForestPlant, Fortress, GarrisonFortress, GarrisonTower, Gates, Human, Iberian, Immortal, Italian, Juggernaut, Kennel, Lighthouse, LongWall, MercenaryCamp, Naval, NavalMarket, Organic, Palace, Palisade, Player, PtolemyIV, SeaCreature, SiegeWall, SpecialBuilding, StoneWall, Structure, Syssiton, Theater, Tower, Unit'>" +
"<attribute name='datatype'>" +
"<value>tokens</value>" +
"</attribute>" +

View file

@ -8,7 +8,7 @@ StatisticsTracker.prototype.Init = function()
this.unitsClasses = [
"Infantry",
"Worker",
"Female",
"FemaleCitizen",
"Cavalry",
"Champion",
"Hero",
@ -19,7 +19,7 @@ StatisticsTracker.prototype.Init = function()
this.unitsTrained = {
"Infantry": 0,
"Worker": 0,
"Female": 0,
"FemaleCitizen": 0,
"Cavalry": 0,
"Champion": 0,
"Hero": 0,
@ -31,7 +31,7 @@ StatisticsTracker.prototype.Init = function()
this.unitsLost = {
"Infantry": 0,
"Worker": 0,
"Female": 0,
"FemaleCitizen": 0,
"Cavalry": 0,
"Champion": 0,
"Hero": 0,
@ -44,7 +44,7 @@ StatisticsTracker.prototype.Init = function()
this.enemyUnitsKilled = {
"Infantry": 0,
"Worker": 0,
"Female": 0,
"FemaleCitizen": 0,
"Cavalry": 0,
"Champion": 0,
"Hero": 0,
@ -57,7 +57,7 @@ StatisticsTracker.prototype.Init = function()
this.unitsCaptured = {
"Infantry": 0,
"Worker": 0,
"Female": 0,
"FemaleCitizen": 0,
"Cavalry": 0,
"Champion": 0,
"Hero": 0,

View file

@ -26,7 +26,7 @@ TechnologyManager.prototype.Init = function()
// This stores the modifications to unit stats from researched technologies
// Example data: {"ResourceGatherer/Rates/food.grain": [
// {"multiply": 1.15, "affects": ["Female", "Infantry Swordsman"]},
// {"multiply": 1.15, "affects": ["FemaleCitizen", "Infantry Swordsman"]},
// {"add": 2}
// ]}
this.modifications = {};

View file

@ -7,7 +7,7 @@ TrainingRestrictions.prototype.Schema =
"<Category>Hero</Category>" +
"</TrainingRestrictions>" +
"</a:example>" +
"<element name='Category' a:help='Specifies the category of this unit, for satisfying special constraints. Choices include: Hero, FemaleCitizen, WarDog'>" +
"<element name='Category' a:help='Specifies the category of this unit, for satisfying special constraints. Choices include: Hero, UniqueBuilding, WarDog'>" +
"<text/>" +
"</element>";

View file

@ -45,7 +45,7 @@ function attackComponentTest(defenderClass, test_function)
"MinRange": 3,
"MaxRange": 5,
"PreferredClasses": {
"_string": "Female"
"_string": "FemaleCitizen"
},
"RestrictedClasses": {
"_string": "Elephant Archer"
@ -99,7 +99,7 @@ function attackComponentTest(defenderClass, test_function)
attackComponentTest(undefined, (attacker, cmpAttack, defender) => {
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackTypes(), ["Melee", "Ranged", "Capture"]);
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetPreferredClasses("Melee"), ["Female"]);
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetPreferredClasses("Melee"), ["FemaleCitizen"]);
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetRestrictedClasses("Melee"), ["Elephant", "Archer"]);
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetFullAttackRange(), { "min": 0, "max": 80 });
TS_ASSERT_UNEVAL_EQUALS(cmpAttack.GetAttackStrengths("Capture"), { "value": 8 });
@ -157,7 +157,7 @@ function testGetBestAttackAgainst(defenderClass, bestAttack, isBuilding = false)
});
}
testGetBestAttackAgainst("Female", "Melee");
testGetBestAttackAgainst("FemaleCitizen", "Melee");
testGetBestAttackAgainst("Archer", "Ranged");
testGetBestAttackAgainst("Domestic", "Slaughter");
testGetBestAttackAgainst("Structure", "Capture", true);

View file

@ -8,6 +8,6 @@
"researchTime": 40,
"tooltip": "Female Citizens +50% Health.",
"modifications": [{"value": "Health/Max", "multiply": 1.50}],
"affects": ["Female Citizen"],
"affects": ["FemaleCitizen"],
"soundComplete": "interface/alarm/alarm_upgradearmory.xml"
}

View file

@ -35,7 +35,7 @@
<GarrisonHolder>
<Max>20</Max>
<EjectHealth>0</EjectHealth>
<EjectClassesOnDestroy datatype="tokens">Female Infantry Dog</EjectClassesOnDestroy>
<EjectClassesOnDestroy datatype="tokens">FemaleCitizen Infantry Dog</EjectClassesOnDestroy>
<List datatype="tokens">Support Infantry Cavalry Dog</List>
<BuffHeal>0</BuffHeal>
<LoadingRange>10</LoadingRange>

View file

@ -22,7 +22,7 @@
<GarrisonHolder>
<Max>1</Max>
<EjectHealth>0</EjectHealth>
<EjectClassesOnDestroy datatype="tokens">Female Infantry</EjectClassesOnDestroy>
<EjectClassesOnDestroy datatype="tokens">FemaleCitizen Infantry</EjectClassesOnDestroy>
<List datatype="tokens">Support Infantry</List>
<BuffHeal>0</BuffHeal>
<LoadingRange>10</LoadingRange>

View file

@ -14,7 +14,7 @@
<GarrisonHolder>
<Max>15</Max>
<EjectHealth>0</EjectHealth>
<EjectClassesOnDestroy datatype="tokens">Female Infantry Dog</EjectClassesOnDestroy>
<EjectClassesOnDestroy datatype="tokens">FemaleCitizen Infantry Dog</EjectClassesOnDestroy>
<List datatype="tokens">Support Infantry Cavalry Dog</List>
<BuffHeal>0</BuffHeal>
<LoadingRange>10</LoadingRange>

View file

@ -44,7 +44,7 @@
<GarrisonHolder>
<Max>50</Max>
<EjectHealth>0</EjectHealth>
<EjectClassesOnDestroy datatype="tokens">Female Infantry Dog</EjectClassesOnDestroy>
<EjectClassesOnDestroy datatype="tokens">FemaleCitizen Infantry Dog</EjectClassesOnDestroy>
<List datatype="tokens">Support Infantry Cavalry Dog Siege Elephant</List>
<BuffHeal>0</BuffHeal>
<LoadingRange>10</LoadingRange>

View file

@ -35,7 +35,7 @@
<GarrisonHolder>
<Max>30</Max>
<EjectHealth>0</EjectHealth>
<EjectClassesOnDestroy datatype="tokens">Female Infantry Dog</EjectClassesOnDestroy>
<EjectClassesOnDestroy datatype="tokens">FemaleCitizen Infantry Dog</EjectClassesOnDestroy>
<List datatype="tokens">Support Infantry Cavalry Dog Siege Elephant</List>
<BuffHeal>0</BuffHeal>
<LoadingRange>10</LoadingRange>

View file

@ -43,7 +43,7 @@
<GenericName>Female Citizen</GenericName>
<Gender>female</Gender>
<History>Women in the ancient world took on a variety of roles - from leadership (Celts) to servant (Greeks). Women are hard workers, the economic backbone of any civilization. In history, it was typical when all the males (capable of fighting) were killed for the females, children, and elderly to be sold as slaves.</History>
<Classes datatype="tokens">Female</Classes>
<Classes datatype="tokens">FemaleCitizen</Classes>
<VisibleClasses datatype="tokens">Citizen Worker</VisibleClasses>
<Formations disable=""/>
</Identity>