- DoActorSetSpeed + ActorFlaming.

This commit is contained in:
Christoph Oelckers 2021-10-30 12:09:34 +02:00
parent ec9ab56ece
commit 3dbd002319
21 changed files with 83 additions and 64 deletions

View file

@ -138,10 +138,10 @@ bool ActorMoveHitReact(DSWActor* actor)
}
bool ActorFlaming(short SpriteNum)
bool ActorFlaming(DSWActor* actor)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
USERp u = actor->u();
SPRITEp sp = &actor->s();
if (u->flame >= 0)
{
@ -151,7 +151,6 @@ bool ActorFlaming(short SpriteNum)
size = SPRITEp_SIZE_Z(sp) - DIV4(SPRITEp_SIZE_Z(sp));
//DSPRINTF(ds,"enemy size %d, flame size %d",size>>8,SPRITEp_SIZE_Z(fp)>>8);
MONO_PRINT(ds);
if (SPRITEp_SIZE_Z(fp) > size)
return true;
@ -160,11 +159,10 @@ bool ActorFlaming(short SpriteNum)
return false;
}
void
DoActorSetSpeed(short SpriteNum, uint8_t speed)
void DoActorSetSpeed(DSWActor* actor, uint8_t speed)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
USERp u = actor->u();
SPRITEp sp = &actor->s();
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
return;
@ -173,7 +171,7 @@ DoActorSetSpeed(short SpriteNum, uint8_t speed)
u->speed = speed;
if (ActorFlaming(SpriteNum))
if (ActorFlaming(actor))
sp->xvel = u->Attrib->Speed[speed] + DIV2(u->Attrib->Speed[speed]);
else
sp->xvel = u->Attrib->Speed[speed];
@ -611,8 +609,9 @@ DECISION GenericFlaming[] =
ANIMATORp
DoActorActionDecide(short SpriteNum)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
auto actor = &swActors[SpriteNum];
USERp u = actor->u();
SPRITEp sp = &actor->s();
int dist;
ANIMATORp action;
USERp pu=nullptr;
@ -639,7 +638,7 @@ DoActorActionDecide(short SpriteNum)
}
// everybody on fire acts like this
if (ActorFlaming(SpriteNum))
if (ActorFlaming(actor))
{
action = ChooseAction(&GenericFlaming[0]);
//CON_Message("On Fire");
@ -1093,7 +1092,7 @@ DoActorCantMoveCloser(DSWActor* actor)
{
sp->ang = getangle((Track[u->track].TrackPoint + u->point)->x - sp->x, (Track[u->track].TrackPoint + u->point)->y - sp->y);
DoActorSetSpeed(SpriteNum, MID_SPEED);
DoActorSetSpeed(actor, MID_SPEED);
SET(u->Flags, SPR_FIND_PLAYER);
u->ActorActionFunc = DoActorDecide;
@ -1372,7 +1371,7 @@ InitActorRunAway(DSWActor* actor)
if (u->track >= 0)
{
sp->ang = NORM_ANGLE(getangle((Track[u->track].TrackPoint + u->point)->x - sp->x, (Track[u->track].TrackPoint + u->point)->y - sp->y));
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
SET(u->Flags, SPR_RUN_AWAY);
//MONO_PRINT("Actor running away on track\n");
}
@ -1399,7 +1398,7 @@ InitActorRunToward(DSWActor* actor)
NewStateGroup(SpriteNum, u->ActorActionSet->Run);
InitActorReposition(actor);
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
return 0;
}
@ -1577,7 +1576,7 @@ InitActorEvade(DSWActor* actor)
if (u->track >= 0)
{
sp->ang = NORM_ANGLE(getangle((Track[u->track].TrackPoint + u->point)->x - sp->x, (Track[u->track].TrackPoint + u->point)->y - sp->y));
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
// NOT doing a RUN_AWAY
RESET(u->Flags, SPR_RUN_AWAY);
}
@ -1605,7 +1604,7 @@ InitActorWanderAround(DSWActor* actor)
if (u->track >= 0)
{
sp->ang = getangle((Track[u->track].TrackPoint + u->point)->x - sp->x, (Track[u->track].TrackPoint + u->point)->y - sp->y);
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
}
return 0;
@ -1630,7 +1629,7 @@ InitActorFindPlayer(DSWActor* actor)
if (u->track >= 0)
{
sp->ang = getangle((Track[u->track].TrackPoint + u->point)->x - sp->x, (Track[u->track].TrackPoint + u->point)->y - sp->y);
DoActorSetSpeed(SpriteNum, MID_SPEED);
DoActorSetSpeed(actor, MID_SPEED);
SET(u->Flags, SPR_FIND_PLAYER);
u->ActorActionFunc = DoActorDecide;
@ -1791,8 +1790,9 @@ int move_scan(short SpriteNum, short ang, int dist, int *stopx, int *stopy, int
int
FindNewAngle(short SpriteNum, signed char dir, int DistToMove)
{
USERp u = User[SpriteNum].Data();
SPRITEp sp = User[SpriteNum]->SpriteP;
auto actor = &swActors[SpriteNum];
USERp u = actor->u();
SPRITEp sp = &actor->s();
static short toward_angle_delta[4][9] =
{
@ -1824,7 +1824,7 @@ FindNewAngle(short SpriteNum, signed char dir, int DistToMove)
int save_dist = 500;
// if on fire, run shorter distances
if (ActorFlaming(SpriteNum))
if (ActorFlaming(actor))
DistToMove = DIV4(DistToMove) + DIV8(DistToMove);
// Find angle to from the player
@ -1992,7 +1992,7 @@ InitActorReposition(DSWActor* actor)
}
sp->ang = ang;
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
RESET(u->Flags, SPR_RUN_AWAY);
}
else
@ -2016,9 +2016,9 @@ InitActorReposition(DSWActor* actor)
{
// pick random speed to move toward the player
if (RANDOM_P2(1024) < 512)
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
else
DoActorSetSpeed(SpriteNum, MID_SPEED);
DoActorSetSpeed(actor, MID_SPEED);
}
sp->ang = ang;

View file

@ -72,8 +72,6 @@ extern ATTRIBUTE DefaultAttrib;
// AI.C functions
void DebugMoveHit(DSWActor* actor);
bool ActorMoveHitReact(DSWActor* actor);
bool ActorFlaming(short SpriteNum);
void DoActorSetSpeed(short SpriteNum,uint8_t speed);
short ChooseActionNumber(short decision[]);
int DoActorNoise(ANIMATORp Action,short SpriteNum);
bool CanSeePlayer(short SpriteNum);
@ -162,7 +160,7 @@ DoActorExtra5Noise,
DoActorExtra6Noise;
*/
void DoActorSetSpeed(short SpriteNum, uint8_t speed);
void DoActorSetSpeed(DSWActor* actor, uint8_t speed);
END_SW_NS

View file

@ -725,13 +725,14 @@ ACTOR_ACTION_SET BunnyWhiteActionSet =
int
SetupBunny(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
{
u = User[SpriteNum].Data();
u = actor->u();
ASSERT(u);
}
else
@ -792,7 +793,7 @@ SetupBunny(short SpriteNum)
//sp->shade = 0; // darker
}
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
SET(u->Flags, SPR_XFLIP_TOGGLE);
@ -866,7 +867,7 @@ DoBunnyBeginJumpAttack(DSWActor* actor)
else
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -400); // was -800
@ -1233,7 +1234,7 @@ void BunnyHatch(short Weapon)
NewStateGroup(New, nu->ActorActionSet->Jump);
nu->ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(New, FAST_SPEED);
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(New, -600);
SET(nu->Flags, SPR_JUMPING);
@ -1291,7 +1292,7 @@ int BunnyHatch2(short Weapon)
NewStateGroup(New, nu->ActorActionSet->Jump);
nu->ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(New, FAST_SPEED);
DoActorSetSpeed(actorNew, FAST_SPEED);
if (TEST_BOOL3(wp))
{
PickJumpMaxSpeed(New, -600-RandomRange(600));

View file

@ -500,6 +500,7 @@ int DoCoolgMatchPlayerZ(short SpriteNum);
void
CoolgCommon(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
@ -518,6 +519,7 @@ CoolgCommon(short SpriteNum)
int
SetupCoolg(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -535,7 +537,7 @@ SetupCoolg(short SpriteNum)
ChangeState(SpriteNum, s_CoolgRun[0]);
u->Attrib = &CoolgAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_CoolgDie;
u->Rot = sg_CoolgRun;
@ -593,7 +595,7 @@ DoCoolgBirth(DSWActor* actor)
u->Health = HEALTH_COOLIE_GHOST;
u->Attrib = &CoolgAttrib;
DoActorSetSpeed(New, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
ChangeState(New, s_CoolgRun[0]);
u->StateEnd = s_CoolgDie;
@ -720,7 +722,7 @@ int InitCoolgCircle(DSWActor* actor)
NewStateGroup(SpriteNum, u->ActorActionSet->Run);
// set it close
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
// set to really fast
sp->xvel = 400;

View file

@ -525,6 +525,7 @@ void EnemyDefaults(short SpriteNum, ACTOR_ACTION_SETp action, PERSONALITYp perso
int
SetupCoolie(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -542,7 +543,7 @@ SetupCoolie(short SpriteNum)
ChangeState(SpriteNum,s_CoolieRun[0]);
u->Attrib = &CoolieAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_CoolieDie;
u->Rot = sg_CoolieRun;
@ -652,7 +653,7 @@ int InitCoolieCharge(DSWActor* actor)
if (RANDOM_P2(1024) > 950)
PlaySound(DIGI_COOLIESCREAM, sp, v3df_follow);
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
InitActorMoveCloser(actor);

View file

@ -378,6 +378,7 @@ EelCommon(short SpriteNum)
int
SetupEel(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -395,7 +396,7 @@ SetupEel(short SpriteNum)
ChangeState(SpriteNum, s_EelRun[0]);
u->Attrib = &EelAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_EelDie;
u->Rot = sg_EelRun;

View file

@ -715,6 +715,7 @@ ACTOR_ACTION_SET GirlNinjaActionSet =
int
SetupGirlNinja(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -740,7 +741,7 @@ SetupGirlNinja(short SpriteNum)
EnemyDefaults(SpriteNum, &GirlNinjaActionSet, &GirlNinjaPersonality);
ChangeState(SpriteNum, s_GirlNinjaRun[0]);
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->Radius = 280;
RESET(u->Flags, SPR_XFLIP_TOGGLE);

View file

@ -484,6 +484,7 @@ ACTOR_ACTION_SET GoroActionSet =
int
SetupGoro(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -501,7 +502,7 @@ SetupGoro(short SpriteNum)
ChangeState(SpriteNum, s_GoroRun[0]);
u->Attrib = &GoroAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_GoroDie;
u->Rot = sg_GoroRun;

View file

@ -290,6 +290,7 @@ int DoHornetMatchPlayerZ(short SpriteNum);
int
SetupHornet(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -307,7 +308,7 @@ SetupHornet(short SpriteNum)
ChangeState(SpriteNum, s_HornetRun[0]);
u->Attrib = &HornetAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_HornetDie;
u->Rot = sg_HornetRun;
@ -433,7 +434,7 @@ int InitHornetCircle(DSWActor* actor)
NewStateGroup(SpriteNum, u->ActorActionSet->Run);
// set it close
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
// set to really fast
sp->xvel = 400;

View file

@ -454,6 +454,7 @@ ACTOR_ACTION_SET LavaActionSet =
int
SetupLava(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -471,7 +472,7 @@ SetupLava(short SpriteNum)
ChangeState(SpriteNum, s_LavaRun[0]);
u->Attrib = &LavaAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_LavaDie;
u->Rot = sg_LavaRun;

View file

@ -1819,6 +1819,7 @@ ACTOR_ACTION_SET PlayerNinjaActionSet =
int
SetupNinja(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -1930,7 +1931,7 @@ SetupNinja(short SpriteNum)
}
ChangeState(SpriteNum, s_NinjaRun[0]);
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->Radius = 280;
SET(u->Flags, SPR_XFLIP_TOGGLE);

View file

@ -817,6 +817,7 @@ ACTOR_ACTION_SET RipperBrownActionSet =
int
SetupRipper(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -834,7 +835,7 @@ SetupRipper(short SpriteNum)
ChangeState(SpriteNum, s_RipperRun[0]);
u->Attrib = &RipperAttrib;
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
u->StateEnd = s_RipperDie;
u->Rot = sg_RipperRun;
sp->xrepeat = 64;
@ -982,7 +983,7 @@ InitRipperHang(DSWActor* actor)
NewStateGroup(SpriteNum, sg_RipperHangJump);
u->StateFallOverride = sg_RipperHangFall;
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -800);
@ -1103,7 +1104,7 @@ DoRipperBeginJumpAttack(DSWActor* actor)
else
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -400); // was -800
@ -1274,7 +1275,7 @@ void RipperHatch(short Weapon)
NewStateGroup(New, nu->ActorActionSet->Jump);
nu->ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(New, FAST_SPEED);
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(New, -600);
SET(nu->Flags, SPR_JUMPING);

View file

@ -885,6 +885,7 @@ ACTOR_ACTION_SET Ripper2BrownActionSet =
int
SetupRipper2(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -902,7 +903,7 @@ SetupRipper2(short SpriteNum)
ChangeState(SpriteNum, s_Ripper2Run[0]);
u->Attrib = &Ripper2Attrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_Ripper2Die;
u->Rot = sg_Ripper2Run;
sp->clipdist = 512 >> 2; // This actor is bigger, needs bigger box.
@ -979,7 +980,7 @@ InitRipper2Hang(DSWActor* actor)
NewStateGroup(SpriteNum, sg_Ripper2HangJump);
u->StateFallOverride = sg_Ripper2HangFall;
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -(RandomRange(400)+100));
@ -1115,7 +1116,7 @@ DoRipper2BeginJumpAttack(DSWActor* actor)
// sp->ang = NORM_ANGLE(tang);
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
//u->jump_speed = -800;
PickJumpMaxSpeed(SpriteNum, -(RandomRange(400)+100));
@ -1288,7 +1289,7 @@ void Ripper2Hatch(short Weapon)
NewStateGroup(New, nu->ActorActionSet->Jump);
nu->ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(New, FAST_SPEED);
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(New, -600);
SET(nu->Flags, SPR_JUMPING);
@ -1353,7 +1354,7 @@ int InitRipper2Charge(DSWActor* actor)
{
USER* u = actor->u();
int SpriteNum = u->SpriteNum;
DoActorSetSpeed(SpriteNum, FAST_SPEED);
DoActorSetSpeed(actor, FAST_SPEED);
InitActorMoveCloser(actor);

View file

@ -698,6 +698,7 @@ ACTOR_ACTION_SET SerpActionSet =
int
SetupSerp(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -718,7 +719,7 @@ SetupSerp(short SpriteNum)
ChangeState(SpriteNum, s_SerpRun[0]);
u->Attrib = &SerpAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_SerpDie;
u->Rot = sg_SerpRun;

View file

@ -503,6 +503,7 @@ ACTOR_ACTION_SET SkelActionSet =
int
SetupSkel(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -520,7 +521,7 @@ SetupSkel(short SpriteNum)
ChangeState(SpriteNum, s_SkelRun[0]);
u->Attrib = &SkelAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_SkelDie;
u->Rot = sg_SkelRun;

View file

@ -212,6 +212,7 @@ STATEp sg_SkullExplode[] =
int
SetupSkull(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -229,7 +230,7 @@ SetupSkull(short SpriteNum)
ChangeState(SpriteNum, s_SkullWait[0]);
u->Attrib = &SkullAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_SkullExplode;
u->Rot = sg_SkullWait;
@ -636,6 +637,7 @@ STATEp sg_BettyExplode[] =
int
SetupBetty(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -653,7 +655,7 @@ SetupBetty(short SpriteNum)
ChangeState(SpriteNum, s_BettyWait[0]);
u->Attrib = &BettyAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_BettyExplode;
u->Rot = sg_BettyWait;

View file

@ -630,6 +630,7 @@ ACTOR_ACTION_SET MiniSumoActionSet =
int
SetupSumo(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -650,7 +651,7 @@ SetupSumo(short SpriteNum)
ChangeState(SpriteNum,s_SumoRun[0]);
u->Attrib = &SumoAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_SumoDie;
u->Rot = sg_SumoRun;

View file

@ -3014,6 +3014,7 @@ DoAutoTurretObject(SECTOR_OBJECTp sop)
void
DoActorHitTrackEndPoint(USERp u)
{
auto actor = &swActors[u->SpriteNum];
SPRITEp sp = u->SpriteP;
RESET(Track[u->track].flags, TF_TRACK_OCCUPIED);
@ -3031,7 +3032,7 @@ DoActorHitTrackEndPoint(USERp u)
else
{
RESET(u->Flags, SPR_RUN_AWAY);
DoActorSetSpeed(short(sp - sprite), NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->track = -1;
}
}
@ -3047,7 +3048,7 @@ DoActorHitTrackEndPoint(USERp u)
else
{
RESET(u->Flags, SPR_FIND_PLAYER);
DoActorSetSpeed(short(sp - sprite), NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->track = -1;
}
}
@ -3760,7 +3761,7 @@ ActorFollowTrack(short SpriteNum, short locktics)
RESET(sp->cstat, CSTAT_SPRITE_YCENTER);
sp->z += u->sy;
DoActorSetSpeed(SpriteNum, SLOW_SPEED);
DoActorSetSpeed(actor, SLOW_SPEED);
u->ActorActionFunc = NinjaJumpActionFunc;
u->jump_speed = -650;
DoActorBeginJump(actor);

View file

@ -13836,6 +13836,7 @@ InitSumoNapalm(short SpriteNum)
int
InitSumoSkull(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = User[SpriteNum]->SpriteP, np;
USERp u = User[SpriteNum].Data(), nu;
short New;
@ -13871,7 +13872,7 @@ InitSumoSkull(short SpriteNum)
nu->Rot = sg_SkullWait;
nu->Attrib = &SkullAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
nu->Counter = RANDOM_P2(2048);
nu->sz = np->z;
nu->Health = 100;

View file

@ -643,6 +643,7 @@ ACTOR_ACTION_SET ZillaActionSet =
int
SetupZilla(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u;
ANIMATOR DoActorDecide;
@ -663,7 +664,7 @@ SetupZilla(short SpriteNum)
ChangeState(SpriteNum,s_ZillaRun[0]);
u->Attrib = &ZillaAttrib;
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->StateEnd = s_ZillaDie;
u->Rot = sg_ZillaRun;

View file

@ -751,6 +751,7 @@ ACTOR_ACTION_SET ZombieActionSet =
int
SetupZombie(short SpriteNum)
{
auto actor = &swActors[SpriteNum];
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
ANIMATOR DoActorDecide;
@ -765,7 +766,7 @@ SetupZombie(short SpriteNum)
EnemyDefaults(SpriteNum, &ZombieActionSet, &ZombiePersonality);
ChangeState(SpriteNum, s_ZombieRun[0]);
DoActorSetSpeed(SpriteNum, NORM_SPEED);
DoActorSetSpeed(actor, NORM_SPEED);
u->Radius = 280;
SET(u->Flags, SPR_XFLIP_TOGGLE);