- PickJumpMaxSpeed.

This commit is contained in:
Christoph Oelckers 2021-11-01 14:31:24 +01:00
parent f09cf97822
commit e7dcd279af
7 changed files with 17 additions and 24 deletions

View file

@ -857,7 +857,6 @@ int UserBreakSprite(DSWActor* breakActor)
SPRITEp bp = &breakActor->s();
short match = bp->lotag;
short match_extra;
int BreakSprite = breakActor->GetSpriteIndex();
auto actor = FindBreakSpriteMatch(match);
@ -930,7 +929,6 @@ int AutoBreakSprite(DSWActor* breakActor, short type)
SPRITEp bp = &breakActor->s();
BREAK_INFOp break_info;
extern void DoWallBreakMatch(short match);
int BreakSprite = breakActor->GetSpriteIndex();
break_info = FindSpriteBreakInfo(bp->picnum);

View file

@ -866,7 +866,7 @@ int DoBunnyBeginJumpAttack(DSWActor* actor)
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(actor->GetSpriteIndex(), -400); // was -800
PickJumpMaxSpeed(actor, -400); // was -800
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -1213,7 +1213,7 @@ void BunnyHatch(DSWActor* actor)
NewStateGroup(actorNew, nu->ActorActionSet->Jump);
nu->ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(actorNew->GetSpriteIndex(), -600);
PickJumpMaxSpeed(actorNew, -600);
SET(nu->Flags, SPR_JUMPING);
RESET(nu->Flags, SPR_FALLING);
@ -1269,7 +1269,7 @@ DSWActor* BunnyHatch2(DSWActor* actor)
DoActorSetSpeed(actorNew, FAST_SPEED);
if (TEST_BOOL3(wp))
{
PickJumpMaxSpeed(actorNew->GetSpriteIndex(), -600-RandomRange(600));
PickJumpMaxSpeed(actorNew, -600-RandomRange(600));
np->xrepeat = np->yrepeat = 64;
np->xvel = 150 + RandomRange(1000);
nu->Health = 1; // Easy to pop. Like shootn' skeet.
@ -1277,7 +1277,7 @@ DSWActor* BunnyHatch2(DSWActor* actor)
np->ang += RandomRange(128);
}
else
PickJumpMaxSpeed(actorNew->GetSpriteIndex(), -600);
PickJumpMaxSpeed(actorNew, -600);
SET(nu->Flags, SPR_JUMPING);
RESET(nu->Flags, SPR_FALLING);

View file

@ -2119,7 +2119,7 @@ extern bool NightVision;
//
///////////////////////////////////////////////////////////////
int PickJumpMaxSpeed(short SpriteNum, short max_speed); // ripper.c
int PickJumpMaxSpeed(DSWActor*, short max_speed); // ripper.c
int DoRipperRipHeart(short SpriteNum); // ripper.c
int DoRipper2RipHeart(short SpriteNum); // ripper2.c
DSWActor* BunnyHatch2(DSWActor*); // bunny.c

View file

@ -903,11 +903,10 @@ PickJumpSpeed(short SpriteNum, int pix_height)
}
int
PickJumpMaxSpeed(short SpriteNum, short max_speed)
int PickJumpMaxSpeed(DSWActor* actor, short max_speed)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
SPRITEp sp = &actor->s();
USERp u = actor->u();
int zh;
ASSERT(max_speed < 0);
@ -986,7 +985,7 @@ InitRipperHang(DSWActor* actor)
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -800);
PickJumpMaxSpeed(actor, -800);
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -1107,7 +1106,7 @@ DoRipperBeginJumpAttack(DSWActor* actor)
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -400); // was -800
PickJumpMaxSpeed(actor, -400); // was -800
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -1277,7 +1276,7 @@ void RipperHatch(short Weapon)
NewStateGroup(actorNew, nu->ActorActionSet->Jump);
nu->ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(New, -600);
PickJumpMaxSpeed(actorNew, -600);
SET(nu->Flags, SPR_JUMPING);
RESET(nu->Flags, SPR_FALLING);

View file

@ -983,7 +983,7 @@ InitRipper2Hang(DSWActor* actor)
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -(RandomRange(400)+100));
PickJumpMaxSpeed(actor, -(RandomRange(400)+100));
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -1119,7 +1119,7 @@ DoRipper2BeginJumpAttack(DSWActor* actor)
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -(RandomRange(400)+100));
PickJumpMaxSpeed(actor, -(RandomRange(400)+100));
SET(u->Flags, SPR_JUMPING);
RESET(u->Flags, SPR_FALLING);
@ -1289,7 +1289,7 @@ void Ripper2Hatch(short Weapon)
NewStateGroup(actorNew, nu->ActorActionSet->Jump);
nu->ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(New, -600);
PickJumpMaxSpeed(actorNew, -600);
SET(nu->Flags, SPR_JUMPING);
RESET(nu->Flags, SPR_FALLING);

View file

@ -935,16 +935,12 @@ SpawnUser(short SpriteNum, short id, STATEp state)
// Problem with sprites spawned really close to white sector walls
// cant do a getzrange there
// Just put in some valid starting values
#if 0
DoActorZrange(SpriteNum);
#else
u->loz = sector[sp->sectnum].floorz;
u->hiz = sector[sp->sectnum].ceilingz;
u->lowActor = nullptr;
u->highActor = nullptr;
u->lo_sectp = &sector[sp->sectnum];
u->hi_sectp = &sector[sp->sectnum];
#endif
return u;
}

View file

@ -13079,7 +13079,7 @@ InitSpellNapalm(PLAYERp pp)
if (mp[i].dist_over != 0)
{
sp->ang = NORM_ANGLE(sp->ang + mp[i].ang);
HelpMissileLateral(u->SpriteNum, mp[i].dist_over);
HelpMissileLateral(actor->GetSpriteIndex(), mp[i].dist_over);
sp->ang = NORM_ANGLE(sp->ang - mp[i].ang);
}
@ -15999,7 +15999,7 @@ InitSerpSpell(DSWActor* actor)
sp->clipdist = 1;
np->ang = NORM_ANGLE(np->ang + lat_ang[i]);
HelpMissileLateral(New, 4200L);
HelpMissileLateral(actorNew->GetSpriteIndex(), 4200);
np->ang = NORM_ANGLE(np->ang - lat_ang[i]);
// find the distance to the target (player)
@ -16121,7 +16121,7 @@ InitSerpMonstSpell(DSWActor* actor)
sp->clipdist = 1;
np->ang = NORM_ANGLE(np->ang + lat_ang[i]);
HelpMissileLateral(New, 4200L);
HelpMissileLateral(actorNew->GetSpriteIndex(), 4200);
np->ang = NORM_ANGLE(np->ang - lat_ang[i]);
// find the distance to the target (player)