mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- Exhumed: Replace Player
velocity and damage variables with vectors.
This commit is contained in:
parent
225a2a39da
commit
8f468607ff
6 changed files with 25 additions and 28 deletions
|
@ -762,8 +762,8 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n
|
|||
int nPlayer = GetPlayerFromActor(pTarget);
|
||||
if (nPlayer > -1)
|
||||
{
|
||||
x += PlayerList[nPlayer].nPlayerDX * 15;
|
||||
y += PlayerList[nPlayer].nPlayerDY * 15;
|
||||
x += PlayerList[nPlayer].nPlayerD.X * 15;
|
||||
y += PlayerList[nPlayer].nPlayerD.Y * 15;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -830,8 +830,8 @@ loc_flag:
|
|||
BuildSnake(nPlayer, nHeight);
|
||||
nQuake[nPlayer] = 512;
|
||||
|
||||
PlayerList[nPlayer].nXDamage -= bcos(pPlayerActor->spr.ang, 9);
|
||||
PlayerList[nPlayer].nYDamage -= bsin(pPlayerActor->spr.ang, 9);
|
||||
PlayerList[nPlayer].nDamage.X -= bcos(pPlayerActor->spr.ang, 9);
|
||||
PlayerList[nPlayer].nDamage.Y -= bsin(pPlayerActor->spr.ang, 9);
|
||||
break;
|
||||
}
|
||||
case kWeaponRing:
|
||||
|
|
|
@ -525,12 +525,12 @@ Collision movesprite(DExhumedActor* pActor, int dx, int dy, int dz, int ceildist
|
|||
|
||||
if (varB || varA)
|
||||
{
|
||||
PlayerList[nPlayer].nXDamage = varB;
|
||||
PlayerList[nPlayer].nYDamage = varA;
|
||||
PlayerList[nPlayer].nDamage.X = varB;
|
||||
PlayerList[nPlayer].nDamage.Y = varA;
|
||||
}
|
||||
|
||||
dx += PlayerList[nPlayer].nXDamage;
|
||||
dy += PlayerList[nPlayer].nYDamage;
|
||||
dx += PlayerList[nPlayer].nDamage.X;
|
||||
dy += PlayerList[nPlayer].nDamage.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -386,8 +386,8 @@ void RestartPlayer(int nPlayer)
|
|||
|
||||
nTemperature[nPlayer] = 0;
|
||||
|
||||
plr->nYDamage = 0;
|
||||
plr->nXDamage = 0;
|
||||
plr->nDamage.Y = 0;
|
||||
plr->nDamage.X = 0;
|
||||
|
||||
plr->nDestVertPan = plr->horizon.ohoriz = plr->horizon.horiz = q16horiz(0);
|
||||
plr->nBreathTimer = 90;
|
||||
|
@ -923,8 +923,8 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
|
||||
if (bUnderwater)
|
||||
{
|
||||
PlayerList[nPlayer].nXDamage /= 2;
|
||||
PlayerList[nPlayer].nYDamage /= 2;
|
||||
PlayerList[nPlayer].nDamage.X /= 2;
|
||||
PlayerList[nPlayer].nDamage.Y /= 2;
|
||||
}
|
||||
|
||||
// Trigger Ramses?
|
||||
|
@ -969,8 +969,8 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
if (bTouchFloor)
|
||||
{
|
||||
// Damage stuff..
|
||||
PlayerList[nPlayer].nXDamage /= 2;
|
||||
PlayerList[nPlayer].nYDamage /= 2;
|
||||
PlayerList[nPlayer].nDamage.X /= 2;
|
||||
PlayerList[nPlayer].nDamage.Y /= 2;
|
||||
|
||||
if (nPlayer == nLocalPlayer)
|
||||
{
|
||||
|
@ -1158,8 +1158,8 @@ sectdone:
|
|||
// loc_1ADAF
|
||||
PlayerList[nPlayer].pPlayerViewSect = pViewSect;
|
||||
|
||||
PlayerList[nPlayer].nPlayerDX = pPlayerActor->spr.pos.X - spr_x;
|
||||
PlayerList[nPlayer].nPlayerDY = pPlayerActor->spr.pos.Y - spr_y;
|
||||
PlayerList[nPlayer].nPlayerD.X = pPlayerActor->spr.pos.X - spr_x;
|
||||
PlayerList[nPlayer].nPlayerD.Y = pPlayerActor->spr.pos.Y - spr_y;
|
||||
|
||||
int var_5C = pViewSect->Flag & kSectUnderwater;
|
||||
|
||||
|
@ -2554,8 +2554,8 @@ sectdone:
|
|||
|
||||
if (!PlayerList[nPlayer].nHealth)
|
||||
{
|
||||
PlayerList[nPlayer].nYDamage = 0;
|
||||
PlayerList[nPlayer].nXDamage = 0;
|
||||
PlayerList[nPlayer].nDamage.Y = 0;
|
||||
PlayerList[nPlayer].nDamage.X = 0;
|
||||
|
||||
if (PlayerList[nPlayer].eyelevel >= -2816)
|
||||
{
|
||||
|
@ -2645,11 +2645,11 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Player& w, Player*
|
|||
("deathtype", w.nDeathType)
|
||||
("score", w.nPlayerScore)
|
||||
("color", w.nPlayerColor)
|
||||
("dx", w.nPlayerDX)
|
||||
("dy", w.nPlayerDY)
|
||||
("dx", w.nPlayerD.X)
|
||||
("dy", w.nPlayerD.Y)
|
||||
("pistolclip", w.nPistolClip)
|
||||
("xdamage", w.nXDamage)
|
||||
("ydamage", w.nYDamage)
|
||||
("xdamage", w.nDamage.X)
|
||||
("ydamage", w.nDamage.Y)
|
||||
("dopplesprite", w.pDoppleSprite)
|
||||
("oldweapon", w.nPlayerOldWeapon)
|
||||
("clip", w.nPlayerClip)
|
||||
|
|
|
@ -94,10 +94,7 @@ struct Player
|
|||
int16_t nPlayerScore;
|
||||
int16_t nPlayerColor;
|
||||
int16_t nPistolClip;
|
||||
int nPlayerDY;
|
||||
int nPlayerDX;
|
||||
int nXDamage;
|
||||
int nYDamage;
|
||||
vec2_t nPlayerD, nDamage;
|
||||
int16_t nPlayerOldWeapon;
|
||||
int16_t nPlayerClip;
|
||||
int16_t nPlayerPushSound;
|
||||
|
|
|
@ -350,8 +350,8 @@ void AIRex::Tick(RunListEvent* ev)
|
|||
if (pHitActor->spr.statnum == 100)
|
||||
{
|
||||
auto nPlayer = GetPlayerFromActor(nMov.actor());
|
||||
PlayerList[nPlayer].nXDamage += (xVel << 4);
|
||||
PlayerList[nPlayer].nYDamage += (yVel << 4);
|
||||
PlayerList[nPlayer].nDamage.X += (xVel << 4);
|
||||
PlayerList[nPlayer].nDamage.Y += (yVel << 4);
|
||||
pHitActor->spr.zvel = -3584;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue