From e42267f246e4f5d93418b9c786013287e7a39274 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 5 Sep 2022 00:11:43 +0200 Subject: [PATCH] - function separators plus one last change in coolg.cpp --- source/games/sw/src/coolg.cpp | 73 +++++++++++++++++++++++++++++++++- source/games/sw/src/coolie.cpp | 49 ++++++++++++++++++++++- 2 files changed, 120 insertions(+), 2 deletions(-) diff --git a/source/games/sw/src/coolg.cpp b/source/games/sw/src/coolg.cpp index a22bf6788..c2fd31dca 100644 --- a/source/games/sw/src/coolg.cpp +++ b/source/games/sw/src/coolg.cpp @@ -499,6 +499,12 @@ ACTOR_ACTION_SET CoolgActionSet = int DoCoolgMatchPlayerZ(DSWActor* actor); +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + void CoolgCommon(DSWActor* actor) { actor->spr.clipdist = (200) >> 2; @@ -512,6 +518,12 @@ void CoolgCommon(DSWActor* actor) actor->spr.extra |= (SPRX_PLAYER_OR_ENEMY); } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int SetupCoolg(DSWActor* actor) { ANIMATOR DoActorDecide; @@ -537,6 +549,12 @@ int SetupCoolg(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int NewCoolg(DSWActor* actor) { ANIMATOR DoActorDecide; @@ -562,6 +580,12 @@ int NewCoolg(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int DoCoolgBirth(DSWActor* actor) { ANIMATOR DoActorDecide; @@ -584,6 +608,12 @@ int DoCoolgBirth(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int NullCoolg(DSWActor* actor) { actor->user.ShellNum -= ACTORMOVETICS; @@ -597,6 +627,12 @@ int NullCoolg(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int DoCoolgMatchPlayerZ(DSWActor* actor) { // If blocking bits get unset, just die @@ -670,6 +706,12 @@ int DoCoolgMatchPlayerZ(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int InitCoolgCircle(DSWActor* actor) { actor->user.ActorActionFunc = DoCoolgCircle; @@ -699,11 +741,17 @@ int InitCoolgCircle(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int DoCoolgCircle(DSWActor* actor) { double bound; - actor->set_int_ang(NORM_ANGLE(actor->int_ang() + actor->user.Counter2)); + actor->spr.angle += DAngle::fromBuild(actor->user.Counter2); if (!move_actor(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, 0))) { @@ -735,6 +783,12 @@ int DoCoolgCircle(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int DoCoolgDeath(DSWActor* actor) { actor->spr.cstat &= ~(CSTAT_SPRITE_TRANSLUCENT); @@ -774,6 +828,11 @@ int DoCoolgDeath(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- int DoCoolgMove(DSWActor* actor) { @@ -858,6 +917,12 @@ int DoCoolgMove(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int DoCoolgPain(DSWActor* actor) { NullCoolg(actor); @@ -869,6 +934,12 @@ int DoCoolgPain(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + #include "saveable.h" static saveable_code saveable_coolg_code[] = diff --git a/source/games/sw/src/coolie.cpp b/source/games/sw/src/coolie.cpp index b9080c4a5..5174351ed 100644 --- a/source/games/sw/src/coolie.cpp +++ b/source/games/sw/src/coolie.cpp @@ -369,7 +369,12 @@ ACTOR_ACTION_SET CoolieActionSet = nullptr }; -// later. This is used by multiple enemies. +//--------------------------------------------------------------------------- +// +// This is used by multiple enemies. +// +//--------------------------------------------------------------------------- + void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* person) { unsigned int wpn; @@ -508,6 +513,12 @@ int SetupCoolie(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int NewCoolg(DSWActor*); int SpawnCoolg(DSWActor* actor) { @@ -523,6 +534,12 @@ int SpawnCoolg(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int CooliePain(DSWActor* actor) { if (actor->user.Flags & (SPR_SLIDING)) @@ -539,6 +556,12 @@ int CooliePain(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int NullCoolie(DSWActor* actor) { if (actor->user.Flags & (SPR_SLIDING)) @@ -552,6 +575,12 @@ int NullCoolie(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int DoCoolieMove(DSWActor* actor) { if (actor->user.Flags & (SPR_SLIDING)) @@ -579,6 +608,12 @@ int DoCoolieMove(DSWActor* actor) return 0; } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int InitCoolieCharge(DSWActor* actor) { if (RANDOM_P2(1024) > 950) @@ -594,6 +629,12 @@ int InitCoolieCharge(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + int DoCoolieWaitBirth(DSWActor* actor) { if ((actor->user.Counter -= ACTORMOVETICS) <= 0) @@ -605,6 +646,12 @@ int DoCoolieWaitBirth(DSWActor* actor) } +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + #include "saveable.h" static saveable_code saveable_coolie_code[] =