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

C++ A_FaceTarget函数代码示例

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

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



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

示例1: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_CrusaderChoose)
{
	if (self->target == NULL)
		return;

	if (Sys_1ed64 (self))
	{
		A_FaceTarget (self);
		self->angle -= ANGLE_180/16;
		P_SpawnMissileZAimed (self, self->z + 40*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile"));
	}
	else
	{
		if (P_CheckMissileRange (self))
		{
			A_FaceTarget (self);
			P_SpawnMissileZAimed (self, self->z + 56*FRACUNIT, self->target, PClass::FindClass("CrusaderMissile"));
			self->angle -= ANGLE_45/32;
			P_SpawnMissileZAimed (self, self->z + 40*FRACUNIT, self->target, PClass::FindClass("CrusaderMissile"));
			self->angle += ANGLE_45/16;
			P_SpawnMissileZAimed (self, self->z + 40*FRACUNIT, self->target, PClass::FindClass("CrusaderMissile"));
			self->angle -= ANGLE_45/16;
			self->reactiontime += 15;
		}
		self->SetState (self->SeeState);
	}
}
开发者ID:Xeomuz,项目名称:Doom-Port-Source-Code,代码行数:27,代码来源:a_crusader.cpp


示例2: A_20c74

void A_20c74 (AActor *selfa)
{
	AEntityBoss *self = static_cast<AEntityBoss *>(selfa);
	AEntitySecond *second;
	fixed_t secondRadius = GetDefault<AEntitySecond>()->radius * 2;
	angle_t an;
	
	an = self->angle >> ANGLETOFINESHIFT;
	second = Spawn<AEntitySecond> (self->SpawnX + FixedMul (secondRadius, finecosine[an]),
		self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ, ALLOW_REPLACE);
	second->target = self->target;
	A_FaceTarget (second);
	an = second->angle >> ANGLETOFINESHIFT;
	second->momx += FixedMul (finecosine[an], 320000);
	second->momy += FixedMul (finesine[an], 320000);

	an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT;
	second = Spawn<AEntitySecond> (self->SpawnX + FixedMul (secondRadius, finecosine[an]),
		self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ, ALLOW_REPLACE);
	second->target = self->target;
	second->momx = FixedMul (secondRadius, finecosine[an]) << 2;
	second->momy = FixedMul (secondRadius, finesine[an]) << 2;
	A_FaceTarget (second);

	an = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT;
	second = Spawn<AEntitySecond> (self->SpawnX + FixedMul (secondRadius, finecosine[an]),
		self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ, ALLOW_REPLACE);
	second->target = self->target;
	second->momx = FixedMul (secondRadius, finecosine[an]) << 2;
	second->momy = FixedMul (secondRadius, finesine[an]) << 2;
	A_FaceTarget (second);
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:32,代码来源:a_entityboss.cpp


示例3: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
{
    PARAM_ACTION_PROLOGUE;

    bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
    AActor *target;
    double dist;

    target = self->target;
    if (!target)
    {
        return 0;
    }
    if (!friendly)
    {
        S_Sound (self, CHAN_WEAPON, "minotaur/sight", 1, ATTN_NORM);
    }
    dist = self->Distance2D(target);
    if (target->Top() > self->Z()
            && target->Top() < self->Top()
            && dist < (friendly ? 16*64. : 8*64.)
            && dist > 1*64.
            && pr_minotaurdecide() < 150)
    {   // Charge attack
        // Don't call the state function right away
        self->SetState (self->FindState ("Charge"), true);
        self->flags |= MF_SKULLFLY;
        if (!friendly)
        {   // Heretic's Minotaur is invulnerable during charge attack
            self->flags2 |= MF2_INVULNERABLE;
        }
        A_FaceTarget (self);
        self->VelFromAngle(MNTR_CHARGE_SPEED);
        self->special1 = TICRATE/2; // Charge duration
    }
    else if (target->Z() == target->floorz
             && dist < 9*64.
             && pr_minotaurdecide() < (friendly ? 100 : 220))
    {   // Floor fire attack
        self->SetState (self->FindState ("Hammer"));
        self->special2 = 0;
    }
    else
    {   // Swing attack
        A_FaceTarget (self);
        // Don't need to call P_SetMobjState because the current state
        // falls through to the swing attack
    }
    return 0;
}
开发者ID:nano-bot,项目名称:zdoom,代码行数:50,代码来源:a_minotaur.cpp


示例4: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack)
{
	PARAM_ACTION_PROLOGUE;

	AActor *proj;

	if (self->target == NULL)
		return 0;

	A_FaceTarget (self);

	self->AddZ(32);
	self->Angles.Yaw -= 45./32;
	proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
	if (proj != NULL)
	{
		proj->Vel.Z += 9;
	}
	self->Angles.Yaw += 45./16;
	proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
	if (proj != NULL)
	{
		proj->Vel.Z += 16;
	}
	self->AddZ(-32);
	return 0;
}
开发者ID:Accusedbold,项目名称:zdoom,代码行数:27,代码来源:a_inquisitor.cpp


示例5: A_SpidRefire

//
// A_SpidRefire
//
// Spider Mastermind line-of-sight checking.
//
void A_SpidRefire(actionargs_t *actionargs)
{
   Mobj *actor = actionargs->actor;

   // keep firing unless target got out of sight
   A_FaceTarget(actionargs);
   
   // killough 12/98: Stop firing if a friend has gotten in the way
   if(actor->flags & MF_FRIEND && P_HitFriend(actor))
   {
      P_SetMobjState(actor, actor->info->seestate);
      return;
   }
   
   if(P_Random(pr_spidrefire) < 10)
      return;

   // killough 11/98: prevent refiring on friends continuously
   if(!actor->target || actor->target->health <= 0    ||
      actor->flags & actor->target->flags & MF_FRIEND ||
      !P_CheckSight(actor, actor->target))
   {
      P_SetMobjState(actor, actor->info->seestate);
   }
}
开发者ID:twinaphex,项目名称:eternity,代码行数:30,代码来源:a_doom.cpp


示例6: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump)
{
	fixed_t dist;
	fixed_t speed;
	angle_t an;

	if (self->target == NULL)
		return;

	S_Sound (self, CHAN_ITEM|CHAN_LOOP, "inquisitor/jump", 1, ATTN_NORM);
	self->AddZ(64*FRACUNIT);
	A_FaceTarget (self);
	an = self->angle >> ANGLETOFINESHIFT;
	speed = self->Speed * 2/3;
	self->velx += FixedMul (speed, finecosine[an]);
	self->vely += FixedMul (speed, finesine[an]);
	dist = self->AproxDistance (self->target);
	dist /= speed;
	if (dist < 1)
	{
		dist = 1;
	}
	self->velz = (self->target->Z() - self->Z()) / dist;
	self->reactiontime = 60;
	self->flags |= MF_NOGRAVITY;
}
开发者ID:loismustdie555,项目名称:GZDoom-GPL,代码行数:26,代码来源:a_inquisitor.cpp


