summaryrefslogtreecommitdiff
path: root/src/strife/p_enemy.c
diff options
context:
space:
mode:
authorSamuel Villareal2010-09-04 06:34:42 +0000
committerSamuel Villareal2010-09-04 06:34:42 +0000
commitded5e702b8f28f9eb2d5322d47f0cd08e93cb74b (patch)
tree917d2535c0133c38358cf2e395250b4e4814c1f3 /src/strife/p_enemy.c
parent583406a2ba2a10bfe0e654a0ede285da46c9bd88 (diff)
downloadchocolate-doom-ded5e702b8f28f9eb2d5322d47f0cd08e93cb74b.tar.gz
chocolate-doom-ded5e702b8f28f9eb2d5322d47f0cd08e93cb74b.tar.bz2
chocolate-doom-ded5e702b8f28f9eb2d5322d47f0cd08e93cb74b.zip
+ Found nearly duplicate names (MT_MINIMISSLE and MT_MINIMISLE).
Corrected names + Majority of player action code pointers implemented + Removed all unused Doom player codepointers + P_SpawnPlayerMissile now returns a mobj Subversion-branch: /branches/strife-branch Subversion-revision: 2009
Diffstat (limited to 'src/strife/p_enemy.c')
-rw-r--r--src/strife/p_enemy.c103
1 files changed, 69 insertions, 34 deletions
diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index cf610285..55ad8910 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -166,6 +166,75 @@ P_NoiseAlert
P_RecursiveSound (emmiter->subsector->sector, 0);
}
+//
+// P_WakeUpThing
+// villsa [STRIFE] new function
+//
+
+static void P_WakeUpThing(mobj_t* puncher, mobj_t* rover)
+{
+ if(!(rover->flags & MF_INCOMBAT))
+ {
+ rover->target = puncher;
+ if(rover->info->seesound)
+ S_StartSound(rover, rover->info->seesound);
+ P_SetMobjState(rover, rover->info->seestate);
+ }
+}
+
+//
+// P_DoPunchAlert
+// villsa [STRIFE] - new function
+// Wake up buddies nearby when the player thinks he's gotten too clever
+// with the punch dagger. Walks sector links.
+//
+void P_DoPunchAlert(mobj_t *puncher, mobj_t *punchee)
+{
+ mobj_t *rover;
+
+ // don't bother with this crap if we're already on alert
+ if(punchee->subsector->sector->soundtarget)
+ return;
+
+ // gotta still be alive to call for help
+ if(punchee->health <= 0)
+ return;
+
+ // has to be something you can wake up and kill too
+ if(!(punchee->flags & MF_COUNTKILL) || punchee->flags & MF_INCOMBAT)
+ return;
+
+ // wake up punchee
+ punchee->target = puncher;
+ P_SetMobjState(punchee, punchee->info->seestate);
+
+ // wake up everybody nearby
+
+ // scan forward on sector list
+ for(rover = punchee->snext; rover; rover = rover->snext)
+ {
+ // we only wake up certain thing types (Acolytes and Templars?)
+ if(rover->health > 0 && rover->type >= MT_GUARD1 && rover->type <= MT_PGUARD &&
+ (P_CheckSight(rover, puncher) || P_CheckSight(rover, punchee)))
+ {
+ P_WakeUpThing(puncher, rover);
+ rover->flags |= MF_INCOMBAT; // huh? why?
+ }
+ }
+
+ // scan backward on sector list
+ for(rover = punchee->sprev; rover; rover = rover->sprev)
+ {
+ // we only wake up certain thing types (Acolytes and Templars?)
+ if(rover->health > 0 && rover->type >= MT_GUARD1 && rover->type <= MT_PGUARD &&
+ (P_CheckSight(rover, puncher) || P_CheckSight(rover, punchee)))
+ {
+ P_WakeUpThing(puncher, rover);
+ rover->flags |= MF_INCOMBAT; // huh? why?
+ }
+ }
+}
+
@@ -2465,40 +2534,6 @@ void A_ClearForceField(mobj_t* actor)
}
-void A_FireFlameThrower(mobj_t* actor)
-{
-
-}
-
-void A_FireMauler2(mobj_t* actor)
-{
-
-}
-
-void A_FireElectricBolt(mobj_t* actor)
-{
-
-}
-
-void A_FirePoisonBolt(mobj_t* actor)
-{
-
-}
-
-void A_FireRifle(mobj_t* actor)
-{
-
-}
-
-void A_FireMauler1(mobj_t* actor)
-{
-
-}
-
-void A_SigilSound(mobj_t* actor)
-{
-
-}
void A_FireSigil(mobj_t* actor)
{