本文整理汇总了C++中object::BlastObject方法的典型用法代码示例。如果您正苦于以下问题:C++ object::BlastObject方法的具体用法?C++ object::BlastObject怎么用?C++ object::BlastObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::BlastObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BlastObjects
// Damage and hurl objects away.
// documented in /docs/sdk/script/fn
global func BlastObjects(int x, int y, int level, object container, int cause_plr, int damage_level, object layer, object prev_container)
{
var obj;
// Coordinates are always supplied globally, convert to local coordinates.
var l_x = x - GetX(), l_y = y - GetY();
// caused by: if not specified, controller of calling object
if (cause_plr == nil)
if (this)
cause_plr = GetController();
// damage: if not specified this is the same as the explosion radius
if (damage_level == nil)
damage_level = level;
// In a container?
if (container)
{
if (container->GetObjectLayer() == layer)
{
container->BlastObject(damage_level, cause_plr);
if (!container)
return true; // Container could be removed in the meanwhile.
for (obj in FindObjects(Find_Container(container), Find_Layer(layer), Find_Exclude(prev_container)))
if (obj)
obj->BlastObject(damage_level, cause_plr);
}
}
示例2: BlastObjectsBlue
global func BlastObjectsBlue(int x, int y, int level, object container, int cause_plr, object layer)
{
var obj;
// Coordinates are always supplied globally, convert to local coordinates.
var l_x = x - GetX(), l_y = y - GetY();
// In a container?
if (container)
{
if (container->GetObjectLayer() == layer)
{
container->BlastObject(level, cause_plr);
if (!container)
return true; // Container could be removed in the meanwhile.
for (obj in FindObjects(Find_Container(container), Find_Layer(layer)))
if (obj)
obj->BlastObject(level, cause_plr);
}
}