示例7: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_TemplarAttack)
{
	int damage;
	angle_t angle;
	int pitch;
	int pitchdiff;

	if (self->target == NULL)
		return;

	S_Sound (self, CHAN_WEAPON, "templar/shoot", 1, ATTN_NORM);

	// [CW] Tell clients to play the sound.
	if ( NETWORK_GetState( ) == NETSTATE_SERVER )
		SERVERCOMMANDS_SoundActor( self, CHAN_WEAPON, "templar/shoot", 1, ATTN_NORM );

	A_FaceTarget (self);
	pitch = P_AimLineAttack (self, self->angle, MISSILERANGE);

	for (int i = 0; i < 10; ++i)
	{
		damage = (pr_templar() & 4) * 2;
		angle = self->angle + (pr_templar.Random2() << 19);
		pitchdiff = pr_templar.Random2() * 332063;
		P_LineAttack (self, angle, MISSILERANGE+64*FRACUNIT, pitch+pitchdiff, damage, NAME_None, NAME_MaulerPuff);
	}
}
开发者ID:WChrisK,项目名称:Zandronum,代码行数:27,代码来源:a_templar.cpp


示例8: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_SkelWhoosh)
{
	if (!self->target)
		return;
	A_FaceTarget (self);
	S_Sound (self, CHAN_WEAPON, "skeleton/swing", 1, ATTN_NORM);
}
开发者ID:DaZombieKiller,项目名称:lxDoom,代码行数:7,代码来源:a_revenant.cpp


