本文整理汇总了C++中P_DamageMobj函数的典型用法代码示例。如果您正苦于以下问题:C++ P_DamageMobj函数的具体用法?C++ P_DamageMobj怎么用?C++ P_DamageMobj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了P_DamageMobj函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_SargAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = ((pr_sargattack()%10)+1)*4;
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
}
return 0;
}
示例2: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
{
if (self->player != NULL)
{
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
}
self->player->mo->PlayAttacking2 ();
}
P_SpawnPlayerMissile (self, PClass::FindClass("MaulerTorpedo"));
P_DamageMobj (self, self, NULL, 20, self->DamageType);
P_ThrustMobj (self, self->angle + ANGLE_180, 0x7D000);
}
示例3: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_ChicAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return 0;
}
if (self->CheckMeleeRange())
{
int damage = 1 + (pr_chicattack() & 1);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
}
return 0;
}
示例4: A_PigAttack
void A_PigAttack (AActor *actor)
{
if (P_UpdateMorphedMonster (actor, 18))
{
return;
}
if (!actor->target)
{
return;
}
if (actor->CheckMeleeRange ())
{
P_DamageMobj(actor->target, actor, actor, 2+(pr_pigattack()&1), MOD_HIT);
S_Sound(actor, CHAN_WEAPON, "PigAttack", 1, ATTN_NORM);
}
}
示例5: ACS_funcThingDamage
//
// ACS_funcThingDamage
//
static void ACS_funcThingDamage(ACS_FUNCARG)
{
int32_t tid = args[0];
int32_t damage = args[1];
int mod = E_DamageTypeNumForName(ACSVM::GetString(args[2]));
Mobj *mo = NULL;
int32_t count = 0;
while((mo = P_FindMobjFromTID(tid, mo, thread->trigger)))
{
P_DamageMobj(mo, NULL, NULL, damage, mod);
++count;
}
*retn++ = count;
}
示例6: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack)
{
if (!self->target)
{
return;
}
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM);
if (self->CheckMeleeRange())
{
int damage = pr_atk.HitDice (4);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return;
}
self->special1 = (pr_atk() & 3) + 5;
}
示例7: A_SkelFist
//
// A_SkelFist
//
// Revenant punch attack.
//
void A_SkelFist(actionargs_t *actionargs)
{
Mobj *actor = actionargs->actor;
if(!actor->target)
return;
A_FaceTarget(actionargs);
if(P_CheckMeleeRange(actor))
{
int damage = ((P_Random(pr_skelfist) % 10) + 1) * 6;
S_StartSound(actor, sfx_skepch);
P_DamageMobj(actor->target, actor, actor, damage, MOD_HIT);
}
}
示例8: Destroy
void DEarthquake::Tick ()
{
int i;
if (m_Spot == NULL)
{
Destroy ();
return;
}
if (!S_IsActorPlayingSomething (m_Spot, CHAN_BODY, m_QuakeSFX))
{
S_Sound (m_Spot, CHAN_BODY | CHAN_LOOP, m_QuakeSFX, 1, ATTN_NORM);
}
if (m_DamageRadius > 0)
{
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !(players[i].cheats & CF_NOCLIP))
{
AActor *victim = players[i].mo;
fixed_t dist;
dist = P_AproxDistance (victim->x - m_Spot->x, victim->y - m_Spot->y);
// Check if in damage radius
if (dist < m_DamageRadius && victim->z <= victim->floorz)
{
if (pr_quake() < 50)
{
P_DamageMobj (victim, NULL, NULL, pr_quake.HitDice (1), NAME_None);
}
// Thrust player around
angle_t an = victim->angle + ANGLE_1*pr_quake();
P_ThrustMobj (victim, an, m_Intensity << (FRACBITS-1));
}
}
}
}
if (--m_Countdown == 0)
{
if (S_IsActorPlayingSomething(m_Spot, CHAN_BODY, m_QuakeSFX))
{
S_StopSound(m_Spot, CHAN_BODY);
}
Destroy();
}
}
示例9: P_MinotaurSlam
void P_MinotaurSlam (AActor *source, AActor *target)
{
DAngle angle;
double thrust;
int damage;
angle = source->AngleTo(target);
thrust = 16 + pr_minotaurslam() / 64.;
target->VelFromAngle(angle, thrust);
damage = pr_minotaurslam.HitDice (static_cast<AMinotaur *>(source) ? 4 : 6);
int newdam = P_DamageMobj (target, NULL, NULL, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, target, angle, 0.);
if (target->player)
{
target->reactiontime = 14+(pr_minotaurslam()&7);
}
}
示例10: A_Srcr1Attack
void A_Srcr1Attack (AActor *actor)
{
AActor *mo;
fixed_t momz;
angle_t angle;
if (!actor->target)
{
return;
}
S_SoundID (actor, CHAN_BODY, actor->AttackSound, 1, ATTN_NORM);
if (actor->CheckMeleeRange ())
{
int damage = pr_scrc1atk.HitDice (8);
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
P_TraceBleed (damage, actor->target, actor);
return;
}
if (actor->health > (actor->GetDefault()->health/3)*2)
{ // Spit one fireball
P_SpawnMissileZ (actor, actor->z + 48*FRACUNIT, actor->target, RUNTIME_CLASS(ASorcererFX1));
}
else
{ // Spit three fireballs
mo = P_SpawnMissileZ (actor, actor->z + 48*FRACUNIT, actor->target, RUNTIME_CLASS(ASorcererFX1));
if (mo != NULL)
{
momz = mo->momz;
angle = mo->angle;
P_SpawnMissileAngleZ (actor, actor->z + 48*FRACUNIT, RUNTIME_CLASS(ASorcererFX1), angle-ANGLE_1*3, momz);
P_SpawnMissileAngleZ (actor, actor->z + 48*FRACUNIT, RUNTIME_CLASS(ASorcererFX1), angle+ANGLE_1*3, momz);
}
if (actor->health < actor->GetDefault()->health/3)
{ // Maybe attack again
if (actor->special1)
{ // Just attacked, so don't attack again
actor->special1 = 0;
}
else
{ // Set state to attack again
actor->special1 = 1;
actor->SetState (&ASorcerer1::States[S_SRCR1_ATK+3]);
}
}
}
}
示例11: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_ProgrammerMelee)
{
int damage;
if (self->target == NULL)
return;
A_FaceTarget (self);
if (!self->CheckMeleeRange ())
return;
S_Sound (self, CHAN_WEAPON, "programmer/clank", 1, ATTN_NORM);
damage = ((pr_prog() % 10) + 1) * 6;
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
}
示例12: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_HeadAttack)
{
if (!self->target)
return;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = (pr_headattack()%6+1)*10;
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("CacodemonBall"));
}
示例13: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_SerpentMeleeAttack)
{
if (!self->target)
{
return;
}
if (self->CheckMeleeRange ())
{
int damage = pr_serpentmeattack.HitDice (5);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
S_Sound (self, CHAN_BODY, "SerpentMeleeHit", 1, ATTN_NORM);
}
if (pr_serpentmeattack() < 96)
{
CALL_ACTION(A_SerpentCheckForAttack, self);
}
}
示例14: DEFINE_ACTION_FUNCTION
DEFINE_ACTION_FUNCTION(AActor, A_StalkerAttack)
{
if (self->flags & MF_NOGRAVITY)
{
self->SetState (self->FindState("Drop"));
}
else if (self->target != NULL)
{
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = (pr_stalker() & 7) * 2 + 2;
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
}
}
}
示例15: DEFINE_ACTION_FUNCTION
//
// A_TroopAttack
//
DEFINE_ACTION_FUNCTION(AActor, A_TroopAttack)
{
if (!self->target)
return;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = (pr_troopattack()%8+1)*3;
S_Sound (self, CHAN_WEAPON, "imp/melee", 1, ATTN_NORM);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("DoomImpBall"));
}