Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/maps/random/danubius_triggers.js
Show First 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | if (!cmpUnitAI || cmpUnitAI.GetCurrentState() != "INDIVIDUAL.IDLE") | ||||
continue; | continue; | ||||
let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | let cmpIdentity = Engine.QueryInterface(ent, IID_Identity); | ||||
if (!cmpIdentity) | if (!cmpIdentity) | ||||
continue; | continue; | ||||
let animations = ritualAnimations[ | let animations = ritualAnimations[ | ||||
cmpIdentity.HasClass("Healer") ? "healer" : | cmpIdentity.HasClass("Healer") ? "healer" : | ||||
cmpIdentity.HasClass("Female") ? "female" : "male"]; | cmpIdentity.HasClass("Female") ? "female" : "male"]; | ||||
Lint: ESLintBear (indent): `Expected indentation of 4 tabs but found 3.` | |||||
let cmpVisual = Engine.QueryInterface(ent, IID_Visual); | let cmpVisual = Engine.QueryInterface(ent, IID_Visual); | ||||
if (!cmpVisual) | if (!cmpVisual) | ||||
continue; | continue; | ||||
if (animations.indexOf(cmpVisual.GetAnimationName()) == -1) | if (animations.indexOf(cmpVisual.GetAnimationName()) == -1) | ||||
cmpVisual.SelectAnimation(pickRandom(animations), false, 1, ""); | cmpVisual.SelectAnimation(pickRandom(animations), false, 1, ""); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | Trigger.prototype.InitDanubius = function() | ||||
// Depends on this.heroes | // Depends on this.heroes | ||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger).RegisterTrigger("OnOwnershipChanged", "DanubiusOwnershipChange", { "enabled": true }); | Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger).RegisterTrigger("OnOwnershipChanged", "DanubiusOwnershipChange", { "enabled": true }); | ||||
// Maps from gaia ship entity ID to ungarrison trigger point entity ID and land patrol triggerpoint name | // Maps from gaia ship entity ID to ungarrison trigger point entity ID and land patrol triggerpoint name | ||||
this.shipTarget = {}; | this.shipTarget = {}; | ||||
this.fillShipsTimer = undefined; | this.fillShipsTimer = undefined; | ||||
// Be able to distinguish between the left and right riverside | // Be able to distinguish between the left and right riverside | ||||
// TODO: The Vector2D types don't survive deserialization, so use an object with x and y properties only! | |||||
let mapSize = TriggerHelper.GetMapSizeTerrain(); | let mapSize = TriggerHelper.GetMapSizeTerrain(); | ||||
this.mapCenter = clone(new Vector2D(mapSize / 2, mapSize / 2)); | this.mapCenter = new Vector2D(mapSize / 2, mapSize / 2); | ||||
this.riverDirection = clone(Vector2D.sub( | this.riverDirection = Vector2D.sub( | ||||
TriggerHelper.GetEntityPosition2D(this.GetTriggerPoints(triggerPointRiverDirection)[0]), | TriggerHelper.GetEntityPosition2D(this.GetTriggerPoints(triggerPointRiverDirection)[0]), | ||||
this.mapCenter)); | this.mapCenter); | ||||
this.StartCelticRitual(); | this.StartCelticRitual(); | ||||
this.GarrisonAllGallicBuildings(); | this.GarrisonAllGallicBuildings(); | ||||
this.SpawnInitialCCDefenders(); | this.SpawnInitialCCDefenders(); | ||||
this.SpawnCCAttackers(); | this.SpawnCCAttackers(); | ||||
this.SpawnShips(); | this.SpawnShips(); | ||||
this.DoAfterDelay(shipUngarrisonInterval() * 60 * 1000, "UngarrisonShipsOrder", {}); | this.DoAfterDelay(shipUngarrisonInterval() * 60 * 1000, "UngarrisonShipsOrder", {}); | ||||
this.DoRepeatedly(5 * 1000, "CheckShipRange", {}); | this.DoRepeatedly(5 * 1000, "CheckShipRange", {}); | ||||
}; | }; | ||||
{ | { | ||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger).RegisterTrigger("OnInitGame", "InitDanubius", { "enabled": true }); | Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger).RegisterTrigger("OnInitGame", "InitDanubius", { "enabled": true }); | ||||
} | } |
Wildfire Games · Phabricator
Expected indentation of 4 tabs but found 3.