本文整理汇总了C++中object::GetActionTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ object::GetActionTarget方法的具体用法?C++ object::GetActionTarget怎么用?C++ object::GetActionTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::GetActionTarget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTargetMovementObject
// Returns the object that determines the movement of the target.
// For example the object the target is attached to or contained in.
private func GetTargetMovementObject(object target)
{
// If attached: return the object the target is attached to.
if (target->GetProcedure() == DFA_ATTACH)
if (target->GetActionTarget())
return target->GetActionTarget();
// Default: return the target itself.
return target;
}
示例2: AddAI
// Add AI execution timer to target Clonk
func AddAI(object clonk)
{
var fx = GetEffect("S2AI", clonk);
if (!fx) fx = AddEffect("S2AI", clonk, 1, 3, nil, S2AI);
if (!fx || !clonk) return nil;
fx.ai = S2AI;
clonk.ExecuteS2AI = S2AI.Execute;
if (clonk->GetProcedure() == "PUSH") fx.vehicle = clonk->GetActionTarget();
BindInventory(clonk);
SetHome(clonk);
SetGuardRange(clonk, fx.home_x-S2AI_DefGuardRangeX, fx.home_y-S2AI_DefGuardRangeY, S2AI_DefGuardRangeX*2, S2AI_DefGuardRangeY*2);
SetMaxAggroDistance(clonk, S2AI_DefMaxAggroDistance);
return fx;
}
示例3: FixElevator
global func FixElevator(object elev, iDig)
{
var fBurned = GetID(elev)==ELVB;
var x=GetX(elev), y=GetDefBottom(elev);
elev->RemoveObject();
elev = CreateConstruction(ELEV, x,y, -1, 100, true); // Fürs Fundament...
elev->CreateShaft(iDig);
AddEffect("NoEnergyNeed", elev, 1, 1);
if(!fBurned) elev->GetActionTarget()->SetComDir(COMD_Down);
else
{
RemoveObject(LocalN("pCase", elev));
elev->ChangeDef(ELVB);
SetCategory(1, elev);
SetObjectLayer(elev, elev);
SetCon(100, elev);
AddEffect("Rebuild", elev, 1, 1);
}
}