mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-20 07:13:56 -07:00
Rename athen archer, as it's not a default unit. Naming it as a default unit makes any capture code more difficult.
This was SVN commit r16494.
This commit is contained in:
parent
0131f2e4d5
commit
14b7e7568c
17 changed files with 74 additions and 70 deletions
|
|
@ -67,6 +67,10 @@ ProductionQueue.prototype.Init = function()
|
|||
this.spawnNotified = false;
|
||||
|
||||
this.alertRaiser = undefined;
|
||||
|
||||
// ATLAS HACK
|
||||
var cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
|
||||
cmpTimer.SetTimeout(this.entity, IID_ProductionQueue, "CalculateEntitiesList", 1, {});
|
||||
};
|
||||
|
||||
ProductionQueue.prototype.PutUnderAlert = function(raiser)
|
||||
|
|
@ -92,33 +96,33 @@ ProductionQueue.prototype.CalculateEntitiesList = function()
|
|||
this.entitiesList = [];
|
||||
if (!this.template.Entities)
|
||||
return;
|
||||
|
||||
|
||||
var string = this.template.Entities._string;
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
|
||||
// Replace the "{civ}" codes with this entity's civ ID
|
||||
var cmpIdentity = Engine.QueryInterface(this.entity, IID_Identity);
|
||||
if (cmpIdentity)
|
||||
string = string.replace(/\{civ\}/g, cmpIdentity.GetCiv());
|
||||
|
||||
var entitiesList = string.split(/\s+/);
|
||||
|
||||
// Remove disabled entities
|
||||
var cmpPlayer = QueryOwnerInterface(this.entity, IID_Player);
|
||||
var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|
||||
var cmpPlayer = QueryOwnerInterface(this.entity);
|
||||
if (!cmpPlayer)
|
||||
return;
|
||||
|
||||
var entitiesList = string.replace(/\{civ\}/g, cmpPlayer.GetCiv()).split(/\s+/);
|
||||
|
||||
// filter out disabled and invalid entities
|
||||
var disabledEntities = cmpPlayer.GetDisabledTemplates();
|
||||
|
||||
for (var i = entitiesList.length - 1; i >= 0; --i)
|
||||
if (disabledEntities[entitiesList[i]])
|
||||
entitiesList.splice(i, 1);
|
||||
|
||||
entitiesList = entitiesList.filter(function(v)
|
||||
{
|
||||
return !disabledEntities[v] && cmpTemplateManager.TemplateExists(v);
|
||||
});
|
||||
|
||||
// check if some templates need to show their advanced or elite version
|
||||
var upgradeTemplate = function(templateName)
|
||||
{
|
||||
var template = cmpTemplateManager.GetTemplate(templateName);
|
||||
while (template && template.Promotion !== undefined)
|
||||
{
|
||||
var requiredXp = ApplyValueModificationsToTemplate("Promotion/RequiredXp", +template.Promotion.RequiredXp, playerID, template);
|
||||
var requiredXp = ApplyValueModificationsToTemplate("Promotion/RequiredXp", +template.Promotion.RequiredXp, cmpPlayer.GetPlayerID(), template);
|
||||
if (requiredXp > 0)
|
||||
break;
|
||||
templateName = template.Promotion.Entity;
|
||||
|
|
@ -127,15 +131,12 @@ ProductionQueue.prototype.CalculateEntitiesList = function()
|
|||
return templateName;
|
||||
};
|
||||
|
||||
var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|
||||
var playerID = cmpPlayer.GetPlayerID();
|
||||
for each (var templateName in entitiesList)
|
||||
for (let templateName of entitiesList)
|
||||
this.entitiesList.push(upgradeTemplate(templateName));
|
||||
for each (var item in this.queue)
|
||||
{
|
||||
|
||||
for (let item of this.queue)
|
||||
if (item.unitTemplate)
|
||||
item.unitTemplate = upgradeTemplate(item.unitTemplate);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -154,13 +155,16 @@ ProductionQueue.prototype.GetTechnologiesList = function()
|
|||
if (!cmpTechnologyManager)
|
||||
return [];
|
||||
|
||||
var cmpPlayer = QueryOwnerInterface(this.entity);
|
||||
var cmpIdentity = Engine.QueryInterface(this.entity, IID_Identity);
|
||||
if (!cmpPlayer || !cmpIdentity || cmpPlayer.GetCiv() != cmpIdentity.GetCiv())
|
||||
return [];
|
||||
|
||||
var techs = string.split(/\s+/);
|
||||
var techList = [];
|
||||
var superseded = {}; // Stores the tech which supersedes the key
|
||||
|
||||
var cmpPlayer = QueryOwnerInterface(this.entity, IID_Player);
|
||||
if (cmpPlayer)
|
||||
var disabledTechnologies = cmpPlayer.GetDisabledTechnologies();
|
||||
var disabledTechnologies = cmpPlayer.GetDisabledTechnologies();
|
||||
|
||||
// Add any top level technologies to an array which corresponds to the displayed icons
|
||||
// Also store what a technology is superceded by in the superceded object {"tech1":"techWhichSupercedesTech1", ...}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
</Identity>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/athen_infantry_spearman_b
|
||||
units/athen_infantry_slinger_b
|
||||
units/athen_cavalry_javelinist_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_slinger_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
</Entities>
|
||||
<Technologies datatype="tokens">
|
||||
-phase_town_generic
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
</Obstruction>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/brit_infantry_spearman_b
|
||||
units/brit_infantry_slinger_b
|
||||
units/brit_cavalry_javelinist_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_slinger_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
</Health>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/cart_infantry_spearman_b
|
||||
units/cart_infantry_archer_b
|
||||
units/cart_cavalry_javelinist_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_archer_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
</Entities>
|
||||
<Technologies datatype="tokens">
|
||||
carthaginians/special_colonisation
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
</Obstruction>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/gaul_infantry_spearman_b
|
||||
units/gaul_infantry_javelinist_b
|
||||
units/gaul_cavalry_javelinist_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_javelinist_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
</Health>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/iber_infantry_swordsman_b
|
||||
units/iber_infantry_javelinist_b
|
||||
units/iber_cavalry_javelinist_b
|
||||
units/{civ}_infantry_swordsman_b
|
||||
units/{civ}_infantry_javelinist_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
</Identity>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/mace_infantry_spearman_b
|
||||
units/mace_infantry_javelinist_b
|
||||
units/mace_cavalry_spearman_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_javelinist_b
|
||||
units/{civ}_cavalry_spearman_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@
|
|||
</Obstruction>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/maur_infantry_spearman_b
|
||||
units/maur_infantry_archer_b
|
||||
units/maur_cavalry_javelinist_b
|
||||
units/maur_support_elephant
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_archer_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
units/{civ}_support_elephant
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@
|
|||
</Health>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/pers_infantry_spearman_b
|
||||
units/pers_infantry_archer_b
|
||||
units/pers_cavalry_javelinist_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_archer_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
</Entities>
|
||||
<Technologies datatype="tokens">
|
||||
persians/persian_architecture
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
</Identity>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/ptol_infantry_spearman_b
|
||||
units/ptol_infantry_archer_b
|
||||
units/ptol_cavalry_archer_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_archer_b
|
||||
units/{civ}_cavalry_archer_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
</Obstruction>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/rome_infantry_swordsman_b
|
||||
units/rome_infantry_javelinist_b
|
||||
units/rome_cavalry_spearman_b
|
||||
units/{civ}_infantry_swordsman_b
|
||||
units/{civ}_infantry_javelinist_b
|
||||
units/{civ}_cavalry_spearman_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@
|
|||
</Identity>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/sele_infantry_spearman_2_b
|
||||
units/sele_infantry_javelinist_b
|
||||
units/sele_cavalry_javelinist
|
||||
units/sele_hero_seleucus_victor
|
||||
units/sele_hero_antiochus_great
|
||||
units/sele_hero_antiochus_righteous
|
||||
units/{civ}_infantry_spearman_2_b
|
||||
units/{civ}_infantry_javelinist_b
|
||||
units/{civ}_cavalry_javelinist
|
||||
units/{civ}_hero_seleucus_victor
|
||||
units/{civ}_hero_antiochus_great
|
||||
units/{civ}_hero_antiochus_righteous
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
</Identity>
|
||||
<ProductionQueue>
|
||||
<Entities datatype="tokens">
|
||||
units/spart_infantry_spearman_b
|
||||
units/spart_infantry_javelinist_b
|
||||
units/spart_cavalry_javelinist_b
|
||||
units/{civ}_infantry_spearman_b
|
||||
units/{civ}_infantry_javelinist_b
|
||||
units/{civ}_cavalry_javelinist_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Entity parent="units/athen_infantry_archer_b">
|
||||
<Entity parent="units/athen_infantry_marine_archer_b">
|
||||
<Armour>
|
||||
<Hack>2</Hack>
|
||||
<Pierce>2</Pierce>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<Rank>Advanced</Rank>
|
||||
</Identity>
|
||||
<Promotion>
|
||||
<Entity>units/athen_infantry_archer_e</Entity>
|
||||
<Entity>units/athen_infantry_marine_archer_e</Entity>
|
||||
</Promotion>
|
||||
<ResourceGatherer>
|
||||
<BaseSpeed>0.75</BaseSpeed>
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
<RequiredTechnology>hellenes/special_iphicratean_reforms</RequiredTechnology>
|
||||
</Identity>
|
||||
<Promotion>
|
||||
<Entity>units/athen_infantry_archer_a</Entity>
|
||||
<Entity>units/athen_infantry_marine_archer_a</Entity>
|
||||
</Promotion>
|
||||
<VisualActor>
|
||||
<Actor>units/macedonians/infantry_archer_b.xml</Actor>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Entity parent="units/athen_infantry_archer_a">
|
||||
<Entity parent="units/athen_infantry_marine_archer_a">
|
||||
<Armour>
|
||||
<Hack>3</Hack>
|
||||
<Pierce>3</Pierce>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<BatchTimeModifier>0.7</BatchTimeModifier>
|
||||
<Entities datatype="tokens">
|
||||
units/athen_champion_marine
|
||||
units/athen_infantry_archer_b
|
||||
units/athen_infantry_marine_archer_b
|
||||
</Entities>
|
||||
</ProductionQueue>
|
||||
<VisualActor>
|
||||
|
|
|
|||
Loading…
Reference in a new issue