Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/UnitAI.js
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | UnitAI.prototype.UnitFsmSpec = { | ||||
"Order.Stop": function(msg) { | "Order.Stop": function(msg) { | ||||
// We have no control over non-domestic animals. | // We have no control over non-domestic animals. | ||||
if (this.IsAnimal() && !this.IsDomestic()) | if (this.IsAnimal() && !this.IsDomestic()) | ||||
{ | { | ||||
this.FinishOrder(); | this.FinishOrder(); | ||||
return; | return; | ||||
} | } | ||||
Engine.DistributeMessage([this.entity], MT_Attacked, { "attacker": this.entity }); | |||||
// Stop moving immediately. | // Stop moving immediately. | ||||
this.StopMoving(); | this.StopMoving(); | ||||
this.FinishOrder(); | this.FinishOrder(); | ||||
// No orders left, we're an individual now | // No orders left, we're an individual now | ||||
if (this.IsAnimal()) | if (this.IsAnimal()) | ||||
this.SetNextState("ANIMAL.IDLE"); | this.SetNextState("ANIMAL.IDLE"); | ||||
else if (this.IsFormationMember()) | else if (this.IsFormationMember()) | ||||
▲ Show 20 Lines • Show All 6,123 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator