2013-02-03 12:48:06 +00:00
|
|
|
-- CON language definitions
|
2012-06-17 19:45:33 +00:00
|
|
|
|
2013-02-03 12:48:06 +00:00
|
|
|
local lpeg = require("lpeg")
|
|
|
|
|
|
|
|
local pairs = pairs
|
|
|
|
local print = print
|
2013-03-24 18:53:28 +00:00
|
|
|
local setmetatable = setmetatable
|
2013-02-03 12:48:06 +00:00
|
|
|
local type = type
|
2012-08-06 20:00:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
module(...)
|
2012-06-17 19:45:33 +00:00
|
|
|
|
|
|
|
|
2012-08-06 20:00:23 +00:00
|
|
|
MAXVOLUMES = 7
|
|
|
|
MAXLEVELS = 64
|
2012-06-17 19:45:37 +00:00
|
|
|
|
2012-08-06 20:00:23 +00:00
|
|
|
MAXSKILLS = 7
|
2012-06-17 19:45:41 +00:00
|
|
|
|
2012-12-25 16:13:45 +00:00
|
|
|
MAXEVENTS = 95 -- KEEPINSYNC with EVENT_* list
|
2012-08-06 20:00:23 +00:00
|
|
|
MAXSOUNDS = 4096
|
2012-06-17 19:45:41 +00:00
|
|
|
|
2013-01-01 15:24:28 +00:00
|
|
|
-- KEEPINSYNC quotes.h
|
|
|
|
MAXQUOTES = 16384
|
|
|
|
MAXQUOTELEN = 128
|
|
|
|
|
2013-01-02 22:33:37 +00:00
|
|
|
local STR = {
|
|
|
|
STR_MAPNAME = 0,
|
|
|
|
STR_MAPFILENAME = 1,
|
|
|
|
STR_PLAYERNAME = 2,
|
|
|
|
STR_VERSION = 3,
|
|
|
|
STR_GAMETYPE = 4,
|
|
|
|
STR_VOLUMENAME = 5,
|
|
|
|
}
|
2012-06-17 19:45:41 +00:00
|
|
|
|
2013-01-02 22:33:37 +00:00
|
|
|
PROJ = {
|
|
|
|
PROJ_WORKSLIKE = 0,
|
|
|
|
PROJ_SPAWNS = 1,
|
|
|
|
PROJ_SXREPEAT = 2,
|
|
|
|
PROJ_SYREPEAT = 3,
|
|
|
|
PROJ_SOUND = 4,
|
|
|
|
PROJ_ISOUND = 5,
|
|
|
|
PROJ_VEL = 6,
|
|
|
|
PROJ_EXTRA = 7,
|
|
|
|
PROJ_DECAL = 8,
|
|
|
|
PROJ_TRAIL = 9,
|
|
|
|
PROJ_TXREPEAT = 10,
|
|
|
|
PROJ_TYREPEAT = 11,
|
|
|
|
PROJ_TOFFSET = 12,
|
|
|
|
PROJ_TNUM = 13,
|
|
|
|
PROJ_DROP = 14,
|
|
|
|
PROJ_CSTAT = 15,
|
|
|
|
PROJ_CLIPDIST = 16,
|
|
|
|
PROJ_SHADE = 17,
|
|
|
|
PROJ_XREPEAT = 18,
|
|
|
|
PROJ_YREPEAT = 19,
|
|
|
|
PROJ_PAL = 20,
|
|
|
|
PROJ_EXTRA_RAND = 21,
|
|
|
|
PROJ_HITRADIUS = 22,
|
2013-02-07 21:01:03 +00:00
|
|
|
PROJ_VEL_MULT = 23, -- NAME (PROJ_MOVECNT)
|
2013-01-02 22:33:37 +00:00
|
|
|
PROJ_OFFSET = 24,
|
|
|
|
PROJ_BOUNCES = 25,
|
|
|
|
PROJ_BSOUND = 26,
|
|
|
|
PROJ_RANGE = 27,
|
|
|
|
PROJ_FLASH_COLOR = 28,
|
|
|
|
}
|
2012-06-17 19:45:33 +00:00
|
|
|
|
2013-02-07 21:01:03 +00:00
|
|
|
-- PROJ_* define -> projectile_t member name
|
2013-02-07 21:01:12 +00:00
|
|
|
--[[
|
2013-02-07 21:01:03 +00:00
|
|
|
PROJ_MEMBNAME = {
|
|
|
|
[PROJ.PROJ_WORKSLIKE] = "workslike",
|
|
|
|
[PROJ.PROJ_SPAWNS] = "spawns",
|
|
|
|
[PROJ.PROJ_SXREPEAT] = "sxrepeat",
|
|
|
|
[PROJ.PROJ_SYREPEAT] = "syrepeat",
|
|
|
|
[PROJ.PROJ_SOUND] = "sound",
|
|
|
|
[PROJ.PROJ_ISOUND] = "isound",
|
|
|
|
[PROJ.PROJ_VEL] = "vel",
|
|
|
|
[PROJ.PROJ_EXTRA] = "extra",
|
|
|
|
[PROJ.PROJ_DECAL] = "decal",
|
|
|
|
[PROJ.PROJ_TRAIL] = "trail",
|
|
|
|
[PROJ.PROJ_TXREPEAT] = "txrepeat",
|
|
|
|
[PROJ.PROJ_TYREPEAT] = "tyrepeat",
|
|
|
|
[PROJ.PROJ_TOFFSET] = "toffset",
|
|
|
|
[PROJ.PROJ_TNUM] = "tnum",
|
|
|
|
[PROJ.PROJ_DROP] = "drop",
|
|
|
|
[PROJ.PROJ_CSTAT] = "cstat",
|
|
|
|
[PROJ.PROJ_CLIPDIST] = "clipdist",
|
|
|
|
[PROJ.PROJ_SHADE] = "shade",
|
|
|
|
[PROJ.PROJ_XREPEAT] = "xrepeat",
|
|
|
|
[PROJ.PROJ_YREPEAT] = "yrepeat",
|
|
|
|
[PROJ.PROJ_PAL] = "pal",
|
|
|
|
[PROJ.PROJ_EXTRA_RAND] = "extra_rand",
|
|
|
|
[PROJ.PROJ_HITRADIUS] = "hitradius",
|
|
|
|
[PROJ.PROJ_VEL_MULT] = "movecnt", -- NAME
|
|
|
|
[PROJ.PROJ_OFFSET] = "offset",
|
|
|
|
[PROJ.PROJ_BOUNCES] = "bounces",
|
|
|
|
[PROJ.PROJ_BSOUND] = "bsound",
|
|
|
|
[PROJ.PROJ_RANGE] = "range",
|
|
|
|
[PROJ.PROJ_FLASH_COLOR] = "flashcolor", -- NAME
|
|
|
|
}
|
2013-02-07 21:01:12 +00:00
|
|
|
--]]
|
2013-02-07 21:01:03 +00:00
|
|
|
|
2013-01-02 22:33:37 +00:00
|
|
|
-- TODO: EVENT_INIT currently can't run since we init Lunatic state only afterwards
|
|
|
|
EVENT = {
|
|
|
|
EVENT_INIT = 0,
|
|
|
|
EVENT_ENTERLEVEL = 1,
|
|
|
|
EVENT_RESETWEAPONS = 2,
|
|
|
|
EVENT_RESETINVENTORY = 3,
|
|
|
|
EVENT_HOLSTER = 4,
|
|
|
|
EVENT_LOOKLEFT = 5,
|
|
|
|
EVENT_LOOKRIGHT = 6,
|
|
|
|
EVENT_SOARUP = 7,
|
|
|
|
EVENT_SOARDOWN = 8,
|
|
|
|
EVENT_CROUCH = 9,
|
|
|
|
EVENT_JUMP = 10,
|
|
|
|
EVENT_RETURNTOCENTER = 11,
|
|
|
|
EVENT_LOOKUP = 12,
|
|
|
|
EVENT_LOOKDOWN = 13,
|
|
|
|
EVENT_AIMUP = 14,
|
|
|
|
EVENT_FIRE = 15,
|
|
|
|
EVENT_CHANGEWEAPON = 16,
|
|
|
|
EVENT_GETSHOTRANGE = 17,
|
|
|
|
EVENT_GETAUTOAIMANGLE = 18,
|
|
|
|
EVENT_GETLOADTILE = 19,
|
|
|
|
EVENT_CHEATGETSTEROIDS = 20,
|
|
|
|
EVENT_CHEATGETHEAT = 21,
|
|
|
|
EVENT_CHEATGETBOOT = 22,
|
|
|
|
EVENT_CHEATGETSHIELD = 23,
|
|
|
|
EVENT_CHEATGETSCUBA = 24,
|
|
|
|
EVENT_CHEATGETHOLODUKE = 25,
|
|
|
|
EVENT_CHEATGETJETPACK = 26,
|
|
|
|
EVENT_CHEATGETFIRSTAID = 27,
|
|
|
|
EVENT_QUICKKICK = 28,
|
|
|
|
EVENT_INVENTORY = 29,
|
|
|
|
EVENT_USENIGHTVISION = 30,
|
|
|
|
EVENT_USESTEROIDS = 31,
|
|
|
|
EVENT_INVENTORYLEFT = 32,
|
|
|
|
EVENT_INVENTORYRIGHT = 33,
|
|
|
|
EVENT_HOLODUKEON = 34,
|
|
|
|
EVENT_HOLODUKEOFF = 35,
|
|
|
|
EVENT_USEMEDKIT = 36,
|
|
|
|
EVENT_USEJETPACK = 37,
|
|
|
|
EVENT_TURNAROUND = 38,
|
|
|
|
EVENT_DISPLAYWEAPON = 39,
|
|
|
|
EVENT_FIREWEAPON = 40,
|
|
|
|
EVENT_SELECTWEAPON = 41,
|
|
|
|
EVENT_MOVEFORWARD = 42,
|
|
|
|
EVENT_MOVEBACKWARD = 43,
|
|
|
|
EVENT_TURNLEFT = 44,
|
|
|
|
EVENT_TURNRIGHT = 45,
|
|
|
|
EVENT_STRAFELEFT = 46,
|
|
|
|
EVENT_STRAFERIGHT = 47,
|
|
|
|
EVENT_WEAPKEY1 = 48,
|
|
|
|
EVENT_WEAPKEY2 = 49,
|
|
|
|
EVENT_WEAPKEY3 = 50,
|
|
|
|
EVENT_WEAPKEY4 = 51,
|
|
|
|
EVENT_WEAPKEY5 = 52,
|
|
|
|
EVENT_WEAPKEY6 = 53,
|
|
|
|
EVENT_WEAPKEY7 = 54,
|
|
|
|
EVENT_WEAPKEY8 = 55,
|
|
|
|
EVENT_WEAPKEY9 = 56,
|
|
|
|
EVENT_WEAPKEY10 = 57,
|
|
|
|
EVENT_DRAWWEAPON = 58,
|
|
|
|
EVENT_DISPLAYCROSSHAIR = 59,
|
|
|
|
EVENT_DISPLAYREST = 60,
|
|
|
|
EVENT_DISPLAYSBAR = 61,
|
|
|
|
EVENT_RESETPLAYER = 62,
|
|
|
|
EVENT_INCURDAMAGE = 63,
|
|
|
|
EVENT_AIMDOWN = 64,
|
|
|
|
EVENT_GAME = 65,
|
|
|
|
EVENT_PREVIOUSWEAPON = 66,
|
|
|
|
EVENT_NEXTWEAPON = 67,
|
|
|
|
EVENT_SWIMUP = 68,
|
|
|
|
EVENT_SWIMDOWN = 69,
|
|
|
|
EVENT_GETMENUTILE = 70,
|
|
|
|
EVENT_SPAWN = 71,
|
|
|
|
EVENT_LOGO = 72,
|
|
|
|
EVENT_EGS = 73,
|
|
|
|
EVENT_DOFIRE = 74,
|
|
|
|
EVENT_PRESSEDFIRE = 75,
|
|
|
|
EVENT_USE = 76,
|
|
|
|
EVENT_PROCESSINPUT = 77,
|
|
|
|
EVENT_FAKEDOMOVETHINGS = 78,
|
|
|
|
EVENT_DISPLAYROOMS = 79,
|
|
|
|
EVENT_KILLIT = 80,
|
|
|
|
EVENT_LOADACTOR = 81,
|
|
|
|
EVENT_DISPLAYBONUSSCREEN = 82,
|
|
|
|
EVENT_DISPLAYMENU = 83,
|
|
|
|
EVENT_DISPLAYMENUREST = 84,
|
|
|
|
EVENT_DISPLAYLOADINGSCREEN = 85,
|
|
|
|
EVENT_ANIMATESPRITES = 86,
|
|
|
|
EVENT_NEWGAME = 87,
|
|
|
|
EVENT_SOUND = 88,
|
|
|
|
EVENT_CHECKTOUCHDAMAGE = 89,
|
|
|
|
EVENT_CHECKFLOORDAMAGE = 90,
|
|
|
|
EVENT_LOADGAME = 91,
|
|
|
|
EVENT_SAVEGAME = 92,
|
|
|
|
EVENT_PREGAME = 93,
|
|
|
|
EVENT_CHANGEMENU = 94,
|
|
|
|
}
|
2012-06-17 19:45:33 +00:00
|
|
|
|
2013-03-24 18:53:28 +00:00
|
|
|
-- NOTE: negated values are not exported to the ffi.C namespace or CON.
|
|
|
|
-- See TWEAK_SFLAG below.
|
|
|
|
SFLAG = {
|
2013-01-02 22:33:37 +00:00
|
|
|
SFLAG_SHADOW = 0x00000001,
|
|
|
|
SFLAG_NVG = 0x00000002,
|
|
|
|
SFLAG_NOSHADE = 0x00000004,
|
2013-03-24 18:53:28 +00:00
|
|
|
SFLAG_PROJECTILE = -0x00000008,
|
|
|
|
SFLAG_DECAL = -0x00000010,
|
2013-01-02 22:33:37 +00:00
|
|
|
SFLAG_BADGUY = 0x00000020,
|
|
|
|
SFLAG_NOPAL = 0x00000040,
|
2013-03-24 18:53:28 +00:00
|
|
|
SFLAG_NOEVENTS = 0x00000080, -- NAME
|
2013-01-02 22:33:37 +00:00
|
|
|
SFLAG_NOLIGHT = 0x00000100,
|
|
|
|
SFLAG_USEACTIVATOR = 0x00000200,
|
2013-03-24 18:53:28 +00:00
|
|
|
SFLAG_NULL = -0x00000400,
|
2013-01-02 22:33:37 +00:00
|
|
|
SFLAG_NOCLIP = 0x00000800,
|
2013-03-24 18:53:28 +00:00
|
|
|
SFLAG_NOFLOORSHADOW = -0x00001000,
|
2013-01-02 22:33:37 +00:00
|
|
|
SFLAG_SMOOTHMOVE = 0x00002000,
|
|
|
|
SFLAG_NOTELEPORT = 0x00004000,
|
2013-03-24 18:53:28 +00:00
|
|
|
SFLAG_BADGUYSTAYPUT = -0x00008000,
|
|
|
|
SFLAG_CACHE = -0x00010000,
|
|
|
|
SFLAG_ROTFIXED = -0x00020000,
|
|
|
|
SFLAG_HARDCODED_BADGUY = -0x00040000,
|
2013-01-02 22:33:37 +00:00
|
|
|
}
|
2012-11-25 13:18:41 +00:00
|
|
|
|
2013-01-02 22:33:37 +00:00
|
|
|
STAT = {
|
|
|
|
STAT_DEFAULT = 0,
|
|
|
|
STAT_ACTOR = 1,
|
|
|
|
STAT_ZOMBIEACTOR = 2,
|
|
|
|
STAT_EFFECTOR = 3,
|
|
|
|
STAT_PROJECTILE = 4,
|
|
|
|
STAT_MISC = 5,
|
|
|
|
STAT_STANDABLE = 6,
|
|
|
|
STAT_LOCATOR = 7,
|
|
|
|
STAT_ACTIVATOR = 8,
|
|
|
|
STAT_TRANSPORT = 9,
|
|
|
|
STAT_PLAYER = 10,
|
|
|
|
STAT_FX = 11,
|
|
|
|
STAT_FALLER = 12,
|
|
|
|
STAT_DUMMYPLAYER = 13,
|
|
|
|
STAT_LIGHT = 14,
|
2013-03-15 16:55:59 +00:00
|
|
|
-- STAT_NETALLOC = 1023, -- MAXSTATUS-1
|
2013-01-02 22:33:37 +00:00
|
|
|
}
|
2012-11-25 13:18:41 +00:00
|
|
|
|
2013-01-02 22:33:37 +00:00
|
|
|
local GAMEFUNC = {
|
|
|
|
GAMEFUNC_MOVE_FORWARD = 0,
|
|
|
|
GAMEFUNC_MOVE_BACKWARD = 1,
|
|
|
|
GAMEFUNC_TURN_LEFT = 2,
|
|
|
|
GAMEFUNC_TURN_RIGHT = 3,
|
|
|
|
GAMEFUNC_STRAFE = 4,
|
|
|
|
GAMEFUNC_FIRE = 5,
|
|
|
|
GAMEFUNC_OPEN = 6,
|
|
|
|
GAMEFUNC_RUN = 7,
|
|
|
|
GAMEFUNC_AUTORUN = 8,
|
|
|
|
GAMEFUNC_JUMP = 9,
|
|
|
|
GAMEFUNC_CROUCH = 10,
|
|
|
|
GAMEFUNC_LOOK_UP = 11,
|
|
|
|
GAMEFUNC_LOOK_DOWN = 12,
|
|
|
|
GAMEFUNC_LOOK_LEFT = 13,
|
|
|
|
GAMEFUNC_LOOK_RIGHT = 14,
|
|
|
|
GAMEFUNC_STRAFE_LEFT = 15,
|
|
|
|
GAMEFUNC_STRAFE_RIGHT = 16,
|
|
|
|
GAMEFUNC_AIM_UP = 17,
|
|
|
|
GAMEFUNC_AIM_DOWN = 18,
|
|
|
|
GAMEFUNC_WEAPON_1 = 19,
|
|
|
|
GAMEFUNC_WEAPON_2 = 20,
|
|
|
|
GAMEFUNC_WEAPON_3 = 21,
|
|
|
|
GAMEFUNC_WEAPON_4 = 22,
|
|
|
|
GAMEFUNC_WEAPON_5 = 23,
|
|
|
|
GAMEFUNC_WEAPON_6 = 24,
|
|
|
|
GAMEFUNC_WEAPON_7 = 25,
|
|
|
|
GAMEFUNC_WEAPON_8 = 26,
|
|
|
|
GAMEFUNC_WEAPON_9 = 27,
|
|
|
|
GAMEFUNC_WEAPON_10 = 28,
|
|
|
|
GAMEFUNC_INVENTORY = 29,
|
|
|
|
GAMEFUNC_INVENTORY_LEFT = 30,
|
|
|
|
GAMEFUNC_INVENTORY_RIGHT = 31,
|
|
|
|
GAMEFUNC_HOLO_DUKE = 32,
|
|
|
|
GAMEFUNC_JETPACK = 33,
|
|
|
|
GAMEFUNC_NIGHTVISION = 34,
|
|
|
|
GAMEFUNC_MEDKIT = 35,
|
|
|
|
GAMEFUNC_TURNAROUND = 36,
|
|
|
|
GAMEFUNC_SENDMESSAGE = 37,
|
|
|
|
GAMEFUNC_MAP = 38,
|
|
|
|
GAMEFUNC_SHRINK_SCREEN = 39,
|
|
|
|
GAMEFUNC_ENLARGE_SCREEN = 40,
|
|
|
|
GAMEFUNC_CENTER_VIEW = 41,
|
|
|
|
GAMEFUNC_HOLSTER_WEAPON = 42,
|
|
|
|
GAMEFUNC_SHOW_OPPONENTS_WEAPON = 43,
|
|
|
|
GAMEFUNC_MAP_FOLLOW_MODE = 44,
|
|
|
|
GAMEFUNC_SEE_COOP_VIEW = 45,
|
|
|
|
GAMEFUNC_MOUSE_AIMING = 46,
|
|
|
|
GAMEFUNC_TOGGLE_CROSSHAIR = 47,
|
|
|
|
GAMEFUNC_STEROIDS = 48,
|
|
|
|
GAMEFUNC_QUICK_KICK = 49,
|
|
|
|
GAMEFUNC_NEXT_WEAPON = 50,
|
|
|
|
GAMEFUNC_PREVIOUS_WEAPON = 51,
|
|
|
|
-- GAMEFUNC_SHOW_CONSOLE = 52,
|
|
|
|
GAMEFUNC_SHOW_DUKEMATCH_SCORES = 53,
|
|
|
|
GAMEFUNC_DPAD_SELECT = 54,
|
|
|
|
GAMEFUNC_DPAD_AIMING = 55,
|
|
|
|
}
|
2012-11-25 13:18:41 +00:00
|
|
|
|
2013-03-24 18:53:28 +00:00
|
|
|
local function shallow_copy(tab)
|
|
|
|
local t = {}
|
|
|
|
for k,v in pairs(tab) do
|
|
|
|
t[k] = v
|
|
|
|
end
|
|
|
|
return t
|
|
|
|
end
|
|
|
|
|
2013-01-02 22:33:37 +00:00
|
|
|
-- KEEPINSYNC with gamedef.c:C_AddDefaultDefinitions() and the respective
|
|
|
|
-- defines. These are exported to the ffi.C namespace and as literal defines
|
|
|
|
-- in lunacon.lua.
|
|
|
|
labels =
|
|
|
|
{
|
|
|
|
STR,
|
|
|
|
PROJ,
|
|
|
|
EVENT,
|
2013-03-24 18:53:28 +00:00
|
|
|
setmetatable(shallow_copy(SFLAG), { __metatable="noffiC" }),
|
2013-01-02 22:33:37 +00:00
|
|
|
STAT,
|
|
|
|
GAMEFUNC,
|
2012-08-06 20:00:23 +00:00
|
|
|
}
|
2012-06-17 19:45:33 +00:00
|
|
|
|
2013-03-24 18:53:28 +00:00
|
|
|
-- TWEAK_SFLAG
|
|
|
|
for name, flag in pairs(SFLAG) do
|
|
|
|
if (flag < 0) then
|
|
|
|
SFLAG[name] = -flag
|
|
|
|
labels[4][name] = nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-01-13 16:40:32 +00:00
|
|
|
-- KEEPINSYNC player.h
|
|
|
|
wdata_members =
|
|
|
|
{
|
|
|
|
-- NOTE: they are lowercased for Lunatic
|
2013-03-18 22:05:26 +00:00
|
|
|
"const int32_t _workslike",
|
2013-01-13 16:40:32 +00:00
|
|
|
"int32_t clip",
|
|
|
|
"int32_t reload",
|
|
|
|
"int32_t firedelay",
|
|
|
|
"int32_t totaltime",
|
|
|
|
"int32_t holddelay",
|
|
|
|
"int32_t flags",
|
2013-03-18 22:05:26 +00:00
|
|
|
"const int32_t _shoots",
|
2013-01-13 16:40:32 +00:00
|
|
|
"int32_t spawntime",
|
2013-03-18 22:05:26 +00:00
|
|
|
"const int32_t _spawn",
|
2013-01-13 16:40:32 +00:00
|
|
|
"int32_t shotsperburst",
|
2013-03-18 22:05:26 +00:00
|
|
|
"const int32_t _initialsound",
|
|
|
|
"const int32_t _firesound",
|
|
|
|
"int32_t sound2time", -- NOTE: this is a time number, not a sound
|
|
|
|
"const int32_t _sound2sound",
|
|
|
|
"const int32_t _reloadsound1",
|
|
|
|
"const int32_t _reloadsound2",
|
|
|
|
"const int32_t _selectsound",
|
2013-01-13 16:40:32 +00:00
|
|
|
"int32_t flashcolor",
|
|
|
|
}
|
2012-04-07 20:10:03 +00:00
|
|
|
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
local SP = function(memb) return "sprite[%s]"..memb end
|
2013-02-03 12:48:06 +00:00
|
|
|
local ATSP = function(memb) return "atsprite[%s]"..memb end
|
2013-01-24 20:03:10 +00:00
|
|
|
local AC = function(memb) return "actor[%s]"..memb end
|
|
|
|
local SX = function(memb) return "spriteext[%s]"..memb end
|
|
|
|
|
|
|
|
-- Generate code to access a signed member as unsigned.
|
|
|
|
local function s2u(label)
|
2013-02-10 16:24:32 +00:00
|
|
|
return "(_bit.band("..label.."+65536,65535))"
|
2013-01-24 20:03:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
local function S2U(label)
|
|
|
|
return { s2u(label), label }
|
|
|
|
end
|
|
|
|
|
|
|
|
local ActorLabels = {
|
|
|
|
x = SP".x",
|
|
|
|
y = SP".y",
|
|
|
|
z = SP".z",
|
|
|
|
cstat = SP".cstat",
|
2013-02-03 12:48:06 +00:00
|
|
|
picnum = { SP".picnum", SP":set_picnum(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
shade = SP".shade",
|
|
|
|
pal = SP".pal",
|
|
|
|
clipdist = SP".clipdist",
|
|
|
|
-- filler = SP".filler",
|
|
|
|
detail = SP".filler", -- NAME
|
|
|
|
xrepeat = SP".xrepeat",
|
|
|
|
yrepeat = SP".yrepeat",
|
|
|
|
xoffset = SP".xoffset",
|
|
|
|
yoffset = SP".yoffset",
|
2013-02-10 16:24:32 +00:00
|
|
|
sectnum = { SP".sectnum", SP".sectnum" }, -- set: for tsprite
|
|
|
|
statnum = { SP".statnum", SP".statnum" }, -- set: for tsprite
|
2013-01-24 20:03:10 +00:00
|
|
|
ang = SP".ang",
|
2013-02-10 16:24:32 +00:00
|
|
|
owner = { SP".owner", SP":_set_owner(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
xvel = SP".xvel",
|
2013-02-10 16:24:32 +00:00
|
|
|
yvel = { SP".yvel", SP":_set_yvel(%%s)" }, -- XXX
|
2013-01-24 20:03:10 +00:00
|
|
|
zvel = SP".zvel",
|
|
|
|
lotag = SP".lotag",
|
|
|
|
hitag = SP".hitag",
|
|
|
|
extra = SP".extra",
|
2013-01-24 20:03:06 +00:00
|
|
|
|
2013-01-24 20:03:10 +00:00
|
|
|
ulotag = S2U(SP".lotag"),
|
|
|
|
uhitag = S2U(SP".hitag"),
|
2013-01-24 20:03:06 +00:00
|
|
|
|
|
|
|
-- ActorExtra labels...
|
2013-01-24 20:03:10 +00:00
|
|
|
htcgg = AC".cgg",
|
2013-02-03 12:48:06 +00:00
|
|
|
htpicnum = { AC".picnum", AC":set_picnum(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
htang = AC".ang",
|
|
|
|
htextra = AC".extra",
|
2013-02-03 12:48:06 +00:00
|
|
|
htowner = { AC".owner", AC":set_owner(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
htmovflag = AC".movflag",
|
|
|
|
httempang = AC".tempang",
|
|
|
|
htactorstayput = AC".actorstayput",
|
2013-02-03 12:48:06 +00:00
|
|
|
htdispicnum = { AC".dispicnum" },
|
2013-02-07 21:01:12 +00:00
|
|
|
-- NOTE: no access for .shootzvel
|
2013-01-24 20:03:10 +00:00
|
|
|
httimetosleep = AC".timetosleep",
|
|
|
|
htfloorz = AC".floorz",
|
|
|
|
htceilingz = AC".ceilingz",
|
|
|
|
htlastvx = AC".lastvx",
|
|
|
|
htlastvy = AC".lastvy",
|
|
|
|
htbposx = AC".bpos.x",
|
|
|
|
htbposy = AC".bpos.y",
|
|
|
|
htbposz = AC".bpos.z",
|
2013-02-01 13:05:00 +00:00
|
|
|
-- Read access differs from write ({ get, set }):
|
|
|
|
htg_t = { AC":get_t_data(%s)", AC":_set_t_data(%s,%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
htflags = AC".flags",
|
2013-01-24 20:03:06 +00:00
|
|
|
|
|
|
|
-- model flags
|
2013-01-24 20:03:10 +00:00
|
|
|
angoff = SX".angoff",
|
|
|
|
pitch = SX".pitch",
|
|
|
|
roll = SX".roll",
|
|
|
|
mdxoff = SX".xoff",
|
|
|
|
mdyoff = SX".yoff",
|
|
|
|
mdzoff = SX".zoff",
|
2013-02-03 12:48:06 +00:00
|
|
|
mdflags = SX".flags",
|
2013-01-24 20:03:10 +00:00
|
|
|
xpanning = SX".xpanning",
|
|
|
|
ypanning = SX".ypanning",
|
2013-01-24 20:03:06 +00:00
|
|
|
|
2013-02-01 13:05:00 +00:00
|
|
|
-- Read access differs from write, write not available:
|
2013-02-11 17:16:58 +00:00
|
|
|
alpha = { "_math.floor(spriteext[%s].alpha*255)", "spriteext[%s].alpha=(%%s)/255" },
|
2013-01-24 20:03:06 +00:00
|
|
|
}
|
|
|
|
|
2013-02-03 12:48:06 +00:00
|
|
|
local function spr2tspr(code)
|
|
|
|
if (code and code:find(SP"", 1, true)==1) then
|
|
|
|
return ATSP(code:sub(#SP"" + 1))
|
|
|
|
end
|
|
|
|
-- else return nothing
|
|
|
|
end
|
|
|
|
|
|
|
|
local TspriteLabels = {}
|
|
|
|
|
|
|
|
for member, code in pairs(ActorLabels) do
|
|
|
|
if (type(code)=="string") then
|
|
|
|
TspriteLabels["tspr"..member] = spr2tspr(code)
|
|
|
|
else
|
2013-02-07 21:01:18 +00:00
|
|
|
TspriteLabels["tspr"..member] = { spr2tspr(code[1]), spr2tspr(code[2]) }
|
2013-02-03 12:48:06 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-10 16:24:32 +00:00
|
|
|
-- Sprites set stat- and sectnum via sprite.change{stat,sect} functions.
|
2013-03-24 18:53:48 +00:00
|
|
|
ActorLabels.sectnum[2] = "sprite.changesect(%s,%%s,true)"
|
|
|
|
ActorLabels.statnum[2] = "sprite.changestat(%s,%%s,true)"
|
2013-02-10 16:24:32 +00:00
|
|
|
|
2013-01-24 20:03:10 +00:00
|
|
|
local PL = function(memb) return "player[%s]"..memb end
|
2013-03-03 16:06:22 +00:00
|
|
|
-- Access to DukePlayer_t's bool members: they must be read as numbers.
|
|
|
|
local PLBOOL = function(memb) return { "("..PL(memb).." and 1 or 0)", PL(memb) } end
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
local PlayerLabels = {
|
|
|
|
posx = PL".pos.x",
|
|
|
|
posy = PL".pos.y",
|
|
|
|
posz = PL".pos.z",
|
|
|
|
oposx = PL".opos.x",
|
|
|
|
oposy = PL".opos.y",
|
|
|
|
oposz = PL".opos.z",
|
|
|
|
posxv = PL".vel.x", -- NAME
|
|
|
|
posyv = PL".vel.y",
|
|
|
|
poszv = PL".vel.z",
|
|
|
|
-- NOTE: no access for .npos
|
|
|
|
bobposx = PL".bobposx",
|
|
|
|
bobposy = PL".bobposy",
|
|
|
|
|
|
|
|
truefz = PL".truefz",
|
|
|
|
truecz = PL".truecz",
|
|
|
|
player_par = PL".player_par",
|
|
|
|
|
|
|
|
randomflamex = PL".randomflamex",
|
|
|
|
exitx = PL".exitx",
|
|
|
|
exity = PL".exity",
|
|
|
|
|
|
|
|
runspeed = PL".runspeed",
|
|
|
|
max_player_health = PL".max_player_health",
|
|
|
|
max_shield_amount = PL".max_shield_amount",
|
|
|
|
|
|
|
|
autostep = PL".autostep",
|
|
|
|
autostep_sbw = PL".autostep_sbw",
|
|
|
|
|
|
|
|
interface_toggle_flag = PL".interface_toggle_flag",
|
|
|
|
|
|
|
|
-- NOTE: *bombControl etc. are accessed by gamevars in CON
|
|
|
|
|
|
|
|
max_actors_killed = PL".max_actors_killed",
|
|
|
|
actors_killed = PL".actors_killed",
|
|
|
|
|
2013-02-01 13:04:52 +00:00
|
|
|
-- NOTE the special case; "%%s" is used to mark settable members
|
|
|
|
-- with METHOD_MEMBER syntax, it's the value to be set.
|
|
|
|
gotweapon = { "("..PL":have_weapon(%s) and 1 or 0)", PL":_gt_weapon(%s,%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
zoom = PL".zoom",
|
|
|
|
|
|
|
|
loogiex = {},
|
|
|
|
loogiey = {},
|
|
|
|
|
|
|
|
sbs = PL".sbs",
|
|
|
|
sound_pitch = PL".sound_pitch",
|
|
|
|
|
|
|
|
ang = PL".ang",
|
|
|
|
oang = PL".oang",
|
|
|
|
angvel = PL".angvel",
|
|
|
|
|
2013-03-03 16:06:22 +00:00
|
|
|
cursectnum = { PL".cursectnum", PL":set_cursectnum(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
look_ang = PL".look_ang",
|
|
|
|
last_extra = PL".last_extra",
|
|
|
|
subweapon = PL".subweapon",
|
|
|
|
|
2013-01-26 17:07:44 +00:00
|
|
|
max_ammo_amount = PL".max_ammo_amount[%s]" ,
|
|
|
|
ammo_amount = PL".ammo_amount[%s]" ,
|
2013-01-24 20:03:10 +00:00
|
|
|
-- NOTE: no direct access for .inv_amount (but see end)
|
|
|
|
|
|
|
|
wackedbyactor = PL".wackedbyactor",
|
|
|
|
pyoff = PL".pyoff",
|
|
|
|
opyoff = PL".opyoff",
|
|
|
|
|
|
|
|
horiz = PL".horiz",
|
|
|
|
horizoff = PL".horizoff",
|
|
|
|
ohoriz = PL".ohoriz",
|
|
|
|
ohorizoff = PL".ohorizoff",
|
|
|
|
|
|
|
|
newowner = { PL".newowner" },
|
|
|
|
|
|
|
|
jumping_counter = PL".jumping_counter",
|
|
|
|
airleft = PL".airleft",
|
|
|
|
|
|
|
|
fta = PL".fta",
|
2013-02-18 16:07:32 +00:00
|
|
|
ftq = { PL".ftq", PL":set_ftq(%%s)" },
|
|
|
|
access_wallnum = { PL".access_wallnum" },
|
|
|
|
access_spritenum = { PL".access_spritenum" },
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
got_access = PL".got_access",
|
|
|
|
weapon_ang = PL".weapon_ang",
|
|
|
|
visibility = PL".visibility",
|
|
|
|
|
|
|
|
somethingonplayer = PL".somethingonplayer",
|
|
|
|
on_crane = PL".on_crane",
|
|
|
|
|
|
|
|
i = { PL".i" },
|
|
|
|
|
|
|
|
one_parallax_sectnum = { PL".one_parallax_sectnum" },
|
|
|
|
|
|
|
|
random_club_frame = PL".random_club_frame",
|
|
|
|
one_eighty_count = PL".one_eighty_count",
|
|
|
|
|
|
|
|
dummyplayersprite = { PL".dummyplayersprite" },
|
|
|
|
extra_extra8 = PL".extra_extra8",
|
|
|
|
|
|
|
|
actorsqu = PL".actorsqu",
|
|
|
|
timebeforeexit = PL".timebeforeexit",
|
|
|
|
customexitsound = { PL".customexitsound" },
|
|
|
|
|
|
|
|
last_pissed_time = PL".last_pissed_time",
|
|
|
|
|
2013-01-26 17:07:44 +00:00
|
|
|
weaprecs = PL".weaprecs[%s]" ,
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
weapon_sway = PL".weapon_sway",
|
|
|
|
crack_time = PL".crack_time",
|
|
|
|
bobcounter = PL".bobcounter",
|
|
|
|
|
|
|
|
-- NOTE: no access for .orotscrnang
|
|
|
|
rotscrnang = PL".rotscrnang",
|
|
|
|
dead_flag = PL".dead_flag",
|
|
|
|
|
|
|
|
holoduke_on = PL".holoduke_on",
|
|
|
|
pycount = PL".pycount",
|
|
|
|
transporter_hold = PL".transporter_hold",
|
|
|
|
|
|
|
|
max_secret_rooms = PL".max_secret_rooms",
|
|
|
|
secret_rooms = PL".secret_rooms",
|
|
|
|
|
|
|
|
frag = PL".frag",
|
|
|
|
fraggedself = PL".fraggedself",
|
|
|
|
quick_kick = PL".quick_kick",
|
|
|
|
last_quick_kick = PL".last_quick_kick",
|
|
|
|
|
|
|
|
return_to_center = PL".return_to_center",
|
2013-03-03 16:06:22 +00:00
|
|
|
reloading = PLBOOL".reloading",
|
2013-02-01 13:04:52 +00:00
|
|
|
weapreccnt = { PL".weapreccnt" },
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
aim_mode = PL".aim_mode",
|
|
|
|
auto_aim = PL".auto_aim",
|
|
|
|
weaponswitch = PL".weaponswitch",
|
|
|
|
movement_lock = PL".movement_lock",
|
|
|
|
team = PL".team",
|
|
|
|
|
|
|
|
tipincs = PL".tipincs",
|
|
|
|
hbomb_hold_delay = PL".hbomb_hold_delay",
|
|
|
|
frag_ps = PL".frag_ps",
|
|
|
|
kickback_pic = PL".kickback_pic",
|
|
|
|
|
|
|
|
gm = PL".gm",
|
2013-03-03 16:06:22 +00:00
|
|
|
on_warping_sector = PLBOOL".on_warping_sector",
|
2013-01-24 20:03:10 +00:00
|
|
|
footprintcount = PL".footprintcount",
|
|
|
|
hurt_delay = PL".hurt_delay",
|
|
|
|
|
2013-03-03 16:06:22 +00:00
|
|
|
hbomb_on = PLBOOL".hbomb_on",
|
|
|
|
jumping_toggle = PLBOOL".jumping_toggle",
|
|
|
|
rapid_fire_hold = PLBOOL".rapid_fire_hold",
|
|
|
|
on_ground = PLBOOL".on_ground",
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
inven_icon = PL".inven_icon",
|
|
|
|
buttonpalette = PL".buttonpalette",
|
2013-03-03 16:06:22 +00:00
|
|
|
over_shoulder_on = PLBOOL".over_shoulder_on",
|
2013-01-24 20:03:10 +00:00
|
|
|
show_empty_weapon = PL".show_empty_weapon",
|
|
|
|
|
2013-03-03 16:06:22 +00:00
|
|
|
jetpack_on = PLBOOL".jetpack_on",
|
|
|
|
spritebridge = PLBOOL".spritebridge",
|
2013-01-24 20:03:10 +00:00
|
|
|
lastrandomspot = PL".lastrandomspot",
|
|
|
|
|
2013-03-03 16:06:22 +00:00
|
|
|
scuba_on = PLBOOL".scuba_on",
|
2013-01-24 20:03:10 +00:00
|
|
|
footprintpal = PL".footprintpal",
|
2013-03-03 16:06:22 +00:00
|
|
|
heat_on = PLBOOL".heat_on",
|
2013-01-24 20:03:10 +00:00
|
|
|
invdisptime = PL".invdisptime",
|
2013-03-03 16:06:22 +00:00
|
|
|
holster_weapon = PLBOOL".holster_weapon",
|
2013-01-24 20:03:10 +00:00
|
|
|
falling_counter = PL".falling_counter",
|
|
|
|
footprintshade = PL".footprintshade",
|
|
|
|
|
|
|
|
refresh_inventory = PL".refresh_inventory",
|
|
|
|
last_full_weapon = PL".last_full_weapon",
|
|
|
|
|
|
|
|
walking_snd_toggle = PL".walking_snd_toggle",
|
|
|
|
palookup = PL".palookup",
|
|
|
|
hard_landing = PL".hard_landing",
|
|
|
|
fist_incs = PL".fist_incs",
|
|
|
|
|
2013-03-03 16:06:22 +00:00
|
|
|
toggle_key_flag = PLBOOL".toggle_key_flag",
|
2013-01-24 20:03:10 +00:00
|
|
|
knuckle_incs = PL".knuckle_incs",
|
|
|
|
knee_incs = PL".knee_incs",
|
|
|
|
access_incs = PL".access_incs",
|
|
|
|
|
|
|
|
numloogs = PL".numloogs",
|
|
|
|
loogcnt = PL".loogcnt",
|
|
|
|
scream_voice = PL".scream_voice",
|
|
|
|
|
|
|
|
last_weapon = PL".last_weapon",
|
|
|
|
cheat_phase = PL".cheat_phase",
|
|
|
|
weapon_pos = PL".weapon_pos",
|
|
|
|
wantweaponfire = PL".wantweaponfire",
|
|
|
|
|
2013-02-01 13:04:52 +00:00
|
|
|
curr_weapon = { PL".curr_weapon", PL":set_curr_weapon(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
palette = PL".palette",
|
|
|
|
|
|
|
|
-- NOTE the special case:
|
2013-02-10 16:24:32 +00:00
|
|
|
pals = PL"._pals.col[%s]",
|
2013-02-01 13:04:52 +00:00
|
|
|
pals_time = PL"._pals.f",
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
name = {},
|
|
|
|
|
|
|
|
-- Access to .inv_amount
|
2013-01-26 17:07:44 +00:00
|
|
|
steroids_amount = PL".inv_amount[0]",
|
|
|
|
shield_amount = PL".inv_amount[1]",
|
|
|
|
scuba_amount = PL".inv_amount[2]",
|
|
|
|
holoduke_amount = PL".inv_amount[3]",
|
|
|
|
jetpack_amount = PL".inv_amount[4]",
|
2013-01-24 20:03:10 +00:00
|
|
|
-- 5: dummy
|
|
|
|
-- 6: no "access_amount"
|
2013-01-26 17:07:44 +00:00
|
|
|
heat_amount = PL".inv_amount[7]",
|
2013-01-24 20:03:10 +00:00
|
|
|
-- 8: dummy
|
2013-01-26 17:07:44 +00:00
|
|
|
firstaid_amount = PL".inv_amount[9]",
|
|
|
|
boot_amount = PL".inv_amount[10]",
|
2013-01-24 20:03:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
local SEC = function(memb) return "sector[%s]"..memb end
|
|
|
|
local SECRO = function(memb) return { "sector[%s]"..memb } end
|
|
|
|
|
|
|
|
local SectorLabels = {
|
|
|
|
wallptr = SECRO".wallptr",
|
|
|
|
wallnum = SECRO".wallnum",
|
|
|
|
|
|
|
|
ceilingz = SEC".ceilingz",
|
|
|
|
floorz = SEC".floorz",
|
|
|
|
|
|
|
|
ceilingstat = SEC".ceilingstat",
|
|
|
|
floorstat = SEC".floorstat",
|
|
|
|
|
|
|
|
-- CEILING
|
2013-02-01 13:05:00 +00:00
|
|
|
ceilingpicnum = { SEC".ceilingpicnum", SEC":set_ceilingpicnum(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
ceilingslope = SEC".ceilingheinum", -- NAME
|
|
|
|
ceilingshade = SEC".ceilingshade",
|
|
|
|
|
|
|
|
ceilingpal = SEC".ceilingpal",
|
|
|
|
ceilingxpanning = SEC".ceilingxpanning",
|
|
|
|
ceilingypanning = SEC".ceilingypanning",
|
|
|
|
|
|
|
|
-- FLOOR
|
2013-02-01 13:05:00 +00:00
|
|
|
floorpicnum = { SEC".floorpicnum", SEC":set_floorpicnum(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
|
|
|
|
floorslope = SEC".floorheinum", -- NAME
|
|
|
|
floorshade = SEC".floorshade",
|
|
|
|
|
|
|
|
floorpal = SEC".floorpal",
|
|
|
|
floorxpanning = SEC".floorxpanning",
|
|
|
|
floorypanning = SEC".floorypanning",
|
|
|
|
|
|
|
|
visibility = SEC".visibility",
|
|
|
|
filler = SEC".filler",
|
|
|
|
alignto = SEC".filler", -- NAME
|
|
|
|
|
|
|
|
lotag = SEC".lotag",
|
|
|
|
hitag = SEC".hitag",
|
|
|
|
extra = SEC".extra",
|
|
|
|
|
|
|
|
ceilingbunch = {},
|
|
|
|
floorbunch = {},
|
|
|
|
|
|
|
|
ulotag = S2U(SEC".lotag"),
|
|
|
|
uhitag = S2U(SEC".hitag"),
|
|
|
|
}
|
|
|
|
|
|
|
|
local WAL = function(memb) return "wall[%s]"..memb end
|
|
|
|
local WALRO = function(memb) return { "wall[%s]"..memb } end
|
|
|
|
|
|
|
|
local WallLabels = {
|
|
|
|
x = WAL".x",
|
|
|
|
y = WAL".y",
|
|
|
|
point2 = WALRO".point2",
|
2013-02-01 13:05:00 +00:00
|
|
|
nextwall = { WAL".nextwall", WAL":_set_nextwall(%%s)" },
|
|
|
|
nextsector = { WAL".nextsector", WAL":_set_nextsector(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
cstat = WAL".cstat",
|
2013-02-01 13:05:00 +00:00
|
|
|
picnum = { WAL".picnum", WAL":set_picnum(%%s)" },
|
|
|
|
overpicnum = { WAL".overpicnum", WAL":set_overpicnum(%%s)" },
|
2013-01-24 20:03:10 +00:00
|
|
|
shade = WAL".shade",
|
|
|
|
pal = WAL".pal",
|
|
|
|
xrepeat = WAL".xrepeat",
|
|
|
|
yrepeat = WAL".yrepeat",
|
|
|
|
xpanning = WAL".xpanning",
|
|
|
|
ypanning = WAL".ypanning",
|
|
|
|
lotag = WAL".lotag",
|
|
|
|
hitag = WAL".hitag",
|
|
|
|
extra = WAL".extra",
|
|
|
|
|
|
|
|
ulotag = S2U(WAL".lotag"),
|
|
|
|
uhitag = S2U(WAL".hitag"),
|
|
|
|
}
|
|
|
|
|
|
|
|
StructAccessCode =
|
|
|
|
{
|
|
|
|
sector = SectorLabels,
|
|
|
|
wall = WallLabels,
|
|
|
|
sprite = ActorLabels,
|
|
|
|
player = PlayerLabels,
|
|
|
|
}
|
2013-01-24 20:03:06 +00:00
|
|
|
|
2013-02-07 21:01:03 +00:00
|
|
|
local PROJ = function(memb) return "projectile[%s]"..memb end
|
2013-02-07 21:01:18 +00:00
|
|
|
local THISPROJ = function(memb) return "actor[%s].proj"..memb end
|
2013-02-07 21:01:03 +00:00
|
|
|
|
|
|
|
local ProjectileLabels = {
|
2013-02-07 21:01:12 +00:00
|
|
|
workslike = PROJ".workslike",
|
|
|
|
cstat = PROJ".cstat",
|
|
|
|
hitradius = PROJ".hitradius",
|
|
|
|
range = PROJ".range",
|
|
|
|
flashcolor = PROJ".flashcolor",
|
2013-02-10 16:23:59 +00:00
|
|
|
spawns = { PROJ".spawns", PROJ":set_spawns(%%s)" },
|
2013-02-07 21:01:12 +00:00
|
|
|
sound = PROJ".sound",
|
|
|
|
isound = PROJ".isound",
|
|
|
|
vel = PROJ".vel",
|
2013-02-10 16:23:59 +00:00
|
|
|
decal = { PROJ".decal", PROJ":set_decal(%%s)" },
|
|
|
|
trail = { PROJ".trail", PROJ":set_trail(%%s)" },
|
2013-02-07 21:01:12 +00:00
|
|
|
tnum = PROJ".tnum",
|
|
|
|
drop = PROJ".drop",
|
|
|
|
offset = PROJ".offset",
|
|
|
|
bounces = PROJ".bounces",
|
|
|
|
bsound = PROJ".bsound",
|
|
|
|
toffset = PROJ".toffset",
|
|
|
|
extra = PROJ".extra",
|
|
|
|
extra_rand = PROJ".extra_rand",
|
|
|
|
sxrepeat = PROJ".sxrepeat",
|
|
|
|
syrepeat = PROJ".syrepeat",
|
|
|
|
txrepeat = PROJ".txrepeat",
|
|
|
|
tyrepeat = PROJ".tyrepeat",
|
|
|
|
shade = PROJ".shade",
|
|
|
|
xrepeat = PROJ".xrepeat",
|
|
|
|
yrepeat = PROJ".yrepeat",
|
|
|
|
pal = PROJ".pal",
|
|
|
|
velmult = PROJ".movecnt", -- NAME
|
|
|
|
clipdist = PROJ".clipdist",
|
2013-02-07 21:01:03 +00:00
|
|
|
}
|
|
|
|
|
2013-02-07 21:01:18 +00:00
|
|
|
-- XXX: kind of CODEDUP form above
|
|
|
|
local function proj2thisproj(code)
|
|
|
|
if (code and code:find(PROJ"", 1, true)==1) then
|
|
|
|
return THISPROJ(code:sub(#PROJ"" + 1))
|
|
|
|
end
|
|
|
|
-- else return nothing
|
|
|
|
end
|
|
|
|
|
|
|
|
local SpriteProjectileLabels = {}
|
|
|
|
|
|
|
|
for member, code in pairs(ProjectileLabels) do
|
|
|
|
if (type(code)=="string") then
|
|
|
|
SpriteProjectileLabels[member] = proj2thisproj(code)
|
|
|
|
else
|
|
|
|
SpriteProjectileLabels[member] = { proj2thisproj(code[1]), proj2thisproj(code[2]) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-02-10 16:24:20 +00:00
|
|
|
local UD = function(memb) return "gv._ud"..memb end
|
|
|
|
local UDRO = function(memb) return { UD(memb) } end
|
|
|
|
|
|
|
|
-- NOTE: Only members that actually encountered in existing mods are added here.
|
|
|
|
local UserdefLabels = {
|
|
|
|
althud = UD".althud",
|
|
|
|
auto_run = UDRO".auto_run",
|
|
|
|
camerasprite = UDRO".camerasprite",
|
|
|
|
cashman = UDRO".cashman",
|
|
|
|
clipping = UD".noclip", -- NAME
|
|
|
|
const_visibility = UD".const_visibility",
|
|
|
|
crosshair = UD".crosshair",
|
|
|
|
crosshairscale = UDRO".crosshairscale",
|
|
|
|
detail = { "1" },
|
|
|
|
display_bonus_screen = UD".display_bonus_screen",
|
|
|
|
drawweapon = UDRO".drawweapon",
|
|
|
|
ffire = UDRO".ffire",
|
|
|
|
fta_on = UD".fta_on",
|
|
|
|
god = UDRO".god",
|
2013-03-17 18:11:47 +00:00
|
|
|
idplayers = UDRO".idplayers",
|
2013-02-10 16:24:20 +00:00
|
|
|
lockout = UDRO".lockout",
|
|
|
|
pause_on = UDRO".pause_on",
|
|
|
|
player_skill = UD".player_skill",
|
|
|
|
m_volume_number = UDRO".m_volume_number",
|
|
|
|
mouseflip = UDRO".mouseflip",
|
|
|
|
multimode = { "1" },
|
|
|
|
overhead_on = UD".overhead_on",
|
|
|
|
show_level_text = UD".show_level_text",
|
|
|
|
screen_size = { UD".screen_size", UD":set_screen_size(%%s)" },
|
|
|
|
screen_tilting = UD".screen_tilting",
|
|
|
|
showallmap = UDRO".showallmap",
|
|
|
|
showweapons = UDRO".showweapons",
|
2013-03-17 18:11:27 +00:00
|
|
|
statusbarscale = UDRO".statusbarscale",
|
2013-02-10 16:24:20 +00:00
|
|
|
volume_number = { UD".volume_number", UD":set_volume_number(%%s)" },
|
2013-03-17 18:11:27 +00:00
|
|
|
weaponscale = UDRO".weaponscale",
|
2013-02-10 16:24:20 +00:00
|
|
|
weaponswitch = UD".weaponswitch",
|
|
|
|
}
|
|
|
|
|
2013-02-10 16:24:44 +00:00
|
|
|
local INP = function(memb) return PL"._input"..memb end
|
|
|
|
|
|
|
|
local InputLabels = {
|
|
|
|
avel = INP".avel",
|
|
|
|
horz = INP".horz",
|
|
|
|
fvel = INP".fvel",
|
|
|
|
svel = INP".svel",
|
|
|
|
bits = INP".bits",
|
|
|
|
extbits = INP".extbits",
|
|
|
|
}
|
|
|
|
|
2013-02-03 12:48:06 +00:00
|
|
|
-- These structs cannot be accessed by inline array exprs in CON:
|
|
|
|
StructAccessCode2 =
|
|
|
|
{
|
|
|
|
tspr = TspriteLabels,
|
2013-02-07 21:01:18 +00:00
|
|
|
projectile = ProjectileLabels,
|
|
|
|
thisprojectile = SpriteProjectileLabels,
|
2013-02-10 16:24:20 +00:00
|
|
|
userdef = UserdefLabels,
|
2013-02-10 16:24:44 +00:00
|
|
|
input = InputLabels,
|
2013-02-03 12:48:06 +00:00
|
|
|
}
|
|
|
|
|
2012-04-22 19:10:46 +00:00
|
|
|
-- NOTE: These MUST be in reverse lexicographical order!
|
|
|
|
-- Per CON syntax, valid identifiers names are disjunct from keywords,
|
|
|
|
-- so that a rule like
|
|
|
|
-- t_identifier = -con_keyword * (sp1 + "[") * t_identifier_all
|
|
|
|
-- (from the final grammar in lunacon.lua) must match the longest
|
|
|
|
-- possible keyword name, else the negation might wrongly not fail.
|
|
|
|
|
2012-06-17 19:45:33 +00:00
|
|
|
keyword =
|
2012-04-07 20:10:03 +00:00
|
|
|
|
|
|
|
lpeg.P(false) +
|
|
|
|
"}" +
|
2012-04-22 19:10:46 +00:00
|
|
|
"{" +
|
2012-04-07 20:10:03 +00:00
|
|
|
"zshootvar" +
|
2012-04-22 19:10:46 +00:00
|
|
|
"zshoot" +
|
|
|
|
"xorvarvar" +
|
|
|
|
"xorvar" +
|
|
|
|
"writearraytofile" +
|
|
|
|
"whilevarvarn" +
|
|
|
|
"whilevarn" +
|
|
|
|
"wackplayer" +
|
|
|
|
"userquote" +
|
|
|
|
"useractor" +
|
|
|
|
"updatesectorz" +
|
|
|
|
"updatesector" +
|
|
|
|
"tossweapon" +
|
|
|
|
"tip" +
|
|
|
|
"time" +
|
|
|
|
"switch" +
|
|
|
|
"subvarvar" +
|
|
|
|
"subvar" +
|
|
|
|
"strength" +
|
|
|
|
"stopsoundvar" +
|
|
|
|
"stopsound" +
|
|
|
|
"stopallsounds" +
|
|
|
|
"stopactorsound" +
|
|
|
|
"state" +
|
|
|
|
"starttrackvar" +
|
|
|
|
"starttrack" +
|
|
|
|
"startlevel" +
|
|
|
|
"ssp" +
|
|
|
|
"sqrt" +
|
|
|
|
"spriteshadow" +
|
|
|
|
"spritepal" +
|
|
|
|
"spritenvg" +
|
|
|
|
"spritenoshade" +
|
|
|
|
"spritenopal" +
|
|
|
|
"spriteflags" +
|
|
|
|
"spgetlotag" +
|
|
|
|
"spgethitag" +
|
|
|
|
"spawn" +
|
|
|
|
"soundvar" +
|
|
|
|
"soundoncevar" +
|
|
|
|
"soundonce" +
|
|
|
|
"sound" +
|
|
|
|
"smaxammo" +
|
|
|
|
"sleeptime" +
|
|
|
|
"sizeto" +
|
|
|
|
"sizeat" +
|
|
|
|
"sin" +
|
|
|
|
"showviewunbiased" +
|
|
|
|
"showview" +
|
|
|
|
"shootvar" +
|
|
|
|
"shoot" +
|
|
|
|
"shiftvarr" +
|
|
|
|
"shiftvarl" +
|
|
|
|
"setwall" +
|
|
|
|
"setvarvar" +
|
|
|
|
"setvar" +
|
|
|
|
"setuserdef" +
|
|
|
|
"settspr" +
|
|
|
|
"setthisprojectile" +
|
|
|
|
"setsprite" +
|
|
|
|
"setsector" +
|
|
|
|
"setprojectile" +
|
|
|
|
"setplayervar" +
|
|
|
|
"setplayerangle" +
|
|
|
|
"setplayer" +
|
|
|
|
"setinput" +
|
|
|
|
"setgamepalette" +
|
|
|
|
"setgamename" +
|
|
|
|
"setdefname" +
|
|
|
|
"setcfgname" +
|
|
|
|
"setaspect" +
|
|
|
|
"setarray" +
|
|
|
|
"setactorvar" +
|
|
|
|
"setactorsoundpitch" +
|
|
|
|
"setactorangle" +
|
|
|
|
"setactor" +
|
|
|
|
"sectsetinterpolation" +
|
|
|
|
"sectorofwall" +
|
|
|
|
"sectgetlotag" +
|
|
|
|
"sectgethitag" +
|
|
|
|
"sectclearinterpolation" +
|
|
|
|
"scriptsize" +
|
|
|
|
"savenn" +
|
|
|
|
"savemapstate" +
|
|
|
|
"savegamevar" +
|
|
|
|
"save" +
|
|
|
|
"rotatesprite16" +
|
|
|
|
"rotatesprite" +
|
|
|
|
"rotatepoint" +
|
|
|
|
"return" +
|
|
|
|
"respawnhitag" +
|
|
|
|
"resizearray" +
|
|
|
|
"resetplayer" +
|
|
|
|
"resetcount" +
|
|
|
|
"resetactioncount" +
|
|
|
|
"redefinequote" +
|
|
|
|
"readgamevar" +
|
|
|
|
"readarrayfromfile" +
|
|
|
|
"rayintersect" +
|
|
|
|
"randvarvar" +
|
|
|
|
"randvar" +
|
|
|
|
"quote" +
|
|
|
|
"quake" +
|
|
|
|
"qsubstr" +
|
|
|
|
"qstrncat" +
|
|
|
|
"qstrlen" +
|
|
|
|
"qstrcpy" +
|
|
|
|
"qstrcat" +
|
|
|
|
"qsprintf" +
|
|
|
|
"qspawnvar" +
|
|
|
|
"qspawn" +
|
|
|
|
"qgetsysstr" +
|
|
|
|
"pstomp" +
|
|
|
|
"prevspritestat" +
|
|
|
|
"prevspritesect" +
|
|
|
|
"precache" +
|
|
|
|
"pkick" +
|
|
|
|
"paper" +
|
|
|
|
"palfrom" +
|
|
|
|
"orvarvar" +
|
|
|
|
"orvar" +
|
|
|
|
"operatesectors" +
|
|
|
|
"operaterespawns" +
|
|
|
|
"operatemasterswitches" +
|
|
|
|
"operateactivators" +
|
|
|
|
"operate" +
|
|
|
|
"onevent" +
|
|
|
|
"nullop" +
|
|
|
|
"nextspritestat" +
|
|
|
|
"nextspritesect" +
|
|
|
|
"neartag" +
|
|
|
|
"myosx" +
|
|
|
|
"myospalx" +
|
|
|
|
"myospal" +
|
|
|
|
"myos" +
|
|
|
|
"music" +
|
|
|
|
"mulvarvar" +
|
|
|
|
"mulvar" +
|
|
|
|
"mulscale" +
|
|
|
|
"movesprite" +
|
|
|
|
"move" +
|
|
|
|
"money" +
|
|
|
|
"modvarvar" +
|
|
|
|
"modvar" +
|
|
|
|
"minitext" +
|
|
|
|
"mikesnd" +
|
|
|
|
"mail" +
|
|
|
|
"lotsofglass" +
|
|
|
|
"lockplayer" +
|
|
|
|
"loadmapstate" +
|
|
|
|
"lineintersect" +
|
|
|
|
"ldist" +
|
|
|
|
"killit" +
|
|
|
|
"jump" +
|
|
|
|
"insertspriteq" +
|
|
|
|
"inittimer" +
|
|
|
|
"includedefault" +
|
|
|
|
"include" +
|
|
|
|
"ifwasweapon" +
|
|
|
|
"ifvarxor" +
|
|
|
|
"ifvarvarxor" +
|
|
|
|
"ifvarvaror" +
|
|
|
|
"ifvarvarn" +
|
|
|
|
"ifvarvarl" +
|
|
|
|
"ifvarvarg" +
|
|
|
|
"ifvarvareither" +
|
|
|
|
"ifvarvare" +
|
|
|
|
"ifvarvarand" +
|
|
|
|
"ifvaror" +
|
|
|
|
"ifvarn" +
|
|
|
|
"ifvarl" +
|
|
|
|
"ifvarg" +
|
|
|
|
"ifvareither" +
|
|
|
|
"ifvare" +
|
|
|
|
"ifvarand" +
|
|
|
|
"ifstrength" +
|
|
|
|
"ifsquished" +
|
|
|
|
"ifspritepal" +
|
|
|
|
"ifspawnedby" +
|
|
|
|
"ifsound" +
|
|
|
|
"ifserver" +
|
|
|
|
"ifrnd" +
|
|
|
|
"ifrespawn" +
|
|
|
|
"ifpinventory" +
|
|
|
|
"ifphealthl" +
|
|
|
|
"ifpdistl" +
|
|
|
|
"ifpdistg" +
|
|
|
|
"ifp" +
|
|
|
|
"ifoutside" +
|
|
|
|
"ifonwater" +
|
|
|
|
"ifnotmoving" +
|
|
|
|
"ifnosounds" +
|
|
|
|
"ifmultiplayer" +
|
|
|
|
"ifmove" +
|
|
|
|
"ifinwater" +
|
|
|
|
"ifinspace" +
|
|
|
|
"ifinouterspace" +
|
|
|
|
"ifhitweapon" +
|
|
|
|
"ifhitspace" +
|
|
|
|
"ifgotweaponce" +
|
|
|
|
"ifgapzl" +
|
|
|
|
"iffloordistl" +
|
|
|
|
"ifdead" +
|
|
|
|
"ifcount" +
|
|
|
|
"ifclient" +
|
|
|
|
"ifceilingdistl" +
|
|
|
|
"ifcanshoottarget" +
|
|
|
|
"ifcanseetarget" +
|
|
|
|
"ifcansee" +
|
|
|
|
"ifbulletnear" +
|
|
|
|
"ifawayfromwall" +
|
|
|
|
"ifangdiffl" +
|
|
|
|
"ifai" +
|
|
|
|
"ifactorsound" +
|
|
|
|
"ifactornotstayput" +
|
|
|
|
"ifactor" +
|
|
|
|
"ifactioncount" +
|
|
|
|
"ifaction" +
|
|
|
|
"hitscan" +
|
|
|
|
"hitradiusvar" +
|
|
|
|
"hitradius" +
|
|
|
|
"headspritestat" +
|
|
|
|
"headspritesect" +
|
|
|
|
"guts" +
|
|
|
|
"guniqhudid" +
|
|
|
|
"gmaxammo" +
|
|
|
|
"globalsoundvar" +
|
|
|
|
"globalsound" +
|
|
|
|
"getzrange" +
|
|
|
|
"getwall" +
|
|
|
|
"getuserdef" +
|
|
|
|
"gettspr" +
|
|
|
|
"gettimedate" +
|
|
|
|
"getticks" +
|
|
|
|
"getthisprojectile" +
|
|
|
|
"gettexturefloor" +
|
|
|
|
"gettextureceiling" +
|
|
|
|
"getsector" +
|
|
|
|
"getprojectile" +
|
|
|
|
"getpname" +
|
|
|
|
"getplayervar" +
|
|
|
|
"getplayerangle" +
|
|
|
|
"getplayer" +
|
|
|
|
"getlastpal" +
|
|
|
|
"getkeyname" +
|
|
|
|
"getinput" +
|
|
|
|
"getincangle" +
|
|
|
|
"getflorzofslope" +
|
|
|
|
"getcurraddress" +
|
|
|
|
"getceilzofslope" +
|
|
|
|
"getarraysize" +
|
|
|
|
"getangletotarget" +
|
|
|
|
"getangle" +
|
|
|
|
"getactorvar" +
|
|
|
|
"getactorangle" +
|
|
|
|
"getactor" +
|
|
|
|
"gamevar" +
|
|
|
|
"gametextz" +
|
|
|
|
"gametext" +
|
|
|
|
"gamestartup" +
|
|
|
|
"gamearray" +
|
|
|
|
"flash" +
|
|
|
|
"findplayer" +
|
|
|
|
"findotherplayer" +
|
|
|
|
"findnearspritezvar" +
|
|
|
|
"findnearspritez" +
|
|
|
|
"findnearspritevar" +
|
|
|
|
"findnearsprite3dvar" +
|
|
|
|
"findnearsprite3d" +
|
|
|
|
"findnearsprite" +
|
|
|
|
"findnearactorzvar" +
|
|
|
|
"findnearactorz" +
|
|
|
|
"findnearactorvar" +
|
|
|
|
"findnearactor3dvar" +
|
|
|
|
"findnearactor3d" +
|
|
|
|
"findnearactor" +
|
|
|
|
"fall" +
|
|
|
|
"ezshootvar" +
|
|
|
|
"ezshoot" +
|
|
|
|
"eventloadactor" +
|
|
|
|
"espawnvar" +
|
|
|
|
"espawn" +
|
|
|
|
"eshootvar" +
|
|
|
|
"eshoot" +
|
|
|
|
"eqspawnvar" +
|
|
|
|
"eqspawn" +
|
|
|
|
"enhanced" +
|
|
|
|
"endswitch" +
|
|
|
|
"ends" +
|
|
|
|
"endofgame" +
|
|
|
|
"endevent" +
|
|
|
|
"enda" +
|
|
|
|
"else" +
|
|
|
|
"echo" +
|
|
|
|
"dynamicremap" +
|
|
|
|
"dragpoint" +
|
|
|
|
"divvarvar" +
|
|
|
|
"divvar" +
|
|
|
|
"dist" +
|
|
|
|
"displayrandvarvar" +
|
|
|
|
"displayrandvar" +
|
|
|
|
"displayrand" +
|
|
|
|
"digitalnumberz" +
|
|
|
|
"digitalnumber" +
|
|
|
|
"definevolumename" +
|
|
|
|
"definesound" +
|
|
|
|
"defineskillname" +
|
|
|
|
"definequote" +
|
|
|
|
"defineprojectile" +
|
|
|
|
"definelevelname" +
|
|
|
|
"definegametype" +
|
|
|
|
"definegamefuncname" +
|
|
|
|
"definecheat" +
|
|
|
|
"define" +
|
|
|
|
"default" +
|
|
|
|
"debug" +
|
|
|
|
"debris" +
|
|
|
|
"cstator" +
|
|
|
|
"cstat" +
|
|
|
|
"count" +
|
|
|
|
"cos" +
|
|
|
|
"copy" +
|
|
|
|
"cmenu" +
|
|
|
|
"clipmovenoslide" +
|
|
|
|
"clipmove" +
|
|
|
|
"clipdist" +
|
|
|
|
"clearmapstate" +
|
|
|
|
"checkavailweapon" +
|
|
|
|
"checkavailinven" +
|
|
|
|
"checkactivatormotion" +
|
|
|
|
"cheatkeys" +
|
|
|
|
"changespritestat" +
|
|
|
|
"changespritesect" +
|
|
|
|
"case" +
|
|
|
|
"canseespr" +
|
|
|
|
"cansee" +
|
|
|
|
"calchypotenuse" +
|
|
|
|
"cactor" +
|
|
|
|
"break" +
|
|
|
|
"betaname" +
|
|
|
|
"angoffvar" +
|
|
|
|
"angoff" +
|
|
|
|
"andvarvar" +
|
|
|
|
"andvar" +
|
|
|
|
"ai" +
|
|
|
|
"addweaponvar" +
|
|
|
|
"addweapon" +
|
|
|
|
"addvarvar" +
|
|
|
|
"addvar" +
|
|
|
|
"addstrength" +
|
|
|
|
"addphealth" +
|
|
|
|
"addlogvar" +
|
|
|
|
"addlog" +
|
|
|
|
"addkills" +
|
|
|
|
"addinventory" +
|
|
|
|
"addammo" +
|
|
|
|
"actor" +
|
|
|
|
"activatecheat" +
|
|
|
|
"activatebysector" +
|
|
|
|
"action" +
|
2012-04-07 20:10:03 +00:00
|
|
|
lpeg.P(false)
|