From ef8b0234251182512faf2501a83356f86c589345 Mon Sep 17 00:00:00 2001 From: Steven Casper Date: Sun, 23 Jun 2024 02:57:01 -0400 Subject: [PATCH] zEvent.cpp fully matching --- configure.py | 2 +- src/SB/Game/zEvent.cpp | 547 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 546 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index f752f927b..ef7a908be 100644 --- a/configure.py +++ b/configure.py @@ -355,7 +355,7 @@ def Rel(lib_name: str, objects: List[Object]) -> Dict[str, Any]: Object(NonMatching, "SB/Game/zEntSimpleObj.cpp"), Object(NonMatching, "SB/Game/zEntTrigger.cpp"), Object(Matching, "SB/Game/zEnv.cpp"), - Object(NonMatching, "SB/Game/zEvent.cpp"), + Object(Matching, "SB/Game/zEvent.cpp"), Object(Matching, "SB/Game/zFeet.cpp"), Object(Matching, "SB/Game/zFMV.cpp"), Object(NonMatching, "SB/Game/zFX.cpp"), diff --git a/src/SB/Game/zEvent.cpp b/src/SB/Game/zEvent.cpp index 5fd6aec1b..dedd176a3 100644 --- a/src/SB/Game/zEvent.cpp +++ b/src/SB/Game/zEvent.cpp @@ -1,8 +1,551 @@ #include "zEvent.h" -extern char* sEventTable[eEventCount]; +// NOTE (Square): Some of these strings appear to be incorrectly written given the enum value they correspond to. +char* sEventTable[eEventCount] = { + "Unknown", + "Enable", + "Disable", + "Visible", + "Invisible", + "EnterPlayer", + "ExitPlayer", + "TouchPlayer", + "ControlOff", + "ControlOn", + "Reset", + "Increment", + "Decrement", + "Open", + "Close", + "Toggle", + "Teleport Player", + "OutOfBounds", + "Run", + "Stop", + "Expired", + "Move", + "Destroy", + "Pause", + "Play", + "PlayOne", + "PlayMaybe", + "RoomStart", + "Invalidate", + "Tilt", + "Untilt", + "Arrive", + "Mount", + "Dismount", + "Break", + "Pickup", + "Death", + "Kill", + "On", + "Off", + "Patrol On", + "Patrol Off", + "Wander On", + "Wander Off", + "Detect Player On", + "Detect Player Off", + "Chase Player On", + "Chase Player Off", + "Go To Sleep", + "Wake Up Villain", + "Respawn", + "PlayerDeath", + "GiveChance", + "GiveShinyObjects", + "GiveHealth", + "ButtonPress", + "ButtonUnpress", + "ArriveHalfway", + "Hit", + "ButtonPressAction", + "Evaluate", + "True", + "False", + "PadPressX", + "PadPressSquare", + "PadPressO", + "PadPressTriangle", + "PadPressL1", + "PadPressL2", + "PadPressR1", + "PadPressR2", + "PadPressStart", + "PadPressSelect", + "PadPressUp", + "PadPressDown", + "PadPressRight", + "PadPressLeft", + "FontBackdropOn", + "FontBackdropOff", + "UI Select", + "UI Unselect", + "UI Focus On", + "UI Focus Off", + "Collision On", + "Collision Off", + "Collision+Visible On", + "Collision+Visible Off", + "Scene Prepare", + "Scene Finish", + "Room Prepare", + "Room Finish", + "LobMaster Shoot", + "LobMaster Reset", + "FallToDeath", + "UI Focus On+Select", + "UI Focus Off+Unselect", + "Set Pad Config to Preset A", + "Set Pad Config to Preset B", + "Set Pad Config to Preset C", + "Set Pad Config to Preset D", + "Pad Vibrate On", + "Pad Vibrate Off", + "Mono Sound", + "Stereo Sound", + "Increase Master Volume", + "Decrease Master Volume", + "Increase Music Volume", + "Decrease Music Volume", + "Increase SFX Volume", + "Decrease SFX Volume", + "IntroState_Sony", + "IntroState_Publisher", + "IntroState_Developer", + "IntroState_License", + "IntroState_Count", + "TitleState_Start", + "TitleState_Attract", + "TitleState_Count", + "LoadState_SelectMemCard", + "LoadState_SelectSlot", + "LoadState_Loading", + "LoadState_Count", + "OptionsState_Options", + "OptionsState_Count", + "SaveState_SelectMemCard", + "SaveState_SelectSlot", + "SaveState_Saving", + "SaveState_Count", + "PauseState_Pause", + "PauseState_Options", + "PauseState_Count", + "GameState_FirstTime", + "GameState_Play", + "GameState_LoseChance", + "GameState_GameOver", + "GameState_SceneSwitch", + "GameState_Dead", + "SetIntroState_Sony", + "SetIntroState_Publisher", + "SetIntroState_Developer", + "SetIntroState_License", + "SetIntroState_Count", + "SetTitleState_Start", + "SetTitleState_Attract", + "SetTitleState_Count", + "SetLoadState_SelectMemCard", + "SetLoadState_SelectSlot", + "SetLoadState_Loading", + "SetLoadState_Count", + "SetOptionsState_Options", + "SetOptionsState_Count", + "SetSaveState_SelectMemCard", + "SetSaveState_SelectSlot", + "SetSaveState_Saving", + "SetSaveState_Count", + "SetPauseState_Pause", + "SetPauseState_Options", + "SetPauseState_Count", + "SetGameState_FirstTime", + "SetGameState_Play", + "SetGameState_LoseChance", + "SetGameState_GameOver", + "SetGameState_SceneSwitch", + "SetGameState_Dead", + "Digup", + "GameState_Exit", + "SetGameState_Exit", + "LobMaster Shoot From Widget", + "Back", + "Cancel", + "Retry", + "Select Card", + "Select Slot", + "OK", + "VilHurtBoss", + "Attack", + "AttackOn", + "AttackOff", + "Drop pickup", + "VilReport_StartingIdle", + "VilReport_StartingSleep", + "VilReport_StartingGuard", + "VilReport_StartingPatrol", + "VilReport_StartingDazed", + "VilReport_StartingLook", + "VilReport_StartingListen", + "VilReport_StartingInvestigate", + "VilReport_StartingChase", + "VilReport_StartingAttack", + "VilReport_StartingRetreat", + "Preload", + "Done", + "Arcto", + "Digup Reaction", + "Set Check Point", + "AnimPlay", + "AnimPlayLoop", + "AnimStop", + "AnimPause", + "AnimResume", + "AnimTogglePause", + "AnimPlayRandom", + "AnimPlayMaybe", + "SetSpeed", + "Accelerate", + "MoveToTarget", + "SwingerFollow", + "ShaggyMount", + "ShaggyWitchDrop", + "ShaggySwap", + "ShaggyState", + "ShaggyAction", + "EnterEntity", + "ExitEntity", + "ENTER FLAGGED - DO NOT USE", + "EXIT FLAGGED - DO NOT USE", + "Drivenby", + "FollowTarget", + "FaceTarget", + "WatchTarget", + "ShaggyCollideOnly", + "Shaggy1_ThrowTarget", + "Shaggy8_CallEnable", + "Shaggy8_CallDisable", + "Shaggy8_SetMagnet", + "Shaggy8_ClearMagnet", + "StartMoving", + "StopMoving", + "Swoosh", + "ShaggySetDown", + "ShaggyGrabEnable", + "ShaggyGrabDisable", + "ShaggyGrabbed", + "ShaggyThrown", + "VilDoAction", + "GangDoBossAction", + "VilFakeChaseOn", + "VilFakeChaseOff", + "BossMMPushButton", + "VilReport_DecayComplete", + "VilGuardWidget", + "TextureAnimateOn", + "TextureAnimateOff", + "TextureAnimateToggle", + "ColorEffectOn", + "ColorEffectOff", + "ColorEffectToggle", + "SetTextureAnimGroup", + "SetTextureAnimSpeed", + "TextureAnimateStep", + "Emit", + "Emitted", + "TranslucentOn", + "TranslucentOff", + "TranslucentToggle", + "VilGangTalkOn", + "VilGangTalkOff", + "Give PowerUp", + "Unlock R001", + "Unlock S001", + "Unlock E001", + "Unlock F001", + "Disable Group Contents", + "ShaggyPhysHack", + "OccludeOn", + "OccludeOff", + "WaveSetLinear - OBSOLETE", + "WaveSetRipple - OBSOLETE", + "SituationLaugh", + "SituationBossBattleGreenGhost", + "SituationBossBattleRedBeard", + "SituationBossBattleMasterMind", + "SituationBossBattleBlacknight", + "SituationPlayerScare", + "SituationPlayerSafe", + "SituationPlayerDanger", + "SituationPlayerChaseBegin", + "SituationPlayerChaseEnd", + "SituationPlayerSeeShaggy", + "SituationPlayerSeeFood", + "SituationPlayerSeeToken", + "SituationPlayerSeeScoobySnack", + "SituationPlayerSeePowerup", + "SituationPlayerSeeMonster", + "SituationPlayerSuccess", + "SituationPlayerFailure", + "Show Hud", + "Hide Hud", + " FADE OUT", + "SetRain", + "SetSnow", + "ShaggyMowerStopMode", + "ScriptReset", + "WaitForInput", + "Play Movie", + "Mastermind is defeated", + "SetGameState_Exit", // This is duplicated from earlier. Looks like the correct string would have been SetGameState_GameStats + "PlayMusic", + "Forward", + "Reverse", + "PlayerRumbleTest", + "PlayerRumbleLight", + "PlayerRumbleMedium", + "PlayerRumbleHeavy", + "Screen Adjustment ON", + "Screen Adjustment OFF", + "Set as Skydome", + "Connect_IOwnYou", + "Duplotron_WaveBegin", + "Duplotron_WaveComplete", + "Duplotron_NPCBorn", + "Duplotron_NPCKilled", + "Duplotron_MaxNPCExpired", + "Duplotron_Pause", + "Duplotron_Resume", + "Set as Goo", + "NPCScript_ScriptBegin", + "NPCScript_ScriptEnd", + "NPCScript_ScriptReady", + "NPCScript_Halt", + "NPCScript_SetPos", + "NPCScript_SetDir", + "NPCScript_LookNormal", + "NPCScript_LookAlert", + "NPCScript_FaceWidget", + "NPCScript_FaceWidgetDone", + "NPCScript_GotoWidget", + "NPCScript_GotoWidgetDone", + "NPCScript_AttackWidget", + "NPCScript_AttackWidgetDone", + "NPCScript_FollowWidget", + "NPCScript_PlayAnim", + "NPCScript_PlayAnimDone", + "NPCScript_LeadPlayer", + "Set Text", + "Start Conversation", + "End Conversation", + "Switch", + "Add Text", + "Clear Text", + "Open Teleport Box", + "Close Teleport Box", + "On Signal 0", + "On Signal 1", + "On Signal 2", + "On Signal 3", + "On Signal 4", + "On Signal 5", + "On Signal 6", + "On Signal 7", + "On Signal 8", + "On Signal 9", + "Stop Wait", + "On Conversation Start", + "On Conversation End", + "Hit Melee", + "Hit Bubble Bounce", + "Hit Bubble Bash", + "Hit Bubble Bowl", + "Hit Patrick Slam", + "Hit By Throwable", + "Paddle Hit Left", + "Paddle Hit Right", + "Initiate Task", + "Set Success", + "Set Failure", + "On Accept", + "On Decline", + "On Complete", + "Generate Boulder", + "Launch Boulder At Widget", + "Launch Boulder At Point", + "Launch Boulder At Player", + "Duplotron_SuperDuperDone", + "Duplotron_DuperIsDoner", + "Bus Switch Character", + "Group Update Together", + "Set Update Distance", + "Translate, Local X", + "Translate, Local Y", + "Translate, Local Z", + "Translate, World X", + "Translate, World Y", + "Translate, World Z", + "Rotate, Local X", + "Rotate, Local Y", + "Rotate, Local Z", + "Rotate, World X", + "Rotate, World Y", + "Rotate, World Z", + "Translate, Local X Done", + "Translate, Local Y Done", + "Translate, Local Z Done", + "Translate, World X Done", + "Translate, World Y Done", + "Translate, World Z Done", + "Rotate, Local X Done", + "Rotate, Local Y Done", + "Rotate, Local Z Done", + "Rotate, World X Done", + "Rotate, World Y Done", + "Rotate, World Z Done", + "Count1", + "Count2", + "Count3", + "Count4", + "Count5", + "Count6", + "Count7", + "Count8", + "Count9", + "Count10", + "Count11", + "Count12", + "Count13", + "Count14", + "Count15", + "Count16", + "Count17", + "Count18", + "Count19", + "Count20", + "Set State", + "Enter SpongeBob", + "Enter Patrick", + "Enter Sandy", + "Exit SpongeBob", + "Exit Patrick", + "Exit Sandy", + "NPCSpecial_PlatformSnap", + "NPCSpecial_PlatformFall", + "Goo set warb coeffs", + "Goo set freeze duration", + "Goo melt", + "Set State Range", + "Set State Delay", + "Set Transition Delay", + "NPC Fight On", + "NPC Fight Off", + "NPC Patrol Spline On", + "NPC Patrol Spline Off", + "NPC Kill Quietly", + "Hit (General)", // This also doesn't match the enum. Should have be Hit (Head) + "Hit (Head)", // Should have been Hit (Upper Body) + "Hit (Left Arm)", + "Hit (Right Arm)", + "Hit (Left Leg)", + "Hit (Right Leg)", + "Hit (Lower Body)", + "GiveSocks (current level)", + "GiveCollectables (current level)", + "SetSocks (current level)", + "SetCollectables (current level)", + "On Answer Yes", + "On Answer No", + "Hit Cruise Bubble", + "Duplotron_KillKids", + "On Signal10", + "On Signal11", + "On Signal12", + "On Signal13", + "On Signal14", + "On Signal15", + "On Signal16", + "On Signal17", + "On Signal18", + "On Signal19", + "Spongeball On", + "Spongeball Off", + "Launch Shrapnel", + "NPC HP Incremented", + "NPC HP Decremented", + "NPC Set Active On", + "NPC Set Active Off", + "Switch Player Character", + "Level Begin", + "Scene Reset (death)", + "Scene Enter", + "Destroyed Tiki", + "Destroyed Robot", + "See Wood Tiki", + "See Lovey Tiki", + "See Shhh Tiki", + "See Thunder Tiki", + "See Stone Tiki", + "See Fodder", + "See Hammer", + "See Tar-Tar", + "See G-Love", + "See Monsoon", + "See Sleepy Time", + "See Arf", + "See Tubelets", + "See Slick", + "See King Jellyfish", + "See Prawn", + "See Dutchman", + "See Sandy Boss", + "See Patrick Boss", + "See SpongeBob Boss", + "See Robot Plankton", + "Change Texture of UI", + "NPC Cheer For Me", + "Fast Visible", + "Fast Invisible", + "ZipLine Mount", + "ZipLine Dismount", + "Target", + "Fire", + "Camera FX Shake", + "Bullet Time", + "Thrown", + "UpdateAnimMatrices", + "EnterCruise", + "ExitCruise", + "CruiseFired", + "CruiseDied", + "CruiseAddLife", + "CruiseSetLife", + "CruiseResetLife", + "Camera Collide Off", + "Camera Collide On", + "Slide On", + "Slide Off", + "Timer Set", + "Timer Add", + "NPC Force Conversation", + "Make A Splash", + "Credits start", + "Credits stop", + "Credits ended", + "Bubble Wipe", + "Set Lightkit", + "Set Opacity", + "Take Socks", + "Debug BREAK", + "Born", + "Platform Pause", + "Platform Unpause", + "Store Options", + "Restore Options", +}; char* zEventName(uint32 eventEnum) { return sEventTable[eventEnum]; -} \ No newline at end of file +}