实体

爆炸 CExplosion

爆炸槽表添加与查询

CExplosion.h

逻辑帧。与 CWorld::TriggerExplosion 不同:这是爆炸槽表。

添加爆炸

AddExplosion

eExplosionType 见头文件。

static bool AddExplosion(CEntity* victim, CEntity* creator, eExplosionType explosionType,
    CVector posn, unsigned int time, unsigned char makeSound, float camShake, unsigned char visibility);

爆炸类型

eExplosionType

手雷、燃烧瓶、火箭、车、船、飞机、小爆炸等。

// EXPLOSION_GRENADE, EXPLOSION_MOLOTOV, EXPLOSION_ROCKET,
// EXPLOSION_CAR, EXPLOSION_BOAT, EXPLOSION_AIRCRAFT,
// EXPLOSION_SMALL, EXPLOSION_RC_VEHICLE, ...

清爆炸

ClearAllExplosions / RemoveAllExplosionsInArea
static void ClearAllExplosions();
static void RemoveAllExplosionsInArea(CVector posn, float radius);

区域是否有爆炸

TestForExplosionInArea
static bool TestForExplosionInArea(eExplosionType explosionType,
    float x1, float y1, float z1, float x2, float y2, float z2);

读槽信息

GetExplosionType / GetExplosionPosition
static unsigned int GetExplosionType(unsigned char explosionId);
static CVector* GetExplosionPosition(unsigned char explosionId);
static unsigned char GetExplosionActiveCounter(unsigned char explosionId);

全局表

aExplosions / MAX_EXPLOSIONS
extern unsigned int MAX_EXPLOSIONS; // 16
extern CExplosion* aExplosions;

也可用 CWorld::TriggerExplosion 做世界伤害扩散,见 世界

On this page