- SW: Change all weapon recoils to work on pitch.

This commit is contained in:
Mitchell Richters 2022-09-27 15:11:28 +10:00 committed by Christoph Oelckers
parent 5bf23f0642
commit 06a9a7b1a7
5 changed files with 12 additions and 11 deletions

View file

@ -590,7 +590,7 @@ struct PLAYER
// variables that do not fit into sprite structure
PlayerHorizon horizon;
PlayerAngle angle;
int16_t recoil_amt;
double recoil_amt;
int16_t recoil_speed;
int16_t recoil_ndx;
fixedhoriz recoil_ohorizoff, recoil_horizoff;

View file

@ -1731,7 +1731,7 @@ void DoPlayerBob(PLAYER* pp)
//
//---------------------------------------------------------------------------
void DoPlayerBeginRecoil(PLAYER* pp, short pix_amt)
void DoPlayerBeginRecoil(PLAYER* pp, double pix_amt)
{
pp->Flags |= (PF_RECOIL);
@ -1761,7 +1761,7 @@ void DoPlayerRecoil(PLAYER* pp)
// move pp->q16horiz up and down
pp->recoil_ohorizoff = pp->recoil_horizoff;
pp->recoil_horizoff = pitchhoriz(HorizToPitch(pp->recoil_amt * BobVal(pp->recoil_ndx)));
pp->recoil_horizoff = pitchhoriz(pp->recoil_amt * BobVal(pp->recoil_ndx));
}
//---------------------------------------------------------------------------

View file

@ -13928,7 +13928,7 @@ int InitNuke(PLAYER* pp)
else
return 0;
DoPlayerBeginRecoil(pp, ROCKET_RECOIL_AMT*12);
DoPlayerBeginRecoil(pp, NUKE_RECOIL_AMT);
PlaySound(DIGI_RIOTFIRE, pp, v3df_dontpan|v3df_doppler);

View file

@ -81,7 +81,7 @@ extern int LoWangsQueueHead;
extern TObjPtr<DSWActor*> LoWangsQueue[MAX_LOWANGS_QUEUE];
void ChangeState(DSWActor* actor, STATE* statep);
void DoPlayerBeginRecoil(PLAYER* pp, short pix_amt);
void DoPlayerBeginRecoil(PLAYER* pp, double pix_amt);
SECTOR_OBJECT* DetectSectorObject(sectortype*);
SECTOR_OBJECT* DetectSectorObjectByWall(walltype*);
void ScaleSpriteVector(DSWActor* actor, int scale);
@ -137,11 +137,12 @@ constexpr double SKEL_ELECTRO_VELOCITY = (850 / 16.);
constexpr double COOLG_FIRE_VELOCITY = (400 / 16.);
constexpr int GORO_FIREBALL_VELOCITY = 50;
#define GRENADE_RECOIL_AMT (12)
#define ROCKET_RECOIL_AMT (7)
#define RAIL_RECOIL_AMT (7)
#define SHOTGUN_RECOIL_AMT (12)
//#define MICRO_RECOIL_AMT (15)
// Recoil speeds in pitch/degrees.
constexpr double GRENADE_RECOIL_AMT = 5.356;
constexpr double ROCKET_RECOIL_AMT = 3.13;
constexpr double RAIL_RECOIL_AMT = 3.13;
constexpr double SHOTGUN_RECOIL_AMT = 5.356;
constexpr double NUKE_RECOIL_AMT = 33.275;
// Damage amounts that determine the type of player death
// The standard flip over death is default

View file

@ -206,7 +206,7 @@ struct SWPlayer native
//native int /*cursectnum,*/lastcursectnum;
// variables that do not fit into sprite structure
native int16 recoil_amt;
native double recoil_amt;
native int16 recoil_speed;
native int16 recoil_ndx;
native int recoil_horizoff;