示例9: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_CPosAttack)
{
    int angle;
    int bangle;
    int damage;
    int slope;

    if (!self->target)
        return;

    // [RH] Andy Baker's stealth monsters
    if (self->flags & MF_STEALTH)
    {
        self->visdir = 1;
    }

    S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
    A_FaceTarget (self);
    bangle = self->angle;
    slope = P_AimLineAttack (self, bangle, MISSILERANGE);

    angle = bangle + (pr_cposattack.Random2() << 20);
    damage = ((pr_cposattack()%5)+1)*3;
    P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_Hitscan, NAME_BulletPuff);
}
开发者ID:BadSanta1980,项目名称:gzdoom,代码行数:25,代码来源:a_possessed.cpp


示例10: DEFINE_ACTION_FUNCTION

//
// A_PosAttack
//
DEFINE_ACTION_FUNCTION(AActor, A_PosAttack)
{
	int angle;
	int damage;
	int slope;
		
	// [BC] Server takes care of the rest of this.
	if (( NETWORK_GetState( ) == NETSTATE_CLIENT ) ||
		( CLIENTDEMO_IsPlaying( )))
	{
		S_Sound( self, CHAN_WEAPON, "grunt/attack", 1, ATTN_NORM );
		return;
	}

	if (!self->target)
		return;
				
	A_FaceTarget (self);
	angle = self->angle;
	slope = P_AimLineAttack (self, angle, MISSILERANGE);

	S_Sound (self, CHAN_WEAPON, "grunt/attack", 1, ATTN_NORM);
	angle += pr_posattack.Random2() << 20;
	damage = ((pr_posattack()%5)+1)*3;
	P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_None, NAME_BulletPuff);
}
开发者ID:WChrisK,项目名称:Zandronum,代码行数:29,代码来源:a_possessed.cpp


示例11: MarinePunch

static void MarinePunch(AActor *self, int damagemul)
{
	angle_t 	angle;
	int 		damage;
	int 		pitch;
	AActor		*linetarget;

	if (self->target == NULL)
		return;

	damage = ((pr_m_punch()%10+1) << 1) * damagemul;

	A_FaceTarget (self);
	angle = self->angle + (pr_m_punch.Random2() << 18);
	pitch = P_AimLineAttack (self, angle, MELEERANGE, &linetarget);
	P_LineAttack (self, angle, MELEERANGE, pitch, damage, NAME_Melee, NAME_BulletPuff, true, &linetarget);

	// turn to face target
	if (linetarget)
	{
		S_Sound (self, CHAN_WEAPON, "*fist", 1, ATTN_NORM);
		self->angle = self->AngleTo(linetarget);

	}
}
开发者ID:Edward850,项目名称:zdoom,代码行数:25,代码来源:a_scriptedmarine.cpp


示例12: A_InquisitorJump

