summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuel Villareal2010-09-06 20:43:37 +0000
committerSamuel Villareal2010-09-06 20:43:37 +0000
commiteda4d7be63c6b5e1bf9ae10c8ed762b9e7a549dc (patch)
tree4578e5f9e3508b39003d55c1d17bca7b023cf4c3 /src
parent3d45d8152fe040341e7b5083305c4cc7a2032a2f (diff)
downloadchocolate-doom-eda4d7be63c6b5e1bf9ae10c8ed762b9e7a549dc.tar.gz
chocolate-doom-eda4d7be63c6b5e1bf9ae10c8ed762b9e7a549dc.tar.bz2
chocolate-doom-eda4d7be63c6b5e1bf9ae10c8ed762b9e7a549dc.zip
+ Un-inlined P_NewRandomDir
+ A_SentinelAttack, A_CrusaderAttack, A_CrusaderLeft, A_CrusaderRight implemented Subversion-branch: /branches/strife-branch Subversion-revision: 2019
Diffstat (limited to 'src')
-rw-r--r--src/strife/p_enemy.c106
1 files changed, 94 insertions, 12 deletions
diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index 1ffe4321..f3899ff3 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -664,11 +664,9 @@ void P_NewRandomDir(mobj_t* actor)
{
actor->movedir = dir;
- if(P_Move(actor))
- {
- actor->movecount = P_Random() & 15;
+ // villsa 09/06/10: un-inlined code
+ if(P_TryWalk(actor))
return;
- }
}
if(--dir == -1)
@@ -680,11 +678,10 @@ void P_NewRandomDir(mobj_t* actor)
}
actor->movedir = opposite[actor->movedir];
- if(P_Move(actor))
- {
- actor->movecount = P_Random() & 15;
+
+ // villsa 09/06/10: un-inlined code
+ if(P_TryWalk(actor))
return;
- }
else
{
actor->movedir = DI_NODIR;
@@ -1281,10 +1278,38 @@ void A_CheckTargetVisible(mobj_t* actor)
//
// [STRIFE] New function
// haleyjd 09/06/10: Action function implementing the Sentinel's laser attack
+// villsa 09/06/10 implemented
//
void A_SentinelAttack(mobj_t* actor)
{
- // STRIFE-TODO
+ mobj_t* mo;
+ mobj_t* mo2;
+ fixed_t x;
+ fixed_t y;
+ fixed_t z;
+ angle_t an;
+ int i;
+
+ mo = P_SpawnFacingMissile(actor, actor->target, MT_L_LASER);
+ an = actor->angle >> ANGLETOFINESHIFT;
+
+ if(mo->momy || mo->momx)
+ {
+ for(i = 8; i > 1; i--)
+ {
+ x = mo->x + FixedMul(mobjinfo[MT_L_LASER].radius * i, finecosine[an]);
+ y = mo->y + FixedMul(mobjinfo[MT_L_LASER].radius * i, finesine[an]);
+ z = mo->z + i * (mo->momz >> 2);
+ mo2 = P_SpawnMobj(x, y, z, MT_R_LASER);
+ mo2->target = actor;
+ mo2->momx = mo->momx;
+ mo2->momy = mo->momy;
+ mo2->momz = mo->momz;
+ P_CheckMissileSpawn(mo2);
+ }
+ }
+
+ mo->z += mo->momz >> 2;
}
//
@@ -1462,19 +1487,76 @@ void A_TemplarMauler(mobj_t* actor)
}
}
+//
+// A_CrusaderAttack
+// villsa [STRIFE] new codepointer
+//
+
void A_CrusaderAttack(mobj_t* actor)
{
- // STRIFE-TODO
+ if(!actor->target)
+ return;
+
+ actor->z += (8*FRACUNIT);
+
+ if(P_CheckRobotRange(actor))
+ {
+ A_FaceTarget(actor);
+ actor->angle -= (ANG90 / 8);
+ P_SpawnFacingMissile(actor, actor->target, MT_C_FLAME);
+ }
+ else
+ {
+ if(P_CheckMissileRange(actor))
+ {
+ A_FaceTarget(actor);
+ actor->z += (16*FRACUNIT);
+ P_SpawnFacingMissile(actor, actor->target, MT_C_MISSILE);
+
+ actor->angle -= (ANG45 / 32);
+ actor->z -= (16*FRACUNIT);
+ P_SpawnFacingMissile(actor, actor->target, MT_C_MISSILE);
+
+ actor->angle += (ANG45 / 16);
+ P_SpawnFacingMissile(actor, actor->target, MT_C_MISSILE);
+
+ actor->reactiontime += 15;
+ }
+ }
+
+ P_SetMobjState(actor, actor->info->seestate);
+ actor->z -= (8*FRACUNIT);
}
+//
+// A_CrusaderLeft
+// villsa [STRIFE] new codepointer
+//
+
void A_CrusaderLeft(mobj_t* actor)
{
- // STRIFE-TODO
+ mobj_t* mo;
+
+ actor->angle += (ANG90 / 16);
+ mo = P_SpawnFacingMissile(actor, actor->target, MT_C_FLAME);
+ mo->momz = FRACUNIT;
+ mo->z += (16*FRACUNIT);
+
}
+//
+// A_CrusaderRight
+// villsa [STRIFE] new codepointer
+//
+
void A_CrusaderRight(mobj_t* actor)
{
- // STRIFE-TODO
+ mobj_t* mo;
+
+ actor->angle -= (ANG90 / 16);
+ mo = P_SpawnFacingMissile(actor, actor->target, MT_C_FLAME);
+ mo->momz = FRACUNIT;
+ mo->z += (16*FRACUNIT);
}
//