From 583406a2ba2a10bfe0e654a0ede285da46c9bd88 Mon Sep 17 00:00:00 2001 From: Samuel Villareal Date: Sat, 4 Sep 2010 04:06:10 +0000 Subject: + Map flags for things added (MTF_*) + A_FireGrenade and A_MissileTick codepointers added + Step up height changed to 16*FRACUNIT (non-human things are excluded) + Fixed bug in P_MovePlayer where player cannot climb over things when pressing forward and jumping. Missed a line of code for this + P_SpawnSubMissile renamed to P_SpawnFaceMissile + P_SpawnMortar added + Ammo types added + Fixed some inaccuracies in P_SpawnBlood Subversion-branch: /branches/strife-branch Subversion-revision: 2008 --- src/strife/p_mobj.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 5 deletions(-) (limited to 'src/strife/p_mobj.c') diff --git a/src/strife/p_mobj.c b/src/strife/p_mobj.c index baa8fa05..a64397d8 100644 --- a/src/strife/p_mobj.c +++ b/src/strife/p_mobj.c @@ -174,6 +174,21 @@ void P_XYMovement (mobj_t* mo) { // try to slide along it P_SlideMove (mo); } + // villsa [STRIFE] check for bouncy missiles + else if(mo->flags & MF_BOUNCE) + { + mo->momx >>= 3; + mo->momy >>= 3; + + if (P_TryMove(mo, mo->x - xmove, ymove + mo->y)) + mo->momy = -mo->momy; + else + mo->momx = -mo->momx; + + + xmove = 0; + ymove = 0; + } else if (mo->flags & MF_MISSILE) { // explode a missile @@ -986,7 +1001,7 @@ P_SpawnBlood z += ((P_Random()-P_Random())<<10); th = P_SpawnMobj (x,y,z, MT_BLOOD_DEATH); th->momz = FRACUNIT*2; - th->tics -= P_Random()&3; + //th->tics -= P_Random()&3; // villsa [STRIFE] unused // villsa [STRIFE] unused /*if (th->tics < 1) @@ -995,6 +1010,8 @@ P_SpawnBlood // villsa [STRIFE] different checks for damage range if (damage >= 10 && damage <= 13) P_SetMobjState (th,S_BLOD_00); + else if (damage < 10 && damage >= 7) + P_SetMobjState (th,S_BLOD_01); else if (damage < 7) P_SetMobjState (th,S_BLOD_02); } @@ -1094,11 +1111,12 @@ P_SpawnMissile } // -// P_SpawnSubMissile -// villsa [STRIFE] new function (TODO - add description) +// P_SpawnFacingMissile +// villsa [STRIFE] new function +// Spawn a missile based on source's angle // -mobj_t* P_SpawnSubMissile(mobj_t* source, mobj_t* target, mobjtype_t type, fixed_t radius) +mobj_t* P_SpawnFacingMissile(mobj_t* source, mobj_t* target, mobjtype_t type) { mobj_t* th; angle_t an; @@ -1173,10 +1191,19 @@ P_SpawnPlayerMissile slope = 0; } } + + // villsa [STRIFE] + if(linetarget) + source->target = linetarget; x = source->x; y = source->y; - z = source->z + 4*8*FRACUNIT; + + // villsa [STRIFE] + if(!(source->flags & MF_FEETCLIPPED)) + z = source->z + 32*FRACUNIT; + else + z = source->z + 22*FRACUNIT; th = P_SpawnMobj (x,y,z, type); @@ -1194,3 +1221,32 @@ P_SpawnPlayerMissile P_CheckMissileSpawn (th); } +// +// P_SpawnMortar +// villsa [STRIFE] new function +// Spawn a high-arcing ballistic projectile +// + +mobj_t* P_SpawnMortar(mobj_t *source, mobjtype_t type) +{ + mobj_t* th; + angle_t an; + fixed_t slope; + + an = source->angle; + + th = P_SpawnMobj(source->x, source->y, source->z, type); + th->target = source; + th->angle = an; + an >>= ANGLETOFINESHIFT; + + slope = P_AimLineAttack(source, source->angle, 1024*FRACUNIT); + + th->momx = FixedMul (th->info->speed, finecosine[an]); + th->momy = FixedMul (th->info->speed, finesine[an]); + th->momz = FixedMul(th->info->speed, slope); + + P_CheckMissileSpawn(th); + + return th; +} -- cgit v1.2.3