0ad/binaries/data/mods/public/simulation/components/Identity.js
Mythos_Ruler 4658cfa775 Mythos_Ruler's Christmas update for SVN users!
Includes:

- Unit rank upgrades, based on a patch by Sanderd. Not all civs get all
rank upgrades. For instance, Spartans get the Infantry rank upgrades,
but not the cavalry rank upgrades. Conversely, the Persians get the
cavalry rank upgrades, but not the infantry rank upgrades. Carthaginians
get rank upgrades for their mercenaries, but not their native units.
etc.

- Updated and tweaked many of the skirmish maps. Too many tweaks to
mention. But I did add Iberian circuit walls to many of them! New
"Bactria" Skirmish Map. Will continue to tweak this one to make it more
unique. It's based on modern-day Afghanistan, which the ancients called
"Bactria." A 2nd Ptolemies sandbox demo map.

- Moved the Ptolemaic Lighthouse to Town Phase to have more impact for
the Ptolemy player on maps with water.

- New Thureos shield patterns by Enrique for a NEW unit: Mercenary
Thureos Spearman.

- TECHNOLOGIES: Some techs renamed and tweaked. Plus, a new "Iron Armor"
tech for Heroes. A new "Roman Logistics" tech for the Roman Army Camp
and Siege Walls. A new "Battlefield Medics" tech for the temple that
unlocks (slow) health regeneration for units. The portrait for this tech
is placeholder and needs replaced ASAP.

- Cavalry now have oval selection rings. Eventually I will implement a
selection ring system where the citizen-soldiers and support units have
round rings, while champions have arrows, and heroes have stars. This
helps visually differentiate the roles of these 3 classes of units. Not
yet implemented.

- Vision radius for infantry slightly reduced.

- Fixed sounds for Persian Wonder.

- Fixed footprint sizes for a few buildings and Ptolemaic walls.

- Ptolemies now have the "Military Settlement" system in place. But this
system might go to the Seleucids instead later for historical reasons.

- Cost of fields reduced. Gathering rates for grain reduced.

- Fixed some selection group names for some templates. (Double clicking
didn't select them all as it should have).

- Fixed/Changed/Added some unit and building names, specifically for the
Ptolemies, but for some others as well.

- Some new temp portraits for Ptolemaic units. Ongoing task.

Lastly, I hope these changes don't break anything. They are heavily
tested on my end, but I can't promise I caught all bugs.

This was SVN commit r14388.
2013-12-25 15:49:49 +00:00

138 lines
4.4 KiB
JavaScript

function Identity() {}
Identity.prototype.Schema =
"<a:help>Specifies various names and values associated with the unit type, typically for GUI display to users.</a:help>" +
"<a:example>" +
"<Civ>hele</Civ>" +
"<GenericName>Infantry Spearman</GenericName>" +
"<SpecificName>Hoplite</SpecificName>" +
"<Icon>units/hele_infantry_spearman.png</Icon>" +
"</a:example>" +
"<element name='Civ' a:help='Civilisation that this unit is primarily associated with, typically a 4-letter code. Choices include: gaia (world objects), cart (Carthaginians), celt (Celts), hele (Hellenes), iber (Iberians), pers (Persians), rome (Romans)'>" +
"<text/>" +
"</element>" +
"<element name='GenericName' a:help='Generic English-language name for this class of unit'>" +
"<text/>" +
"</element>" +
"<optional>" +
"<element name='SpecificName' a:help='Specific native-language name for this unit type'>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='SelectionGroupName' a:help='Name used to group ranked entities'>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Tooltip'>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Rollover'>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='History'>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Rank'>" +
"<choice>" +
"<value>Basic</value>" +
"<value>Advanced</value>" +
"<value>Elite</value>" +
"</choice>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Classes' a:help='Optional list of space-separated classes applying to this entity. Choices include: Unit, Infantry, Melee, Cavalry, Ranged, Mechanical, Ship, Siege, Champion, Hero, Elephant, Chariot, Mercenary, Spear, Sword, Bow, Javelin, Sling, Support, Animal, Domestic, Organic, Structure, Civic, CivCentre, Economic, Defensive, Gates, Wall, BarterMarket, Village, Town, City, ConquestCritical, Worker, Female, Healer, Slave, CitizenSoldier, Trade, Market, NavalMarket, Warship, SeaCreature, ForestPlant, DropsiteFood, DropsiteWood, DropsiteStone, DropsiteMetal, GarrisonTower, GarrisonFortress'>" +
"<attribute name='datatype'>" +
"<value>tokens</value>" +
"</attribute>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Formations' a:help='Optional list of space-separated formations this unit is allowed to use. Choices include: Scatter, Box, ColumnClosed, LineClosed, ColumnOpen, LineOpen, Flank, Skirmish, Wedge, Testudo, Phalanx, Syntagma, BattleLine'>" +
"<attribute name='datatype'>" +
"<value>tokens</value>" +
"</attribute>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='Icon'>" +
"<text/>" +
"</element>" +
"</optional>" +
"<optional>" +
"<element name='RequiredTechnology' a:help='Optional name of a technology which must be researched before the entity can be produced'>" +
"<text/>" +
"</element>" +
"</optional>";
Identity.prototype.Init = function()
{
};
Identity.prototype.Serialize = null; // we have no dynamic state to save
Identity.prototype.GetCiv = function()
{
return this.template.Civ;
};
Identity.prototype.GetRank = function()
{
return (this.template.Rank || "");
};
Identity.prototype.GetClassesList = function()
{
if (this.template.Classes && "_string" in this.template.Classes)
return ( this.template.Classes._string + " " + this.GetRank() ).split(/\s+/);
if (this.GetRank().length)
return [this.GetRank()];
return [];
};
Identity.prototype.HasClass = function(name)
{
return this.GetClassesList().indexOf(name) != -1;
};
Identity.prototype.GetFormationsList = function()
{
if (this.template.Formations && "_string" in this.template.Formations)
{
var string = this.template.Formations._string;
return string.split(/\s+/);
}
else
{
return [];
}
};
Identity.prototype.CanUseFormation = function(name)
{
return this.GetFormationsList().indexOf(name) != -1;
};
Identity.prototype.GetSelectionGroupName = function()
{
return (this.template.SelectionGroupName || "");
};
Identity.prototype.GetGenericName = function()
{
return this.template.GenericName;
};
Engine.RegisterComponentType(IID_Identity, "Identity", Identity);