void A_InquisitorJump (AActor *self)
{
	fixed_t dist;
	fixed_t speed;
	angle_t an;

	if (self->target == NULL)
		return;

	S_LoopedSound (self, CHAN_ITEM, "inquisitor/jump", 1, ATTN_NORM);
	self->z += 64*FRACUNIT;
	A_FaceTarget (self);
	an = self->angle >> ANGLETOFINESHIFT;
	speed = self->Speed * 2/3;
	self->momx += FixedMul (speed, finecosine[an]);
	self->momy += FixedMul (speed, finesine[an]);
	dist = P_AproxDistance (self->target->x - self->x, self->target->y - self->y);
	dist /= speed;
	if (dist < 1)
	{
		dist = 1;
	}
	self->momz = (self->target->z - self->z) / dist;
	self->reactiontime = 60;
	self->flags |= MF_NOGRAVITY;
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:26,代码来源:a_inquisitor.cpp


示例13: A_ImpMsAttack

void A_ImpMsAttack (AActor *self)
{
	AActor *dest;
	angle_t an;
	int dist;

	if (!self->target || pr_impmsatk() > 64)
	{
		self->SetState (self->SeeState);
		return;
	}
	dest = self->target;
	self->flags |= MF_SKULLFLY;
	S_SoundID (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
	A_FaceTarget (self);
	an = self->angle >> ANGLETOFINESHIFT;
	self->momx = FixedMul (12*FRACUNIT, finecosine[an]);
	self->momy = FixedMul (12*FRACUNIT, finesine[an]);
	dist = P_AproxDistance (dest->x - self->x, dest->y - self->y);
	dist = dist/(12*FRACUNIT);
	if (dist < 1)
	{
		dist = 1;
	}
	self->momz = (dest->z + (dest->height>>1) - self->z)/dist;
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:26,代码来源:a_hereticimp.cpp


示例14: A_WizAtk2

void A_WizAtk2 (AActor *actor)
{
	A_FaceTarget (actor);
	actor->alpha = HR_SHADOW;
	actor->RenderStyle = STYLE_Translucent;
	actor->flags3 |= MF3_GHOST;
}
开发者ID:ddraigcymraeg,项目名称:gzscoredoom,代码行数:7,代码来源:a_wizard.cpp


示例15: A_PainAttack

//
// A_PainAttack
// Spawn a lost soul and launch it at the target
// 
void A_PainAttack (AActor *self)
{
	if (!self->target)
		return;

	A_FaceTarget (self);
	A_PainShootSkull (self, self->angle);
}
开发者ID:ddraigcymraeg,项目名称:scoredoomst,代码行数:12,代码来源:a_painelemental.cpp


示例16: A_SkelWhoosh

//
// A_SkelWhoosh
//
// Fist swing sound for Revenant.
//
void A_SkelWhoosh(actionargs_t *actionargs)
{
   Mobj *actor = actionargs->actor;
   if(!actor->target)
      return;
   A_FaceTarget(actionargs);
   S_StartSound(actor, sfx_skeswg);
}
开发者ID:twinaphex,项目名称:eternity,代码行数:13,代码来源:a_doom.cpp


示例17: DEFINE_ACTION_FUNCTION_PARAMS

DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DualPainAttack)
{
	if (!self->target)
		return;

	const PClass *spawntype = GetSpawnType(PUSH_PARAMINFO);
	A_FaceTarget (self);
	A_PainShootSkull (self, self->angle + ANG45, spawntype);
	A_PainShootSkull (self, self->angle - ANG45, spawntype);
}
开发者ID:1Akula1,项目名称:gzdoom,代码行数:10,代码来源:a_painelemental.cpp


示例18: DEFINE_ACTION_FUNCTION

DEFINE_ACTION_FUNCTION(AActor, A_CyberAttack)
{
	PARAM_ACTION_PROLOGUE;

	if (!self->target)
		return 0;
				
	A_FaceTarget (self);
	P_SpawnMissile (self, self->target, PClass::FindActor("Rocket"));
	return 0;
}
开发者ID:Edward850,项目名称:zdoom,代码行数:11,代码来源:a_cyberdemon.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ A_MEMCPY函数代码示例发布时间:2022-05-30
下一篇:
C++ A_FREE函数代码示例发布时间: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