I have managed to implement this for my mod, simply:
for every tileset in tilesets\ add an duplicate of beach type, like this
Code: Select all
TerrainType@Shallow:
Type: Shallow
TargetTypes: Ground
Color: B09C78
open the tilesetname.yaml, search for that Id:, change every Beach to Shallow under its definition Template@numbers: definition, like this:
Code: Select all
Template@247:
Id: 247
Images: f01.sno
Size: 3,3
Categories: Bridge
Tiles:
0: Rough
1: Road
2: Road
3: Shallow
4: Shallow
5: Shallow
6: Shallow
7: Shallow
8: Shallow
Code: Select all
Locomotor@NAVAL:
Name: naval
Crushes: crate
TerrainSpeeds:
Water: 100
Shallow: 70
Code: Select all
Cloak:
CloakTypes: Underwater
InitialDelay: 0
CloakDelay: 50
CloakSound: subshow1.aud
UncloakSound: subshow1.aud
CloakedCondition: underwater
Palette: submerged
PauseOnCondition: cloak-force-disabled || shallowcrossing
GrantConditionOnTerrain@CROSSINGFORD:
Condition: shallowcrossing
TerrainTypes: Shallow
Also maybe better to split the Submarine definition into its own, so Submarine units inherit it rather than having to insert it into every Submarine's definition:
Code: Select all
^Submarine
Inherits: ^Ship
RepairableNear:
Buildings: spen
Targetable:
TargetTypes: Ground, Water, Ship, Submarine
RequiresCondition: !underwater
Targetable@UNDERWATER:
TargetTypes: Underwater, Submarine
RequiresCondition: underwater
Targetable@REPAIR:
RequiresCondition: !underwater && damaged
TargetTypes: Repair
GrantConditionOnDamageState@DAMAGED:
Condition: damaged
ValidDamageStates: Light, Medium, Heavy, Critical
Cloak:
CloakTypes: Underwater
InitialDelay: 0
CloakDelay: 50
CloakSound: subshow1.aud
UncloakSound: subshow1.aud
CloakedCondition: underwater
Palette: submerged
PauseOnCondition: cloak-force-disabled || shallowcrossing
GrantConditionOnDamageState@UNCLOAK:
Condition: cloak-force-disabled
ValidDamageStates: Critical
GrantConditionOnTerrain@CROSSINGFORD:
Condition: shallowcrossing
TerrainTypes: Shallow
-MustBeDestroyed: