mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 07:31:03 +00:00
- Negate everything to do with PlayerHorizon::__horiz
where appropriate, including some loose horizoff
members.
This commit is contained in:
parent
619b8005ac
commit
0600bf5860
30 changed files with 116 additions and 116 deletions
|
@ -44,7 +44,7 @@ bool calcChaseCamPos(DVector3& ppos, DCoreActor* act, sectortype** psect, DAngle
|
|||
if (!*psect) return false;
|
||||
|
||||
// Calculate new pos to shoot backwards
|
||||
DVector3 npos = DVector3(-ang.ToVector(), horiz.Tan()) * backamp;
|
||||
DVector3 npos = -DVector3(ang.ToVector(), horiz.Tan()) * backamp;
|
||||
|
||||
HitInfoBase hitinfo;
|
||||
auto bakcstat = act->spr.cstat;
|
||||
|
|
|
@ -534,17 +534,17 @@ inline double BobVal(double val)
|
|||
|
||||
inline DAngle GetMinPitch()
|
||||
{
|
||||
return !cl_clampedpitch ? -DAngle90 : gi->playerPitchMin();
|
||||
return !cl_clampedpitch ? DAngle90 : gi->playerPitchMin();
|
||||
}
|
||||
|
||||
inline DAngle GetMaxPitch()
|
||||
{
|
||||
return !cl_clampedpitch ? DAngle90 : gi->playerPitchMax();
|
||||
return !cl_clampedpitch ? -DAngle90 : gi->playerPitchMax();
|
||||
}
|
||||
|
||||
inline DAngle ClampViewPitch(const DAngle pitch)
|
||||
{
|
||||
return clamp(pitch, GetMinPitch(), GetMaxPitch());
|
||||
return clamp(pitch, GetMaxPitch(), GetMinPitch());
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -148,7 +148,7 @@ void processMovement(InputPacket* const currInput, InputPacket* const inputBuffe
|
|||
|
||||
// process player pitch input.
|
||||
if (!(inputBuffer->actions & SB_AIMMODE))
|
||||
currInput->horz -= hidInput->mouseturny + hidInput->dpitch * hidspeed * scaleAdjustf;
|
||||
currInput->horz += hidInput->mouseturny - hidInput->dpitch * hidspeed * scaleAdjustf;
|
||||
else
|
||||
currInput->fvel -= hidInput->mousemovey + hidInput->dpitch * keymove * scaleAdjustf;
|
||||
|
||||
|
@ -189,7 +189,7 @@ void PlayerHorizon::applyinput(float const horz, ESyncBits* actions, double cons
|
|||
if (*actions & (up | down))
|
||||
{
|
||||
if (lock) *actions &= ~SB_CENTERVIEW; else *actions |= SB_CENTERVIEW;
|
||||
__horiz += getTicrateScale(rate) * scaleAdjust * (!!(*actions & up) - !!(*actions & down));
|
||||
__horiz += getTicrateScale(rate) * scaleAdjust * (!!(*actions & down) - !!(*actions & up));
|
||||
}
|
||||
};
|
||||
doKbdInput(SB_AIM_UP, SB_AIM_DOWN, PITCH_AIMSPEED, true);
|
||||
|
@ -306,7 +306,7 @@ void PlayerHorizon::calcviewpitch(const DVector2& pos, DAngle const ang, bool co
|
|||
// accordingly
|
||||
if (cursectnum == tempsect || (!isBlood() && abs(getflorzofslopeptr(tempsect, rotpt) - k) <= 4))
|
||||
{
|
||||
horizoff += maphoriz(scaleAdjust * ((j - k) * (!isBlood() ? 0.625 : 5.5)));
|
||||
horizoff -= maphoriz(scaleAdjust * ((j - k) * (!isBlood() ? 0.625 : 5.5)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ void PlayerHorizon::calcviewpitch(const DVector2& pos, DAngle const ang, bool co
|
|||
if (climbing)
|
||||
{
|
||||
// tilt when climbing but you can't even really tell it.
|
||||
if (horizoff < PITCH_HORIZOFFCLIMB) horizoff += getscaledangle(PITCH_HORIZOFFSPEED, scaleAdjust, deltaangle(horizoff, PITCH_HORIZOFFCLIMB), PITCH_HORIZOFFPUSH);
|
||||
if (horizoff > PITCH_HORIZOFFCLIMB) horizoff -= getscaledangle(PITCH_HORIZOFFSPEED, scaleAdjust, deltaangle(horizoff, PITCH_HORIZOFFCLIMB), PITCH_HORIZOFFPUSH);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -109,8 +109,8 @@ struct GameInterface
|
|||
virtual void LevelCompleted(MapRecord* map, int skill) {}
|
||||
virtual bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) { return false; }
|
||||
virtual void SetTileProps(int tile, int surf, int vox, int shade) {}
|
||||
virtual DAngle playerPitchMin() { return DAngle::fromDeg(-57.375); }
|
||||
virtual DAngle playerPitchMax() { return DAngle::fromDeg(57.375); }
|
||||
virtual DAngle playerPitchMin() { return DAngle::fromDeg(57.375); }
|
||||
virtual DAngle playerPitchMax() { return DAngle::fromDeg(-57.375); }
|
||||
virtual void WarpToCoords(double x, double y, double z, DAngle a) {}
|
||||
virtual void ToggleThirdPerson() { }
|
||||
virtual void SwitchCoopView() { Printf("Unsupported command\n"); }
|
||||
|
|
|
@ -149,7 +149,7 @@ struct MapRecord
|
|||
// game specific stuff
|
||||
int rr_startsound = 0;
|
||||
int rr_mamaspawn = 15;
|
||||
DAngle ex_ramses_horiz = DAngle::fromDeg(4.912);
|
||||
DAngle ex_ramses_horiz = DAngle::fromDeg(-4.912);
|
||||
int ex_ramses_cdtrack = -1; // this is not music, it is the actual dialogue!
|
||||
FString ex_ramses_pup;
|
||||
FString ex_ramses_text;
|
||||
|
|
|
@ -200,7 +200,7 @@ FRenderViewpoint SetupViewpoint(DCoreActor* cam, const DVector3& position, int s
|
|||
r_viewpoint.SectCount = sectnum;
|
||||
r_viewpoint.Pos = { position.X, -position.Y, -position.Z };
|
||||
r_viewpoint.HWAngles.Yaw = FAngle::fromDeg(-90.f + (float)angle.Degrees());
|
||||
r_viewpoint.HWAngles.Pitch = FAngle::fromDeg(-ClampViewPitch(horizon).Degrees());
|
||||
r_viewpoint.HWAngles.Pitch = FAngle::fromDeg(ClampViewPitch(horizon).Degrees());
|
||||
r_viewpoint.HWAngles.Roll = FAngle::fromDeg(-(float)rollang.Degrees());
|
||||
r_viewpoint.FieldOfView = FAngle::fromDeg(fov > 0? fov : (float)r_fov);
|
||||
r_viewpoint.RotAngle = angle.BAMs();
|
||||
|
|
|
@ -133,8 +133,8 @@ struct GameInterface : public ::GameInterface
|
|||
void LevelCompleted(MapRecord* map, int skill) override;
|
||||
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
|
||||
void SetTileProps(int til, int surf, int vox, int shade) override;
|
||||
DAngle playerPitchMin() override { return DAngle::fromDeg(-54.575); }
|
||||
DAngle playerPitchMax() override { return DAngle::fromDeg(43.15); }
|
||||
DAngle playerPitchMin() override { return DAngle::fromDeg(54.575); }
|
||||
DAngle playerPitchMax() override { return DAngle::fromDeg(-43.15); }
|
||||
void WarpToCoords(double x, double y, double z, DAngle a) override;
|
||||
void ToggleThirdPerson() override;
|
||||
void SwitchCoopView() override;
|
||||
|
|
|
@ -1731,7 +1731,7 @@ void ProcessInput(PLAYER* pPlayer)
|
|||
pPlayer->angle.unlockinput();
|
||||
pPlayer->horizon.unlockinput();
|
||||
|
||||
pPlayer->slope = -pPlayer->horizon.__horiz.Tan();
|
||||
pPlayer->slope = pPlayer->horizon.__horiz.Tan();
|
||||
if (pInput->actions & SB_INVPREV)
|
||||
{
|
||||
pInput->actions &= ~SB_INVPREV;
|
||||
|
|
|
@ -412,7 +412,7 @@ void viewUpdateShake(PLAYER* pPlayer, DVector3& cPos, DAngle& cA, DAngle& cH, do
|
|||
if (effectType)
|
||||
{
|
||||
int nValue = ClipHigh(effectType * 8, 2000);
|
||||
cH += maphoriz(QRandom2F(nValue * (1. / 256.)));
|
||||
cH -= maphoriz(QRandom2F(nValue * (1. / 256.)));
|
||||
cA += DAngle::fromDeg(QRandom2F(nValue * (360. / 524288.)));
|
||||
cPos.X += QRandom2F(nValue * maptoworld) * maptoworld;
|
||||
cPos.Y += QRandom2F(nValue * maptoworld) * maptoworld;
|
||||
|
@ -424,7 +424,7 @@ void viewUpdateShake(PLAYER* pPlayer, DVector3& cPos, DAngle& cA, DAngle& cH, do
|
|||
doEffect(pPlayer->flickerEffect);
|
||||
doEffect(pPlayer->quakeEffect);
|
||||
|
||||
cH += DAngle::fromDeg((1 - BobVal((pPlayer->tiltEffect << 2) + 512)) * 13.2);
|
||||
cH -= DAngle::fromDeg((1 - BobVal((pPlayer->tiltEffect << 2) + 512)) * 13.2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -526,7 +526,7 @@ static void SetupView(PLAYER* pPlayer, DVector3& cPos, DAngle& cA, DAngle& cH, s
|
|||
{
|
||||
cPos.Z += bobHeight;
|
||||
}
|
||||
cPos.Z += clamp(cH.Tan(), -1.171875, 1.171875) * 5.;
|
||||
cPos.Z -= clamp(cH.Tan(), -1.171875, 1.171875) * 5.;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -738,7 +738,7 @@ void viewDrawScreen(bool sceneonly)
|
|||
DAngle deliriumPitchI = interpolatedvalue(maphoriz(deliriumPitchO), maphoriz(deliriumPitch), interpfrac);
|
||||
auto bakCstat = pPlayer->actor->spr.cstat;
|
||||
pPlayer->actor->spr.cstat |= (gViewPos == 0) ? CSTAT_SPRITE_INVISIBLE : CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP;
|
||||
render_drawrooms(pPlayer->actor, cPos, pSector, cA, cH + deliriumPitchI, rotscrnang, interpfrac);
|
||||
render_drawrooms(pPlayer->actor, cPos, pSector, cA, cH - deliriumPitchI, rotscrnang, interpfrac);
|
||||
pPlayer->actor->spr.cstat = bakCstat;
|
||||
bDeliriumOld = bDelirium && gDeliriumBlur;
|
||||
|
||||
|
|
|
@ -1382,7 +1382,7 @@ static bool weaponhitsprite(DDukeActor* proj, DDukeActor *targ, bool fireball)
|
|||
|
||||
if (proj->spr.picnum == SPIT)
|
||||
{
|
||||
ps[p].horizon.addadjustment(DAngle::fromDeg(14.04));
|
||||
ps[p].horizon.addadjustment(DAngle::fromDeg(-14.04));
|
||||
ps[p].sync.actions |= SB_CENTERVIEW;
|
||||
|
||||
if (ps[p].loogcnt == 0)
|
||||
|
@ -2170,7 +2170,7 @@ static void greenslime(DDukeActor *actor)
|
|||
return;
|
||||
}
|
||||
|
||||
actor->spr.pos.Z = ps[p].pos.Z + 8 + ps[p].pyoff - (actor->temp_data[2] - (ps[p].horizon.__horiz.Tan() * 2048.)) * zinttoworld;
|
||||
actor->spr.pos.Z = ps[p].pos.Z + 8 + ps[p].pyoff - (actor->temp_data[2] + (ps[p].horizon.__horiz.Tan() * 2048.)) * zinttoworld;
|
||||
|
||||
if (actor->temp_data[2] > 512)
|
||||
actor->temp_data[2] -= 128;
|
||||
|
|
|
@ -1004,7 +1004,7 @@ static bool weaponhitsprite(DDukeActor *proj, DDukeActor *targ, const DVector3 &
|
|||
guts_r(proj, RABBITJIBC, 2, myconnectindex);
|
||||
}
|
||||
|
||||
ps[p].horizon.addadjustment(DAngle::fromDeg(14.04));
|
||||
ps[p].horizon.addadjustment(DAngle::fromDeg(-14.04));
|
||||
ps[p].sync.actions |= SB_CENTERVIEW;
|
||||
|
||||
if (ps[p].loogcnt == 0)
|
||||
|
|
|
@ -344,22 +344,22 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
|||
{
|
||||
ps[iPlayer].sync.actions &= ~SB_CENTERVIEW;
|
||||
}
|
||||
ps[iPlayer].horizon.settarget(maphoriz(lValue));
|
||||
ps[iPlayer].horizon.settarget(maphoriz(-lValue));
|
||||
}
|
||||
else SetGameVarID(lVar2, int(ps[iPlayer].horizon.__horiz.Tan() * 128.), sActor, sPlayer);
|
||||
else SetGameVarID(lVar2, int(ps[iPlayer].horizon.__horiz.Tan() * -128.), sActor, sPlayer);
|
||||
break;
|
||||
|
||||
case PLAYER_OHORIZ:
|
||||
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ohoriz.Tan() * 128.), sActor, sPlayer);
|
||||
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ohoriz.Tan() * -128.), sActor, sPlayer);
|
||||
break;
|
||||
|
||||
case PLAYER_HORIZOFF:
|
||||
if (bSet) ps[iPlayer].horizon.horizoff = maphoriz(lValue);
|
||||
else SetGameVarID(lVar2, int(ps[iPlayer].horizon.horizoff.Tan() * 128.), sActor, sPlayer);
|
||||
if (bSet) ps[iPlayer].horizon.horizoff = maphoriz(-lValue);
|
||||
else SetGameVarID(lVar2, int(ps[iPlayer].horizon.horizoff.Tan() * -128.), sActor, sPlayer);
|
||||
break;
|
||||
|
||||
case PLAYER_OHORIZOFF:
|
||||
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ohorizoff.Tan() * 128.), sActor, sPlayer);
|
||||
if (!bSet) SetGameVarID(lVar2, int(ps[iPlayer].horizon.ohorizoff.Tan() * -128.), sActor, sPlayer);
|
||||
break;
|
||||
|
||||
case PLAYER_INVDISPTIME:
|
||||
|
|
|
@ -111,7 +111,7 @@ static bool animateknee(int gs, player_struct* p, double look_anghalf, double lo
|
|||
const double kneei = interpolatedvalue<double>(knee_y[p->oknee_incs], knee_y[p->knee_incs], interpfrac);
|
||||
looking_arc += kneei;
|
||||
|
||||
hud_drawpal(105 + plravel - look_anghalf + (kneei * 0.25), looking_arc + 280 - horiz16th, KNEE, gs, 4, pal);
|
||||
hud_drawpal(105 + plravel - look_anghalf + (kneei * 0.25), looking_arc + 280 + horiz16th, KNEE, gs, 4, pal);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ static bool animateknuckles(int gs, player_struct* p, double look_anghalf, doubl
|
|||
|
||||
static const uint8_t knuckle_frames[] = { 0,1,2,2,3,3,3,2,2,1,0 };
|
||||
|
||||
hud_drawpal(160 + plravel - look_anghalf, looking_arc + 180 - horiz16th, CRACKKNUCKLES + knuckle_frames[p->knuckle_incs >> 1], gs, 4, pal);
|
||||
hud_drawpal(160 + plravel - look_anghalf, looking_arc + 180 + horiz16th, CRACKKNUCKLES + knuckle_frames[p->knuckle_incs >> 1], gs, 4, pal);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ static bool animatetip(int gs, player_struct* p, double look_anghalf, double loo
|
|||
static const int8_t tip_y[] = { 0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16 };
|
||||
const double tipi = interpolatedvalue<double>(tip_y[p->otipincs], tip_y[p->tipincs], interpfrac) * 0.5;
|
||||
|
||||
hud_drawpal(170 + plravel - look_anghalf, tipi + looking_arc + 240 - horiz16th, TIP + ((26 - p->tipincs) >> 4), gs, 0, pal);
|
||||
hud_drawpal(170 + plravel - look_anghalf, tipi + looking_arc + 240 + horiz16th, TIP + ((26 - p->tipincs) >> 4), gs, 0, pal);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -185,9 +185,9 @@ static bool animateaccess(int gs, player_struct* p, double look_anghalf, double
|
|||
const int pal = p->access_spritenum != nullptr ? p->access_spritenum->spr.pal : 0;
|
||||
|
||||
if ((p->access_incs-3) > 0 && (p->access_incs-3)>>3)
|
||||
hud_drawpal(170 + plravel - look_anghalf + (accessi * 0.25), looking_arc + 266 - horiz16th, HANDHOLDINGLASER + (p->access_incs >> 3), gs, 0, pal);
|
||||
hud_drawpal(170 + plravel - look_anghalf + (accessi * 0.25), looking_arc + 266 + horiz16th, HANDHOLDINGLASER + (p->access_incs >> 3), gs, 0, pal);
|
||||
else
|
||||
hud_drawpal(170 + plravel - look_anghalf + (accessi * 0.25), looking_arc + 266 - horiz16th, HANDHOLDINGACCESS, gs, 4, pal);
|
||||
hud_drawpal(170 + plravel - look_anghalf + (accessi * 0.25), looking_arc + 266 + horiz16th, HANDHOLDINGACCESS, gs, 4, pal);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ void forceplayerangle(int snum)
|
|||
{
|
||||
player_struct* p = &ps[snum];
|
||||
|
||||
p->horizon.addadjustment(DAngle::fromDeg(26.566));
|
||||
p->horizon.addadjustment(DAngle::fromDeg(-26.566));
|
||||
p->sync.actions |= SB_CENTERVIEW;
|
||||
p->angle.rotscrnang = p->angle.look_ang = (DAngle22_5 - randomAngle(45)) / 2.;
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ DDukeActor* aim(DDukeActor* actor, int abase)
|
|||
// This is a reimplementation of how it was solved in RedNukem.
|
||||
if (plr->curr_weapon == PISTOL_WEAPON && !isWW2GI())
|
||||
{
|
||||
double zvel = -plr->horizon.sum().Tan() * 16.;
|
||||
double zvel = plr->horizon.sum().Tan() * 16.;
|
||||
|
||||
HitInfo hit{};
|
||||
hitscan(plr->pos.plusZ(4), actor->sector(), DVector3(actor->spr.angle.ToVector() * 1024, zvel), hit, CLIPMASK1);
|
||||
|
@ -374,7 +374,7 @@ void dokneeattack(int snum, const std::initializer_list<int> & respawnlist)
|
|||
{
|
||||
p->oknee_incs = p->knee_incs;
|
||||
p->knee_incs++;
|
||||
p->horizon.addadjustment(DAngle::fromDeg(-20.556));
|
||||
p->horizon.addadjustment(DAngle::fromDeg(20.556));
|
||||
p->sync.actions |= SB_CENTERVIEW;
|
||||
if (p->knee_incs > 15)
|
||||
{
|
||||
|
@ -806,7 +806,7 @@ void player_struct::checkhardlanding()
|
|||
{
|
||||
if (hard_landing > 0)
|
||||
{
|
||||
horizon.addadjustment(maphoriz(-(hard_landing << 4)));
|
||||
horizon.addadjustment(maphoriz(hard_landing << 4));
|
||||
hard_landing--;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ static void shootfireball(DDukeActor *actor, int p, DVector3 pos, DAngle ang)
|
|||
}
|
||||
else
|
||||
{
|
||||
zvel = -ps[p].horizon.sum().Tan() * 49.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 49.;
|
||||
pos += (ang + DAngle1 * 61).ToVector() * (1024 / 448.);
|
||||
pos.Z += 3;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ static void shootflamethrowerflame(DDukeActor* actor, int p, DVector3 spos, DAng
|
|||
}
|
||||
else
|
||||
{
|
||||
zvel = -ps[p].horizon.sum().Tan() * 40.5;
|
||||
zvel = ps[p].horizon.sum().Tan() * 40.5;
|
||||
|
||||
// WTF???
|
||||
DAngle myang = DAngle90 - (DAngle180 - abs(abs((spos.XY() - ps[p].pos.XY()).Angle() - sang) - DAngle180));
|
||||
|
@ -242,7 +242,7 @@ static void shootknee(DDukeActor* actor, int p, DVector3 pos, DAngle ang)
|
|||
|
||||
if (p >= 0)
|
||||
{
|
||||
zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
pos.Z += 6;
|
||||
ang += DAngle1 * 2.64;
|
||||
}
|
||||
|
@ -374,14 +374,14 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int
|
|||
if (aimed == nullptr)
|
||||
{
|
||||
// no target
|
||||
zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
}
|
||||
zvel += (zRange / 2) - krandf(zRange);
|
||||
}
|
||||
else if (aimed == nullptr)
|
||||
{
|
||||
ang += DAngle22_5 / 8 - randomAngle(22.5 / 4);
|
||||
zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel += 0.5 - krandf(1);
|
||||
}
|
||||
|
||||
|
@ -606,7 +606,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
|
|||
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
|
||||
}
|
||||
else
|
||||
zvel = -ps[p].horizon.sum().Tan() * 49.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 49.;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -717,7 +717,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
|
||||
}
|
||||
else
|
||||
zvel = -ps[p].horizon.sum().Tan() * 40.5;
|
||||
zvel = ps[p].horizon.sum().Tan() * 40.5;
|
||||
|
||||
if (atwith == RPG)
|
||||
S_PlayActorSound(RPG_SHOOT, actor);
|
||||
|
@ -861,7 +861,7 @@ static void shootlaser(DDukeActor* actor, int p, DVector3 pos, DAngle ang)
|
|||
HitInfo hit{};
|
||||
|
||||
if (p >= 0)
|
||||
zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
else zvel = 0;
|
||||
|
||||
hitscan(pos, sectp, DVector3(ang.ToVector() * 1024, zvel * 64), hit, CLIPMASK1);
|
||||
|
@ -958,7 +958,7 @@ static void shootgrowspark(DDukeActor* actor, int p, DVector3 pos, DAngle ang)
|
|||
else
|
||||
{
|
||||
ang += DAngle22_5 / 8 - randomAngle(22.5 / 4);
|
||||
zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel += 0.5 - krandf(1);
|
||||
}
|
||||
|
||||
|
@ -1051,7 +1051,7 @@ static void shootshrinker(DDukeActor* actor, int p, const DVector3& pos, DAngle
|
|||
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
|
||||
}
|
||||
else
|
||||
zvel = -ps[p].horizon.sum().Tan() * 49.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 49.;
|
||||
}
|
||||
else if (actor->spr.statnum != 3)
|
||||
{
|
||||
|
@ -2241,7 +2241,7 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
else
|
||||
{
|
||||
vel = 140/16.;
|
||||
zvel = -4 - p->horizon.sum().Tan() * 10.;
|
||||
zvel = 4 + p->horizon.sum().Tan() * 10.;
|
||||
}
|
||||
|
||||
auto spawned = CreateActor(p->cursector, p->pos + p->angle.ang.ToVector() * 16, HEAVYHBOMB, -16, 9, 9,
|
||||
|
|
|
@ -91,7 +91,7 @@ static void shootmelee(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int a
|
|||
|
||||
if (p >= 0)
|
||||
{
|
||||
zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
pos.Z += 6;
|
||||
ang += DAngle1 * 2.64;
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
|
|||
if (aimed == nullptr)
|
||||
{
|
||||
ang += DAngle22_5 / 8 - randomAngle(22.5 / 4);
|
||||
zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel += 0.5 - krandf(1);
|
||||
}
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
|
|||
ang += DAngle22_5 / 2 - randomAngle(22.5);
|
||||
else
|
||||
ang += DAngle22_5 / 8 - randomAngle(22.5 / 4);
|
||||
if (aimed == nullptr) zvel = -ps[p].horizon.sum().Tan() * 16.;
|
||||
if (aimed == nullptr) zvel = ps[p].horizon.sum().Tan() * 16.;
|
||||
zvel += 0.5 - krandf(1);
|
||||
}
|
||||
pos.Z -= 2;
|
||||
|
@ -512,7 +512,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
|
|||
}
|
||||
else
|
||||
{
|
||||
zvel = -ps[p].horizon.sum().Tan() * 49.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 49.;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -628,7 +628,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw
|
|||
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
|
||||
}
|
||||
else
|
||||
zvel = -ps[p].horizon.sum().Tan() * 40.5;
|
||||
zvel = ps[p].horizon.sum().Tan() * 40.5;
|
||||
|
||||
if (atwith == RPG)
|
||||
S_PlayActorSound(RPG_SHOOT, actor);
|
||||
|
@ -782,7 +782,7 @@ static void shootwhip(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int at
|
|||
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
|
||||
}
|
||||
else
|
||||
zvel = -ps[p].horizon.sum().Tan() * 49.;
|
||||
zvel = ps[p].horizon.sum().Tan() * 49.;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1761,7 +1761,7 @@ static void onMotorcycle(int snum, ESyncBits &actions)
|
|||
}
|
||||
if (horiz != FRACUNIT)
|
||||
{
|
||||
p->horizon.addadjustment(deltaangle(p->horizon.__horiz, maphoriz(horiz)));
|
||||
p->horizon.addadjustment(deltaangle(p->horizon.__horiz, maphoriz(-horiz)));
|
||||
}
|
||||
|
||||
const DAngle adjust = mapangle(-510);
|
||||
|
@ -2029,7 +2029,7 @@ static void onBoat(int snum, ESyncBits &actions)
|
|||
}
|
||||
if (horiz != FRACUNIT)
|
||||
{
|
||||
p->horizon.addadjustment(deltaangle(p->horizon.__horiz, maphoriz(horiz)));
|
||||
p->horizon.addadjustment(deltaangle(p->horizon.__horiz, maphoriz(-horiz)));
|
||||
}
|
||||
|
||||
if (p->MotoSpeed > 0 && p->on_ground == 1 && (p->vehTurnLeft || p->vehTurnRight))
|
||||
|
@ -2750,7 +2750,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
else
|
||||
{
|
||||
vel = 140 / 16.;
|
||||
zvel = -4 - p->horizon.sum().Tan() * 10.;
|
||||
zvel = 4 + p->horizon.sum().Tan() * 10.;
|
||||
}
|
||||
|
||||
auto spawned = CreateActor(p->cursector, p->pos + p->angle.ang.ToVector() * 16, HEAVYHBOMB, -16, 9, 9,
|
||||
|
@ -2964,7 +2964,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
case RIFLEGUN_WEAPON:
|
||||
|
||||
p->kickback_pic++;
|
||||
p->horizon.addadjustment(DAngle::fromDeg(0.4476));
|
||||
p->horizon.addadjustment(DAngle::fromDeg(-0.4476));
|
||||
p->recoil++;
|
||||
|
||||
if (p->kickback_pic <= 12)
|
||||
|
@ -3136,7 +3136,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
else if (p->kickback_pic == 12)
|
||||
{
|
||||
p->vel.XY() -= p->angle.ang.ToVector();
|
||||
p->horizon.addadjustment(DAngle::fromDeg(8.88));
|
||||
p->horizon.addadjustment(DAngle::fromDeg(-8.88));
|
||||
p->recoil += 20;
|
||||
}
|
||||
if (p->kickback_pic > 20)
|
||||
|
@ -3157,7 +3157,7 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
else
|
||||
{
|
||||
vel = 2.;
|
||||
zvel = -4 - p->horizon.sum().Tan() * 10.;
|
||||
zvel = 4 + p->horizon.sum().Tan() * 10.;
|
||||
}
|
||||
|
||||
CreateActor(p->cursector, p->pos + p->angle.ang.ToVector() * 16, POWDERKEG, -16, 9, 9, p->angle.ang, vel * 2, zvel, pact, 1);
|
||||
|
@ -3976,7 +3976,7 @@ HORIZONLY:
|
|||
if (!d)
|
||||
d = 1;
|
||||
p->recoil -= d;
|
||||
p->horizon.addadjustment(maphoriz(-d));
|
||||
p->horizon.addadjustment(maphoriz(d));
|
||||
}
|
||||
|
||||
if (SyncInput())
|
||||
|
|
|
@ -338,7 +338,7 @@ void operateweapon_ww(int snum, ESyncBits actions)
|
|||
else
|
||||
{
|
||||
vel = 140 / 16.;
|
||||
zvel = -4 - p->horizon.sum().Tan() * 10.;
|
||||
zvel = 4 + p->horizon.sum().Tan() * 10.;
|
||||
}
|
||||
|
||||
auto spawned = CreateActor(p->cursector, p->pos + p->angle.ang.ToVector() * 16, HEAVYHBOMB, -16, 9, 9,
|
||||
|
|
|
@ -151,7 +151,7 @@ void resetplayerstats(int snum)
|
|||
p->footprintpal = 0;
|
||||
p->footprintshade = 0;
|
||||
p->jumping_toggle = 0;
|
||||
p->horizon.ohoriz = p->horizon.__horiz = DAngle::fromDeg(17.354);
|
||||
p->horizon.ohoriz = p->horizon.__horiz = DAngle::fromDeg(-17.354);
|
||||
p->horizon.ohorizoff = p->horizon.horizoff = nullAngle;
|
||||
p->bobcounter = 0;
|
||||
p->on_ground = 0;
|
||||
|
|
|
@ -254,7 +254,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
|
|||
|
||||
cpos = viewer->spr.pos.plusZ(-4);
|
||||
cang = viewer->interpolatedangle(interpfrac);
|
||||
choriz = maphoriz(viewer->spr.yint);
|
||||
choriz = maphoriz(-viewer->spr.yint);
|
||||
rotscrnang = nullAngle;
|
||||
sect = viewer->sector();
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
|
|||
{
|
||||
viewer = p->newOwner;
|
||||
cang = viewer->interpolatedangle(interpfrac);
|
||||
choriz = maphoriz(viewer->spr.shade);
|
||||
choriz = maphoriz(-viewer->spr.shade);
|
||||
cpos = viewer->spr.pos;
|
||||
sect = viewer->sector();
|
||||
rotscrnang = nullAngle;
|
||||
|
|
|
@ -405,7 +405,7 @@ void initshell(DDukeActor* actj, DDukeActor* act, bool isshell)
|
|||
ang = ps[snum].angle.ang - mapangle((krand() & 63) + 8); //Fine tune
|
||||
|
||||
act->temp_data[0] = krand() & 1;
|
||||
act->spr.pos.Z = 3 + ps[snum].pos.Z + ps[snum].pyoff - (ps[snum].horizon.sum().Tan() * 8.) + (!isshell ? 3 : 0);
|
||||
act->spr.pos.Z = 3 + ps[snum].pos.Z + ps[snum].pyoff + (ps[snum].horizon.sum().Tan() * 8.) + (!isshell ? 3 : 0);
|
||||
act->vel.Z = -krandf(1);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -231,8 +231,8 @@ struct GameInterface : public ::GameInterface
|
|||
void LevelCompleted(MapRecord *map, int skill) override;
|
||||
void NextLevel(MapRecord *map, int skill) override;
|
||||
bool DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, const DAngle cang, const DVector2& xydim, const double czoom, double const interpfrac) override;
|
||||
DAngle playerPitchMin() override { return DAngle::fromDeg(-49.5); }
|
||||
DAngle playerPitchMax() override { return DAngle::fromDeg(49.5); }
|
||||
DAngle playerPitchMin() override { return DAngle::fromDeg(49.5); }
|
||||
DAngle playerPitchMax() override { return DAngle::fromDeg(-49.5); }
|
||||
void WarpToCoords(double x, double y, double z, DAngle ang) override;
|
||||
void ToggleThirdPerson() override;
|
||||
void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) override;
|
||||
|
|
|
@ -84,12 +84,12 @@ void ThrowGrenade(int nPlayer, double dz, double push1)
|
|||
pActor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
||||
pActor->spr.angle = nAngle;
|
||||
|
||||
if (push1 >= -23.4375)
|
||||
if (push1 <= 23.4375)
|
||||
{
|
||||
int nVel = PlayerList[nPlayer].totalvel << 5;
|
||||
|
||||
pActor->nTurn = ((90 - pActor->nIndex2) * (90 - pActor->nIndex2)) + nVel;
|
||||
pActor->vel.Z = ((-32. * push1) - 17);
|
||||
pActor->vel.Z = ((32. * push1) - 17);
|
||||
|
||||
|
||||
DVector2 vec = nAngle.ToVector() * pPlayerActor->fClipdist() *2; // == << 14 + 3 + 2 - 18
|
||||
|
|
|
@ -747,7 +747,7 @@ loc_flag:
|
|||
// loc_27266:
|
||||
case kWeaponSword:
|
||||
{
|
||||
nHeight -= PlayerList[nLocalPlayer].horizon.__horiz.Tan() * 32.;
|
||||
nHeight += PlayerList[nLocalPlayer].horizon.__horiz.Tan() * 32.;
|
||||
|
||||
thePos.Z += nHeight;
|
||||
|
||||
|
@ -853,7 +853,7 @@ loc_flag:
|
|||
case kWeaponPistol:
|
||||
{
|
||||
double h = PlayerList[nLocalPlayer].horizon.__horiz.Tan() * 2.;
|
||||
nHeight -= h;
|
||||
nHeight += h;
|
||||
|
||||
DExhumedActor* target = nullptr;
|
||||
if (sPlayerInput[nPlayer].pTarget != nullptr && Autoaim(nPlayer))
|
||||
|
|
|
@ -1162,7 +1162,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
sectdone:
|
||||
if (!PlayerList[nPlayer].bPlayerPan && !PlayerList[nPlayer].bLockPan)
|
||||
{
|
||||
PlayerList[nPlayer].nDestVertPan = maphoriz((spr_pos.Z - pPlayerActor->spr.pos.Z) * 2.);
|
||||
PlayerList[nPlayer].nDestVertPan = maphoriz((pPlayerActor->spr.pos.Z - spr_pos.Z) * 2.);
|
||||
}
|
||||
|
||||
playerPos -= pPlayerActor->spr.pos.XY();
|
||||
|
@ -2620,20 +2620,20 @@ sectdone:
|
|||
}
|
||||
else
|
||||
{
|
||||
if (PlayerList[nPlayer].horizon.__horiz.Sgn() < 0)
|
||||
if (PlayerList[nPlayer].horizon.__horiz.Sgn() > 0)
|
||||
{
|
||||
PlayerList[nPlayer].horizon.settarget(nullAngle);
|
||||
PlayerList[nPlayer].eyelevel -= dVertPan[nPlayer];
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerList[nPlayer].horizon.addadjustment(maphoriz(dVertPan[nPlayer]));
|
||||
PlayerList[nPlayer].horizon.addadjustment(maphoriz(-dVertPan[nPlayer]));
|
||||
|
||||
if (PlayerList[nPlayer].horizon.__horiz.Degrees() >= 38)
|
||||
if (PlayerList[nPlayer].horizon.__horiz.Degrees() <= 38)
|
||||
{
|
||||
PlayerList[nPlayer].horizon.settarget(DAngle::fromDeg(37.72));
|
||||
PlayerList[nPlayer].horizon.settarget(DAngle::fromDeg(-37.72));
|
||||
}
|
||||
else if (PlayerList[nPlayer].horizon.__horiz.Sgn() <= 0)
|
||||
else if (PlayerList[nPlayer].horizon.__horiz.Sgn() >= 0)
|
||||
{
|
||||
if (!(pPlayerActor->sector()->Flag & kSectUnderwater))
|
||||
{
|
||||
|
|
|
@ -1311,7 +1311,7 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
|
|||
}
|
||||
|
||||
// recoil only when not in camera
|
||||
thoriz += interpolatedvalue(pp->recoil_ohorizoff, pp->recoil_horizoff, interpfrac);
|
||||
thoriz -= interpolatedvalue(pp->recoil_ohorizoff, pp->recoil_horizoff, interpfrac);
|
||||
}
|
||||
|
||||
if (automapMode != am_full)
|
||||
|
|
|
@ -594,7 +594,7 @@ void JS_DrawCameras(PLAYER* pp, const DVector3& campos, double smoothratio)
|
|||
}
|
||||
|
||||
// Set the horizon value.
|
||||
auto camhoriz = maphoriz(SP_TAG7(camactor) - 100);
|
||||
auto camhoriz = maphoriz(100 - SP_TAG7(camactor));
|
||||
|
||||
// If player is dead still then update at MoveSkip4
|
||||
// rate.
|
||||
|
|
|
@ -1289,7 +1289,7 @@ int PlayerInitChemBomb(PLAYER* pp)
|
|||
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
|
||||
actorNew->user.Flags |= (SPR_UNDERWATER);
|
||||
|
||||
actorNew->vel.Z -= pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z += pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
|
||||
oclipdist = plActor->native_clipdist();
|
||||
plActor->set_const_clipdist(0);
|
||||
|
@ -1664,7 +1664,7 @@ int PlayerInitCaltrops(PLAYER* pp)
|
|||
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
|
||||
actorNew->user.Flags |= (SPR_UNDERWATER);
|
||||
|
||||
actorNew->vel.Z -= pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z += pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
|
||||
oclipdist = plActor->native_clipdist();
|
||||
plActor->set_const_clipdist(0);
|
||||
|
@ -2209,7 +2209,7 @@ int SpawnShell(DSWActor* actor, int ShellNum)
|
|||
|
||||
if (actor->user.PlayerP)
|
||||
{
|
||||
actorNew->vel.Z = -actor->user.PlayerP->horizon.__horiz.Tan() * (HORIZ_MULTF / 3.);
|
||||
actorNew->vel.Z = actor->user.PlayerP->horizon.__horiz.Tan() * (HORIZ_MULTF / 3.);
|
||||
}
|
||||
|
||||
switch (actorNew->user.ID)
|
||||
|
|
|
@ -6006,12 +6006,12 @@ static void DoPlayerDeathHoriz(PLAYER* pp, double target, double speed)
|
|||
{
|
||||
if ((pp->horizon.__horiz.Degrees() - target) > 0.4476)
|
||||
{
|
||||
pp->horizon.addadjustment(DAngle::fromDeg(-speed));
|
||||
pp->horizon.addadjustment(DAngle::fromDeg(speed));
|
||||
}
|
||||
|
||||
if ((target - pp->horizon.__horiz.Degrees()) > 0.4476)
|
||||
{
|
||||
pp->horizon.addadjustment(DAngle::fromDeg(speed));
|
||||
pp->horizon.addadjustment(DAngle::fromDeg(-speed));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11610,7 +11610,7 @@ int DoRing(DSWActor* actor)
|
|||
|
||||
// put it out there
|
||||
actor->spr.pos += actor->spr.angle.ToVector() * actor->user.Dist;
|
||||
if (pp) actor->spr.pos.Z += actor->user.Dist * -pp->horizon.__horiz.Tan() * 2.; // horizon math sucks...
|
||||
if (pp) actor->spr.pos.Z -= actor->user.Dist * pp->horizon.__horiz.Tan() * 2.; // horizon math sucks...
|
||||
|
||||
SetActor(actor, actor->spr.pos);
|
||||
|
||||
|
@ -11689,7 +11689,7 @@ void InitSpellRing(PLAYER* pp)
|
|||
|
||||
// put it out there
|
||||
actorNew->spr.pos += actorNew->spr.angle.ToVector() * actorNew->user.Dist;
|
||||
actorNew->spr.pos.Z += pp->pos.Z + 20 + (actorNew->user.Dist * -pp->horizon.__horiz.Tan() * 2.); // horizon math sucks...
|
||||
actorNew->spr.pos.Z += pp->pos.Z + 20 - (actorNew->user.Dist * pp->horizon.__horiz.Tan() * 2.); // horizon math sucks...
|
||||
|
||||
actorNew->spr.angle += DAngle90;
|
||||
|
||||
|
@ -12063,7 +12063,7 @@ void InitSpellNapalm(PLAYER* pp)
|
|||
actor->spr.xrepeat = 32;
|
||||
actor->spr.yrepeat = 32;
|
||||
actor->set_const_clipdist(0);
|
||||
actor->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actor->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actor->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
actor->user.Flags2 |= (SPR2_BLUR_TAPER_FAST);
|
||||
|
@ -12195,7 +12195,7 @@ int InitSpellMirv(PLAYER* pp)
|
|||
actorNew->spr.xrepeat = 72;
|
||||
actorNew->spr.yrepeat = 72;
|
||||
actorNew->set_const_clipdist(32 >> 2);
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->spr.cstat |= (CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_YCENTER);
|
||||
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
|
||||
|
@ -12329,7 +12329,7 @@ int InitSwordAttack(PLAYER* pp)
|
|||
{
|
||||
HitInfo hit{};
|
||||
|
||||
double daz = -pp->horizon.__horiz.Tan() * 1000. + (RandomRangeF(24000 / 256.) - 12000 / 256.);
|
||||
double daz = pp->horizon.__horiz.Tan() * 1000. - (RandomRangeF(24000 / 256.) - 12000 / 256.);
|
||||
DAngle daang = pp->angle.ang;
|
||||
FAFhitscan(pp->pos, pp->cursector, DVector3(pp->angle.ang.ToVector() * 1024, daz), hit, CLIPMASK_MISSILE);
|
||||
|
||||
|
@ -12506,7 +12506,7 @@ int InitFistAttack(PLAYER* pp)
|
|||
// all this is to break glass
|
||||
{
|
||||
HitInfo hit{};
|
||||
double daz = -pp->horizon.__horiz.Tan() * 1000. + (RandomRangeF(24000 / 256.) - 12000 / 256.);
|
||||
double daz = pp->horizon.__horiz.Tan() * 1000. - (RandomRangeF(24000 / 256.) - 12000 / 256.);
|
||||
auto daang = pp->angle.ang;
|
||||
FAFhitscan(pp->pos, pp->cursector, DVector3(pp->angle.ang.ToVector() * 1024, daz), hit, CLIPMASK_MISSILE);
|
||||
|
||||
|
@ -13069,7 +13069,7 @@ int InitStar(PLAYER* pp)
|
|||
actorNew->spr.shade = -25;
|
||||
actorNew->set_const_clipdist(32 >> 2);
|
||||
// zvel was overflowing with this calculation - had to move to a local long var
|
||||
double zvel = -pp->horizon.__horiz.Tan() * ((HORIZ_MULT + STAR_HORIZ_ADJ) * 0.5);
|
||||
double zvel = pp->horizon.__horiz.Tan() * ((HORIZ_MULT + STAR_HORIZ_ADJ) * 0.5);
|
||||
|
||||
actorNew->user.ceiling_dist = (1);
|
||||
actorNew->user.floor_dist = (1);
|
||||
|
@ -13120,7 +13120,7 @@ int InitStar(PLAYER* pp)
|
|||
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew2))
|
||||
actorNew2->user.Flags |= SPR_UNDERWATER;
|
||||
|
||||
zvel = -pp->horizon.__horiz.Tan() * ((HORIZ_MULT + STAR_HORIZ_ADJ) * 0.5);
|
||||
zvel = pp->horizon.__horiz.Tan() * ((HORIZ_MULT + STAR_HORIZ_ADJ) * 0.5);
|
||||
actorNew2->vel.Z = zvel * 0.5;
|
||||
|
||||
if (MissileSetPos(actorNew2, DoStar, 1000))
|
||||
|
@ -13170,7 +13170,7 @@ void InitHeartAttack(PLAYER* pp)
|
|||
actorNew->spr.xrepeat = 52;
|
||||
actorNew->spr.yrepeat = 52;
|
||||
actorNew->set_const_clipdist(0);
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
actorNew->user.Flags2 |= (SPR2_DONT_TARGET_OWNER);
|
||||
actorNew->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);
|
||||
|
@ -13314,7 +13314,7 @@ int InitShotgun(PLAYER* pp)
|
|||
}
|
||||
else
|
||||
{
|
||||
daz = -pp->horizon.__horiz.Tan() * 1000.;
|
||||
daz = pp->horizon.__horiz.Tan() * 1000.;
|
||||
daang = pp->angle.ang;
|
||||
}
|
||||
|
||||
|
@ -13477,7 +13477,7 @@ int InitLaser(PLAYER* pp)
|
|||
actorNew->set_const_clipdist(64 >> 2);;
|
||||
|
||||
// the slower the missile travels the less of a zvel it needs
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * 16.;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * 16.;
|
||||
|
||||
actorNew->user.WeaponNum = actor->user.WeaponNum;
|
||||
actorNew->user.Radius = 200;
|
||||
|
@ -13573,7 +13573,7 @@ int InitRail(PLAYER* pp)
|
|||
actorNew->spr.yrepeat = 52;
|
||||
actorNew->spr.xrepeat = 52;
|
||||
actorNew->spr.shade = -15;
|
||||
zvel = -pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 17) * 0.5);
|
||||
zvel = pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 17) * 0.5);
|
||||
|
||||
actorNew->user.RotNum = 5;
|
||||
NewStateGroup(actorNew, &sg_Rail[0]);
|
||||
|
@ -13739,7 +13739,7 @@ int InitRocket(PLAYER* pp)
|
|||
actorNew->spr.yrepeat = 90;
|
||||
actorNew->spr.xrepeat = 90;
|
||||
actorNew->spr.shade = -15;
|
||||
zvel = -pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 35) * 0.5);
|
||||
zvel = pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 35) * 0.5);
|
||||
|
||||
actorNew->set_const_clipdist(64 >> 2);
|
||||
|
||||
|
@ -13847,7 +13847,7 @@ int InitBunnyRocket(PLAYER* pp)
|
|||
actorNew->spr.yrepeat = 64;
|
||||
actorNew->spr.xrepeat = 64;
|
||||
actorNew->spr.shade = -15;
|
||||
zvel = -pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 35) * 0.5);
|
||||
zvel = pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 35) * 0.5);
|
||||
|
||||
actorNew->set_const_clipdist(64 >> 2);
|
||||
|
||||
|
@ -13950,7 +13950,7 @@ int InitNuke(PLAYER* pp)
|
|||
actorNew->spr.yrepeat = 128;
|
||||
actorNew->spr.xrepeat = 128;
|
||||
actorNew->spr.shade = -15;
|
||||
zvel = -pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 36) * 0.5);
|
||||
zvel = pp->horizon.__horiz.Tan() * ((HORIZ_MULT + 36) * 0.5);
|
||||
actorNew->set_const_clipdist(64 >> 2);
|
||||
|
||||
// Set to red palette
|
||||
|
@ -14133,7 +14133,7 @@ int InitMicro(PLAYER* pp)
|
|||
actorNew->spr.yrepeat = 24;
|
||||
actorNew->spr.xrepeat = 24;
|
||||
actorNew->spr.shade = -15;
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->set_const_clipdist(64 >> 2);
|
||||
|
||||
// randomize zvelocity
|
||||
|
@ -15321,7 +15321,7 @@ int InitTracerUzi(PLAYER* pp)
|
|||
|
||||
static const short lat_dist[] = {800,-800};
|
||||
|
||||
double nz = 8 - (pp->horizon.__horiz.Tan() * 36.);
|
||||
double nz = 8 + (pp->horizon.__horiz.Tan() * 36.);
|
||||
|
||||
// Spawn a shot
|
||||
// Inserting and setting up variables
|
||||
|
@ -15361,7 +15361,7 @@ int InitTracerUzi(PLAYER* pp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
|
||||
plActor->set_native_clipdist(oclipdist);
|
||||
|
||||
|
@ -15408,7 +15408,7 @@ int InitTracerTurret(DSWActor* actor, DSWActor* Operator, DAngle horiz)
|
|||
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
|
||||
actorNew->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);
|
||||
|
||||
actorNew->vel.Z = -horiz.Tan() * actorNew->vel.X;
|
||||
actorNew->vel.Z = horiz.Tan() * actorNew->vel.X;
|
||||
|
||||
WeaponAutoAim(actor, actorNew, DAngle22_5 / 4, false);
|
||||
|
||||
|
@ -15629,7 +15629,7 @@ int InitUzi(PLAYER* pp)
|
|||
else
|
||||
{
|
||||
daang = pp->angle.ang + mapangle(RandomRange(24) - 12);
|
||||
daz = -pp->horizon.__horiz.Tan() * 1000. + (RandomRangeF(24000/256.) - 12000/256.);
|
||||
daz = pp->horizon.__horiz.Tan() * 1000. - (RandomRangeF(24000/256.) - 12000/256.);
|
||||
}
|
||||
|
||||
DVector3 vect(daang.ToVector() * 1024, daz);
|
||||
|
@ -15804,7 +15804,7 @@ int InitTankShell(DSWActor* actor, PLAYER* pp)
|
|||
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
|
||||
actorNew->spr.cstat |= (CSTAT_SPRITE_INVISIBLE);
|
||||
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
|
||||
WeaponAutoAim(actor, actorNew, DAngle22_5 / 2, false);
|
||||
// a bit of randomness
|
||||
|
@ -15873,7 +15873,7 @@ int InitTurretMicro(DSWActor* actor, PLAYER* pp)
|
|||
actorNew->spr.yrepeat = 24;
|
||||
actorNew->spr.xrepeat = 24;
|
||||
actorNew->spr.shade = -15;
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF + RandomRangeF(8) - 5;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF - RandomRangeF(8) + 5;
|
||||
actorNew->set_const_clipdist(64 >> 2);
|
||||
|
||||
|
||||
|
@ -15943,7 +15943,7 @@ int InitTurretRocket(DSWActor* actor, PLAYER* pp)
|
|||
actorNew->user.Flags2 |= (SPR2_SO_MISSILE);
|
||||
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
|
||||
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
|
||||
WeaponAutoAim(actor, actorNew, DAngle22_5 / 2, false);
|
||||
// a bit of randomness
|
||||
|
@ -15983,7 +15983,7 @@ int InitTurretFireball(DSWActor* actor, PLAYER* pp)
|
|||
actorNew->user.Flags2 |= (SPR2_SO_MISSILE);
|
||||
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
|
||||
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * actorNew->vel.X;
|
||||
|
||||
WeaponAutoAim(actor, actorNew, DAngle22_5 / 2, false);
|
||||
// a bit of randomness
|
||||
|
@ -16021,7 +16021,7 @@ int InitTurretRail(DSWActor* actor, PLAYER* pp)
|
|||
actorNew->spr.yrepeat = 52;
|
||||
actorNew->spr.xrepeat = 52;
|
||||
actorNew->spr.shade = -15;
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
|
||||
actorNew->user.RotNum = 5;
|
||||
NewStateGroup(actorNew, &sg_Rail[0]);
|
||||
|
@ -16069,7 +16069,7 @@ int InitTurretLaser(DSWActor* actor, PLAYER* pp)
|
|||
actorNew->spr.shade = -15;
|
||||
|
||||
// the slower the missile travels the less of a zvel it needs
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * 16.;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * 16.;
|
||||
|
||||
actorNew->user.Radius = 200;
|
||||
actorNew->user.ceiling_dist = (1);
|
||||
|
@ -16116,7 +16116,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
|
|||
}
|
||||
else
|
||||
{
|
||||
daz = -1000 * max(pp->horizon.__horiz.Tan(), -0.1953125) + RandomRangeF(80) - 40;
|
||||
daz = min(pp->horizon.__horiz.Tan(), 0.1953125) * 1000 - RandomRangeF(80) + 40;
|
||||
daang = actor->spr.angle;
|
||||
}
|
||||
|
||||
|
@ -16814,7 +16814,7 @@ int InitGrenade(PLAYER* pp)
|
|||
if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew))
|
||||
actorNew->user.Flags |= (SPR_UNDERWATER);
|
||||
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
|
||||
SAVE_CLIP;
|
||||
actor->set_const_clipdist(0);
|
||||
|
@ -16932,7 +16932,7 @@ int InitMine(PLAYER* pp)
|
|||
actorNew->spr.xrepeat = 32;
|
||||
actorNew->spr.shade = -15;
|
||||
actorNew->set_const_clipdist(128 >> 2);
|
||||
actorNew->vel.Z = -pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->vel.Z = pp->horizon.__horiz.Tan() * HORIZ_MULTF;
|
||||
actorNew->user.WeaponNum = actor->user.WeaponNum;
|
||||
actorNew->user.Radius = 200;
|
||||
actorNew->user.ceiling_dist = (5);
|
||||
|
@ -17067,7 +17067,7 @@ int InitFireball(PLAYER* pp)
|
|||
|
||||
actorNew->user.ceiling_dist = (6);
|
||||
actorNew->user.floor_dist = (6);
|
||||
double zvel = -pp->horizon.__horiz.Tan() * 120.;
|
||||
double zvel = pp->horizon.__horiz.Tan() * 120.;
|
||||
|
||||
// at certain angles the clipping box was big enough to block the
|
||||
// initial positioning of the fireball.
|
||||
|
|
|
@ -120,7 +120,7 @@ map lev11 "$TXT_EX_MAP11"
|
|||
ex_ramses_cdtrack = 7
|
||||
ex_ramses_pup = "lev11.pup"
|
||||
ex_ramses_text = "$TXT_EX_CINEMA5"
|
||||
ex_ramses_horiz = 46
|
||||
ex_ramses_horiz = -46
|
||||
intro
|
||||
{
|
||||
function = ExhumedCutscenes.BuildCinemaBefore11
|
||||
|
|
Loading…
Reference in a new issue