Skip to content

Commit

Permalink
Migrate for a26
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Oct 14, 2024
1 parent 12c2948 commit 0cd7fe5
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 85 deletions.
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"label": "Water Resource",
"url": "github.com/0ADMods/resource__water",
"description": "Adds water as a usable resource in 0AD.",
"dependencies": ["0ad>=0.0.22"],
"dependencies": ["0ad=0.0.26"],
"type": "GUI Resource"
}
}
2 changes: 2 additions & 0 deletions simulation/data/resources/water.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"code": "water",
"name": "Water",
"description": "Get from water",
"order": 5,
"subtypes": {
"fresh": "Fresh Water",
"salt": "Salt Water",
"dirty": "Dirty Water"
},
"properties": ["barterable", "tradable", "tributable"],
"truePrice": 100,
"aiAnalysisInfluenceGroup": "ignore"
}
133 changes: 133 additions & 0 deletions simulation/templates/template_player.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity>
<AttackDetection>
<SuppressionTransferRange>80</SuppressionTransferRange>
<SuppressionRange>160</SuppressionRange>
<SuppressionTime>60000</SuppressionTime>
</AttackDetection>
<BattleDetection>
<TimerInterval>200</TimerInterval>
<RecordLength>12</RecordLength>
<DamageRateThreshold>0.04</DamageRateThreshold>
<AlertnessBattleThreshold>4</AlertnessBattleThreshold>
<AlertnessPeaceThreshold>0</AlertnessPeaceThreshold>
<AlertnessMax>8</AlertnessMax>
</BattleDetection>
<EntityLimits>
<Limits>
<Animal>50</Animal>
<CivilCentre>1</CivilCentre>
<Gladiator>0</Gladiator>
<Hero>1</Hero>
<Juggernaut>1</Juggernaut>
<Library>1</Library>
<Lighthouse>1</Lighthouse>
<Monument>5</Monument>
<Palace>2</Palace>
<Pillar>0</Pillar>
<PyramidLarge>2</PyramidLarge>
<TempleOfAmun>1</TempleOfAmun>
<TempleOfVesta>1</TempleOfVesta>
<Theater>1</Theater>
<Yakhchal>5</Yakhchal>
<WarDog>20</WarDog>
<Wonder>1</Wonder>
</Limits>
<LimitChangers>
<Gladiator>
<Amphitheater>15</Amphitheater>
</Gladiator>
<Juggernaut>
<PtolemyIV>4</PtolemyIV>
</Juggernaut>
<Pillar>
<Ashoka>5</Ashoka>
</Pillar>
</LimitChangers>
<LimitRemovers>
<CivilCentre>
<RequiredTechs datatype="tokens">phase_town</RequiredTechs>
</CivilCentre>
</LimitRemovers>
</EntityLimits>
<Identity>
<Classes datatype="tokens">Player</Classes>
<Undeletable>true</Undeletable>
</Identity>
<Player>
<BarterMultiplier>
<Buy>
<food>1.0</food>
<wood>1.0</wood>
<stone>1.0</stone>
<metal>1.0</metal>
<water>1.0</water>
</Buy>
<Sell>
<food>1.0</food>
<wood>1.0</wood>
<stone>1.0</stone>
<metal>1.0</metal>
<water>1.0</water>
</Sell>
</BarterMultiplier>
<SharedLosTech>unlock_shared_los</SharedLosTech>
<SharedDropsitesTech>unlock_shared_dropsites</SharedDropsitesTech>
<SpyCostMultiplier>1.0</SpyCostMultiplier>
<Formations datatype="tokens">
special/formations/null
special/formations/box
special/formations/column_closed
special/formations/line_closed
special/formations/column_open
special/formations/line_open
special/formations/flank
special/formations/battle_line
special/formations/skirmish
special/formations/wedge
</Formations>
</Player>
<ResourceTrickle>
<Rates>
<food>0.0</food>
<wood>0.0</wood>
<stone>0.0</stone>
<metal>0.0</metal>
<water>0.0</water>
</Rates>
<Interval>1000</Interval>
</ResourceTrickle>
<Sound>
<SoundGroups>
<defeated>interface/alarm/alarm_defeated.xml</defeated>
<defeated_ally>interface/alarm/alarm_defeated_ally.xml</defeated_ally>
<defeated_enemy>interface/alarm/alarm_defeated_enemy.xml</defeated_enemy>
<no_idle_unit>interface/alarm/alarm_no_idle_unit.xml</no_idle_unit>
</SoundGroups>
</Sound>
<StatisticsTracker>
<!-- The summary screen and lobby rankings expect these classes, but additional classes may be added. -->
<UnitClasses datatype="tokens">
Cavalry
Champion
Domestic
FemaleCitizen
Hero
Infantry
Ship
Siege
Trader
Worker
</UnitClasses>
<StructureClasses datatype="tokens">
Economic
CivCentre
Fortress
House
Military
Outpost
Wonder
</StructureClasses>
</StatisticsTracker>
<TechnologyManager/>
</Entity>
96 changes: 59 additions & 37 deletions simulation/templates/template_structure.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Entity parent="template_entity_full">
<Armour>
<Hack>1</Hack>
<Pierce>1</Pierce>
<Crush>1</Crush>
<Foundation>
<Hack>1</Hack>
<Pierce>1</Pierce>
<Crush>1</Crush>
</Foundation>
</Armour>
<BuildingAI>
<DefaultArrowCount>0</DefaultArrowCount>
<GarrisonArrowMultiplier>0</GarrisonArrowMultiplier>
<GarrisonArrowClasses>Infantry Cavalry</GarrisonArrowClasses>
</BuildingAI>
<Entity>
<AIProxy/>
<BuildRestrictions>
<PlacementType>land</PlacementType>
<Territory>own</Territory>
<Category>Structure</Category>
</BuildRestrictions>
<Capturable>
<CapturePoints>500</CapturePoints>
Expand All @@ -26,7 +13,6 @@
</Capturable>
<Cost>
<Population>0</Population>
<PopulationBonus>0</PopulationBonus>
<BuildTime>10</BuildTime>
<Resources>
<food>0</food>
Expand Down Expand Up @@ -54,21 +40,23 @@
<DeathType>corpse</DeathType>
<RegenRate>0</RegenRate>
<IdleRegenRate>0</IdleRegenRate>
<Undeletable>false</Undeletable>
<Unhealable>true</Unhealable>
</Health>
<Identity>
<Civ>gaia</Civ>
<GenericName>Structure</GenericName>
<Classes datatype="tokens">Structure ConquestCritical</Classes>
<Classes datatype="tokens">Structure</Classes>
<Undeletable>false</Undeletable>
</Identity>
<Loot>
<xp>0</xp>
<food>0</food>
<wood>10</wood>
<wood>0</wood>
<stone>0</stone>
<metal>0</metal>
<water>0</water>
<xp>0</xp>
</Loot>
<Looter/>
<Minimap>
<Type>structure</Type>
</Minimap>
Expand All @@ -77,36 +65,64 @@
<BlockMovement>true</BlockMovement>
<BlockPathfinding>true</BlockPathfinding>
<BlockFoundation>true</BlockFoundation>
<BlockConstruction>true</BlockConstruction>
<BlockConstruction>false</BlockConstruction>
<DisableBlockMovement>false</DisableBlockMovement>
<DisableBlockPathfinding>false</DisableBlockPathfinding>
<DeleteUponConstruction>false</DeleteUponConstruction>
</Obstruction>
<OverlayRenderer/>
<ProductionQueue>
<TechCostMultiplier>
<food>1.0</food>
<wood>1.0</wood>
<stone>1.0</stone>
<metal>1.0</metal>
<water>1.0</water>
<time>1.0</time>
</TechCostMultiplier>
</ProductionQueue>
<Ownership/>
<Position>
<Altitude>0</Altitude>
<Anchor>upright</Anchor>
<Floating>false</Floating>
<FloatDepth>0</FloatDepth>
<TurnRate>6</TurnRate>
</Position>
<RallyPoint/>
<RallyPointRenderer>
<MarkerTemplate>special/rallypoint</MarkerTemplate>
<LineTexture>art/textures/misc/rallypoint_line.png</LineTexture>
<LineTextureMask>art/textures/misc/rallypoint_line_mask.png</LineTextureMask>
<LineThickness>0.2</LineThickness>
<LineColor r="35" g="86" b="188"/>
<LineThickness>0.25</LineThickness>
<LineDashColor r="158" g="11" b="15"/>
<LineStartCap>square</LineStartCap>
<LineEndCap>round</LineEndCap>
<LinePassabilityClass>default</LinePassabilityClass>
</RallyPointRenderer>
<RangeOverlayManager/>
<RangeOverlayRenderer/>
<Repairable>
<RepairTimeRatio>2.0</RepairTimeRatio>
</Repairable>
<Resistance>
<Entity>
<ApplyStatus>
<Poisoned>
<Duration>0.0</Duration>
<BlockChance>1</BlockChance>
</Poisoned>
</ApplyStatus>
<Damage>
<Hack>1</Hack>
<Pierce>10</Pierce>
<Crush>1</Crush>
</Damage>
</Entity>
<Foundation>
<ApplyStatus>
<Poisoned>
<Duration>0.0</Duration>
<BlockChance>1</BlockChance>
</Poisoned>
</ApplyStatus>
<Damage>
<Hack>1</Hack>
<Pierce>10</Pierce>
<Crush>1</Crush>
</Damage>
</Foundation>
</Resistance>
<Selectable>
<Overlay>
<Outline>
Expand All @@ -122,17 +138,20 @@
<constructed>interface/complete/building/complete_universal.xml</constructed>
<death>attack/destruction/building_collapse_large.xml</death>
<attacked>interface/alarm/alarm_attackplayer.xml</attacked>
<attack>attack/weapon/arrowfly.xml</attack>
<attack_impact>attack/impact/arrow_metal.xml</attack_impact>
<attacked_gaia>interface/alarm/alarm_attacked_gaia.xml</attacked_gaia>
<attacked_capture>interface/alarm/alarm_attackplayer.xml</attacked_capture>
<attacked_capture_gaia>interface/alarm/alarm_attacked_gaia.xml</attacked_capture_gaia>
</SoundGroups>
</Sound>
<StatusBars>
<BarWidth>6.0</BarWidth>
<BarHeight>0.6</BarHeight>
<HeightOffset>12.0</HeightOffset>
</StatusBars>
<StatusEffectsReceiver/>
<TerritoryDecay>
<DecayRate>20</DecayRate>
<Territory>neutral enemy</Territory>
</TerritoryDecay>
<Visibility>
<RetainInFog>true</RetainInFog>
Expand All @@ -141,8 +160,11 @@
<Preview>false</Preview>
</Visibility>
<Vision>
<Range>40</Range>
<Range>4</Range>
</Vision>
<VisionSharing>
<Bribable>false</Bribable>
</VisionSharing>
<VisualActor>
<ConstructionPreview/>
<SilhouetteDisplay>false</SilhouetteDisplay>
Expand Down
Loading

0 comments on commit 0cd7fe5

Please sign in to comment.