mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-21 11:01:01 +00:00
- actFloorBounceVector
This commit is contained in:
parent
38c0bc915d
commit
6ee9ae7ec6
5 changed files with 7 additions and 8 deletions
|
@ -2613,10 +2613,9 @@ int actWallBounceVector(int* x, int* y, walltype* pWall, int a4)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
int actFloorBounceVector(int* x, int* y, int* z, int nSector, int a5)
|
int actFloorBounceVector(int* x, int* y, int* z, sectortype* pSector, int a5)
|
||||||
{
|
{
|
||||||
int t = 0x10000 - a5;
|
int t = 0x10000 - a5;
|
||||||
auto pSector = §or[nSector];
|
|
||||||
if (pSector->floorheinum == 0)
|
if (pSector->floorheinum == 0)
|
||||||
{
|
{
|
||||||
int t2 = MulScale(*z, t, 16);
|
int t2 = MulScale(*z, t, 16);
|
||||||
|
@ -4695,7 +4694,7 @@ static Collision MoveThing(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
|
|
||||||
pSprite->flags |= 4;
|
pSprite->flags |= 4;
|
||||||
int vax = actFloorBounceVector(&actor->xvel, &actor->yvel, (int*)&v20, pSprite->sectnum, pThingInfo->elastic);
|
int vax = actFloorBounceVector(&actor->xvel, &actor->yvel, (int*)&v20, pSprite->sector(), pThingInfo->elastic);
|
||||||
int nDamage = MulScale(vax, vax, 30) - pThingInfo->dmgResist;
|
int nDamage = MulScale(vax, vax, 30) - pThingInfo->dmgResist;
|
||||||
if (nDamage > 0) actDamageSprite(actor, actor, kDamageFall, nDamage);
|
if (nDamage > 0) actDamageSprite(actor, actor, kDamageFall, nDamage);
|
||||||
|
|
||||||
|
@ -5187,7 +5186,7 @@ void MoveDude(DBloodActor* actor)
|
||||||
int v30 = actor->zvel - pSprite->sector()->velFloor;
|
int v30 = actor->zvel - pSprite->sector()->velFloor;
|
||||||
if (v30 > 0)
|
if (v30 > 0)
|
||||||
{
|
{
|
||||||
int vax = actFloorBounceVector((int*)&actor->xvel, (int*)&actor->yvel, (int*)&v30, pSprite->sectnum, 0);
|
int vax = actFloorBounceVector((int*)&actor->xvel, (int*)&actor->yvel, (int*)&v30, pSprite->sector(), 0);
|
||||||
int nDamage = MulScale(vax, vax, 30);
|
int nDamage = MulScale(vax, vax, 30);
|
||||||
if (pPlayer)
|
if (pPlayer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -214,7 +214,7 @@ bool IsUnderwaterSector(sectortype* pSector);
|
||||||
void actInit();
|
void actInit();
|
||||||
int actWallBounceVector(int *x, int *y, walltype* pWall, int a4);
|
int actWallBounceVector(int *x, int *y, walltype* pWall, int a4);
|
||||||
int actFloorBounceVector(int *x, int *y, int *z, int nSector, int a5);
|
int actFloorBounceVector(int *x, int *y, int *z, int nSector, int a5);
|
||||||
void actRadiusDamage(DBloodActor* source, int x, int y, int z, int nSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11);
|
void actRadiusDamage(DBloodActor* source, int x, int y, int z, sectortype* pSector, int nDist, int a7, int a8, DAMAGE_TYPE a9, int a10, int a11);
|
||||||
DBloodActor *actDropObject(DBloodActor *pSprite, int nType);
|
DBloodActor *actDropObject(DBloodActor *pSprite, int nType);
|
||||||
bool actHealDude(DBloodActor* pXDude, int a2, int a3);
|
bool actHealDude(DBloodActor* pXDude, int a2, int a3);
|
||||||
void actKillDude(DBloodActor* a1, DBloodActor* pSprite, DAMAGE_TYPE a3, int a4);
|
void actKillDude(DBloodActor* a1, DBloodActor* pSprite, DAMAGE_TYPE a3, int a4);
|
||||||
|
|
|
@ -449,7 +449,7 @@ void fxBouncingSleeve(DBloodActor* actor, int) // 16
|
||||||
|
|
||||||
if (actor->zvel == 0) sleeveStopBouncing(actor);
|
if (actor->zvel == 0) sleeveStopBouncing(actor);
|
||||||
else if (zv > 0) {
|
else if (zv > 0) {
|
||||||
actFloorBounceVector((int*)& actor->xvel, (int*)& actor->yvel, &zv, pSprite->sectnum, 0x9000);
|
actFloorBounceVector((int*)& actor->xvel, (int*)& actor->yvel, &zv, pSprite->sector(), 0x9000);
|
||||||
actor->zvel = zv;
|
actor->zvel = zv;
|
||||||
if (pSprite->sector()->velFloor == 0 && abs(actor->zvel) < 0x20000) {
|
if (pSprite->sector()->velFloor == 0 && abs(actor->zvel) < 0x20000) {
|
||||||
sleeveStopBouncing(actor);
|
sleeveStopBouncing(actor);
|
||||||
|
|
|
@ -1819,7 +1819,7 @@ void debrisMove(int listIndex)
|
||||||
if (v30 > 0)
|
if (v30 > 0)
|
||||||
{
|
{
|
||||||
pXSprite->physAttr |= kPhysFalling;
|
pXSprite->physAttr |= kPhysFalling;
|
||||||
actFloorBounceVector(&actor->xvel, &actor->yvel, &v30, pSprite->sectnum, tmpFraction);
|
actFloorBounceVector(&actor->xvel, &actor->yvel, &v30, pSprite->sector(), tmpFraction);
|
||||||
actor->zvel = v30;
|
actor->zvel = v30;
|
||||||
|
|
||||||
if (abs(actor->zvel) < 0x10000)
|
if (abs(actor->zvel) < 0x10000)
|
||||||
|
|
|
@ -509,7 +509,7 @@ static void fakeMoveDude(spritetype *pSprite)
|
||||||
int var44 = predict.zvel-predict.sector()->velFloor;
|
int var44 = predict.zvel-predict.sector()->velFloor;
|
||||||
if (var44 > 0)
|
if (var44 > 0)
|
||||||
{
|
{
|
||||||
actFloorBounceVector(&predict.xvel, &predict.yvel, &var44, predict.sectnum, 0);
|
actFloorBounceVector(&predict.xvel, &predict.yvel, &var44, predict.sector, 0);
|
||||||
predict.zvel = var44;
|
predict.zvel = var44;
|
||||||
if (abs(predict.zvel) < 0x10000)
|
if (abs(predict.zvel) < 0x10000)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue