mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- WallBounce
This commit is contained in:
parent
300e6df6c3
commit
b705ff3b97
3 changed files with 20 additions and 32 deletions
|
@ -418,7 +418,7 @@ int DoBloodSpray(DSWActor* actor)
|
|||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
SpawnMidSplash(actor);
|
||||
QueueWallBlood(actor, hsp->ang);
|
||||
WallBounce(actor->GetSpriteIndex(), wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
}
|
||||
else
|
||||
|
@ -493,8 +493,6 @@ int DoBloodSpray(DSWActor* actor)
|
|||
ChangeState(actor, s_BloodSprayDrip);
|
||||
}
|
||||
|
||||
//WallBounce(Weapon, wall_ang);
|
||||
//ScaleSpriteVector(actor, 32000);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -627,7 +625,7 @@ int DoPhosphorus(DSWActor* actor)
|
|||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
|
||||
{
|
||||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
WallBounce(actor->GetSpriteIndex(), wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
}
|
||||
else
|
||||
|
@ -669,7 +667,7 @@ int DoPhosphorus(DSWActor* actor)
|
|||
nw = wall[hit_wall].point2;
|
||||
wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y) + 512);
|
||||
|
||||
WallBounce(actor->GetSpriteIndex(), wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
break;
|
||||
}
|
||||
|
@ -844,7 +842,7 @@ int DoChemBomb(DSWActor* actor)
|
|||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
|
||||
{
|
||||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
WallBounce(actor->GetSpriteIndex(), wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
}
|
||||
else
|
||||
|
@ -887,7 +885,7 @@ int DoChemBomb(DSWActor* actor)
|
|||
nw = wall[hit_wall].point2;
|
||||
wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y) + 512);
|
||||
|
||||
WallBounce(actor->GetSpriteIndex(), wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
break;
|
||||
}
|
||||
|
@ -1083,7 +1081,7 @@ int DoCaltrops(DSWActor* actor)
|
|||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
|
||||
{
|
||||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
WallBounce(actor->GetSpriteIndex(), wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 10000);
|
||||
}
|
||||
else
|
||||
|
@ -1113,7 +1111,7 @@ int DoCaltrops(DSWActor* actor)
|
|||
int nw = wall[hit_wall].point2;
|
||||
int wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y) + 512);
|
||||
|
||||
WallBounce(actor->GetSpriteIndex(), wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 1000);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -7988,7 +7988,7 @@ DoStar(DSWActor* actor)
|
|||
nw = wall[hit_wall].point2;
|
||||
wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512);
|
||||
|
||||
WallBounce(Weapon, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 36000);
|
||||
SET(u->Flags, SPR_BOUNCE);
|
||||
u->motion_blur_num = 0;
|
||||
|
@ -8733,27 +8733,17 @@ void ScaleSpriteVector(DSWActor* actor, int scale)
|
|||
u->zchange = MulScale(u->zchange, scale, 16);
|
||||
}
|
||||
|
||||
void WallBounce(short SpriteNum, short ang)
|
||||
void WallBounce(DSWActor* actor, short ang)
|
||||
{
|
||||
USERp u = User[SpriteNum].Data();
|
||||
SPRITEp sp = u->SpriteP;
|
||||
USERp u = actor->u();
|
||||
SPRITEp sp = &actor->s();
|
||||
int old_ang;
|
||||
//short hit_wall;
|
||||
//short nextwall;
|
||||
int k,l;
|
||||
//short ang;
|
||||
int dax, day;
|
||||
|
||||
//hit_wall = NORM_WALL(u->ret);
|
||||
|
||||
//nextwall = wall[hit_wall].point2;
|
||||
//ang = getangle(wall[nextwall].x - wall[hit_wall].x, wall[nextwall].y - wall[hit_wall].y)+512;
|
||||
|
||||
u->bounce++;
|
||||
|
||||
//k = cos(ang) * sin(ang) * 2
|
||||
k = MulScale(bcos(ang), bsin(ang), 13);
|
||||
//l = cos(ang * 2)
|
||||
l = bcos(ang << 1);
|
||||
|
||||
dax = -u->xchange;
|
||||
|
@ -8908,7 +8898,7 @@ DoGrenade(DSWActor* actor)
|
|||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
|
||||
{
|
||||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
WallBounce(Weapon, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
}
|
||||
else
|
||||
|
@ -8951,7 +8941,7 @@ DoGrenade(DSWActor* actor)
|
|||
wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512);
|
||||
|
||||
//sp->ang = NORM_ANGLE(sp->ang + 1);
|
||||
WallBounce(Weapon, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 22000);
|
||||
|
||||
break;
|
||||
|
@ -9138,7 +9128,7 @@ DoVulcanBoulder(DSWActor* actor)
|
|||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
|
||||
{
|
||||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
WallBounce(Weapon, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 40000);
|
||||
}
|
||||
else
|
||||
|
@ -9173,7 +9163,7 @@ DoVulcanBoulder(DSWActor* actor)
|
|||
nw = wall[hit_wall].point2;
|
||||
wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512);
|
||||
|
||||
WallBounce(Weapon, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 40000);
|
||||
break;
|
||||
}
|
||||
|
@ -20715,7 +20705,7 @@ DoShrapVelocity(int16_t SpriteNum)
|
|||
hsp = &sprite[hit_sprite];
|
||||
|
||||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
WallBounce(SpriteNum, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
|
||||
break;
|
||||
|
@ -20736,7 +20726,7 @@ DoShrapVelocity(int16_t SpriteNum)
|
|||
nw = wall[hit_wall].point2;
|
||||
wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512);
|
||||
|
||||
WallBounce(SpriteNum, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
break;
|
||||
}
|
||||
|
@ -21054,7 +21044,7 @@ DoItemFly(int16_t SpriteNum)
|
|||
if (TEST(hsp->cstat, CSTAT_SPRITE_ALIGNMENT_WALL))
|
||||
{
|
||||
wall_ang = NORM_ANGLE(hsp->ang);
|
||||
WallBounce(SpriteNum, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
}
|
||||
else
|
||||
|
@ -21077,7 +21067,7 @@ DoItemFly(int16_t SpriteNum)
|
|||
nw = wall[hit_wall].point2;
|
||||
wall_ang = NORM_ANGLE(getangle(wall[nw].x - wph->x, wall[nw].y - wph->y)+512);
|
||||
|
||||
WallBounce(SpriteNum, wall_ang);
|
||||
WallBounce(actor, wall_ang);
|
||||
ScaleSpriteVector(actor, 32000);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ extern short StatDamageList[STAT_DAMAGE_LIST_SIZE];
|
|||
#define MUSHROOM_CLOUD 3280
|
||||
extern STATE s_NukeMushroom[];
|
||||
|
||||
void WallBounce(short SpriteNum, short ang);
|
||||
void WallBounce(DSWActor*, short ang);
|
||||
|
||||
#define PUFF 1748
|
||||
#define CALTROPS 2218
|
||||
|
|
Loading…
Reference in a new issue