当前位置: 首页>>代码示例>>C++>>正文


C++ P_DamageMobj函数代码示例

本文整理汇总了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;
}
开发者ID:Edward850,项目名称:zdoom,代码行数:16,代码来源:a_demon.cpp

示例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);
}
开发者ID:loismustdie555,项目名称:GZDoom-GPL,代码行数:16,代码来源:a_strifeweapons.cpp

示例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;
}
开发者ID:FlameNeon,项目名称:gzdoom,代码行数:16,代码来源:a_chicken.cpp

示例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);
    }
}
开发者ID:doomtech,项目名称:zdoom-old,代码行数:16,代码来源:a_pig.cpp

示例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;
}
开发者ID:Blastfrog,项目名称:eternity,代码行数:19,代码来源:acs_func.cpp

示例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;
}
开发者ID:BenJamesbabala,项目名称:ViZDoom,代码行数:16,代码来源:a_bishop.cpp

示例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);
   }
}
开发者ID:twinaphex,项目名称:eternity,代码行数:21,代码来源:a_doom.cpp

示例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();
	}
}
开发者ID:WChrisK,项目名称:Zandronum,代码行数:47,代码来源:a_quake.cpp

示例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);
    }
}
开发者ID:nano-bot,项目名称:zdoom,代码行数:17,代码来源:a_minotaur.cpp

示例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]);
			}
		}
	}
}
开发者ID:ddraigcymraeg,项目名称:gzscoredoom,代码行数:46,代码来源:a_dsparil.cpp

示例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);
}
开发者ID:loismustdie555,项目名称:GZDoom-GPL,代码行数:18,代码来源:a_programmer.cpp

示例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"));
}
开发者ID:DaZombieKiller,项目名称:lxDoom,代码行数:18,代码来源:a_cacodemon.cpp

示例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);
    }
}
开发者ID:loismustdie555,项目名称:GZDoom-GPL,代码行数:18,代码来源:a_serpent.cpp

示例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);
		}
	}
}
开发者ID:Krazygamr,项目名称:D-Touch,代码行数:18,代码来源:a_stalker.cpp

示例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"));
}
开发者ID:Jarvizx,项目名称:gz3doom,代码行数:21,代码来源:a_doomimp.cpp


注:本文中的P_DamageMobj函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。