Select Git revision

sphere authored
lua_hook.h 6.05 KiB
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 2012-2016 by John "JTE" Muniz.
// Copyright (C) 2012-2022 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file lua_hook.h
/// \brief hooks for Lua scripting
#include "r_defs.h"
#include "d_player.h"
#include "s_sound.h"
#include "d_event.h"
/*
Do you know what an 'X Macro' is? Such a macro is called over each element of
a list and expands the input. I use it for the hook lists because both an enum
and array of hook names need to be kept in order. The X Macro handles this
automatically.
*/
#define MOBJ_HOOK_LIST(X) \
X (MobjSpawn),/* P_SpawnMobj */\
X (MobjCollide),/* PIT_CheckThing */\
X (MobjLineCollide),/* ditto */\
X (MobjMoveCollide),/* tritto */\
X (TouchSpecial),/* P_TouchSpecialThing */\
X (MobjFuse),/* when mobj->fuse runs out */\
X (MobjThinker),/* P_MobjThinker, P_SceneryThinker */\
X (BossThinker),/* P_GenericBossThinker */\
X (ShouldDamage),/* P_DamageMobj (Should mobj take damage?) */\
X (MobjDamage),/* P_DamageMobj (Mobj actually takes damage!) */\
X (MobjDeath),/* P_KillMobj */\
X (BossDeath),/* A_BossDeath */\
X (MobjRemoved),/* P_RemoveMobj */\
X (BotRespawn),/* B_CheckRespawn */\
X (MobjMoveBlocked),/* P_XYMovement (when movement is blocked) */\
X (MapThingSpawn),/* P_SpawnMapThing */\
X (FollowMobj),/* P_PlayerAfterThink Smiles mobj-following */\
#define HOOK_LIST(X) \
X (NetVars),/* add to archive table (netsave) */\
X (MapChange),/* (before map load) */\
X (MapLoad),\
X (PlayerJoin),/* Got_AddPlayer */\
X (PreThinkFrame)/* frame (before mobj and player thinkers) */,\
X (ThinkFrame),/* frame (after mobj and player thinkers) */\
X (PostThinkFrame),/* frame (at end of tick, ie after overlays, precipitation, specials) */\
X (JumpSpecial),/* P_DoJumpStuff (Any-jumping) */\
X (AbilitySpecial),/* P_DoJumpStuff (Double-jumping) */\
X (SpinSpecial),/* P_DoSpinAbility (Spin button effect) */\
X (JumpSpinSpecial),/* P_DoJumpStuff (Spin button effect (mid-air)) */\
X (BotTiccmd),/* B_BuildTiccmd */\
X (PlayerMsg),/* chat messages */\
X (HurtMsg),/* imhurttin */\
X (PlayerSpawn),/* G_SpawnPlayer */\
X (ShieldSpawn),/* P_SpawnShieldOrb */\
X (ShieldSpecial),/* shield abilities */\
X (PlayerCanDamage),/* P_PlayerCanDamage */\
X (PlayerQuit),\
X (IntermissionThinker),/* Y_Ticker */\
X (TeamSwitch),/* team switching in... uh... *what* speak, spit it the fuck out */\
X (ViewpointSwitch),/* spy mode (no trickstabs) */\
X (SeenPlayer),/* MT_NAMECHECK */\
X (PlayerThink),/* P_PlayerThink */\
X (GameQuit),\
X (PlayerCmd),/* building the player's ticcmd struct (Ported from SRB2Kart) */\