2010-08-02 08:13:51 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010 EDuke32 developers and contributors
|
|
|
|
|
|
|
|
This file is part of EDuke32.
|
|
|
|
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef __gameexec_h__
|
|
|
|
#define __gameexec_h__
|
|
|
|
|
2012-02-09 22:44:45 +00:00
|
|
|
#include "build.h"
|
|
|
|
#include "sector.h" // mapstate_t
|
|
|
|
#include "gamedef.h" // vmstate_t
|
|
|
|
|
2010-08-02 08:13:51 +00:00
|
|
|
// the order of these can't be changed or else compatibility with EDuke 2.0 mods will break
|
2012-12-09 13:24:36 +00:00
|
|
|
// KEEPINSYNC with EventNames[] and lunatic/con_lang.lua
|
2010-08-02 08:13:51 +00:00
|
|
|
enum GameEvent_t {
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_INIT, // 0
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_ENTERLEVEL,
|
|
|
|
EVENT_RESETWEAPONS,
|
|
|
|
EVENT_RESETINVENTORY,
|
|
|
|
EVENT_HOLSTER,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_LOOKLEFT, // 5
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_LOOKRIGHT,
|
|
|
|
EVENT_SOARUP,
|
|
|
|
EVENT_SOARDOWN,
|
|
|
|
EVENT_CROUCH,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_JUMP, // 10
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_RETURNTOCENTER,
|
|
|
|
EVENT_LOOKUP,
|
|
|
|
EVENT_LOOKDOWN,
|
|
|
|
EVENT_AIMUP,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_FIRE, // 15
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_CHANGEWEAPON,
|
|
|
|
EVENT_GETSHOTRANGE,
|
|
|
|
EVENT_GETAUTOAIMANGLE,
|
|
|
|
EVENT_GETLOADTILE,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_CHEATGETSTEROIDS, // 20
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_CHEATGETHEAT,
|
|
|
|
EVENT_CHEATGETBOOT,
|
|
|
|
EVENT_CHEATGETSHIELD,
|
|
|
|
EVENT_CHEATGETSCUBA,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_CHEATGETHOLODUKE, // 25
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_CHEATGETJETPACK,
|
|
|
|
EVENT_CHEATGETFIRSTAID,
|
|
|
|
EVENT_QUICKKICK,
|
|
|
|
EVENT_INVENTORY,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_USENIGHTVISION, // 30
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_USESTEROIDS,
|
|
|
|
EVENT_INVENTORYLEFT,
|
|
|
|
EVENT_INVENTORYRIGHT,
|
|
|
|
EVENT_HOLODUKEON,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_HOLODUKEOFF, // 35
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_USEMEDKIT,
|
|
|
|
EVENT_USEJETPACK,
|
|
|
|
EVENT_TURNAROUND,
|
|
|
|
EVENT_DISPLAYWEAPON,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_FIREWEAPON, // 40
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_SELECTWEAPON,
|
|
|
|
EVENT_MOVEFORWARD,
|
|
|
|
EVENT_MOVEBACKWARD,
|
|
|
|
EVENT_TURNLEFT,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_TURNRIGHT, // 45
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_STRAFELEFT,
|
|
|
|
EVENT_STRAFERIGHT,
|
|
|
|
EVENT_WEAPKEY1,
|
|
|
|
EVENT_WEAPKEY2,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_WEAPKEY3, // 50
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_WEAPKEY4,
|
|
|
|
EVENT_WEAPKEY5,
|
|
|
|
EVENT_WEAPKEY6,
|
|
|
|
EVENT_WEAPKEY7,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_WEAPKEY8, // 55
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_WEAPKEY9,
|
|
|
|
EVENT_WEAPKEY10,
|
|
|
|
EVENT_DRAWWEAPON,
|
|
|
|
EVENT_DISPLAYCROSSHAIR,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_DISPLAYREST, // 60
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_DISPLAYSBAR,
|
|
|
|
EVENT_RESETPLAYER,
|
|
|
|
EVENT_INCURDAMAGE,
|
|
|
|
EVENT_AIMDOWN,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_GAME, // 65
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_PREVIOUSWEAPON,
|
|
|
|
EVENT_NEXTWEAPON,
|
|
|
|
EVENT_SWIMUP,
|
|
|
|
EVENT_SWIMDOWN,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_GETMENUTILE, // 70
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_SPAWN,
|
|
|
|
EVENT_LOGO,
|
|
|
|
EVENT_EGS,
|
|
|
|
EVENT_DOFIRE,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_PRESSEDFIRE, // 75
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_USE,
|
|
|
|
EVENT_PROCESSINPUT,
|
|
|
|
EVENT_FAKEDOMOVETHINGS,
|
|
|
|
EVENT_DISPLAYROOMS,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_KILLIT, // 80
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_LOADACTOR,
|
|
|
|
EVENT_DISPLAYBONUSSCREEN,
|
|
|
|
EVENT_DISPLAYMENU,
|
|
|
|
EVENT_DISPLAYMENUREST,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_DISPLAYLOADINGSCREEN, // 85
|
2010-08-02 08:13:51 +00:00
|
|
|
EVENT_ANIMATESPRITES,
|
|
|
|
EVENT_NEWGAME,
|
2012-05-14 18:12:27 +00:00
|
|
|
EVENT_SOUND,
|
|
|
|
EVENT_CHECKTOUCHDAMAGE,
|
2012-06-17 19:45:33 +00:00
|
|
|
EVENT_CHECKFLOORDAMAGE, // 90
|
2012-05-25 05:14:19 +00:00
|
|
|
EVENT_LOADGAME,
|
|
|
|
EVENT_SAVEGAME,
|
2012-08-27 03:49:55 +00:00
|
|
|
EVENT_PREGAME,
|
2012-10-29 04:29:45 +00:00
|
|
|
EVENT_CHANGEMENU,
|
2010-08-02 08:13:51 +00:00
|
|
|
MAXEVENTS
|
|
|
|
};
|
|
|
|
|
|
|
|
extern int32_t g_errorLineNum;
|
|
|
|
extern int32_t g_tw;
|
|
|
|
extern int32_t ticrandomseed;
|
|
|
|
extern vmstate_t vm;
|
|
|
|
|
2011-08-03 17:22:46 +00:00
|
|
|
extern int32_t g_currentEventExec;
|
|
|
|
|
2010-08-02 08:13:51 +00:00
|
|
|
void A_Execute(int32_t iActor,int32_t iPlayer,int32_t lDist);
|
|
|
|
void A_Fall(int32_t iActor);
|
|
|
|
int32_t A_FurthestVisiblePoint(int32_t iActor,spritetype *ts,int32_t *dax,int32_t *day);
|
|
|
|
int32_t A_GetFurthestAngle(int32_t iActor,int32_t angs);
|
|
|
|
void A_GetZLimits(int32_t iActor);
|
|
|
|
void A_LoadActor(int32_t iActor);
|
|
|
|
int32_t G_GetAngleDelta(int32_t a,int32_t na);
|
|
|
|
void G_RestoreMapState(mapstate_t *save);
|
|
|
|
void G_RestoreMapState(mapstate_t *save);
|
|
|
|
void G_SaveMapState(mapstate_t *save);
|
|
|
|
void G_SaveMapState(mapstate_t *save);
|
2013-01-01 15:24:18 +00:00
|
|
|
//void Gv_RefreshPointers(void);
|
2012-05-16 00:45:10 +00:00
|
|
|
int32_t VM_OnEvent(int32_t iEventID,int32_t iActor,int32_t iPlayer,int32_t lDist, int32_t iReturn);
|
2010-08-02 08:13:51 +00:00
|
|
|
void VM_ScriptInfo(void);
|
|
|
|
|
2012-09-05 17:25:47 +00:00
|
|
|
#define CON_ERRPRINTF(Text, ...) do { \
|
2012-11-15 14:28:04 +00:00
|
|
|
OSD_Printf_nowarn("Line %d, %s: " Text, g_errorLineNum, keyw[g_tw], ## __VA_ARGS__); \
|
|
|
|
} while (0)
|
2012-09-05 17:25:47 +00:00
|
|
|
|
2012-12-09 13:24:36 +00:00
|
|
|
#endif
|