summaryrefslogtreecommitdiff
path: root/src/strife
diff options
context:
space:
mode:
authorSamuel Villareal2010-09-18 04:48:19 +0000
committerSamuel Villareal2010-09-18 04:48:19 +0000
commitfc6385246c666b4e9a58ce17cf68a76d06bf03a2 (patch)
treedeed77eabc9f5e6eef28765889ae537485f3e026 /src/strife
parent08b1ff3b0ba4796908d9aee601c62d9ce54f091f (diff)
downloadchocolate-doom-fc6385246c666b4e9a58ce17cf68a76d06bf03a2.tar.gz
chocolate-doom-fc6385246c666b4e9a58ce17cf68a76d06bf03a2.tar.bz2
chocolate-doom-fc6385246c666b4e9a58ce17cf68a76d06bf03a2.zip
+ A_TeleportBeacon done
Subversion-branch: /branches/strife-branch Subversion-revision: 2102
Diffstat (limited to 'src/strife')
-rw-r--r--src/strife/p_enemy.c55
1 files changed, 54 insertions, 1 deletions
diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index acebb77f..d073e84f 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -2956,9 +2956,62 @@ void A_PlayerScream (mobj_t* mo)
S_StartSound (mo, sound);
}
+//
+// A_TeleportBeacon
+// villsa [STRIFE] - new codepointer
+//
void A_TeleportBeacon(mobj_t* actor)
{
- // STRIFE-TODO
+ mobj_t* mobj;
+ mobj_t* fog;
+ fixed_t fog_x;
+ fixed_t fog_y;
+
+ if(actor->target != players[actor->miscdata].mo)
+ actor->target = players[actor->miscdata].mo;
+
+ mobj = P_SpawnMobj(actor->x, actor->y, ONFLOORZ, MT_REBEL1);
+
+ if(!P_TryMove(mobj, mobj->x, mobj->y))
+ {
+ // Rebel is probably stuck in something.. too bad
+ P_RemoveMobj(mobj);
+ return;
+ }
+
+ // beacon no longer solid
+ actor->flags &= ~MF_SOLID;
+
+ // set color and flags
+ mobj->flags |= ((actor->miscdata << MF_TRANSSHIFT) | MF_INCOMBAT);
+ mobj->target = NULL;
+
+ // double Rebel's health in deathmatch mode
+ if(deathmatch)
+ mobj->health <<= 1;
+
+ if(actor->target)
+ {
+ mobj_t* targ = actor->target->target;
+
+ if(targ)
+ {
+ if(targ->type != MT_REBEL1 || targ->miscdata != mobj->miscdata)
+ mobj->target = targ;
+ }
+ }
+
+ P_SetMobjState(mobj, mobj->info->seestate);
+ mobj->angle = actor->angle;
+
+ fog_x = FixedMul(20*FRACUNIT, finecosine[actor->angle>>ANGLETOFINESHIFT] + mobj->x);
+ fog_y = FixedMul(20*FRACUNIT, finesine[actor->angle>>ANGLETOFINESHIFT] + mobj->y);
+
+ fog = P_SpawnMobj(fog_x, fog_y, mobj->z, MT_TFOG);
+ S_StartSound(fog, sfx_telept);
+
+ if((actor->health--) - 1 < 0)
+ P_RemoveMobj(actor);
}
//