本文整理汇总了C++中AInventory::BecomeItem方法的典型用法代码示例。如果您正苦于以下问题:C++ AInventory::BecomeItem方法的具体用法?C++ AInventory::BecomeItem怎么用?C++ AInventory::BecomeItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AInventory
的用法示例。
在下文中一共展示了AInventory::BecomeItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FixedMul
AInventory *AAmmo::CreateCopy (AActor *other)
{
AInventory *copy;
int amount = Amount;
// extra ammo in baby mode and nightmare mode
if (!(ItemFlags&IF_IGNORESKILL))
{
amount = FixedMul(amount, G_SkillProperty(SKILLP_AmmoFactor));
}
if (GetClass()->ParentClass != RUNTIME_CLASS(AAmmo) && GetClass() != RUNTIME_CLASS(AAmmo))
{
const PClass *type = GetParentAmmo();
assert (type->ActorInfo != NULL);
if (!GoAway ())
{
Destroy ();
}
copy = static_cast<AInventory *>(Spawn (type, 0, 0, 0, NO_REPLACE));
copy->Amount = amount;
copy->BecomeItem ();
}
else
{
copy = Super::CreateCopy (other);
copy->Amount = amount;
}
if (copy->Amount > copy->MaxAmount)
{ // Don't pick up more ammo than you're supposed to be able to carry.
copy->Amount = copy->MaxAmount;
}
return copy;
}
示例2: GetParentAmmo
AInventory *AAmmo::CreateCopy (AActor *other)
{
AInventory *copy;
if (GetClass()->ParentType != RUNTIME_CLASS(AAmmo))
{
const TypeInfo *type = GetParentAmmo();
if (!GoAway ())
{
Destroy ();
}
copy = static_cast<AInventory *>(Spawn (type, 0, 0, 0));
copy->Amount = Amount;
copy->BecomeItem ();
}
else
{
copy = Super::CreateCopy (other);
}
if (copy->Amount > copy->MaxAmount)
{ // Don't pick up more ammo than you're supposed to be able to carry.
copy->Amount = copy->MaxAmount;
}
return copy;
}
示例3: CreateCopy
AInventory *ACoin::CreateCopy (AActor *other)
{
if (GetClass() == RUNTIME_CLASS(ACoin))
{
return Super::CreateCopy (other);
}
AInventory *copy = Spawn<ACoin> (0,0,0, NO_REPLACE);
copy->Amount = Amount;
copy->BecomeItem ();
GoAwayAndDie ();
return copy;
}