本文整理汇总了C++中object::FindContents方法的典型用法代码示例。如果您正苦于以下问题:C++ object::FindContents方法的具体用法?C++ object::FindContents怎么用?C++ object::FindContents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::FindContents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FxIntCyclopsAITimer
global func FxIntCyclopsAITimer(object cyclops, proplist fx, int time)
{
if (!fx.cyclops)
{
fx.cyclops = cyclops;
fx.weapon = cyclops->FindContents(Club);
}
if (!fx.eye) fx.eye = FindObject(Find_ID(CyclopsEye));
fx.time = time;
// do not idle
var effect = GetEffect("IntWalk", fx.cyclops);
if (effect) effect.idle_time = 0;
fx.eye->SetPosition(fx.cyclops->GetX() -4 + fx.cyclops->GetDir() * 8, fx.cyclops->GetY() - 19);
// Find an enemy
if (fx.target) if (!fx.target->GetAlive() || (!fx.ranged && ObjectDistance(fx.target) >= fx.max_aggro_distance)) fx.target = nil;
if (!fx.target)
{
if (!(fx.target = CyclopsFindTarget(fx))) return CyclopsExecuteIdle(fx);
}
// Attack it!
return CyclopsExecuteMelee(fx, time);
}
示例2: Dlg_Newton_3
func Dlg_Newton_3(object clonk)
{
if (clonk->FindContents(Axe))
{
MessageBox("$Newton5$", clonk, clonk); // nope. where r trees?
SetDialogueProgress(5);
}
else
{
MessageBox("$Newton3$", clonk, clonk); // nope. where is axe?
}
return true;
}
示例3: Dlg_Iolo
public func Dlg_Iolo(object player)
{
var has_dialogue_arrow = player.dialogue_iolo_arrow
&& !player.dialogue_iolo_has_arrow;
var has_dialogue_elevator = GetActiveSequence()
&& GetActiveSequence().seq_name == "Iolo_Elevator";
var has_dialogue_iolo = player.dialogue_guardsman_elevator // same as in Iolo's father dialogue
&& !player.dialogue_iolo_arrow; // talked to guardsman about the elevator
if (has_dialogue_arrow)
{
var arrows = player->FindContents(BombArrow);
DlgText("$DlgIoloA01$");
if (arrows)
{
DlgText("$DlgIoloA02$", player);
DlgText("$DlgIoloA03$");
if (DlgEvent())
{
arrows->RemoveObject();
player.dialogue_iolo_has_arrow = true;
StartSequence("Iolo_Elevator", 0, this, player);
}
}
else
{
DlgText("$DlgIoloA04$", player);
}
}
else if (has_dialogue_elevator)
{
DlgText("$DlgIoloB01$");
DlgText("$DlgIoloB02$", player);
if (DlgEvent())
{
StopSequence();
}
}
else if (has_dialogue_iolo)
{
var in_sequence = GetActiveSequence()
&& GetActiveSequence().seq_name == "Iolo_Comes";
if (!in_sequence)
{
DlgText("$DlgIoloC01$");
// from father dialoge
DlgText("$DlgIoloFatherA10$", player);
DlgText("$DlgIoloFatherA11$", player);
DlgText("$DlgIoloFatherA12$", player);
DlgText("$DlgIoloFatherA13$");
// end of father dialoge
DlgText("$DlgIoloC02$");
if (DlgEvent())
{
StartSequence("Iolo_Comes", 0, this, player, true);
}
}
else
{
DlgText("$DlgIoloC03$");
if (DlgEvent())
{
player.dialogue_iolo_arrow = true;
StopSequence();
}
}
}
else
{
DlgText("$DlgIoloD01$");
DlgText("$DlgIoloD02$", player);
DlgText("$DlgIoloD03$");
}
}