• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ P_DamageMobj函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中P_DamageMobj函数的典型用法代码示例。如果您正苦于以下问题:C++ P_DamageMobj函数的具体用法?C++ P_DamageMobj怎么用?C++ P_DamageMobj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了P_DamageMobj函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
{
	PARAM_ACTION_PROLOGUE;

	if (self->player != NULL)
	{
		AWeapon *weapon = self->player->ReadyWeapon;
		if (weapon != NULL)
		{
			if (!weapon->DepleteAmmo (weapon->bAltFire))
				return 0;
		}
		self->player->mo->PlayAttacking2 ();
	}
	P_SpawnPlayerMissile (self, PClass::FindActor("MaulerTorpedo"));
	P_DamageMobj (self, self, NULL, 20, self->DamageType);
	self->Thrust(self->Angles.Yaw+180., 7.8125);
	return 0;
}
开发者ID:Jayman2000,项目名称:zdoom-pull,代码行数:19,代码来源:a_strifeweapons.cpp


示例17: P_PlayerOnSpecialFlat

void P_PlayerOnSpecialFlat(player_t *player, int floorType)
{
	if(player->plr->mo->z		/*!= player->plr->mo->floorz */
	   > player->plr->mo->subsector->sector->floorheight)
	{							// Player is not touching the floor
		return;
	}
	switch (floorType)
	{
	case FLOOR_LAVA:
		if(!(leveltime & 31))
		{
			P_DamageMobj(player->plr->mo, &LavaInflictor, NULL, 10);
			S_StartSound(SFX_LAVA_SIZZLE, player->plr->mo);
		}
		break;
	default:
		break;
	}
}
开发者ID:amitahire,项目名称:development,代码行数:20,代码来源:P_spec.c


示例18: P_DamageMobj

int ALightning::SpecialMissileHit (AActor *thing)
{
	if (thing->flags&MF_SHOOTABLE && thing != target)
	{
		if (thing->Mass != INT_MAX)
		{
			thing->Vel.X += Vel.X / 16;
			thing->Vel.Y += Vel.Y / 16;
		}
		if ((!thing->player && !(thing->flags2&MF2_BOSS))
			|| !(level.time&1))
		{
			P_DamageMobj(thing, this, target, 3, NAME_Electric);
			if (!(S_IsActorPlayingSomething (this, CHAN_WEAPON, -1)))
			{
				S_Sound (this, CHAN_WEAPON, this->AttackSound, 1, ATTN_NORM);
			}
			if (thing->flags3&MF3_ISMONSTER && pr_hit() < 64)
			{
				thing->Howl ();
			}
		}
		health--;
		if (health <= 0 || thing->health <= 0)
		{
			return 0;
		}
		if (flags3 & MF3_FLOORHUGGER)
		{
			if (lastenemy && ! lastenemy->tracer)
			{
				lastenemy->tracer = thing;
			}
		}
		else if (!tracer)
		{
			tracer = thing;
		}
	}
	return 1; // lightning zaps through all sprites
}
开发者ID:Jayman2000,项目名称:zdoom-pull,代码行数:41,代码来源:a_magelightning.cpp


示例19: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
{
    PARAM_ACTION_PROLOGUE;

    AActor *mo;
    DAngle angle;
    double vz;
    double z;
    bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);

    if (self->target == NULL)
    {
        return 0;
    }
    S_Sound (self, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
    if (self->CheckMeleeRange())
    {
        int damage;
        damage = pr_atk.HitDice (friendly ? 3 : 5);
        int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
        P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
        return 0;
    }
    z = self->Z() + 40;
    PClassActor *fx = PClass::FindActor("MinotaurFX1");
    if (fx)
    {
        mo = P_SpawnMissileZ (self, z, self->target, fx);
        if (mo != NULL)
        {
//			S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
            vz = mo->Vel.Z;
            angle = mo->Angles.Yaw;
            P_SpawnMissileAngleZ (self, z, fx, angle-(45./8), vz);
            P_SpawnMissileAngleZ (self, z, fx, angle+(45./8), vz);
            P_SpawnMissileAngleZ (self, z, fx, angle-(45./16), vz);
            P_SpawnMissileAngleZ (self, z, fx, angle+(45./16), vz);
        }
    }
    return 0;
}
开发者ID:nano-bot,项目名称:zdoom,代码行数:41,代码来源:a_minotaur.cpp


示例20: A_BruisAttack

//
// A_BruisAttack
//
// Baron of Hell attack.
//
void A_BruisAttack(actionargs_t *actionargs)
{
   Mobj *actor = actionargs->actor;

   if(!actor->target)
      return;
   
   if(P_CheckMeleeRange(actor))
   {
      int damage;
      S_StartSound(actor, sfx_claw);
      damage = (P_Random(pr_bruisattack)%8+1)*10;
      P_DamageMobj(actor->target, actor, actor, damage, MOD_HIT);
   }
   else
   {
      // launch a missile
      P_SpawnMissile(actor, actor->target, E_SafeThingType(MT_BRUISERSHOT),
                     actor->z + DEFAULTMISSILEZ);  
   }
}
开发者ID:twinaphex,项目名称:eternity,代码行数:26,代码来源:a_doom.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ P_FIRSTDATAKEY函数代码示例发布时间:2022-05-30
下一篇:
C++ P_AimLineAttack函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap