本文整理汇总了C++中UnitObj::StartBlindTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ UnitObj::StartBlindTarget方法的具体用法?C++ UnitObj::StartBlindTarget怎么用?C++ UnitObj::StartBlindTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitObj
的用法示例。
在下文中一共展示了UnitObj::StartBlindTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
//
// Apply
//
void ExplosionObjType::Apply(const Vector &location, UnitObj *unit, Team *team)
{
MapObjIter::All i(NULL, MapObjIter::FilterData(location, areaOuter));
MapObj *obj;
while ((obj = i.Next()) != NULL)
{
// Is the object within the full damage area
F32 dist2 = i.GetProximity2() - areaInner2;
S32 deltaHp;
//Vector dir = obj->WorldMatrix().posit - location;
//dir.Normalize();
if (dist2 <= 0.0f)
{
// Apply the full damage to this object
deltaHp = -damage.GetAmount(obj->MapType()->GetArmourClass());
obj->ModifyHitPoints(deltaHp, unit, team/*, &dir*/);
}
else
{
F32 mod = 1.0f - (dist2 * areaDiff2Inv);
ASSERT(mod >= 0 && mod <= 1.0f)
// Apply a proportional damage to this object
//Vector v = dir * mod;
deltaHp = -(S32) (((F32) damage.GetAmount(obj->MapType()->GetArmourClass())) * mod);
obj->ModifyHitPoints(deltaHp, unit, team/*, &v*/);
}
// Apply hit modifiers
if (ArmourClass::Lookup(damage.GetDamageId(), obj->MapType()->GetArmourClass()))
{
damage.GetModifiers().Apply(obj);
// Set blind target time
if (blindTargetTime)
{
UnitObj *unitObj = Promote::Object<UnitObjType, UnitObj>(obj);
if (unitObj)
{
unitObj->FlushTasks();
unitObj->StartBlindTarget(blindTargetTime);
}
}
// Apply the generic effect
StartGenericFX(obj, 0x32FBA304); // "ExplosionObj::ApplyTarget"
}
// Is there an action to execute
if (action && team)
{
Action::Execute(team, action);
}
}
}