Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/helpers/Transform.js
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | if (cmpUnitAI.IsGuardOf()) | ||||
if (cmpGuard) | if (cmpGuard) | ||||
{ | { | ||||
cmpGuard.RenameGuard(oldEnt, newEnt); | cmpGuard.RenameGuard(oldEnt, newEnt); | ||||
cmpNewUnitAI.SetGuardOf(guarded); | cmpNewUnitAI.SetGuardOf(guarded); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
let cmpPromotion = Engine.QueryInterface(oldEnt, IID_Promotion); | |||||
let cmpNewPromotion = Engine.QueryInterface(newEnt, IID_Promotion); | |||||
if (cmpPromotion && cmpNewPromotion) | |||||
cmpNewPromotion.IncreaseXp(cmpPromotion.GetCurrentXp()); | |||||
let cmpResGatherer = Engine.QueryInterface(oldEnt, IID_ResourceGatherer); | |||||
let cmpNewResGatherer = Engine.QueryInterface(newEnt, IID_ResourceGatherer); | |||||
if (cmpResGatherer && cmpNewResGatherer) | |||||
{ | |||||
let carriedResources = cmpResGatherer.GetCarryingStatus(); | |||||
cmpNewResGatherer.GiveResources(carriedResources); | |||||
} | |||||
// Maintain the list of guards | // Maintain the list of guards | ||||
let cmpGuard = Engine.QueryInterface(oldEnt, IID_Guard); | let cmpGuard = Engine.QueryInterface(oldEnt, IID_Guard); | ||||
let cmpNewGuard = Engine.QueryInterface(newEnt, IID_Guard); | let cmpNewGuard = Engine.QueryInterface(newEnt, IID_Guard); | ||||
if (cmpGuard && cmpNewGuard) | if (cmpGuard && cmpNewGuard) | ||||
{ | { | ||||
let entities = cmpGuard.GetEntities(); | let entities = cmpGuard.GetEntities(); | ||||
if (entities.length) | if (entities.length) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator