- moved remaining stuff to refactor to a substructure for easier lookup later.

This commit is contained in:
Christoph Oelckers 2023-05-27 12:37:24 +02:00
parent 3612127a5e
commit 7d30f1921c
32 changed files with 365 additions and 362 deletions

View file

@ -135,7 +135,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
case COOLIE_RUN_R0:
actor->ChangeStateEnd();
actor->vel.X *= 2;
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.ActorActionFunc = nullptr;
actor->spr.Angles.Yaw += DAngle180;
break;
@ -162,7 +162,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
}
actor->ChangeStateEnd();
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.ActorActionFunc = nullptr;
actor->vel.X = 12.5 + RandomRangeF(12.5);
actor->user.jump_speed = -200 - RandomRange(250);
DoActorBeginJump(actor);
@ -180,10 +180,10 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
DoActorBeginJump(actor);
}
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.ActorActionFunc = nullptr;
//actor->user.ActorActionFunc = NullAnimator;
actor->user.__legacyState.ActorActionFunc = nullptr;
//actor->user.__legacyState.ActorActionFunc = NullAnimator;
if (!sw_ninjahack)
actor->spr.Angles.Yaw = weapActor->spr.Angles.Yaw;
break;
@ -215,7 +215,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->user.jump_speed = -10 - RandomRange(25);
DoActorBeginJump(actor);
}
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.ActorActionFunc = nullptr;
// Get angle to player
actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos.Y).Angle() + DAngle180;
break;
@ -237,7 +237,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
actor->user.jump_speed = -100 - RandomRange(250);
}
DoActorBeginJump(actor);
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.ActorActionFunc = nullptr;
// Get angle to player
actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle() + DAngle180;
break;
@ -259,7 +259,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
if (RandomRange(1000) > 500)
actor->spr.cstat |= (CSTAT_SPRITE_YFLIP);
actor->ChangeStateEnd();
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.ActorActionFunc = nullptr;
actor->vel.X = 18.75 + RandomRangeF(25);
actor->user.jump_speed = -300 - RandomRange(350);
DoActorBeginJump(actor);
@ -663,7 +663,7 @@ int DoActorBeginJump(DSWActor* actor)
else
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Jump);
}
actor->user.StateFallOverride = nullptr;
actor->user.__legacyState.StateFallOverride = nullptr;
//DO NOT CALL DoActorJump! DoActorStopFall can cause an infinite loop and
//stack overflow if it is called.
@ -737,9 +737,9 @@ int DoActorBeginFall(DSWActor* actor)
else
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Fall);
if (actor->user.StateFallOverride)
if (actor->user.__legacyState.StateFallOverride)
{
NewStateGroup(actor, actor->user.StateFallOverride);
NewStateGroup(actor, actor->user.__legacyState.StateFallOverride);
}
}
@ -981,8 +981,8 @@ saveable_module saveable_actor =
void DSWActor::ChangeStateEnd()
{
ChangeState(this, user.StateEnd);
user.RotNum = 0;
ChangeState(this, user.__legacyState.StateEnd);
user.__legacyState.RotNum = 0;
}

View file

@ -67,7 +67,7 @@ bool ActorMoveHitReact(DSWActor* actor)
{
// if you ran into a player - call close range functions
DoActorPickClosePlayer(actor);
auto action = ChooseAction(actor->user.Personality->TouchTarget);
auto action = ChooseAction(actor->user.__legacyState.Personality->TouchTarget);
if (action)
{
(*action)(actor);
@ -107,15 +107,15 @@ void DoActorSetSpeed(DSWActor* actor, uint8_t speed)
if (actor->spr.cstat & (CSTAT_SPRITE_RESTORE))
return;
ASSERT(actor->user.Attrib);
ASSERT(actor->user.__legacyState.Attrib);
actor->user.speed = speed;
int vel;
if (ActorFlaming(actor))
vel = actor->user.Attrib->Speed[speed] + (actor->user.Attrib->Speed[speed] >> 1);
vel = actor->user.__legacyState.Attrib->Speed[speed] + (actor->user.__legacyState.Attrib->Speed[speed] >> 1);
else
vel = actor->user.Attrib->Speed[speed];
vel = actor->user.__legacyState.Attrib->Speed[speed];
actor->vel.X = vel * maptoworld;
}
@ -481,7 +481,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
// REMINDER: This function is not even called if SpriteControl doesn't let
// it get called
ASSERT(actor->user.Personality);
ASSERT(actor->user.__legacyState.Personality);
actor->user.Dist = 0;
action = InitActorDecide;
@ -527,7 +527,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
actor->user.Flags &= ~(SPR_ACTIVE);
// You've lost the player - now decide what to do
action = ChooseAction(actor->user.Personality->LostTarget);
action = ChooseAction(actor->user.__legacyState.Personality->LostTarget);
//CON_Message("LostTarget");
return action;
}
@ -539,9 +539,9 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
(pActor && pActor->hasU() && pActor->user.WeaponNum == WPN_FIST && actor->user.ID != RIPPER2_RUN_R0 && actor->user.ID != RIPPER_RUN_R0))
{
if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
action = ChooseAction(actor->user.Personality->Evasive);
action = ChooseAction(actor->user.__legacyState.Personality->Evasive);
else
action = ChooseAction(actor->user.Personality->CloseRange);
action = ChooseAction(actor->user.__legacyState.Personality->CloseRange);
//CON_Message("CloseRange");
return action;
}
@ -561,9 +561,9 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
else
{
if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
action = ChooseAction(actor->user.Personality->Evasive);
action = ChooseAction(actor->user.__legacyState.Personality->Evasive);
else
action = ChooseAction(actor->user.Personality->Battle);
action = ChooseAction(actor->user.__legacyState.Personality->Battle);
}
//CON_Message("Battle 1");
return action;
@ -573,9 +573,9 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
else
{
if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
action = ChooseAction(actor->user.Personality->Evasive);
action = ChooseAction(actor->user.__legacyState.Personality->Evasive);
else
action = ChooseAction(actor->user.Personality->Battle);
action = ChooseAction(actor->user.__legacyState.Personality->Battle);
//CON_Message("Battle 2");
return action;
}
@ -585,16 +585,16 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
else if (ICanSee)
{
if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
action = ChooseAction(actor->user.Personality->Evasive);
action = ChooseAction(actor->user.__legacyState.Personality->Evasive);
else
action = ChooseAction(actor->user.Personality->Offense);
action = ChooseAction(actor->user.__legacyState.Personality->Offense);
//CON_Message("Offense");
return action;
}
else
{
// You've lost the player - now decide what to do
action = ChooseAction(actor->user.Personality->LostTarget);
action = ChooseAction(actor->user.__legacyState.Personality->LostTarget);
//CON_Message("Close but cant see, LostTarget");
return action;
}
@ -616,7 +616,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
DoActorOperate(actor);
// Don't let player completely sneek up behind you
action = ChooseAction(actor->user.Personality->Surprised);
action = ChooseAction(actor->user.__legacyState.Personality->Surprised);
//CON_Message("Surprised");
if (!actor->user.DidAlert && ICanSee)
{
@ -630,7 +630,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
{
// Player has not seen actor, to be fair let him know actor
// are there
DoActorNoise(ChooseAction(actor->user.Personality->Broadcast),actor);
DoActorNoise(ChooseAction(actor->user.__legacyState.Personality->Broadcast),actor);
//CON_Message("Actor Noise");
return action;
}
@ -649,7 +649,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
int InitActorDecide(DSWActor* actor)
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return DoActorDecide(actor);
}
@ -719,7 +719,7 @@ int sw_snd_scratch = 0;
int InitActorAlertNoise(DSWActor* actor)
{
sw_snd_scratch = 1;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -728,7 +728,7 @@ int InitActorAlertNoise(DSWActor* actor)
int InitActorAmbientNoise(DSWActor* actor)
{
sw_snd_scratch = 2;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -736,7 +736,7 @@ int InitActorAmbientNoise(DSWActor* actor)
int InitActorAttackNoise(DSWActor* actor)
{
sw_snd_scratch = 3;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -744,7 +744,7 @@ int InitActorAttackNoise(DSWActor* actor)
int InitActorPainNoise(DSWActor* actor)
{
sw_snd_scratch = 4;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -752,7 +752,7 @@ int InitActorPainNoise(DSWActor* actor)
int InitActorDieNoise(DSWActor* actor)
{
sw_snd_scratch = 5;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -760,7 +760,7 @@ int InitActorDieNoise(DSWActor* actor)
int InitActorExtra1Noise(DSWActor* actor)
{
sw_snd_scratch = 6;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -768,7 +768,7 @@ int InitActorExtra1Noise(DSWActor* actor)
int InitActorExtra2Noise(DSWActor* actor)
{
sw_snd_scratch = 7;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -776,7 +776,7 @@ int InitActorExtra2Noise(DSWActor* actor)
int InitActorExtra3Noise(DSWActor* actor)
{
sw_snd_scratch = 8;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -784,7 +784,7 @@ int InitActorExtra3Noise(DSWActor* actor)
int InitActorExtra4Noise(DSWActor* actor)
{
sw_snd_scratch = 9;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -792,7 +792,7 @@ int InitActorExtra4Noise(DSWActor* actor)
int InitActorExtra5Noise(DSWActor* actor)
{
sw_snd_scratch = 10;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -800,7 +800,7 @@ int InitActorExtra5Noise(DSWActor* actor)
int InitActorExtra6Noise(DSWActor* actor)
{
sw_snd_scratch = 11;
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -814,12 +814,12 @@ int InitActorExtra6Noise(DSWActor* actor)
int InitActorMoveCloser(DSWActor* actor)
{
actor->user.ActorActionFunc = DoActorMoveCloser;
actor->user.__legacyState.ActorActionFunc = DoActorMoveCloser;
if (actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Run)
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -842,7 +842,7 @@ int DoActorCantMoveCloser(DSWActor* actor)
DoActorSetSpeed(actor, MID_SPEED);
actor->user.Flags |= (SPR_FIND_PLAYER);
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
}
else
@ -872,7 +872,7 @@ int DoActorMoveCloser(DSWActor* actor)
}
// Do a noise if ok
DoActorNoise(ChooseAction(actor->user.Personality->Broadcast), actor);
DoActorNoise(ChooseAction(actor->user.__legacyState.Personality->Broadcast), actor);
// after moving a ways check to see if player is still in sight
if (actor->user.DistCheck > 34.375)
@ -1078,7 +1078,7 @@ int FindWanderTrack(DSWActor* actor)
int InitActorRunAway(DSWActor* actor)
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
actor->user.track = FindTrackAwayFromPlayer(actor);
@ -1107,7 +1107,7 @@ int InitActorRunAway(DSWActor* actor)
int InitActorRunToward(DSWActor* actor)
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
InitActorReposition(actor);
@ -1167,7 +1167,7 @@ int InitActorAttack(DSWActor* actor)
return 0;
}
actor->user.ActorActionFunc = DoActorAttack;
actor->user.__legacyState.ActorActionFunc = DoActorAttack;
// move into standing frame
//NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Stand);
@ -1191,7 +1191,7 @@ int InitActorAttack(DSWActor* actor)
{
if (CHOOSE2(100))
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Death2);
return 0;
}
@ -1199,7 +1199,7 @@ int InitActorAttack(DSWActor* actor)
}
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -1214,7 +1214,7 @@ int DoActorAttack(DSWActor* actor)
{
int rand_num;
DoActorNoise(ChooseAction(actor->user.Personality->Broadcast),actor);
DoActorNoise(ChooseAction(actor->user.__legacyState.Personality->Broadcast),actor);
double dist =(actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).Length();
@ -1235,10 +1235,10 @@ int DoActorAttack(DSWActor* actor)
ASSERT(rand_num < actor->user.WeaponNum);
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Attack[rand_num]);
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
}
//actor->user.ActorActionFunc = DoActorDecide;
//actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
@ -1254,7 +1254,7 @@ int InitActorEvade(DSWActor* actor)
// Evade is same thing as run away except when you get to the end of the track
// you stop and take up the fight again.
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
actor->user.track = FindTrackAwayFromPlayer(actor);
@ -1279,7 +1279,7 @@ int InitActorEvade(DSWActor* actor)
int InitActorWanderAround(DSWActor* actor)
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
DoActorPickClosePlayer(actor);
@ -1304,7 +1304,7 @@ int InitActorWanderAround(DSWActor* actor)
int InitActorFindPlayer(DSWActor* actor)
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
actor->user.track = FindTrackToPlayer(actor);
@ -1316,7 +1316,7 @@ int InitActorFindPlayer(DSWActor* actor)
DoActorSetSpeed(actor, MID_SPEED);
actor->user.Flags |= (SPR_FIND_PLAYER);
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
}
else
@ -1336,11 +1336,11 @@ int InitActorDuck(DSWActor* actor)
{
if (!actor->user.__legacyState.ActorActionSet->Duck)
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
return 0;
}
actor->user.ActorActionFunc = DoActorDuck;
actor->user.__legacyState.ActorActionFunc = DoActorDuck;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Duck);
double dist = (actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).LengthSquared();
@ -1356,7 +1356,7 @@ int InitActorDuck(DSWActor* actor)
}
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -1372,7 +1372,7 @@ int DoActorDuck(DSWActor* actor)
if ((actor->user.WaitTics -= ACTORMOVETICS) < 0)
{
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Rise);
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
actor->user.Flags &= ~(SPR_TARGETED);
}
@ -1691,11 +1691,11 @@ int InitActorReposition(DSWActor* actor)
}
actor->user.ActorActionFunc = DoActorReposition;
actor->user.__legacyState.ActorActionFunc = DoActorReposition;
if (!(actor->user.Flags & SPR_SWIMMING))
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -1737,9 +1737,9 @@ int DoActorReposition(DSWActor* actor)
int InitActorPause(DSWActor* actor)
{
actor->user.ActorActionFunc = DoActorPause;
actor->user.__legacyState.ActorActionFunc = DoActorPause;
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -1756,7 +1756,7 @@ int DoActorPause(DSWActor* actor)
// WaitTics is used by too much other actor code and causes problems here
if ((actor->user.Vis -= ACTORMOVETICS) < 0)
{
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
actor->user.Flags &= ~(SPR_TARGETED);
}

View file

@ -1017,11 +1017,11 @@ bool NullActor(DSWActor* actor)
return true;
// does not have a STATE or FUNC to control it
if (!actor->user.State)
if (!actor->user.__legacyState.State)
return true;
// does not have a STATE or FUNC to control it
if (!actor->user.ActorActionFunc)
if (!actor->user.__legacyState.ActorActionFunc)
return true;
return false;

View file

@ -742,7 +742,7 @@ int SetupBunny(DSWActor* actor)
Bunny_Count++;
ChangeState(actor, s_BunnyRun[0]);
actor->user.StateEnd = s_BunnyDie;
actor->user.__legacyState.StateEnd = s_BunnyDie;
actor->user.__legacyState.Rot = sg_BunnyRun;
actor->user.ShellNum = 0; // Not Pregnant right now
actor->user.FlagOwner = 0;
@ -752,7 +752,7 @@ int SetupBunny(DSWActor* actor)
if (actor->spr.pal == PALETTE_PLAYER1)
{
EnemyDefaults(actor, &BunnyWhiteActionSet, &WhiteBunnyPersonality);
actor->user.Attrib = &WhiteBunnyAttrib;
actor->user.__legacyState.Attrib = &WhiteBunnyAttrib;
actor->spr.scale = DVector2(1.5, 1.40625);
actor->clipdist = 12.5;
@ -763,7 +763,7 @@ int SetupBunny(DSWActor* actor)
else if (actor->spr.pal == PALETTE_PLAYER8) // Male Rabbit
{
EnemyDefaults(actor, &BunnyActionSet, &BunnyPersonality);
actor->user.Attrib = &BunnyAttrib;
actor->user.__legacyState.Attrib = &BunnyAttrib;
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
actor->user.Health = 20;
@ -773,7 +773,7 @@ int SetupBunny(DSWActor* actor)
{
// Female Rabbit
EnemyDefaults(actor, &BunnyActionSet, &BunnyPersonality);
actor->user.Attrib = &BunnyAttrib;
actor->user.__legacyState.Attrib = &BunnyAttrib;
actor->user.spal = actor->spr.pal = PALETTE_PLAYER0;
actor->user.Flag1 = SEC(5);
//actor->spr.shade = 0; // darker
@ -1179,7 +1179,7 @@ void BunnyHatch(DSWActor* actor)
actorNew->user.ShellNum = 0; // Not Pregnant right now
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
actorNew->user.ActorActionFunc = DoActorMoveJump;
actorNew->user.__legacyState.ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(actorNew, -600);
@ -1227,7 +1227,7 @@ DSWActor* BunnyHatch2(DSWActor* actor)
actorNew->user.ShellNum = 0; // Not Pregnant right now
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
actorNew->user.ActorActionFunc = DoActorMoveJump;
actorNew->user.__legacyState.ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(actorNew, FAST_SPEED);
if (TEST_BOOL3(actor))
{
@ -1297,7 +1297,7 @@ int DoBunnyMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
// stay on floor unless doing certain things
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
@ -1316,7 +1316,7 @@ int DoBunnyMove(DSWActor* actor)
actor->spr.Angles.Yaw = RandomAngle();
actor->user.jump_speed = -350;
DoActorBeginJump(actor);
actor->user.ActorActionFunc = DoActorMoveJump;
actor->user.__legacyState.ActorActionFunc = DoActorMoveJump;
}
}

View file

@ -534,9 +534,9 @@ int SetupCoolg(DSWActor* actor)
}
ChangeState(actor, s_CoolgRun[0]);
actor->user.Attrib = &CoolgAttrib;
actor->user.__legacyState.Attrib = &CoolgAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_CoolgDie;
actor->user.__legacyState.StateEnd = s_CoolgDie;
actor->user.__legacyState.Rot = sg_CoolgRun;
EnemyDefaults(actor, &CoolgActionSet, &CoolgPersonality);
@ -561,15 +561,15 @@ int NewCoolg(DSWActor* actor)
auto actorNew = SpawnActor(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], actor->sector(), actor->spr.pos, actor->spr.Angles.Yaw, 50/16.);
ChangeState(actorNew, &s_CoolgBirth[0]);
actorNew->user.StateEnd = s_CoolgDie;
actorNew->user.__legacyState.StateEnd = s_CoolgDie;
actorNew->user.__legacyState.Rot = sg_CoolgRun;
actorNew->spr.pal = actorNew->user.spal = actor->user.spal;
actorNew->user.__legacyState.ActorActionSet = &CoolgActionSet;
actorNew->spr.shade = actor->spr.shade;
actorNew->user.Personality = &CoolgPersonality;
actorNew->user.Attrib = &CoolgAttrib;
actorNew->user.__legacyState.Personality = &CoolgPersonality;
actorNew->user.__legacyState.Attrib = &CoolgAttrib;
// special case
TotalKillable++;
@ -590,11 +590,11 @@ int DoCoolgBirth(DSWActor* actor)
ANIMATOR DoActorDecide;
actor->user.Health = HEALTH_COOLIE_GHOST;
actor->user.Attrib = &CoolgAttrib;
actor->user.__legacyState.Attrib = &CoolgAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
ChangeState(actor, s_CoolgRun[0]);
actor->user.StateEnd = s_CoolgDie;
actor->user.__legacyState.StateEnd = s_CoolgDie;
actor->user.__legacyState.Rot = sg_CoolgRun;
EnemyDefaults(actor, &CoolgActionSet, &CoolgPersonality);
@ -713,7 +713,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
int InitCoolgCircle(DSWActor* actor)
{
actor->user.ActorActionFunc = DoCoolgCircle;
actor->user.__legacyState.ActorActionFunc = DoCoolgCircle;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
@ -735,7 +735,7 @@ int InitCoolgCircle(DSWActor* actor)
actor->user.WaitTics = (RandomRange(3)+1) * 120;
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -901,7 +901,7 @@ int DoCoolgMove(DSWActor* actor)
ActorFollowTrack(actor, ACTORMOVETICS);
else
{
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
}
if (RANDOM_P2(1024) < 32 && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))

View file

@ -409,7 +409,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
actor->user.spal = actor->spr.pal;
actor->user.RotNum = 5;
actor->user.__legacyState.RotNum = 5;
actor->clipdist = 16;
actor->user.zclip = 48;
@ -427,10 +427,10 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actor->spr.extra |= (SPRX_PLAYER_OR_ENEMY);
actor->spr.picnum = actor->user.State->Pic;
actor->spr.picnum = actor->user.__legacyState.State->Pic;
change_actor_stat(actor, STAT_ENEMY);
actor->user.Personality = person;
actor->user.__legacyState.Personality = person;
actor->user.__legacyState.ActorActionSet = action;
DoActorZrange(actor);
@ -470,7 +470,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
actor->user.ActorActionFunc = DoActorDecide;
actor->user.__legacyState.ActorActionFunc = DoActorDecide;
// find the number of long range attacks
for (wpn = wpn_cnt = 0; wpn < SIZ(actor->user.__legacyState.ActorActionSet->Attack); wpn++)
@ -497,9 +497,9 @@ int SetupCoolie(DSWActor* actor)
}
ChangeState(actor,s_CoolieRun[0]);
actor->user.Attrib = &CoolieAttrib;
actor->user.__legacyState.Attrib = &CoolieAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_CoolieDie;
actor->user.__legacyState.StateEnd = s_CoolieDie;
actor->user.__legacyState.Rot = sg_CoolieRun;
EnemyDefaults(actor, &CoolieActionSet, &CooliePersonality);
@ -588,7 +588,7 @@ int DoCoolieMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
KeepActorOnFloor(actor);

View file

@ -108,7 +108,7 @@ int GetRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& view)
tspritetype* tsp = tsprites.get(tSpriteNum);
auto ownerActor = static_cast<DSWActor*>(tsp->ownerActor);
if (!ownerActor->hasU() || ownerActor->user.RotNum == 0)
if (!ownerActor->hasU() || ownerActor->user.__legacyState.RotNum == 0)
return 0;
// Get which of the 8 angles of the sprite to draw (0-7)
@ -117,7 +117,7 @@ int GetRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& view)
rotation = (tsp->Angles.Yaw + DAngle180 + DAngle22_5 * 0.5 - angle2).Buildang() & 2047;
rotation = (rotation >> 8) & 7;
if (ownerActor->user.RotNum == 5)
if (ownerActor->user.__legacyState.RotNum == 5)
{
if ((ownerActor->user.Flags & SPR_XFLIP_TOGGLE))
{
@ -183,10 +183,10 @@ int SetActorRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& vie
if (!ownerActor->hasU()) return 0;
// don't modify ANY tu vars - back them up!
STATE* State = ownerActor->user.State;
STATE* StateStart = ownerActor->user.StateStart;
STATE* State = ownerActor->user.__legacyState.State;
STATE* StateStart = ownerActor->user.__legacyState.StateStart;
if (ownerActor->user.RotNum == 0)
if (ownerActor->user.__legacyState.RotNum == 0)
return 0;
// Get the offset into the State animation
@ -511,10 +511,10 @@ void DoStarView(tspritetype* tsp, DSWActor* tActor, double viewz)
if (abs(zdiff) > 24)
{
if (tActor->user.StateStart == s_StarStuck)
tsp->picnum = s_StarDownStuck[tActor->user.State - s_StarStuck].Pic;
if (tActor->user.__legacyState.StateStart == s_StarStuck)
tsp->picnum = s_StarDownStuck[tActor->user.__legacyState.State - s_StarStuck].Pic;
else
tsp->picnum = s_StarDown[tActor->user.State - s_Star].Pic;
tsp->picnum = s_StarDown[tActor->user.__legacyState.State - s_Star].Pic;
if (zdiff > 0)
tsp->cstat |= (CSTAT_SPRITE_YFLIP);
@ -702,7 +702,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
}
// rotation
if (tActor->user.RotNum > 0)
if (tActor->user.__legacyState.RotNum > 0)
SetActorRotation(tsprites, tSpriteNum, viewpos.XY());
if (tActor->user.motion_blur_num)
@ -1093,13 +1093,13 @@ void PreDrawStackedWater(void)
// copy everything reasonable from the user that
// analyzesprites() needs to draw the image
actorNew->user.State = itActor2->user.State;
actorNew->user.__legacyState.State = itActor2->user.__legacyState.State;
actorNew->user.__legacyState.Rot = itActor2->user.__legacyState.Rot;
actorNew->user.StateStart = itActor2->user.StateStart;
actorNew->user.StateEnd = itActor2->user.StateEnd;
actorNew->user.__legacyState.StateStart = itActor2->user.__legacyState.StateStart;
actorNew->user.__legacyState.StateEnd = itActor2->user.__legacyState.StateEnd;
actorNew->user.Flags = itActor2->user.Flags;
actorNew->user.Flags2 = itActor2->user.Flags2;
actorNew->user.RotNum = itActor2->user.RotNum;
actorNew->user.__legacyState.RotNum = itActor2->user.__legacyState.RotNum;
actorNew->user.ID = itActor2->user.ID;
actorNew->user.PlayerP = itActor2->user.PlayerP;

View file

@ -393,9 +393,9 @@ int SetupEel(DSWActor* actor)
}
ChangeState(actor, s_EelRun[0]);
actor->user.Attrib = &EelAttrib;
actor->user.__legacyState.Attrib = &EelAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_EelDie;
actor->user.__legacyState.StateEnd = s_EelDie;
actor->user.__legacyState.Rot = sg_EelRun;
EnemyDefaults(actor, &EelActionSet, &EelPersonality);
@ -590,7 +590,7 @@ int DoEelMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
DoEelMatchPlayerZ(actor);

View file

@ -48,6 +48,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "gameinput.h"
#include "serialize_obj.h"
#include "texturemanager.h"
#include "states.h"
#include "vm.h"
EXTERN_CVAR(Bool, sw_ninjahack)
EXTERN_CVAR(Bool, sw_darts)
@ -689,21 +691,23 @@ struct USER
TArray<int8_t> WallShade;
walltype* WallP; // operate on wall instead of sprite
struct LegacyState
{
ACTOR_ACTION_SET* ActorActionSet;
STATE* *Rot;
STATE* State;
STATE** Rot;
STATE* StateStart;
STATE* StateEnd;
STATE** StateFallOverride; // a bit kludgy - override std fall state
ACTOR_ACTION_SET* ActorActionSet;
int16_t RotNum;
ANIMATOR* ActorActionFunc;
PERSONALITY* Personality;
ATTRIBUTE* Attrib;
};
LegacyState __legacyState;
STATE* State;
STATE* StateStart;
STATE* StateEnd;
STATE* *StateFallOverride; // a bit kludgy - override std fall state
ANIMATOR* ActorActionFunc;
PERSONALITY* Personality;
ATTRIBUTE* Attrib;
SECTOR_OBJECT* sop_parent; // denotes that this sprite is a part of the
// sector object - contains info for the SO
@ -729,7 +733,6 @@ struct USER
int Flags2;
int Tics;
int16_t RotNum;
int16_t ID;
// Health/Pain related

View file

@ -227,7 +227,7 @@ STATE s_GirlNinjaRise[5][3] =
{GIRLNINJA_STAND_R0 + 0, GIRLNINJA_STAND_RATE, NullGirlNinja, &s_GirlNinjaRise[0][2]},
{0, 0, nullptr, (STATE*)sg_GirlNinjaRun}, // JBF: sg_GirlNinjaRun really is supposed to be the
// pointer to the state group. See StateControl() where
// it says "if (!actor->user.State->Pic)".
// it says "if (!actor->user.__legacyState.State->Pic)".
},
{
{GIRLNINJA_KNEEL_R1 + 0, GIRLNINJA_RISE_RATE, NullGirlNinja, &s_GirlNinjaRise[1][1]},
@ -726,11 +726,11 @@ int SetupGirlNinja(DSWActor* actor)
actor->user.Health = (Skill < MinEnemySkill - 1) ? 50 : 100;
}
actor->user.StateEnd = s_GirlNinjaDie;
actor->user.__legacyState.StateEnd = s_GirlNinjaDie;
actor->user.__legacyState.Rot = sg_GirlNinjaRun;
actor->spr.scale = DVector2(0.796875, 0.671875);
actor->user.Attrib = &GirlNinjaAttrib;
actor->user.__legacyState.Attrib = &GirlNinjaAttrib;
actor->spr.pal = actor->user.spal = 26;
EnemyDefaults(actor, &GirlNinjaActionSet, &GirlNinjaPersonality);
@ -769,7 +769,7 @@ int DoGirlNinjaMove(DSWActor* actor)
ActorFollowTrack(actor, ACTORMOVETICS);
else
{
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
}
// stay on floor unless doing certain things

View file

@ -498,9 +498,9 @@ int SetupGoro(DSWActor* actor)
}
ChangeState(actor, s_GoroRun[0]);
actor->user.Attrib = &GoroAttrib;
actor->user.__legacyState.Attrib = &GoroAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_GoroDie;
actor->user.__legacyState.StateEnd = s_GoroDie;
actor->user.__legacyState.Rot = sg_GoroRun;
@ -557,7 +557,7 @@ int DoGoroMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
KeepActorOnFloor(actor);

View file

@ -304,9 +304,9 @@ int SetupHornet(DSWActor* actor)
}
ChangeState(actor, s_HornetRun[0]);
actor->user.Attrib = &HornetAttrib;
actor->user.__legacyState.Attrib = &HornetAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_HornetDie;
actor->user.__legacyState.StateEnd = s_HornetDie;
actor->user.__legacyState.Rot = sg_HornetRun;
EnemyDefaults(actor, &HornetActionSet, &HornetPersonality);
@ -428,7 +428,7 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
int InitHornetCircle(DSWActor* actor)
{
actor->user.ActorActionFunc = DoHornetCircle;
actor->user.__legacyState.ActorActionFunc = DoHornetCircle;
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
@ -450,7 +450,7 @@ int InitHornetCircle(DSWActor* actor)
actor->user.WaitTics = (RandomRange(3)+1) * 60;
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -616,7 +616,7 @@ int DoHornetMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
DoHornetMatchPlayerZ(actor);

View file

@ -182,10 +182,10 @@ void JS_SpriteSetup(void)
{
SpawnUser(itActor, 0, nullptr);
itActor->user.RotNum = 0;
itActor->user.__legacyState.RotNum = 0;
itActor->user.WaitTics = itActor->spr.lotag * 120;
itActor->user.ActorActionFunc = GenerateDrips;
itActor->user.__legacyState.ActorActionFunc = GenerateDrips;
change_actor_stat(itActor, STAT_NO_STATE);
itActor->spr.cstat |= CSTAT_SPRITE_INVISIBLE;

View file

@ -1268,7 +1268,7 @@ int PlayerInitChemBomb(PLAYER* pp)
actorNew->vel.X *= 0.75;
}
// actorNew->user.RotNum = 5;
// actorNew->user.__legacyState.RotNum = 5;
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
SetOwner(pp->actor, actorNew);

View file

@ -468,9 +468,9 @@ int SetupLava(DSWActor* actor)
}
ChangeState(actor, s_LavaRun[0]);
actor->user.Attrib = &LavaAttrib;
actor->user.__legacyState.Attrib = &LavaAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_LavaDie;
actor->user.__legacyState.StateEnd = s_LavaDie;
actor->user.__legacyState.Rot = sg_LavaRun;
EnemyDefaults(actor, &LavaActionSet, &LavaPersonality);
@ -514,7 +514,7 @@ int DoLavaMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
KeepActorOnFloor(actor);

View file

@ -130,10 +130,10 @@ int SetupToiletGirl(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_ToiletGirlStand);
actor->user.Attrib = &ToiletGirlAttrib;
actor->user.StateEnd = s_ToiletGirlStand;
actor->user.__legacyState.Attrib = &ToiletGirlAttrib;
actor->user.__legacyState.StateEnd = s_ToiletGirlStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->spr.scale = DVector2(0.5, 0.5);
actor->vel.X = 0;
@ -385,10 +385,10 @@ int SetupWashGirl(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_WashGirlStand);
actor->user.Attrib = &WashGirlAttrib;
actor->user.StateEnd = s_WashGirlStand;
actor->user.__legacyState.Attrib = &WashGirlAttrib;
actor->user.__legacyState.StateEnd = s_WashGirlStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->spr.scale = DVector2(0.4374, 0.375);
actor->vel.X = 0;
@ -614,10 +614,10 @@ int SetupTrashCan(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_TrashCanStand);
actor->user.Attrib = &TrashCanAttrib;
actor->user.StateEnd = s_TrashCanStand;
actor->user.__legacyState.Attrib = &TrashCanAttrib;
actor->user.__legacyState.StateEnd = s_TrashCanStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->spr.scale = DVector2(0.71875, 0.65625);
@ -727,10 +727,10 @@ int SetupPachinkoLight(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_PachinkoLightStand);
actor->user.Attrib = &PachinkoLightAttrib;
actor->user.StateEnd = s_PachinkoLightStand;
actor->user.__legacyState.Attrib = &PachinkoLightAttrib;
actor->user.__legacyState.StateEnd = s_PachinkoLightStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.ID = PACHINKOLIGHT_R0;
actor->vel.X = 0;
@ -832,10 +832,10 @@ int SetupPachinko1(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_Pachinko1Stand);
actor->user.Attrib = &Pachinko1Attrib;
actor->user.StateEnd = s_Pachinko1Stand;
actor->user.__legacyState.Attrib = &Pachinko1Attrib;
actor->user.__legacyState.StateEnd = s_Pachinko1Stand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.ID = PACHINKO1;
actor->vel.Z = 0;
@ -1005,10 +1005,10 @@ int SetupPachinko2(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_Pachinko2Stand);
actor->user.Attrib = &Pachinko2Attrib;
actor->user.StateEnd = s_Pachinko2Stand;
actor->user.__legacyState.Attrib = &Pachinko2Attrib;
actor->user.__legacyState.StateEnd = s_Pachinko2Stand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.ID = PACHINKO2;
actor->vel.Z = 0;
@ -1090,10 +1090,10 @@ int SetupPachinko3(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_Pachinko3Stand);
actor->user.Attrib = &Pachinko3Attrib;
actor->user.StateEnd = s_Pachinko3Stand;
actor->user.__legacyState.Attrib = &Pachinko3Attrib;
actor->user.__legacyState.StateEnd = s_Pachinko3Stand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.ID = PACHINKO3;
actor->vel.Z = 0;
@ -1176,10 +1176,10 @@ int SetupPachinko4(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_Pachinko4Stand);
actor->user.Attrib = &Pachinko4Attrib;
actor->user.StateEnd = s_Pachinko4Stand;
actor->user.__legacyState.Attrib = &Pachinko4Attrib;
actor->user.__legacyState.StateEnd = s_Pachinko4Stand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.ID = PACHINKO4;
actor->vel.Z = 0;
@ -1290,10 +1290,10 @@ int SetupCarGirl(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_CarGirlStand);
actor->user.Attrib = &CarGirlAttrib;
actor->user.StateEnd = s_CarGirlStand;
actor->user.__legacyState.Attrib = &CarGirlAttrib;
actor->user.__legacyState.StateEnd = s_CarGirlStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->spr.scale = DVector2(0.453125, 0.390625);
actor->vel.X = 0;
@ -1525,10 +1525,10 @@ int SetupMechanicGirl(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_MechanicGirlStand);
actor->user.Attrib = &MechanicGirlAttrib;
actor->user.StateEnd = s_MechanicGirlStand;
actor->user.__legacyState.Attrib = &MechanicGirlAttrib;
actor->user.__legacyState.StateEnd = s_MechanicGirlStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->spr.scale = DVector2(0.421875, 0.40625);
actor->vel.X = 0;
@ -1759,10 +1759,10 @@ int SetupSailorGirl(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_SailorGirlStand);
actor->user.Attrib = &SailorGirlAttrib;
actor->user.StateEnd = s_SailorGirlStand;
actor->user.__legacyState.Attrib = &SailorGirlAttrib;
actor->user.__legacyState.StateEnd = s_SailorGirlStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->spr.scale = DVector2(0.4375, 0.40625);
actor->vel.X = 0;
@ -1988,10 +1988,10 @@ int SetupPruneGirl(DSWActor* actor)
EnemyDefaults(actor, nullptr, nullptr);
ChangeState(actor,s_PruneGirlStand);
actor->user.Attrib = &PruneGirlAttrib;
actor->user.StateEnd = s_PruneGirlStand;
actor->user.__legacyState.Attrib = &PruneGirlAttrib;
actor->user.__legacyState.StateEnd = s_PruneGirlStand;
actor->user.__legacyState.Rot = 0;
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->spr.scale = DVector2(0.515625, 0.4375);
actor->vel.X = 0;

View file

@ -1828,13 +1828,13 @@ int SetupNinja(DSWActor* actor)
actor->user.Health = HEALTH_NINJA;
}
actor->user.StateEnd = s_NinjaDie;
actor->user.__legacyState.StateEnd = s_NinjaDie;
actor->user.__legacyState.Rot = sg_NinjaRun;
actor->spr.scale = DVector2(0.71875, 0.71875);
if (actor->spr.pal == PALETTE_PLAYER5)
{
actor->user.Attrib = &InvisibleNinjaAttrib;
actor->user.__legacyState.Attrib = &InvisibleNinjaAttrib;
EnemyDefaults(actor, &NinjaGreenActionSet, &NinjaPersonality);
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
actor->user.Health = RedNinjaHealth;
@ -1846,23 +1846,23 @@ int SetupNinja(DSWActor* actor)
{
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
actor->user.__legacyState.ActorActionSet = &NinjaActionSet;
actor->user.Personality = &NinjaPersonality;
actor->user.__legacyState.Personality = &NinjaPersonality;
ChangeState(actor, s_NinjaCeiling[0]);
}
else
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet;
actor->user.Personality = &NinjaSniperPersonality;
actor->user.__legacyState.Personality = &NinjaSniperPersonality;
ChangeState(actor, s_NinjaDuck[0]);
}
}
}
else if (actor->spr.pal == PALETTE_PLAYER3)
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
EnemyDefaults(actor, &NinjaRedActionSet, &NinjaPersonality);
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
actor->user.Health = RedNinjaHealth;
@ -1871,48 +1871,48 @@ int SetupNinja(DSWActor* actor)
{
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
actor->user.__legacyState.ActorActionSet = &NinjaActionSet;
actor->user.Personality = &NinjaPersonality;
actor->user.__legacyState.Personality = &NinjaPersonality;
ChangeState(actor, s_NinjaCeiling[0]);
}
else
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet;
actor->user.Personality = &NinjaSniperPersonality;
actor->user.__legacyState.Personality = &NinjaSniperPersonality;
ChangeState(actor, s_NinjaDuck[0]);
}
}
}
else if (actor->spr.pal == PAL_XLAT_LT_TAN)
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
EnemyDefaults(actor, &NinjaSeekerActionSet, &NinjaPersonality);
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
actor->user.Health = RedNinjaHealth;
actor->spr.pal = actor->user.spal = PAL_XLAT_LT_TAN;
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
}
else if (actor->spr.pal == PAL_XLAT_LT_GREY)
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
EnemyDefaults(actor, &NinjaGrenadeActionSet, &NinjaPersonality);
if (!(actor->spr.cstat & CSTAT_SPRITE_RESTORE))
actor->user.Health = RedNinjaHealth;
actor->spr.pal = actor->user.spal = PAL_XLAT_LT_GREY;
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
}
else
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
actor->spr.pal = actor->user.spal = PALETTE_PLAYER0;
EnemyDefaults(actor, &NinjaActionSet, &NinjaPersonality);
if (pic == NINJA_CRAWL_R0)
{
actor->user.Attrib = &NinjaAttrib;
actor->user.__legacyState.Attrib = &NinjaAttrib;
actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet;
actor->user.Personality = &NinjaSniperPersonality;
actor->user.__legacyState.Personality = &NinjaSniperPersonality;
ChangeState(actor, s_NinjaDuck[0]);
}
}
@ -1940,8 +1940,8 @@ int DoNinjaHariKari(DSWActor* actor)
actor->user.Flags |= (SPR_DEAD);
actor->user.Flags &= ~(SPR_FALLING | SPR_JUMPING);
actor->user.floor_dist = (40);
actor->user.RotNum = 0;
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.RotNum = 0;
actor->user.__legacyState.ActorActionFunc = nullptr;
actor->spr.extra |= (SPRX_BREAKABLE);
actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE);
@ -1975,8 +1975,8 @@ int DoNinjaGrabThroat(DSWActor* actor)
actor->user.Flags |= (SPR_DEAD);
actor->user.Flags &= ~(SPR_FALLING | SPR_JUMPING);
actor->user.floor_dist = (40);
actor->user.RotNum = 0;
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.RotNum = 0;
actor->user.__legacyState.ActorActionFunc = nullptr;
actor->spr.extra |= (SPRX_BREAKABLE);
actor->spr.cstat |= (CSTAT_SPRITE_BREAKABLE);
@ -2031,7 +2031,7 @@ int DoNinjaMove(DSWActor* actor)
ActorFollowTrack(actor, ACTORMOVETICS);
else
{
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
}
// stay on floor unless doing certain things
@ -2411,7 +2411,7 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
actor->user.__legacyState.Rot = sg_NinjaRun;
actor->user.__legacyState.ActorActionSet = &PlayerNinjaActionSet;
actor->user.RotNum = 5;
actor->user.__legacyState.RotNum = 5;
actor->user.Radius = 400;
actor->user.PlayerP = pp;
@ -2419,7 +2419,7 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
actor->user.Flags |= (SPR_XFLIP_TOGGLE);
actor->spr.picnum = actor->user.State->Pic;
actor->spr.picnum = actor->user.__legacyState.State->Pic;
actor->spr.shade = -60; // was 15
actor->clipdist = 16;
@ -2478,7 +2478,7 @@ void SpawnPlayerUnderSprite(PLAYER* pp)
actor->spr.extra |= (SPRX_PLAYER_OR_ENEMY);
actor->user.__legacyState.Rot = sg_NinjaRun;
actor->user.RotNum = plActor->user.RotNum;
actor->user.__legacyState.RotNum = plActor->user.__legacyState.RotNum;
NewStateGroup(pp->PlayerUnderActor, plActor->user.__legacyState.Rot);
actor->user.Radius = plActor->user.Radius;

View file

@ -1815,9 +1815,9 @@ void UpdatePlayerUnderSprite(PLAYER* pp)
// add diff to ceiling
act_under->spr.pos.Z = act_under->sector()->ceilingz + zdiff;
act_under->user.State = act_over->user.State;
act_under->user.__legacyState.State = act_over->user.__legacyState.State;
act_under->user.__legacyState.Rot = act_over->user.__legacyState.Rot;
act_under->user.StateStart = act_over->user.StateStart;
act_under->user.__legacyState.StateStart = act_over->user.__legacyState.StateStart;
act_under->spr.picnum = act_over->spr.picnum;
}
@ -5978,8 +5978,8 @@ void DoPlayerDeathCheckKeys(PLAYER* pp)
}
NewStateGroup(plActor, plActor->user.__legacyState.ActorActionSet->Stand);
plActor->spr.picnum = plActor->user.State->Pic;
plActor->spr.picnum = plActor->user.State->Pic;
plActor->spr.picnum = plActor->user.__legacyState.State->Pic;
plActor->spr.picnum = plActor->user.__legacyState.State->Pic;
plActor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
//DoSpawnTeleporterEffect(plActor);
@ -6594,44 +6594,44 @@ void PlayerStateControl(DSWActor* actor)
actor->user.Tics += synctics;
// Skip states if too much time has passed
while (actor->user.Tics >= (actor->user.State->Tics & SF_TICS_MASK))
while (actor->user.Tics >= (actor->user.__legacyState.State->Tics & SF_TICS_MASK))
{
// Set Tics
actor->user.Tics -= (actor->user.State->Tics & SF_TICS_MASK);
actor->user.Tics -= (actor->user.__legacyState.State->Tics & SF_TICS_MASK);
// Transition to the next state
actor->user.State = actor->user.State->NextState;
actor->user.__legacyState.State = actor->user.__legacyState.State->NextState;
// !JIM! Added this so I can do quick calls in player states!
// Need this in order for floor blood and footprints to not get called more than once.
while ((actor->user.State->Tics & SF_QUICK_CALL))
while ((actor->user.__legacyState.State->Tics & SF_QUICK_CALL))
{
// Call it once and go to the next state
(*actor->user.State->Animator)(actor);
(*actor->user.__legacyState.State->Animator)(actor);
// if still on the same QUICK_CALL should you
// go to the next state.
if ((actor->user.State->Tics & SF_QUICK_CALL))
actor->user.State = actor->user.State->NextState;
if ((actor->user.__legacyState.State->Tics & SF_QUICK_CALL))
actor->user.__legacyState.State = actor->user.__legacyState.State->NextState;
}
if (!actor->user.State->Pic)
if (!actor->user.__legacyState.State->Pic)
{
NewStateGroup(actor, (STATE* *) actor->user.State->NextState);
NewStateGroup(actor, (STATE* *) actor->user.__legacyState.State->NextState);
}
}
// Set picnum to the correct pic
if (actor->user.RotNum > 1)
if (actor->user.__legacyState.RotNum > 1)
actor->spr.picnum = actor->user.__legacyState.Rot[0]->Pic;
else
actor->spr.picnum = actor->user.State->Pic;
actor->spr.picnum = actor->user.__legacyState.State->Pic;
// Call the correct animator
if ((actor->user.State->Tics & SF_PLAYER_FUNC))
if (actor->user.State->Animator)
(*actor->user.State->Animator)(actor);
if ((actor->user.__legacyState.State->Tics & SF_PLAYER_FUNC))
if (actor->user.__legacyState.State->Animator)
(*actor->user.__legacyState.State->Animator)(actor);
return;
}

View file

@ -831,9 +831,9 @@ int SetupRipper(DSWActor* actor)
}
ChangeState(actor, s_RipperRun[0]);
actor->user.Attrib = &RipperAttrib;
actor->user.__legacyState.Attrib = &RipperAttrib;
DoActorSetSpeed(actor, FAST_SPEED);
actor->user.StateEnd = s_RipperDie;
actor->user.__legacyState.StateEnd = s_RipperDie;
actor->user.__legacyState.Rot = sg_RipperRun;
actor->spr.scale = DVector2(1, 1);
@ -971,7 +971,7 @@ int InitRipperHang(DSWActor* actor)
}
NewStateGroup(actor, sg_RipperHangJump);
actor->user.StateFallOverride = sg_RipperHangFall;
actor->user.__legacyState.StateFallOverride = sg_RipperHangFall;
DoActorSetSpeed(actor, FAST_SPEED);
PickJumpMaxSpeed(actor, -800);
@ -1000,7 +1000,7 @@ int DoRipperHang(DSWActor* actor)
NewStateGroup(actor, sg_RipperJumpAttack);
// move to the 2nd frame - past the pause frame
actor->user.Tics += actor->user.State->Tics;
actor->user.Tics += actor->user.__legacyState.State->Tics;
return 0;
}
@ -1242,7 +1242,7 @@ void RipperHatch(DSWActor* actor)
actorNew->user.Flags |= (SPR_ACTIVE);
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
actorNew->user.ActorActionFunc = DoActorMoveJump;
actorNew->user.__legacyState.ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(actorNew, -600);
@ -1294,7 +1294,7 @@ int DoRipperMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
DoActorSectorDamage(actor);
return 0;

View file

@ -899,9 +899,9 @@ int SetupRipper2(DSWActor* actor)
}
ChangeState(actor, s_Ripper2Run[0]);
actor->user.Attrib = &Ripper2Attrib;
actor->user.__legacyState.Attrib = &Ripper2Attrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_Ripper2Die;
actor->user.__legacyState.StateEnd = s_Ripper2Die;
actor->user.__legacyState.Rot = sg_Ripper2Run;
actor->clipdist = 32; // This actor is bigger, needs bigger box.
actor->spr.scale = DVector2(0.859375, 0.859375);
@ -968,7 +968,7 @@ int InitRipper2Hang(DSWActor* actor)
}
NewStateGroup(actor, sg_Ripper2HangJump);
actor->user.StateFallOverride = sg_Ripper2HangFall;
actor->user.__legacyState.StateFallOverride = sg_Ripper2HangFall;
DoActorSetSpeed(actor, FAST_SPEED);
PickJumpMaxSpeed(actor, -(RandomRange(400)+100));
@ -997,7 +997,7 @@ int DoRipper2Hang(DSWActor* actor)
NewStateGroup(actor, sg_Ripper2JumpAttack);
// move to the 2nd frame - past the pause frame
actor->user.Tics += actor->user.State->Tics;
actor->user.Tics += actor->user.__legacyState.State->Tics;
return 0;
}
@ -1252,7 +1252,7 @@ void Ripper2Hatch(DSWActor* actor)
actorNew->user.Flags |= (SPR_ACTIVE);
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
actorNew->user.ActorActionFunc = DoActorMoveJump;
actorNew->user.__legacyState.ActorActionFunc = DoActorMoveJump;
DoActorSetSpeed(actorNew, FAST_SPEED);
PickJumpMaxSpeed(actorNew, -600);
@ -1307,7 +1307,7 @@ int DoRipper2Move(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
DoActorSectorDamage(actor);

View file

@ -741,19 +741,19 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def
if (arc.BeginObject(keyname))
{
arc("WallP", w.WallP, def->WallP)
("State", w.State, def->State)
("State", w.__legacyState.State, def->__legacyState.State)
("Rot", w.__legacyState.Rot, def->__legacyState.Rot)
("StateStart", w.StateStart, def->StateStart)
("StateEnd", w.StateEnd, def->StateEnd)
("StateFallOverride", w.StateFallOverride, def->StateFallOverride)
("StateStart", w.__legacyState.StateStart, def->__legacyState.StateStart)
("StateEnd", w.__legacyState.StateEnd, def->__legacyState.StateEnd)
("StateFallOverride", w.__legacyState.StateFallOverride, def->__legacyState.StateFallOverride)
("ActorActionSet", w.__legacyState.ActorActionSet, def->__legacyState.ActorActionSet)
("Personality", w.Personality, def->Personality)
("Attrib", w.Attrib, def->Attrib)
("Personality", w.__legacyState.Personality, def->__legacyState.Personality)
("Attrib", w.__legacyState.Attrib, def->__legacyState.Attrib)
("sop_parent", w.sop_parent, def->sop_parent)
("flags", w.Flags, def->Flags)
("flags2", w.Flags2, def->Flags2)
("Tics", w.Tics, def->Tics)
("RotNum", w.RotNum, def->RotNum)
("RotNum", w.__legacyState.RotNum, def->__legacyState.RotNum)
("ID", w.ID, def->ID)
("Health", w.Health, def->Health)
("MaxHealth", w.MaxHealth, def->MaxHealth)
@ -830,7 +830,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def
("rotator", w.rotator)
("oz", w.oz, def->oz);
SerializeCodePtr(arc, "ActorActionFunc", (void**)&w.ActorActionFunc);
SerializeCodePtr(arc, "ActorActionFunc", (void**)&w.__legacyState.ActorActionFunc);
arc.EndObject();
if (arc.isReading())

View file

@ -1007,7 +1007,7 @@ void DoSpawnSpotsForKill(short match)
if (actor->spr.hitag == SPAWN_SPOT && actor->spr.lotag == match)
{
change_actor_stat(actor, STAT_NO_STATE);
actor->user.ActorActionFunc = DoSpawnSpot;
actor->user.__legacyState.ActorActionFunc = DoSpawnSpot;
actor->user.WaitTics = SP_TAG5(actor) * 15;
SetActorZ(actor, actor->spr.pos);
// setting for Killed
@ -1034,7 +1034,7 @@ void DoSpawnSpotsForDamage(short match)
if (actor->spr.hitag == SPAWN_SPOT && actor->spr.lotag == match)
{
change_actor_stat(actor, STAT_NO_STATE);
actor->user.ActorActionFunc = DoSpawnSpot;
actor->user.__legacyState.ActorActionFunc = DoSpawnSpot;
actor->user.WaitTics = SP_TAG7(actor) * 15;
// setting for Damaged
actor->user.LastDamage = 0;
@ -1777,7 +1777,7 @@ int OperateSprite(DSWActor* actor, short player_is_operating)
SpawnUser(actor, 0, nullptr);
actor->user.ActorActionFunc = DoGrating;
actor->user.__legacyState.ActorActionFunc = DoGrating;
actor->spr.lotag = 0;
actor->spr.hitag /= 2;

View file

@ -707,9 +707,9 @@ int SetupSerp(DSWActor* actor)
if (Skill == 1) actor->user.Health = 2200;
ChangeState(actor, s_SerpRun[0]);
actor->user.Attrib = &SerpAttrib;
actor->user.__legacyState.Attrib = &SerpAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_SerpDie;
actor->user.__legacyState.StateEnd = s_SerpDie;
actor->user.__legacyState.Rot = sg_SerpRun;
EnemyDefaults(actor, &SerpActionSet, &SerpPersonality);
@ -760,7 +760,7 @@ int DoSerpMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
// serp ring
if (actor->spr.pal != 16)

View file

@ -517,9 +517,9 @@ int SetupSkel(DSWActor* actor)
}
ChangeState(actor, s_SkelRun[0]);
actor->user.Attrib = &SkelAttrib;
actor->user.__legacyState.Attrib = &SkelAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_SkelDie;
actor->user.__legacyState.StateEnd = s_SkelDie;
actor->user.__legacyState.Rot = sg_SkelRun;
EnemyDefaults(actor, &SkelActionSet, &SkelPersonality);
@ -636,7 +636,7 @@ int DoSkelMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
KeepActorOnFloor(actor);

View file

@ -224,9 +224,9 @@ int SetupSkull(DSWActor* actor)
}
ChangeState(actor, s_SkullWait[0]);
actor->user.Attrib = &SkullAttrib;
actor->user.__legacyState.Attrib = &SkullAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_SkullExplode;
actor->user.__legacyState.StateEnd = s_SkullExplode;
actor->user.__legacyState.Rot = sg_SkullWait;
actor->user.ID = SKULL_R0;
@ -344,7 +344,7 @@ int DoSkullBeginDeath(DSWActor* actor)
}
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.Tics = 0;
actor->user.ID = SKULL_R0;
actor->user.Radius = DamageData[DMG_SKULL_EXP].radius; //*DamageRadiusSkull;
@ -643,9 +643,9 @@ int SetupBetty(DSWActor* actor)
}
ChangeState(actor, s_BettyWait[0]);
actor->user.Attrib = &BettyAttrib;
actor->user.__legacyState.Attrib = &BettyAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_BettyExplode;
actor->user.__legacyState.StateEnd = s_BettyExplode;
actor->user.__legacyState.Rot = sg_BettyWait;
actor->user.ID = BETTY_R0;
@ -751,7 +751,7 @@ int DoBettyBeginDeath(DSWActor* actor)
}
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.Tics = 0;
actor->user.ID = BETTY_R0;
actor->user.Radius = DamageData[DMG_SKULL_EXP].radius; //*DamageRadiusBetty;

View file

@ -719,7 +719,7 @@ void Terminate3DSounds(void)
void PlaySpriteSound(DSWActor* actor, int attrib_ndx, int flags)
{
if (actor->hasU())
PlaySound(actor->user.Attrib->Sounds[attrib_ndx], actor, flags);
PlaySound(actor->user.__legacyState.Attrib->Sounds[attrib_ndx], actor, flags);
}
//==========================================================================

View file

@ -788,7 +788,7 @@ void ChangeState(DSWActor* actor, STATE* statep)
return;
actor->user.Tics = 0;
actor->user.State = actor->user.StateStart = statep;
actor->user.__legacyState.State = actor->user.__legacyState.StateStart = statep;
actor->spr.cstat2 |= CSTAT2_SPRITE_NOANIMATE; // just in case
}
@ -859,7 +859,7 @@ void SpawnUser(DSWActor* actor, short id, STATE* state)
PRODUCTION_ASSERT(actor->hasU());
// be careful State can be nullptr
actor->user.State = actor->user.StateStart = state;
actor->user.__legacyState.State = actor->user.__legacyState.StateStart = state;
change_actor_stat(actor, actor->spr.statnum);
@ -920,9 +920,9 @@ DSWActor* SpawnActor(int stat, int id, STATE* state, sectortype* sect, const DVe
SpawnUser(spawnedActor, id, state);
// be careful State can be nullptr
if (spawnedActor->user.State)
if (spawnedActor->user.__legacyState.State)
{
spawnedActor->spr.picnum = spawnedActor->user.State->Pic;
spawnedActor->spr.picnum = spawnedActor->user.__legacyState.State->Pic;
spawnedActor->spr.cstat2 |= CSTAT2_SPRITE_NOANIMATE; // just in case
}
@ -1562,7 +1562,7 @@ void SpriteSetupPost(void)
jActor->user.ceiling_dist = 4;
jActor->user.floor_dist = -2;
jActor->user.ActorActionFunc = DoActorDebris;
jActor->user.__legacyState.ActorActionFunc = DoActorDebris;
jActor->spr.cstat |= CSTAT_SPRITE_BREAKABLE;
jActor->spr.extra |= SPRX_BREAKABLE;
@ -2022,10 +2022,10 @@ void SpriteSetup(void)
SpawnUser(actor, 0, nullptr);
ASSERT(actor->hasU());
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
actor->user.WaitTics = actor->spr.lotag * 120;
actor->user.ActorActionFunc = DoGenerateSewerDebris;
actor->user.__legacyState.ActorActionFunc = DoGenerateSewerDebris;
change_actor_stat(actor, STAT_NO_STATE);
break;
@ -2071,18 +2071,18 @@ void SpriteSetup(void)
{
case 0:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoVator;
actor->user.__legacyState.ActorActionFunc = DoVator;
break;
case 1:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoVator;
actor->user.__legacyState.ActorActionFunc = DoVator;
break;
case 2:
actor->user.ActorActionFunc = DoVatorAuto;
actor->user.__legacyState.ActorActionFunc = DoVatorAuto;
break;
case 3:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoVatorAuto;
actor->user.__legacyState.ActorActionFunc = DoVatorAuto;
break;
}
@ -2179,11 +2179,11 @@ void SpriteSetup(void)
{
case 0:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoRotator;
actor->user.__legacyState.ActorActionFunc = DoRotator;
break;
case 1:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoRotator;
actor->user.__legacyState.ActorActionFunc = DoRotator;
break;
}
@ -2224,11 +2224,11 @@ void SpriteSetup(void)
{
case 0:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoSlidor;
actor->user.__legacyState.ActorActionFunc = DoSlidor;
break;
case 1:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoSlidor;
actor->user.__legacyState.ActorActionFunc = DoSlidor;
break;
}
@ -2272,18 +2272,18 @@ void SpriteSetup(void)
{
case 0:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoSpike;
actor->user.__legacyState.ActorActionFunc = DoSpike;
break;
case 1:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoSpike;
actor->user.__legacyState.ActorActionFunc = DoSpike;
break;
case 2:
actor->user.ActorActionFunc = DoSpikeAuto;
actor->user.__legacyState.ActorActionFunc = DoSpikeAuto;
break;
case 3:
actor->user.Flags &= ~(SPR_ACTIVE);
actor->user.ActorActionFunc = DoSpikeAuto;
actor->user.__legacyState.ActorActionFunc = DoSpikeAuto;
break;
}
@ -2460,7 +2460,7 @@ void SpriteSetup(void)
SpawnUser(actor, ST1, nullptr);
change_actor_stat(actor, STAT_NO_STATE);
actor->user.ActorActionFunc = DoLavaErupt;
actor->user.__legacyState.ActorActionFunc = DoLavaErupt;
// interval between erupts
if (SP_TAG10(actor) == 0)
@ -4298,11 +4298,11 @@ int NewStateGroup(DSWActor* actor, STATE* StateGroup[])
// Kind of a goofy check, but it should catch alot of invalid states!
// BTW, 6144 is the max tile number allowed in editart.
if (actor->user.State && (actor->user.State->Pic < 0 || actor->user.State->Pic > MAXTILES)) // JBF: verify this!
if (actor->user.__legacyState.State && (actor->user.__legacyState.State->Pic < 0 || actor->user.__legacyState.State->Pic > MAXTILES)) // JBF: verify this!
return 0;
actor->user.__legacyState.Rot = StateGroup;
actor->user.State = actor->user.StateStart = StateGroup[0];
actor->user.__legacyState.State = actor->user.__legacyState.StateStart = StateGroup[0];
actor->user.Tics = 0;
@ -4796,20 +4796,20 @@ int DoCoin(DSWActor* actor)
if (actor->user.WaitTics < 10*120)
{
if (actor->user.StateStart != s_GreenCoin)
if (actor->user.__legacyState.StateStart != s_GreenCoin)
{
offset = int(actor->user.State - actor->user.StateStart);
offset = int(actor->user.__legacyState.State - actor->user.__legacyState.StateStart);
ChangeState(actor, s_GreenCoin);
actor->user.State = actor->user.StateStart + offset;
actor->user.__legacyState.State = actor->user.__legacyState.StateStart + offset;
}
}
else if (actor->user.WaitTics < 20*120)
{
if (actor->user.StateStart != s_YellowCoin)
if (actor->user.__legacyState.StateStart != s_YellowCoin)
{
offset = int(actor->user.State - actor->user.StateStart);
offset = int(actor->user.__legacyState.State - actor->user.__legacyState.StateStart);
ChangeState(actor, s_YellowCoin);
actor->user.State = actor->user.StateStart + offset;
actor->user.__legacyState.State = actor->user.__legacyState.StateStart + offset;
}
}
@ -6018,10 +6018,10 @@ int StateControl(DSWActor* actor)
{
short StateTics;
if (!actor->user.State)
if (!actor->user.__legacyState.State)
{
ASSERT(actor->user.ActorActionFunc);
(actor->user.ActorActionFunc)(actor);
ASSERT(actor->user.__legacyState.ActorActionFunc);
(actor->user.__legacyState.ActorActionFunc)(actor);
return 0;
}
@ -6031,30 +6031,30 @@ int StateControl(DSWActor* actor)
actor->user.Tics += ACTORMOVETICS;
// Skip states if too much time has passed
while (actor->user.Tics >= (actor->user.State->Tics & SF_TICS_MASK))
while (actor->user.Tics >= (actor->user.__legacyState.State->Tics & SF_TICS_MASK))
{
StateTics = (actor->user.State->Tics & SF_TICS_MASK);
StateTics = (actor->user.__legacyState.State->Tics & SF_TICS_MASK);
if ((actor->user.State->Tics & SF_TIC_ADJUST))
if ((actor->user.__legacyState.State->Tics & SF_TIC_ADJUST))
{
ASSERT(actor->user.Attrib);
ASSERT(actor->user.__legacyState.Attrib);
ASSERT(actor->user.speed < MAX_SPEED);
ASSERT(StateTics > -actor->user.Attrib->TicAdjust[actor->user.speed]);
ASSERT(StateTics > -actor->user.__legacyState.Attrib->TicAdjust[actor->user.speed]);
StateTics += actor->user.Attrib->TicAdjust[actor->user.speed];
StateTics += actor->user.__legacyState.Attrib->TicAdjust[actor->user.speed];
}
// Set Tics
actor->user.Tics -= StateTics;
// Transition to the next state
actor->user.State = actor->user.State->NextState;
actor->user.__legacyState.State = actor->user.__legacyState.State->NextState;
// Look for flags embedded into the Tics variable
while ((actor->user.State->Tics & SF_QUICK_CALL))
while ((actor->user.__legacyState.State->Tics & SF_QUICK_CALL))
{
// Call it once and go to the next state
(*actor->user.State->Animator)(actor);
(*actor->user.__legacyState.State->Animator)(actor);
ASSERT(actor->hasU()); //put this in to see if actor was getting killed with in his QUICK_CALL state
@ -6063,39 +6063,39 @@ int StateControl(DSWActor* actor)
// if still on the same QUICK_CALL should you
// go to the next state.
if ((actor->user.State->Tics & SF_QUICK_CALL))
actor->user.State = actor->user.State->NextState;
if ((actor->user.__legacyState.State->Tics & SF_QUICK_CALL))
actor->user.__legacyState.State = actor->user.__legacyState.State->NextState;
}
if (!actor->hasU())
break;
if (!actor->user.State->Pic)
if (!actor->user.__legacyState.State->Pic)
{
NewStateGroup(actor, (STATE* *) actor->user.State->NextState);
NewStateGroup(actor, (STATE* *) actor->user.__legacyState.State->NextState);
}
}
if (actor->hasU())
{
ASSERT(actor->user.State);
ASSERT(actor->user.__legacyState.State);
// Set picnum to the correct pic
if ((actor->user.State->Tics & SF_WALL_STATE))
if ((actor->user.__legacyState.State->Tics & SF_WALL_STATE))
{
ASSERT(actor->user.WallP);
actor->user.WallP->setwalltexture(tileGetTextureID(actor->user.State->Pic));
actor->user.WallP->setwalltexture(tileGetTextureID(actor->user.__legacyState.State->Pic));
}
else
{
if (actor->user.RotNum > 1)
if (actor->user.__legacyState.RotNum > 1)
actor->spr.picnum = actor->user.__legacyState.Rot[0]->Pic;
else
actor->spr.picnum = actor->user.State->Pic;
actor->spr.picnum = actor->user.__legacyState.State->Pic;
}
// Call the correct animator
if (actor->user.State->Animator && actor->user.State->Animator != NullAnimator)
(*actor->user.State->Animator)(actor);
if (actor->user.__legacyState.State->Animator && actor->user.__legacyState.State->Animator != NullAnimator)
(*actor->user.__legacyState.State->Animator)(actor);
}
return 0;
@ -6191,8 +6191,8 @@ void SpriteControl(void)
it.Reset(STAT_NO_STATE);
while (auto actor = it.Next())
{
if (actor->hasU() && actor->user.ActorActionFunc)
actor->user.ActorActionFunc(actor);
if (actor->hasU() && actor->user.__legacyState.ActorActionFunc)
actor->user.__legacyState.ActorActionFunc(actor);
}
if (MoveSkip8 == 0)
@ -6231,7 +6231,7 @@ void SpriteControl(void)
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);
actor->user.__legacyState.ActorActionFunc(actor);
}
it.Reset(STAT_SPIKE);
@ -6248,7 +6248,7 @@ void SpriteControl(void)
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);
actor->user.__legacyState.ActorActionFunc(actor);
}
it.Reset(STAT_ROTATOR);
@ -6265,7 +6265,7 @@ void SpriteControl(void)
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);
actor->user.__legacyState.ActorActionFunc(actor);
}
it.Reset(STAT_SLIDOR);
@ -6282,7 +6282,7 @@ void SpriteControl(void)
if (!(actor->user.Flags & SPR_ACTIVE))
continue;
actor->user.ActorActionFunc(actor);
actor->user.__legacyState.ActorActionFunc(actor);
}
it.Reset(STAT_SUICIDE);

View file

@ -617,9 +617,9 @@ int SetupSumo(DSWActor* actor)
if (Skill == 1) actor->user.Health = 4000;
ChangeState(actor,s_SumoRun[0]);
actor->user.Attrib = &SumoAttrib;
actor->user.__legacyState.Attrib = &SumoAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_SumoDie;
actor->user.__legacyState.StateEnd = s_SumoDie;
actor->user.__legacyState.Rot = sg_SumoRun;
EnemyDefaults(actor, &SumoActionSet, &SumoPersonality);
@ -669,7 +669,7 @@ int DoSumoMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
KeepActorOnFloor(actor);

View file

@ -804,7 +804,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
if (!itActor->hasU())
SpawnUser(itActor, 0, nullptr);
itActor->user.RotNum = 0;
itActor->user.__legacyState.RotNum = 0;
itActor->backuppos();
itActor->user.oz = itActor->opos.Z;
@ -1071,7 +1071,7 @@ void SetupSectorObject(sectortype* sectp, short tag)
{
change_actor_stat(actor, STAT_NO_STATE);
SpawnUser(actor, 0, nullptr);
actor->user.ActorActionFunc = nullptr;
actor->user.__legacyState.ActorActionFunc = nullptr;
}
break;
@ -2595,7 +2595,7 @@ void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATOR* animator)
DoSoundSpotStopSound(actor->spr.lotag);
}
actor->user.ActorActionFunc = animator;
actor->user.__legacyState.ActorActionFunc = animator;
}
break;
}
@ -2911,7 +2911,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
actor->user.jump_speed = -tpoint->tag_high;
DoActorBeginJump(actor);
actor->user.ActorActionFunc = DoActorMoveJump;
actor->user.__legacyState.ActorActionFunc = DoActorMoveJump;
}
break;
@ -2957,7 +2957,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
}
DoActorBeginJump(actor);
actor->user.ActorActionFunc = DoActorMoveJump;
actor->user.__legacyState.ActorActionFunc = DoActorMoveJump;
return false;
}
@ -2982,7 +2982,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
}
DoActorBeginJump(actor);
actor->user.ActorActionFunc = DoActorMoveJump;
actor->user.__legacyState.ActorActionFunc = DoActorMoveJump;
return false;
}
@ -3012,7 +3012,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
actor->user.WaitTics = tpoint->tag_high * 128;
InitActorDuck(actor);
actor->user.ActorActionFunc = DoActorDuck;
actor->user.__legacyState.ActorActionFunc = DoActorDuck;
return false;
}
@ -3436,7 +3436,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
actor->spr.pos.Z += actor->user.pos.Y;
DoActorSetSpeed(actor, SLOW_SPEED);
actor->user.ActorActionFunc = NinjaJumpActionFunc;
actor->user.__legacyState.ActorActionFunc = NinjaJumpActionFunc;
actor->user.jump_speed = -650;
DoActorBeginJump(actor);

View file

@ -4712,7 +4712,7 @@ int SetSuicide(DSWActor* actor)
if (actor->hasU())
{
actor->user.Flags |= (SPR_SUICIDE);
actor->user.RotNum = 0;
actor->user.__legacyState.RotNum = 0;
}
ChangeState(actor, s_Suicide);
return 0;
@ -4809,7 +4809,7 @@ int ActorChooseDeath(DSWActor* actor, DSWActor* weapActor)
UpdateSinglePlayKills(actor);
if (actor->user.Attrib)
if (actor->user.__legacyState.Attrib)
PlaySpriteSound(actor,attr_die,v3df_follow);
switch (actor->user.ID)
@ -5097,7 +5097,7 @@ int ActorHealth(DSWActor* actor, short amt)
}
}
if (actor->user.Attrib && RANDOM_P2(1024) > 850)
if (actor->user.__legacyState.Attrib && RANDOM_P2(1024) > 850)
PlaySpriteSound(actor,attr_pain,v3df_follow|v3df_dontpan);
// keep track of the last damage
@ -5648,7 +5648,7 @@ int DoDamage(DSWActor* actor, DSWActor* weapActor)
if ((weapActor->user.Flags & SPR_SUICIDE))
return 0;
if (actor->user.Attrib && RANDOM_P2(1024) > 850)
if (actor->user.__legacyState.Attrib && RANDOM_P2(1024) > 850)
PlaySpriteSound(actor,attr_pain,v3df_follow);
if (actor->user.Flags & (SPR_DEAD))
@ -9440,7 +9440,7 @@ int DoRail(DSWActor* actor)
actorNew->vel.X += RandomRangeF(140 / 16.) - RandomRangeF(140 / 16.);
actorNew->vel.Z += RandomRangeF(140 / 256.) - RandomRangeF(140 / 256.);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, sg_RailPuff);
actorNew->spr.shade = -40;
@ -9601,7 +9601,7 @@ int SpawnExtraMicroMini(DSWActor* actor)
actorNew->spr.shade = actor->spr.shade;
actorNew->copy_clipdist(actor);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_MicroMini[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
actorNew->user.Radius = actor->user.Radius;
@ -11343,9 +11343,9 @@ int DoMirv(DSWActor* actor)
auto actorNew = SpawnActor(STAT_MISSILE, MIRV_METEOR, &sg_MirvMeteor[0][0], actor->sector(),
actor->spr.pos, actor->spr.Angles.Yaw + angs[i], 50);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_MirvMeteor[0]);
actorNew->user.StateEnd = s_MirvMeteorExp;
actorNew->user.__legacyState.StateEnd = s_MirvMeteorExp;
SetOwner(actor, actorNew);
actorNew->spr.shade = -40;
@ -11623,7 +11623,7 @@ int DoSerpRing(DSWActor* actor)
auto own = GetOwner(actor);
// if Owner does not exist or he's dead on the floor
// kill off all of his skull children
if (own == nullptr || own->user.RotNum < 5)
if (own == nullptr || own->user.__legacyState.RotNum < 5)
{
UpdateSinglePlayKills(actor);
DoSkullBeginDeath(actor);
@ -11907,7 +11907,7 @@ int InitSerpRing(DSWActor* actor)
actorNew->user.TargetDist = SERP_RING_DIST;
actorNew->user.Counter2 = 0;
actorNew->user.StateEnd = s_SkullExplode;
actorNew->user.__legacyState.StateEnd = s_SkullExplode;
actorNew->user.__legacyState.Rot = sg_SkullRing;
// defaults do change the statnum
@ -12624,10 +12624,10 @@ int InitSumoSkull(DSWActor* actor)
actor->user.Flags ^= SPR_BOUNCE;
actorNew->user.Flags |= (actor->user.Flags & (SPR_BOUNCE));
actorNew->user.StateEnd = s_SkullExplode;
actorNew->user.__legacyState.StateEnd = s_SkullExplode;
actorNew->user.__legacyState.Rot = sg_SkullWait;
actorNew->user.Attrib = &SkullAttrib;
actorNew->user.__legacyState.Attrib = &SkullAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actorNew->user.Counter = RANDOM_P2(2048);
actorNew->user.pos.Z = actorNew->spr.pos.Z;
@ -13476,7 +13476,7 @@ int InitRail(PLAYER* pp)
actorNew->spr.shade = -15;
setFreeAimVelocity(actorNew->vel.X, zvel, pp->Angles.getPitchWithView(), (HORIZ_MULT + 17) * 0.5);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rail[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
@ -13549,7 +13549,7 @@ int InitZillaRail(DSWActor* actor)
actorNew->spr.shade = -15;
double zvel = (100 * (HORIZ_MULT+17)) / 256.;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rail[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
@ -13642,7 +13642,7 @@ int InitRocket(PLAYER* pp)
actorNew->clipdist = 4;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
@ -13749,7 +13749,7 @@ int InitBunnyRocket(PLAYER* pp)
actorNew->clipdist = 4;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_BunnyRocket[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
@ -13853,7 +13853,7 @@ int InitNuke(PLAYER* pp)
// Set to red palette
actorNew->spr.pal = actorNew->user.spal = 19;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
@ -13935,7 +13935,7 @@ int InitEnemyNuke(DSWActor* actor)
// Set to red palette
actorNew->spr.pal = actorNew->user.spal = 19;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
@ -14037,7 +14037,7 @@ int InitMicro(PLAYER* pp)
// randomize zvelocity
actorNew->vel.Z += RandomRangeF(8) - 5;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Micro[0]);
actorNew->user.WeaponNum = actor->user.WeaponNum;
@ -14443,9 +14443,9 @@ int InitSerpSpell(DSWActor* actor)
actorNew->spr.pos.Z = ActorZOfTop(actor);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_SerpMeteor[0]);
actorNew->user.StateEnd = s_MirvMeteorExp;
actorNew->user.__legacyState.StateEnd = s_MirvMeteorExp;
SetOwner(actor, actorNew);
actorNew->spr.shade = -40;
@ -14546,9 +14546,9 @@ int InitSerpMonstSpell(DSWActor* actor)
actorNew->user.spal = actorNew->spr.pal = 25; // Bright Red
actorNew->spr.pos.Z = ActorZOfTop(actor);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_SerpMeteor[0]);
actorNew->user.StateEnd = s_TeleportEffect2;
actorNew->user.__legacyState.StateEnd = s_TeleportEffect2;
SetOwner(actor, actorNew);
actorNew->spr.shade = -40;
@ -14635,7 +14635,7 @@ int InitEnemyRocket(DSWActor* actor)
actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw;
actorNew->clipdist = 4;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
actorNew->user.Radius = 200;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -14707,7 +14707,7 @@ int InitEnemyRail(DSWActor* actor)
actorNew->spr.shade = -15;
actorNew->vel.Z = 0;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rail[0]);
actorNew->user.Radius = 200;
@ -14773,7 +14773,7 @@ int InitZillaRocket(DSWActor* actor)
actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw;
actorNew->clipdist = 4;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
actorNew->user.Radius = 200;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
@ -14864,7 +14864,7 @@ int InitEnemyCrossbow(DSWActor* actor)
actorNew->spr.Angles.Yaw = actor->spr.Angles.Yaw;
actorNew->clipdist = 4;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_CrossBolt[0]);
UpdateChange(actorNew);
@ -15140,7 +15140,7 @@ void InitBoltTrap(DSWActor* actor)
actorNew->vel.Z = 0;
actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rocket[0]);
actorNew->user.Radius = 200;
@ -15164,7 +15164,7 @@ void InitSpearTrap(DSWActor* actor)
actorNew->spr.shade = -25;
actorNew->clipdist = 4;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_CrossBolt[0]);
UpdateChange(actorNew);
@ -15756,7 +15756,7 @@ int InitTurretMicro(DSWActor* actor, PLAYER* pp)
actorNew->clipdist = 4;
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Micro[0]);
actorNew->user.WeaponNum = plActor->user.WeaponNum;
@ -15899,7 +15899,7 @@ int InitTurretRail(DSWActor* actor, PLAYER* pp)
actorNew->spr.shade = -15;
setFreeAimVelocity(actorNew->vel.X, actorNew->vel.Z, pp->Angles.getPitchWithView(), HORIZ_MULTF);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Rail[0]);
actorNew->user.Radius = 200;
@ -16662,7 +16662,7 @@ int InitGrenade(PLAYER* pp)
actorNew->vel.Z *= 0.75;
}
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Grenade[0]);
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);
@ -16733,7 +16733,7 @@ int InitSpriteGrenade(DSWActor* actor)
auto actorNew = SpawnActor(STAT_MISSILE, GRENADE, &s_Grenade[0][0], actor->sector(),
actor->spr.pos.plusZ(-40), actor->spr.Angles.Yaw, GRENADE_VELOCITY);
actorNew->user.RotNum = 5;
actorNew->user.__legacyState.RotNum = 5;
NewStateGroup(actorNew, &sg_Grenade[0]);
actorNew->user.Flags |= (SPR_XFLIP_TOGGLE);

View file

@ -623,9 +623,9 @@ int SetupZilla(DSWActor* actor)
if (Skill == 1) actor->user.Health = 4000;
ChangeState(actor,s_ZillaRun[0]);
actor->user.Attrib = &ZillaAttrib;
actor->user.__legacyState.Attrib = &ZillaAttrib;
DoActorSetSpeed(actor, NORM_SPEED);
actor->user.StateEnd = s_ZillaDie;
actor->user.__legacyState.StateEnd = s_ZillaDie;
actor->user.__legacyState.Rot = sg_ZillaRun;
EnemyDefaults(actor, &ZillaActionSet, &ZillaPersonality);
@ -684,7 +684,7 @@ int DoZillaMove(DSWActor* actor)
if (actor->user.track >= 0)
ActorFollowTrack(actor, ACTORMOVETICS);
else
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
KeepActorOnFloor(actor);

View file

@ -758,11 +758,11 @@ int SetupZombie(DSWActor* actor)
ANIMATOR DoActorDecide;
actor->user.Health = 100;
actor->user.StateEnd = &s_ZombiePain[0][0];
actor->user.__legacyState.StateEnd = &s_ZombiePain[0][0];
actor->user.__legacyState.Rot = sg_ZombieRun;
actor->spr.scale = DVector2(PLAYER_NINJA_XREPEAT, PLAYER_NINJA_YREPEAT);
actor->user.Attrib = &ZombieAttrib;
actor->user.__legacyState.Attrib = &ZombieAttrib;
EnemyDefaults(actor, &ZombieActionSet, &ZombiePersonality);
ChangeState(actor, s_ZombieRun[0]);
@ -903,7 +903,7 @@ int DoZombieMove(DSWActor* actor)
ActorFollowTrack(actor, ACTORMOVETICS);
else
{
(*actor->user.ActorActionFunc)(actor);
(*actor->user.__legacyState.ActorActionFunc)(actor);
}
// stay on floor unless doing certain things