1
0
forked from mirrors/0ad

Introduce a 'Builder' class for entities that can build structures.

- Increases moddability
- Increases the clarity of visible classes (gatherer & builder vs
Worker)
- Introduce an 'Idle builder' hotkey.

Patch by: Nescio
Differential Revision: https://code.wildfiregames.com/D3290
This was SVN commit r25174.
This commit is contained in:
wraitii
2021-04-01 07:26:59 +00:00
parent 1b5ed5063f
commit 28bd4f0092
11 changed files with 20 additions and 14 deletions
+1
View File
@@ -263,6 +263,7 @@ nonmilitaryonly = "Alt+Y" ; Add only non-military units to the sel
idleonly = "I" ; Select only idle units
woundedonly = "O" ; Select only wounded units
remove = Ctrl ; Remove units from selection
idlebuilder = Semicolon ; Select next idle builder
idleworker = Period, NumDecimal ; Select next idle worker
idlewarrior = Slash, NumDivide ; Select next idle warrior
idleunit = BackSlash ; Select next idle unit
@@ -71,6 +71,7 @@ You may change hotkeys in [font="sans-bold-14"]Options > Hotkeys[font="sans-14"]
hotkey.selection.remove Modifier remove from selection (works with clicking and hotkeys, e.g. the idle hotkeys)
hotkey.selection.offscreen Modifier add all units, including offscreen units, to selection.
hotkey.selection.cancel Unselect all units, cancel building placement.
hotkey.selection.idlebuilder Select idle builder
hotkey.selection.idlewarrior Select idle fighter
hotkey.selection.idleworker Select idle worker (including citizen-soldiers)
hotkey.selection.idleunit Select idle unit
@@ -49,6 +49,10 @@
<action on="Release">updateSelectionDetails();</action>
</object>
<object hotkey="selection.idlebuilder">
<action on="KeyDown">findIdleUnit(["Builder"]);</action>
</object>
<!-- Find idle warrior - TODO: Potentially move this to own UI button? -->
<object hotkey="selection.idlewarrior">
<action on="KeyDown">findIdleUnit(g_MilitaryTypes);</action>
@@ -65,7 +65,7 @@ Identity.prototype.Schema =
"</element>" +
"</optional>" +
"<optional>" +
"<element name='VisibleClasses' a:help='Optional list of space-separated classes applying to this entity. These classes will also be visible in various GUI elements. If the classes need spaces, underscores will be replaced with spaces. Choices include: Amphitheater, Archer, ArmyCamp, Arsenal, ArtilleryTower, Axeman, Barracks, Bireme, BoltShooter, BoltTower, Bribable, Camel, Cavalry, Champion, Chariot, Citizen, City, Civic, CivilCentre, Colony, Corral, Council, Crossbowman, Defensive, Dock, Dog, Economic, Elephant, ElephantStable, Embassy, Farmstead, Field, Fireship, FishingBoat, Forge, Fortress, Gate, Gladiator, Gymnasium, Hall, Healer, Hero, House, Immortal, Infantry, Javelineer, Library, Lighthouse, Maceman, Melee, Market, Mercenary, Military, Monument, Naval, Outpost, Palace, Palisade, Pikeman, Pillar, Pyramid, Quinquereme, Ram, Range, Ranged, Relic, Resource, RotaryMill, SentryTower, Ship, Shipyard, Siege, SiegeTower, SiegeWall, Slave, Slinger, Soldier, Spearman, Stable, Stoa, StoneThrower, StoneTower, Storehouse, Support, Swordsman, Syssiton, Temple, TempleOfAmun, TempleOfApedemak, TempleOfMars, TempleOfVesta, Theater, Tower, Town, Trade, Trader, Trireme, TriumphalArch, Village, Wall, Warship, Wonder, Worker.'>" +
"<element name='VisibleClasses' a:help='Optional list of space-separated classes applying to this entity. These classes will also be visible in various GUI elements. If the classes need spaces, underscores will be replaced with spaces. Choices include: Amphitheater, Archer, ArmyCamp, Arsenal, ArtilleryTower, Axeman, Barracks, Bireme, BoltShooter, BoltTower, Bribable, Builder, Camel, Cavalry, Champion, Chariot, Citizen, City, Civic, CivilCentre, Colony, Corral, Council, Crossbowman, Defensive, Dock, Dog, Economic, Elephant, ElephantStable, Embassy, Farmstead, Field, Fireship, FishingBoat, Forge, Fortress, Gate, Gladiator, Gymnasium, Hall, Healer, Hero, House, Immortal, Infantry, Javelineer, Library, Lighthouse, Maceman, Melee, Market, Mercenary, Military, Monument, Naval, Outpost, Palace, Palisade, Pikeman, Pillar, Pyramid, Quinquereme, Ram, Range, Ranged, Relic, Resource, RotaryMill, SentryTower, Ship, Shipyard, Siege, SiegeTower, SiegeWall, Slave, Slinger, Soldier, Spearman, Stable, Stoa, StoneThrower, StoneTower, Storehouse, Support, Swordsman, Syssiton, Temple, TempleOfAmun, TempleOfApedemak, TempleOfMars, TempleOfVesta, Theater, Tower, Town, Trade, Trader, Trireme, TriumphalArch, Village, Wall, Warship, Wonder, Worker.'>" +
"<attribute name='datatype'>" +
"<value>tokens</value>" +
"</attribute>" +
@@ -1,6 +1,6 @@
{
"affects": ["Worker"],
"auraDescription": "Workers +25% build rate.",
"affects": ["Builder"],
"auraDescription": "Builders +25% build rate.",
"auraName": "Elephant Workers",
"modifications": [
{ "value": "Builder/Rate", "multiply": 1.25 }
@@ -1,11 +1,11 @@
{
"type": "range",
"radius": 60,
"affects": ["Worker"],
"affects": ["Builder"],
"modifications": [
{ "value": "Builder/Rate", "multiply": 1.15 }
],
"auraName": "Periclean Building Program",
"auraDescription": "Workers +15% build rate.",
"auraDescription": "Builders +15% build rate.",
"overlayIcon": "art/textures/ui/session/auras/build_bonus.png"
}
@@ -4,7 +4,7 @@
"affects": ["Worker"],
"modifications": [
{ "value": "Builder/Rate", "multiply": 1.15 },
{ "value": "ResourceGatherer/BaseSpeed", "multiply": 1.15 }
{ "value": "ResourceGatherer/BaseSpeed", "multiply": 1.15, "affects": "Builder" }
],
"auraName": "Administrator",
"auraDescription": "Workers +15% build rate and gather speed.",
@@ -1,11 +1,11 @@
{
"type": "range",
"radius": 60,
"affects": ["Worker"],
"affects": ["Builder"],
"modifications": [
{ "value": "Builder/Rate", "multiply": 1.1 }
],
"auraName": "Patron of Construction",
"auraDescription": "Workers +10% build rate.",
"auraDescription": "Builders +10% build rate.",
"overlayIcon": "art/textures/ui/session/auras/build_bonus.png"
}
@@ -60,9 +60,9 @@
<Max>80</Max>
</Health>
<Identity>
<Classes datatype="tokens">Human CitizenSoldier</Classes>
<VisibleClasses datatype="tokens">Citizen Worker Soldier Infantry</VisibleClasses>
<GenericName>Infantry</GenericName>
<Classes datatype="tokens">Human CitizenSoldier</Classes>
<VisibleClasses datatype="tokens">Citizen Builder Worker Soldier Infantry</VisibleClasses>
<Rank>Basic</Rank>
</Identity>
<Loot>
@@ -59,11 +59,11 @@
<Max>25</Max>
</Health>
<Identity>
<Classes datatype="tokens">FemaleCitizen</Classes>
<VisibleClasses datatype="tokens">Citizen Worker</VisibleClasses>
<Phenotype>female</Phenotype>
<GenericName>Female Citizen</GenericName>
<SelectionGroupName>template_unit_support_female_citizen</SelectionGroupName>
<Phenotype>female</Phenotype>
<Classes datatype="tokens">FemaleCitizen</Classes>
<VisibleClasses datatype="tokens">Citizen Builder Worker</VisibleClasses>
<Formations disable=""/>
</Identity>
<Loot>
@@ -43,10 +43,10 @@
<Unhealable>true</Unhealable>
</Health>
<Identity>
<VisibleClasses datatype="tokens">Slave Worker</VisibleClasses>
<GenericName>Slave</GenericName>
<SelectionGroupName>template_unit_support_slave</SelectionGroupName>
<Tooltip>Gatherer with a finite life span. Bonused at mining and lumbering.</Tooltip>
<VisibleClasses datatype="tokens">Builder Worker Slave</VisibleClasses>
</Identity>
<Loot>
<xp>10</xp>