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 131 Lines • ▼ Show 20 Lines | Trigger.prototype.AttackAndPatrol = function(entities, targetClass, triggerPointRef, debugName, attack) | ||||
this.debugLog(debugName + " " + uneval(attackers) + " attack " + uneval(closestTarget)); | this.debugLog(debugName + " " + uneval(attackers) + " attack " + uneval(closestTarget)); | ||||
if (attack && closestTarget) | if (attack && closestTarget) | ||||
ProcessCommand(gaulPlayer, { | ProcessCommand(gaulPlayer, { | ||||
"type": "attack", | "type": "attack", | ||||
"entities": attackers, | "entities": attackers, | ||||
"target": closestTarget, | "target": closestTarget, | ||||
"queued": true, | "ignoreAttackEffects": { | ||||
"allowCapture": false | "Capture": true | ||||
}, | |||||
"queued": true | |||||
}); | }); | ||||
let patrolTargets = shuffleArray(this.GetTriggerPoints(triggerPointRef)).slice(0, patrolCount); | let patrolTargets = shuffleArray(this.GetTriggerPoints(triggerPointRef)).slice(0, patrolCount); | ||||
this.debugLog(debugName + " " + uneval(attackers) + " patrol to " + uneval(patrolTargets)); | this.debugLog(debugName + " " + uneval(attackers) + " patrol to " + uneval(patrolTargets)); | ||||
for (let patrolTarget of patrolTargets) | for (let patrolTarget of patrolTargets) | ||||
{ | { | ||||
let targetPos = TriggerHelper.GetEntityPosition2D(patrolTarget); | let targetPos = TriggerHelper.GetEntityPosition2D(patrolTarget); | ||||
ProcessCommand(gaulPlayer, { | ProcessCommand(gaulPlayer, { | ||||
"type": "patrol", | "type": "patrol", | ||||
"entities": attackers, | "entities": attackers, | ||||
"x": targetPos.x, | "x": targetPos.x, | ||||
"z": targetPos.y, | "z": targetPos.y, | ||||
"targetClasses": { | "targetClasses": { | ||||
"attack": targetClass | "attack": targetClass | ||||
}, | }, | ||||
"queued": true, | "ignoreAttackEffects": { | ||||
"allowCapture": false | "Capture": true | ||||
}, | |||||
"queued": true | |||||
}); | }); | ||||
} | } | ||||
}; | }; | ||||
/** | /** | ||||
* To avoid unloading unlimited amounts of units on empty riversides, | * To avoid unloading unlimited amounts of units on empty riversides, | ||||
* only add attackers to riversides where player buildings exist that are | * only add attackers to riversides where player buildings exist that are | ||||
* actually targeted. | * actually targeted. | ||||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Expected indentation of 4 tabs but found 3.