- added the remaining CON features from EDuke 2.x

Not everything will do something, though. This was some incredibly careless code operating without a safety net allowing uncontrolled write access to the map structure.
Most of the critical fields have been made read-only, which has been the only mode of access in the mods I checked.

Note that this does not enable scripting of the weapon sprite drawer, only the gameplay related features were done.
This commit is contained in:
Christoph Oelckers 2020-09-17 22:36:09 +02:00
parent e1ee9bc83c
commit 8fa5d3d9d2
14 changed files with 4135 additions and 35 deletions

View file

@ -59,7 +59,7 @@ const char *GameInterface::CheckCheatMode()
static const char *cheatGod(int myconnectindex, int state)
{
if (state == -1) state = 1 - ud.god;
if (state == -1) state = !ud.god;
ud.god = state;
sprite[ps[myconnectindex].i].extra = max_player_health;

View file

@ -1,3 +1,4 @@
// original index for reference. Raze never uses literal indices anywhere and should not care about the actual numbers
cmd(definelevelname) // 0
cmd(actor) // 1
cmd(addammo) // 2
@ -171,6 +172,76 @@ cmd(motoloopsnd) // 144
cmd(ifsizedown) // 145
cmd(rndmove) // 146
// EDuke 2.x additions
cmd(spgetlotag) // 127
cmd(spgethitag) // 128
cmd(sectgetlotag) // 129
cmd(sectgethitag) // 130
cmd(ifsound) // 131
cmd(gettexturefloor) // 132
cmd(gettextureceiling) // 133
cmd(gettexturewall) // 134
cmd(starttrack) // 135
cmd(randvar) // 136
cmd(enhanced) // 137
cmd(getangletotarget) // 138
cmd(getactorangle) // 139
cmd(setactorangle) // 140
cmd(mulvar) // 141
cmd(mulvarvar) // 142
cmd(divvar) // 143
cmd(divvarvar) // 144
cmd(modvar) // 145
cmd(modvarvar) // 146
cmd(andvar) // 147
cmd(andvarvar) // 148
cmd(orvar) // 149
cmd(orvarvar) // 150
cmd(getplayerangle) // 151
cmd(setplayerangle) // 152
cmd(lockplayer) // 153
cmd(setsector) // 154
cmd(getsector) // 155
cmd(setactor) // 156
cmd(getactor) // 157
cmd(setwall) // 158
cmd(getwall) // 159
cmd(findnearactor) // 160
cmd(findnearactorvar) // 161
cmd(setactorvar) // 162
cmd(getactorvar) // 163
cmd(espawn) // 164
cmd(getplayer) // 165
cmd(setplayer) // 166
cmd(sqrt) // 167
cmd(eventloadactor) // 168
cmd(espawnvar) // 169
cmd(getuserdef) // 170
cmd(setuserdef) // 171
cmd(subvarvar) // 172
cmd(subvar) // 173
cmd(ifvarn) // 174
cmd(ifvarvarn) // 175
cmd(ifvarand) // 176
cmd(ifvarvarand) // 177
cmd(myos) // 178
cmd(myospal) // 179
cmd(switch) // 180
cmd(case) // 181
cmd(default) // 182
cmd(endswitch) // 183
cmd(displayrand) // 184
cmd(sin) // 185
cmd(xorvarvar) // 186
cmd(xorvar) // 187
cmd(randvarvar) // 188
cmd(myosx) // 189
cmd(myospalx) // 190
cmd(gmaxammo) // 191
cmd(smaxammo) // 192
cmd(mapvoxel) // 193
cmd(startlevel) // 194
// RR Deer Huntin'. These are merely here for reference because the game is not supported.
// cmd(iffindnewspot)
// cmd(ifpupwind)

View file

@ -0,0 +1,294 @@
enum
{
PLAYER_ZOOM = 1,
PLAYER_EXITX = 2,
PLAYER_EXITY = 3,
PLAYER_LOOGIEX = 4,
PLAYER_LOOGIEY = 5,
PLAYER_NUMLOOGS = 6,
PLAYER_LOOGCNT = 7,
PLAYER_POSX = 8,
PLAYER_POSY = 9,
PLAYER_POSZ = 10,
PLAYER_HORIZ = 11,
PLAYER_OHORIZ = 12,
PLAYER_OHORIZOFF = 13,
PLAYER_INVDISPTIME = 14,
PLAYER_BOBPOSX = 15,
PLAYER_BOBPOSY = 16,
PLAYER_OPOSX = 17,
PLAYER_OPOSY = 18,
PLAYER_OPOSZ = 19,
PLAYER_PYOFF = 20,
PLAYER_OPYOFF = 21,
PLAYER_POSXV = 22,
PLAYER_POSYV = 23,
PLAYER_POSZV = 24,
PLAYER_LAST_PISSED_TIME = 25,
PLAYER_TRUEFZ = 26,
PLAYER_TRUECZ = 27,
PLAYER_PLAYER_PAR = 28,
PLAYER_VISIBILITY = 29,
PLAYER_BOBCOUNTER = 30,
PLAYER_WEAPON_SWAY = 31,
PLAYER_PALS_TIME = 32,
PLAYER_RANDOMFLAMEX = 33,
PLAYER_CRACK_TIME = 34,
PLAYER_AIM_MODE = 35,
PLAYER_ANG = 36,
PLAYER_OANG = 37,
PLAYER_ANGVEL = 38,
PLAYER_CURSECTNUM = 39,
PLAYER_LOOK_ANG = 40,
PLAYER_LAST_EXTRA = 41,
PLAYER_SUBWEAPON = 42,
PLAYER_AMMO_AMOUNT = 43,
PLAYER_WACKEDBYACTOR = 44,
PLAYER_FRAG = 45,
PLAYER_FRAGGEDSELF = 945,
PLAYER_CURR_WEAPON = 46,
PLAYER_LAST_WEAPON = 47,
PLAYER_TIPINCS = 48,
PLAYER_HORIZOFF = 49,
PLAYER_WANTWEAPONFIRE = 50,
PLAYER_HOLODUKE_AMOUNT = 51,
PLAYER_NEWOWNER = 52,
PLAYER_HURT_DELAY = 53,
PLAYER_HBOMB_HOLD_DELAY = 54,
PLAYER_JUMPING_COUNTER = 55,
PLAYER_AIRLEFT = 56,
PLAYER_KNEE_INCS = 57,
PLAYER_ACCESS_INCS = 58,
PLAYER_FTA = 59,
PLAYER_FTQ = 60,
PLAYER_ACCESS_WALLNUM = 61,
PLAYER_ACCESS_SPRITENUM = 62,
PLAYER_KICKBACK_PIC = 63,
PLAYER_GOT_ACCESS = 64,
PLAYER_WEAPON_ANG = 65,
PLAYER_FIRSTAID_AMOUNT = 66,
PLAYER_SOMETHINGONPLAYER = 67,
PLAYER_ON_CRANE = 68,
PLAYER_I = 69,
PLAYER_ONE_PARALLAX_SECTNUM = 70,
PLAYER_OVER_SHOULDER_ON = 71,
PLAYER_RANDOM_CLUB_FRAME = 72,
PLAYER_FIST_INCS = 73,
PLAYER_ONE_EIGHTY_COUNT = 74,
PLAYER_CHEAT_PHASE = 75,
PLAYER_DUMMYPLAYERSPRITE = 76,
PLAYER_EXTRA_EXTRA8 = 77,
PLAYER_QUICK_KICK = 78,
PLAYER_HEAT_AMOUNT = 79,
PLAYER_ACTORSQU = 80,
PLAYER_TIMEBEFOREEXIT = 81,
PLAYER_CUSTOMEXITSOUND = 82,
PLAYER_WEAPRECS = 83,
PLAYER_WEAPRECCNT = 84,
PLAYER_INTERFACE_TOGGLE_FLAG = 85,
PLAYER_ROTSCRNANG = 86,
PLAYER_DEAD_FLAG = 87,
PLAYER_SHOW_EMPTY_WEAPON = 88,
PLAYER_SCUBA_AMOUNT = 89,
PLAYER_JETPACK_AMOUNT = 90,
PLAYER_STEROIDS_AMOUNT = 91,
PLAYER_SHIELD_AMOUNT = 92,
PLAYER_HOLODUKE_ON = 93,
PLAYER_PYCOUNT = 94,
PLAYER_WEAPON_POS = 95,
PLAYER_FRAG_PS = 96,
PLAYER_TRANSPORTER_HOLD = 97,
PLAYER_LAST_FULL_WEAPON = 98,
PLAYER_FOOTPRINTSHADE = 99,
PLAYER_BOOT_AMOUNT = 100,
PLAYER_SCREAM_VOICE = 101,
PLAYER_GM = 102,
PLAYER_ON_WARPING_SECTOR = 103,
PLAYER_FOOTPRINTCOUNT = 104,
PLAYER_HBOMB_ON = 105,
PLAYER_JUMPING_TOGGLE = 106,
PLAYER_RAPID_FIRE_HOLD = 107,
PLAYER_ON_GROUND = 108,
PLAYER_NAME = 109,
PLAYER_INVEN_ICON = 110,
PLAYER_BUTTONPALETTE = 111,
PLAYER_JETPACK_ON = 112,
PLAYER_SPRITEBRIDGE = 113,
PLAYER_LASTRANDOMSPOT = 114,
PLAYER_SCUBA_ON = 115,
PLAYER_FOOTPRINTPAL = 116,
PLAYER_HEAT_ON = 117,
PLAYER_HOLSTER_WEAPON = 118,
PLAYER_FALLING_COUNTER = 119,
PLAYER_GOTWEAPON = 120,
PLAYER_REFRESH_INVENTORY = 121,
PLAYER_PALETTE = 122,
PLAYER_TOGGLE_KEY_FLAG = 123,
PLAYER_KNUCKLE_INCS = 124,
PLAYER_WALKING_SND_TOGGLE = 125,
PLAYER_PALOOKUP = 126,
PLAYER_HARD_LANDING = 127,
PLAYER_MAX_SECRET_ROOMS = 128,
PLAYER_SECRET_ROOMS = 129,
PLAYER_PALS = 130,
PLAYER_MAX_ACTORS_KILLED = 131,
PLAYER_ACTORS_KILLED = 132,
PLAYER_RETURN_TO_CENTER = 133,
USERDEFS_GOD = 2,
USERDEFS_WARP_ON = 3,
USERDEFS_CASHMAN = 4,
USERDEFS_EOG = 5,
USERDEFS_SHOWALLMAP = 6,
USERDEFS_SHOW_HELP = 7,
USERDEFS_SCROLLMODE = 8,
USERDEFS_CLIPPING = 9,
USERDEFS_USER_NAME = 10,
USERDEFS_RIDECULE = 11,
USERDEFS_SAVEGAME = 12,
USERDEFS_PWLOCKOUT = 13,
USERDEFS_RTSNAME = 14,
USERDEFS_OVERHEAD_ON = 15,
USERDEFS_LAST_OVERHEAD = 16,
USERDEFS_SHOWWEAPONS = 17,
USERDEFS_PAUSE_ON = 18,
USERDEFS_FROM_BONUS = 19,
USERDEFS_CAMERASPRITE = 20,
USERDEFS_LAST_CAMSPRITE = 21,
USERDEFS_LAST_LEVEL = 22,
USERDEFS_SECRETLEVEL = 23,
USERDEFS_CONST_VISIBILITY = 24,
USERDEFS_UW_FRAMERATE = 25,
USERDEFS_CAMERA_TIME = 26,
USERDEFS_FOLFVEL = 27,
USERDEFS_FOLAVEL = 28,
USERDEFS_FOLX = 29,
USERDEFS_FOLY = 30,
USERDEFS_FOLA = 31,
USERDEFS_RECCNT = 32,
USERDEFS_ENTERED_NAME = 33,
USERDEFS_SCREEN_TILTING = 34,
USERDEFS_SHADOWS = 35,
USERDEFS_FTA_ON = 36,
USERDEFS_EXECUTIONS = 37,
USERDEFS_AUTO_RUN = 38,
USERDEFS_COORDS = 39,
USERDEFS_TICKRATE = 40,
USERDEFS_M_COOP = 41,
USERDEFS_COOP = 42,
USERDEFS_SCREEN_SIZE = 43,
USERDEFS_LOCKOUT = 44,
USERDEFS_CROSSHAIR = 45,
USERDEFS_WCHOICE = 46,
USERDEFS_PLAYERAI = 47,
USERDEFS_RESPAWN_MONSTERS = 48,
USERDEFS_RESPAWN_ITEMS = 49,
USERDEFS_RESPAWN_INVENTORY = 50,
USERDEFS_RECSTAT = 51,
USERDEFS_MONSTERS_OFF = 52,
USERDEFS_BRIGHTNESS = 53,
USERDEFS_M_RESPAWN_ITEMS = 54,
USERDEFS_M_RESPAWN_MONSTERS = 55,
USERDEFS_M_RESPAWN_INVENTORY = 56,
USERDEFS_M_RECSTAT = 57,
USERDEFS_M_MONSTERS_OFF = 58,
USERDEFS_DETAIL = 59,
USERDEFS_M_FFIRE = 60,
USERDEFS_FFIRE = 61,
USERDEFS_M_PLAYER_SKILL = 62,
USERDEFS_M_LEVEL_NUMBER = 63,
USERDEFS_M_VOLUME_NUMBER = 64,
USERDEFS_MULTIMODE = 65,
USERDEFS_PLAYER_SKILL = 66,
USERDEFS_LEVEL_NUMBER = 67,
USERDEFS_VOLUME_NUMBER = 68,
USERDEFS_M_MARKER = 69,
USERDEFS_MARKER = 70,
USERDEFS_MOUSEFLIP = 71,
SECTOR_WALLPTR = 1,
SECTOR_WALLNUM = 2,
SECTOR_CEILINGZ = 3,
SECTOR_FLOORZ = 4,
SECTOR_CEILINGSTAT = 5,
SECTOR_FLOORSTAT = 6,
SECTOR_CEILINGPICNUM = 7,
SECTOR_CEILINGSLOPE = 8,
SECTOR_CEILINGSHADE = 9,
SECTOR_CEILINGPAL = 10,
SECTOR_CEILINGXPANNING = 11,
SECTOR_CEILINGYPANNING = 12,
SECTOR_FLOORPICNUM = 13,
SECTOR_FLOORSLOPE = 14,
SECTOR_FLOORSHADE = 15,
SECTOR_FLOORPAL = 16,
SECTOR_FLOORXPANNING = 17,
SECTOR_FLOORYPANNING = 18,
SECTOR_VISIBILITY = 19,
SECTOR_ALIGNTO = 20,
SECTOR_LOTAG = 21,
SECTOR_HITAG = 22,
SECTOR_EXTRA = 23,
WALL_X = 1,
WALL_Y = 2,
WALL_POINT2 = 3,
WALL_NEXTWALL = 4,
WALL_NEXTSECTOR = 5,
WALL_CSTAT = 6,
WALL_PICNUM = 7,
WALL_OVERPICNUM = 8,
WALL_SHADE = 9,
WALL_PAL = 10,
WALL_XREPEAT = 11,
WALL_YREPEAT = 12,
WALL_XPANNING = 13,
WALL_YPANNING = 14,
WALL_LOTAG = 15,
WALL_HITAG = 16,
WALL_EXTRA = 17,
ACTOR_X = 1,
ACTOR_Y = 2,
ACTOR_Z = 3,
ACTOR_CSTAT = 4,
ACTOR_PICNUM = 5,
ACTOR_SHADE = 6,
ACTOR_PAL = 7,
ACTOR_CLIPDIST = 8,
ACTOR_DETAIL = 9,
ACTOR_XREPEAT = 10,
ACTOR_YREPEAT = 11,
ACTOR_XOFFSET = 12,
ACTOR_YOFFSET = 13,
ACTOR_SECTNUM = 14,
ACTOR_STATNUM = 15,
ACTOR_ANG = 16,
ACTOR_OWNER = 17,
ACTOR_XVEL = 18,
ACTOR_YVEL = 19,
ACTOR_ZVEL = 20,
ACTOR_LOTAG = 21,
ACTOR_HITAG = 22,
ACTOR_EXTRA = 23,
ACTOR_HTCGG = 50,
ACTOR_HTPICNUM = 51,
ACTOR_HTANG = 52,
ACTOR_HTEXTRA = 53,
ACTOR_HTOWNER = 54,
ACTOR_HTMOVFLAG = 55,
ACTOR_HTTEMPANG = 56,
ACTOR_HTACTORSTAYPUT = 57,
ACTOR_HTDISPICNUM = 58,
ACTOR_HTTIMETOSLEEP = 59,
ACTOR_HTFLOORZ = 60,
ACTOR_HTCEILINGZ = 61,
ACTOR_HTLASTVX = 62,
ACTOR_HTLASTVY = 63,
ACTOR_HTBPOSX = 64,
ACTOR_HTBPOSY = 65,
ACTOR_HTBPOSZ = 66,
ACTOR_HTG_T0 = 67,
ACTOR_HTG_T1 = 68,
ACTOR_HTG_T2 = 69,
ACTOR_HTG_T3 = 70,
ACTOR_HTG_T4 = 71,
ACTOR_HTG_T5 = 72,
ACTOR_HTG_T = 73,
};

View file

@ -0,0 +1,351 @@
#include "names.h"
BEGIN_DUKE_NS
enum
{
LABEL_HASPARM2= 1,
LABEL_ISSTRING= 2
};
struct LABELS
{
const char *name;
int lId;
int flags;
int maxParm2;
};
LABELS sectorlabels[]=
{
{ "wallptr", SECTOR_WALLPTR, 0, 0 },
{ "wallnum", SECTOR_WALLNUM, 0, 0 },
{ "ceilingz", SECTOR_CEILINGZ, 0, 0 },
{ "floorz", SECTOR_FLOORZ, 0, 0 },
{ "ceilingstat", SECTOR_CEILINGSTAT, 0, 0 },
{ "floorstat", SECTOR_FLOORSTAT, 0, 0 },
{ "ceilingpicnum", SECTOR_CEILINGPICNUM, 0, 0 },
{ "ceilingslope", SECTOR_CEILINGSLOPE, 0, 0 },
{ "ceilingshade", SECTOR_CEILINGSHADE, 0, 0 },
{ "ceilingpal", SECTOR_CEILINGPAL, 0, 0 },
{ "ceilingxpanning", SECTOR_CEILINGXPANNING, 0, 0 },
{ "ceilingypanning", SECTOR_CEILINGYPANNING, 0, 0 },
{ "floorpicnum", SECTOR_FLOORPICNUM, 0, 0 },
{ "floorslope", SECTOR_FLOORSLOPE, 0, 0 },
{ "floorshade", SECTOR_FLOORSHADE, 0, 0 },
{ "floorpal", SECTOR_FLOORPAL, 0, 0 },
{ "floorxpanning", SECTOR_FLOORXPANNING, 0, 0 },
{ "floorypanning", SECTOR_FLOORYPANNING, 0, 0 },
{ "visibility", SECTOR_VISIBILITY, 0, 0 },
{ "lotag", SECTOR_LOTAG, 0, 0 },
{ "hitag", SECTOR_HITAG, 0, 0 },
{ "extra", SECTOR_EXTRA, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};
LABELS walllabels[]=
{
{ "x", WALL_X, 0, 0 },
{ "y", WALL_Y, 0, 0 },
{ "point2", WALL_POINT2, 0, 0 },
{ "nextwall", WALL_NEXTWALL, 0, 0 },
{ "nextsector", WALL_NEXTSECTOR, 0, 0 },
{ "cstat", WALL_CSTAT, 0, 0 },
{ "picnum", WALL_PICNUM, 0, 0 },
{ "overpicnum", WALL_OVERPICNUM, 0, 0 },
{ "shade", WALL_SHADE, 0, 0 },
{ "pal", WALL_PAL, 0, 0 },
{ "xrepeat", WALL_XREPEAT, 0, 0 },
{ "yrepeat", WALL_YREPEAT, 0, 0 },
{ "xpanning", WALL_XPANNING, 0, 0 },
{ "ypanning", WALL_YPANNING, 0, 0 },
{ "lotag", WALL_LOTAG, 0, 0 },
{ "hitag", WALL_HITAG, 0, 0 },
{ "extra", WALL_EXTRA, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};
LABELS actorlabels[]=
{
{ "x", ACTOR_X, 0, 0 },
{ "y", ACTOR_Y, 0, 0 },
{ "z", ACTOR_Z, 0, 0 },
{ "cstat", ACTOR_CSTAT, 0, 0 },
{ "picnum", ACTOR_PICNUM, 0, 0 },
{ "shade", ACTOR_SHADE, 0, 0 },
{ "pal", ACTOR_PAL, 0, 0 },
{ "clipdist", ACTOR_CLIPDIST, 0, 0 },
{ "detail", ACTOR_DETAIL, 0, 0 },
{ "xrepeat", ACTOR_XREPEAT, 0, 0 },
{ "yrepeat", ACTOR_YREPEAT, 0, 0 },
{ "xoffset", ACTOR_XOFFSET, 0, 0 },
{ "yoffset", ACTOR_YOFFSET, 0, 0 },
{ "sectnum", ACTOR_SECTNUM, 0, 0 },
{ "statnum", ACTOR_STATNUM, 0, 0 },
{ "ang", ACTOR_ANG, 0, 0 },
{ "owner", ACTOR_OWNER, 0, 0 },
{ "xvel", ACTOR_XVEL, 0, 0 },
{ "yvel", ACTOR_YVEL, 0, 0 },
{ "zvel", ACTOR_ZVEL, 0, 0 },
{ "lotag", ACTOR_LOTAG, 0, 0 },
{ "hitag", ACTOR_HITAG, 0, 0 },
{ "extra", ACTOR_EXTRA, 0, 0 },
// hittype labels...
{ "htcgg", ACTOR_HTCGG, 0, 0 },
{ "htpicnum", ACTOR_HTPICNUM, 0, 0 },
{ "htang", ACTOR_HTANG, 0, 0 },
{ "htextra", ACTOR_HTEXTRA, 0, 0 },
{ "htowner", ACTOR_HTOWNER, 0, 0 },
{ "htmovflag", ACTOR_HTMOVFLAG, 0, 0 },
{ "httempang", ACTOR_HTTEMPANG, 0, 0 },
{ "htactorstayput", ACTOR_HTACTORSTAYPUT, 0, 0 },
{ "htdispicnum", ACTOR_HTDISPICNUM, 0, 0 },
{ "httimetosleep", ACTOR_HTTIMETOSLEEP, 0, 0 },
{ "htfloorz", ACTOR_HTFLOORZ, 0, 0 },
{ "htceilingz", ACTOR_HTCEILINGZ, 0, 0 },
{ "htlastvx", ACTOR_HTLASTVX, 0, 0 },
{ "htlastvy", ACTOR_HTLASTVY, 0, 0 },
{ "htbposx", ACTOR_HTBPOSX, 0, 0 },
{ "htbposy", ACTOR_HTBPOSY, 0, 0 },
{ "htbposz", ACTOR_HTBPOSZ, 0, 0 },
{ "htg_t", ACTOR_HTG_T, LABEL_HASPARM2, 5 },
{ "htg_t[0]", ACTOR_HTG_T0, 0, 0 },
{ "htg_t[1]", ACTOR_HTG_T1, 0, 0 },
{ "htg_t[2]", ACTOR_HTG_T2, 0, 0 },
{ "htg_t[3]", ACTOR_HTG_T3, 0, 0 },
{ "htg_t[4]", ACTOR_HTG_T4, 0, 0 },
{ "htg_t[5]", ACTOR_HTG_T5, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};
//////////////////////////////////
LABELS playerlabels[]=
{
{ "zoom", PLAYER_ZOOM, 0, 0 },
{ "exitx", PLAYER_EXITX, 0, 0 },
{ "exity", PLAYER_EXITY, 0, 0 },
{ "loogiex", PLAYER_LOOGIEX, LABEL_HASPARM2, 64 },
{ "loogiey", PLAYER_LOOGIEY, LABEL_HASPARM2, 64 },
{ "numloogs", PLAYER_NUMLOOGS, 0, 0 },
{ "loogcnt", PLAYER_LOOGCNT, 0, 0 },
{ "posx", PLAYER_POSX, 0, 0 },
{ "posy", PLAYER_POSY, 0, 0 },
{ "posz", PLAYER_POSZ, 0, 0 },
{ "horiz", PLAYER_HORIZ, 0, 0 },
{ "ohoriz", PLAYER_OHORIZ, 0, 0 },
{ "ohorizoff", PLAYER_OHORIZOFF, 0, 0 },
{ "invdisptime", PLAYER_INVDISPTIME, 0, 0 },
{ "bobposx", PLAYER_BOBPOSX, 0, 0 },
{ "bobposy", PLAYER_BOBPOSY, 0, 0 },
{ "oposx", PLAYER_OPOSX, 0, 0 },
{ "oposy", PLAYER_OPOSY, 0, 0 },
{ "oposz", PLAYER_OPOSZ, 0, 0 },
{ "pyoff", PLAYER_PYOFF, 0, 0 },
{ "opyoff", PLAYER_OPYOFF, 0, 0 },
{ "posxv", PLAYER_POSXV, 0, 0 },
{ "posyv", PLAYER_POSYV, 0, 0 },
{ "poszv", PLAYER_POSZV, 0, 0 },
{ "last_pissed_time", PLAYER_LAST_PISSED_TIME, 0, 0 },
{ "truefz", PLAYER_TRUEFZ, 0, 0 },
{ "truecz", PLAYER_TRUECZ, 0, 0 },
{ "player_par", PLAYER_PLAYER_PAR, 0, 0 },
{ "visibility", PLAYER_VISIBILITY, 0, 0 },
{ "bobcounter", PLAYER_BOBCOUNTER, 0, 0 },
{ "weapon_sway", PLAYER_WEAPON_SWAY, 0, 0 },
{ "pals_time", PLAYER_PALS_TIME, 0, 0 },
{ "randomflamex", PLAYER_RANDOMFLAMEX, 0, 0 },
{ "crack_time", PLAYER_CRACK_TIME, 0, 0 },
{ "aim_mode", PLAYER_AIM_MODE, 0, 0 },
{ "ang", PLAYER_ANG, 0, 0 },
{ "oang", PLAYER_OANG, 0, 0 },
{ "angvel", PLAYER_ANGVEL, 0, 0 },
{ "cursectnum", PLAYER_CURSECTNUM, 0, 0 },
{ "look_ang", PLAYER_LOOK_ANG, 0, 0 },
{ "last_extra", PLAYER_LAST_EXTRA, 0, 0 },
{ "subweapon", PLAYER_SUBWEAPON, 0, 0 },
{ "ammo_amount", PLAYER_AMMO_AMOUNT, LABEL_HASPARM2, MAX_WEAPONS },
{ "wackedbyactor", PLAYER_WACKEDBYACTOR, 0, 0 },
{ "frag", PLAYER_FRAG, 0, 0 },
{ "fraggedself", PLAYER_FRAGGEDSELF, 0, 0 },
{ "curr_weapon", PLAYER_CURR_WEAPON, 0, 0 },
{ "last_weapon", PLAYER_LAST_WEAPON, 0, 0 },
{ "tipincs", PLAYER_TIPINCS, 0, 0 },
{ "horizoff", PLAYER_HORIZOFF, 0, 0 },
{ "wantweaponfire", PLAYER_WANTWEAPONFIRE, 0, 0 },
{ "holoduke_amount", PLAYER_HOLODUKE_AMOUNT, 0, 0 },
{ "newowner", PLAYER_NEWOWNER, 0, 0 },
{ "hurt_delay", PLAYER_HURT_DELAY, 0, 0 },
{ "hbomb_hold_delay", PLAYER_HBOMB_HOLD_DELAY, 0, 0 },
{ "jumping_counter", PLAYER_JUMPING_COUNTER, 0, 0 },
{ "airleft", PLAYER_AIRLEFT, 0, 0 },
{ "knee_incs", PLAYER_KNEE_INCS, 0, 0 },
{ "access_incs", PLAYER_ACCESS_INCS, 0, 0 },
{ "fta", PLAYER_FTA, 0, 0 },
{ "ftq", PLAYER_FTQ, 0, 0 },
{ "access_wallnum", PLAYER_ACCESS_WALLNUM, 0, 0 },
{ "access_spritenum", PLAYER_ACCESS_SPRITENUM, 0, 0 },
{ "kickback_pic", PLAYER_KICKBACK_PIC, 0, 0 },
{ "got_access", PLAYER_GOT_ACCESS, 0, 0 },
{ "weapon_ang", PLAYER_WEAPON_ANG, 0, 0 },
{ "firstaid_amount", PLAYER_FIRSTAID_AMOUNT, 0, 0 },
{ "somethingonplayer", PLAYER_SOMETHINGONPLAYER, 0, 0 },
{ "on_crane", PLAYER_ON_CRANE, 0, 0 },
{ "i", PLAYER_I, 0, 0 },
{ "one_parallax_sectnum", PLAYER_ONE_PARALLAX_SECTNUM, 0, 0 },
{ "over_shoulder_on", PLAYER_OVER_SHOULDER_ON, 0, 0 },
{ "random_club_frame", PLAYER_RANDOM_CLUB_FRAME, 0, 0 },
{ "fist_incs", PLAYER_FIST_INCS, 0, 0 },
{ "one_eighty_count", PLAYER_ONE_EIGHTY_COUNT, 0, 0 },
{ "cheat_phase", PLAYER_CHEAT_PHASE, 0, 0 },
{ "dummyplayersprite", PLAYER_DUMMYPLAYERSPRITE, 0, 0 },
{ "extra_extra8", PLAYER_EXTRA_EXTRA8, 0, 0 },
{ "quick_kick", PLAYER_QUICK_KICK, 0, 0 },
{ "heat_amount", PLAYER_HEAT_AMOUNT, 0, 0 },
{ "actorsqu", PLAYER_ACTORSQU, 0, 0 },
{ "timebeforeexit", PLAYER_TIMEBEFOREEXIT, 0, 0 },
{ "customexitsound", PLAYER_CUSTOMEXITSOUND, 0, 0 },
{ "weaprecs", PLAYER_WEAPRECS, LABEL_HASPARM2, 256 },
{ "weapreccnt", PLAYER_WEAPRECCNT, 0, 0 },
{ "interface_toggle_flag", PLAYER_INTERFACE_TOGGLE_FLAG, 0, 0 },
{ "rotscrnang", PLAYER_ROTSCRNANG, 0, 0 },
{ "dead_flag", PLAYER_DEAD_FLAG, 0, 0 },
{ "show_empty_weapon", PLAYER_SHOW_EMPTY_WEAPON, 0, 0 },
{ "scuba_amount", PLAYER_SCUBA_AMOUNT, 0, 0 },
{ "jetpack_amount", PLAYER_JETPACK_AMOUNT, 0, 0 },
{ "steroids_amount", PLAYER_STEROIDS_AMOUNT, 0, 0 },
{ "shield_amount", PLAYER_SHIELD_AMOUNT, 0, 0 },
{ "holoduke_on", PLAYER_HOLODUKE_ON, 0, 0 },
{ "pycount", PLAYER_PYCOUNT, 0, 0 },
{ "weapon_pos", PLAYER_WEAPON_POS, 0, 0 },
{ "frag_ps", PLAYER_FRAG_PS, 0, 0 },
{ "transporter_hold", PLAYER_TRANSPORTER_HOLD, 0, 0 },
{ "last_full_weapon", PLAYER_LAST_FULL_WEAPON, 0, 0 },
{ "footprintshade", PLAYER_FOOTPRINTSHADE, 0, 0 },
{ "boot_amount", PLAYER_BOOT_AMOUNT, 0, 0 },
{ "scream_voice", PLAYER_SCREAM_VOICE, 0, 0 },
{ "gm", PLAYER_GM, 0, 0 },
{ "on_warping_sector", PLAYER_ON_WARPING_SECTOR, 0, 0 },
{ "footprintcount", PLAYER_FOOTPRINTCOUNT, 0, 0 },
{ "hbomb_on", PLAYER_HBOMB_ON, 0, 0 },
{ "jumping_toggle", PLAYER_JUMPING_TOGGLE, 0, 0 },
{ "rapid_fire_hold", PLAYER_RAPID_FIRE_HOLD, 0, 0 },
{ "on_ground", PLAYER_ON_GROUND, 0, 0 },
{ "name", PLAYER_NAME, LABEL_ISSTRING, 32 },
{ "inven_icon", PLAYER_INVEN_ICON, 0, 0 },
{ "buttonpalette", PLAYER_BUTTONPALETTE, 0, 0 },
{ "jetpack_on", PLAYER_JETPACK_ON, 0, 0 },
{ "spritebridge", PLAYER_SPRITEBRIDGE, 0, 0 },
{ "lastrandomspot", PLAYER_LASTRANDOMSPOT, 0, 0 },
{ "scuba_on", PLAYER_SCUBA_ON, 0, 0 },
{ "footprintpal", PLAYER_FOOTPRINTPAL, 0, 0 },
{ "heat_on", PLAYER_HEAT_ON, 0, 0 },
{ "holster_weapon", PLAYER_HOLSTER_WEAPON, 0, 0 },
{ "falling_counter", PLAYER_FALLING_COUNTER, 0, 0 },
{ "gotweapon", PLAYER_GOTWEAPON, LABEL_HASPARM2, MAX_WEAPONS },
{ "refresh_inventory", PLAYER_REFRESH_INVENTORY, 0, 0 },
{ "palette", PLAYER_PALETTE, 0, 0 },
{ "toggle_key_flag", PLAYER_TOGGLE_KEY_FLAG, 0, 0 },
{ "knuckle_incs", PLAYER_KNUCKLE_INCS, 0, 0 },
{ "walking_snd_toggle", PLAYER_WALKING_SND_TOGGLE, 0, 0 },
{ "palookup", PLAYER_PALOOKUP, 0, 0 },
{ "hard_landing", PLAYER_HARD_LANDING, 0, 0 },
{ "max_secret_rooms", PLAYER_MAX_SECRET_ROOMS, 0, 0 },
{ "secret_rooms", PLAYER_SECRET_ROOMS, 0, 0 },
{ "pals", PLAYER_PALS, LABEL_HASPARM2, 3 },
{ "max_actors_killed", PLAYER_MAX_ACTORS_KILLED, 0, 0 },
{ "actors_killed", PLAYER_ACTORS_KILLED, 0, 0 },
{ "return_to_center", PLAYER_RETURN_TO_CENTER, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};
///////////////////////////////////////
LABELS userdefslabels[]=
{
{ "god", USERDEFS_GOD, 0, 0 },
{ "warp_on", USERDEFS_WARP_ON, 0, 0 },
{ "cashman", USERDEFS_CASHMAN, 0, 0 },
{ "eog", USERDEFS_EOG, 0, 0 },
{ "showallmap", USERDEFS_SHOWALLMAP, 0, 0 },
{ "show_help", USERDEFS_SHOW_HELP, 0, 0 },
{ "scrollmode", USERDEFS_SCROLLMODE, 0, 0 },
{ "clipping", USERDEFS_CLIPPING, 0, 0 },
{ "user_name", USERDEFS_USER_NAME, LABEL_HASPARM2, MAXPLAYERS },
{ "ridecule", USERDEFS_RIDECULE, LABEL_HASPARM2 | LABEL_ISSTRING, 10 },
{ "savegame", USERDEFS_SAVEGAME, LABEL_HASPARM2 | LABEL_ISSTRING, 10 },
{ "pwlockout", USERDEFS_PWLOCKOUT, LABEL_ISSTRING, 128 },
{ "rtsname;", USERDEFS_RTSNAME, LABEL_ISSTRING, 128 },
{ "overhead_on", USERDEFS_OVERHEAD_ON, 0, 0 },
{ "last_overhead", USERDEFS_LAST_OVERHEAD, 0, 0 },
{ "showweapons", USERDEFS_SHOWWEAPONS, 0, 0 },
{ "pause_on", USERDEFS_PAUSE_ON, 0, 0 },
{ "from_bonus", USERDEFS_FROM_BONUS, 0, 0 },
{ "camerasprite", USERDEFS_CAMERASPRITE, 0, 0 },
{ "last_camsprite", USERDEFS_LAST_CAMSPRITE, 0, 0 },
{ "last_level", USERDEFS_LAST_LEVEL, 0, 0 },
{ "secretlevel", USERDEFS_SECRETLEVEL, 0, 0 },
{ "const_visibility", USERDEFS_CONST_VISIBILITY, 0, 0 },
{ "uw_framerate", USERDEFS_UW_FRAMERATE, 0, 0 },
{ "camera_time", USERDEFS_CAMERA_TIME, 0, 0 },
{ "folfvel", USERDEFS_FOLFVEL, 0, 0 },
{ "folavel", USERDEFS_FOLAVEL, 0, 0 },
{ "folx", USERDEFS_FOLX, 0, 0 },
{ "foly", USERDEFS_FOLY, 0, 0 },
{ "fola", USERDEFS_FOLA, 0, 0 },
{ "reccnt", USERDEFS_RECCNT, 0, 0 },
{ "entered_name", USERDEFS_ENTERED_NAME, 0, 0 },
{ "screen_tilting", USERDEFS_SCREEN_TILTING, 0, 0 },
{ "shadows", USERDEFS_SHADOWS, 0, 0 },
{ "fta_on", USERDEFS_FTA_ON, 0, 0 },
{ "executions", USERDEFS_EXECUTIONS, 0, 0 },
{ "auto_run", USERDEFS_AUTO_RUN, 0, 0 },
{ "coords", USERDEFS_COORDS, 0, 0 },
{ "tickrate", USERDEFS_TICKRATE, 0, 0 },
{ "m_coop", USERDEFS_M_COOP, 0, 0 },
{ "coop", USERDEFS_COOP, 0, 0 },
{ "screen_size", USERDEFS_SCREEN_SIZE, 0, 0 },
{ "lockout", USERDEFS_LOCKOUT, 0, 0 },
{ "crosshair", USERDEFS_CROSSHAIR, 0, 0 },
{ "wchoice[MAXPLAYERS][MAX_WEAPONS]", USERDEFS_WCHOICE, 0, 0 },
{ "playerai", USERDEFS_PLAYERAI, 0, 0 },
{ "respawn_monsters", USERDEFS_RESPAWN_MONSTERS, 0, 0 },
{ "respawn_items", USERDEFS_RESPAWN_ITEMS, 0, 0 },
{ "respawn_inventory", USERDEFS_RESPAWN_INVENTORY, 0, 0 },
{ "recstat", USERDEFS_RECSTAT, 0, 0 },
{ "monsters_off", USERDEFS_MONSTERS_OFF, 0, 0 },
{ "brightness", USERDEFS_BRIGHTNESS, 0, 0 },
{ "m_respawn_items", USERDEFS_M_RESPAWN_ITEMS, 0, 0 },
{ "m_respawn_monsters", USERDEFS_M_RESPAWN_MONSTERS, 0, 0 },
{ "m_respawn_inventory", USERDEFS_M_RESPAWN_INVENTORY, 0, 0 },
{ "m_recstat", USERDEFS_M_RECSTAT, 0, 0 },
{ "m_monsters_off", USERDEFS_M_MONSTERS_OFF, 0, 0 },
{ "detail", USERDEFS_DETAIL, 0, 0 },
{ "m_ffire", USERDEFS_M_FFIRE, 0, 0 },
{ "ffire", USERDEFS_FFIRE, 0, 0 },
{ "m_player_skill", USERDEFS_M_PLAYER_SKILL, 0, 0 },
{ "m_level_number", USERDEFS_M_LEVEL_NUMBER, 0, 0 },
{ "m_volume_number", USERDEFS_M_VOLUME_NUMBER, 0, 0 },
{ "multimode", USERDEFS_MULTIMODE, 0, 0 },
{ "player_skill", USERDEFS_PLAYER_SKILL, 0, 0 },
{ "level_number", USERDEFS_LEVEL_NUMBER, 0, 0 },
{ "volume_number", USERDEFS_VOLUME_NUMBER, 0, 0 },
{ "m_marker", USERDEFS_M_MARKER, 0, 0 },
{ "marker", USERDEFS_MARKER, 0, 0 },
{ "mouseflip", USERDEFS_MOUSEFLIP, 0, 0 },
{ "", -1, 0, 0 } // END OF LIST
};
END_DUKE_NS

View file

@ -160,6 +160,7 @@ void clearcamera(player_struct* ps);
void showtwoscreens(const CompletionFunc& func);
void doorders(const CompletionFunc& func);
void LoadActor(int i, int p, int x);
void execute(int s, int p, int d);
void makeitfall(int s);
int furthestangle(int snum, int angDiv);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -285,6 +285,10 @@ int GetGameVarID(int id, int sActor, int sPlayer)
Printf("GetGameVarID: Invalid Game ID %d\n", id);
return -1;
}
if (id == g_iThisActorID)
{
return sActor;
}
if( aGameVars[id].dwFlags & GAMEVAR_FLAG_PERPLAYER )
{
// for the current player
@ -474,6 +478,10 @@ int g_iZRangeVarID = -1; // var ID of "ZRANGE"
int g_iAngRangeVarID = -1; // var ID of "ANGRANGE"
int g_iAimAngleVarID = -1; // var ID of "AUTOAIMANGLE"
int g_iAtWithVarID = -1; // var ID of "AtWith"
int g_iLoTagID = -1; // var ID of "LOTAG"
int g_iHiTagID = -1; // ver ID of "HITAG"
int g_iTextureID = -1; // var ID of "TEXTURE"
int g_iThisActorID = -1; // var ID of "THISACTOR"
//---------------------------------------------------------------------------
//
@ -1131,6 +1139,11 @@ void AddSystemVars()
AddGameVar("ZRANGE", 0, GAMEVAR_FLAG_SYSTEM);
AddGameVar("ANGRANGE", 0, GAMEVAR_FLAG_SYSTEM);
AddGameVar("AUTOAIMANGLE", 0, GAMEVAR_FLAG_SYSTEM);
AddGameVar("LOTAG", 0, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
AddGameVar("HITAG", 0, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
AddGameVar("TEXTURE", 0, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
AddGameVar("THISACTOR", 0, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
AddGameVar("ATWITH", 0, GAMEVAR_FLAG_READONLY | GAMEVAR_FLAG_SYSTEM);
AddGameVar("RESPAWN_MONSTERS", (intptr_t)&ud.respawn_monsters,GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
AddGameVar("RESPAWN_ITEMS",(intptr_t)&ud.respawn_items, GAMEVAR_FLAG_SYSTEM | GAMEVAR_FLAG_PLONG);
@ -1211,6 +1224,11 @@ void ResetSystemDefaults(void)
g_iZRangeVarID=GetGameID("ZRANGE");
g_iAngRangeVarID=GetGameID("ANGRANGE");
g_iAimAngleVarID=GetGameID("AUTOAIMANGLE");
g_iAtWithVarID = GetGameID("ATWITH");
g_iLoTagID = GetGameID("LOTAG");
g_iHiTagID = GetGameID("HITAG");
g_iTextureID = GetGameID("TEXTURE");
g_iThisActorID = GetGameID("THISACTOR");
}

View file

@ -112,6 +112,10 @@ extern int g_iWorksLikeVarID; // var ID of "WORKSLIKE"
extern int g_iZRangeVarID; // var ID of "ZRANGE"
extern int g_iAngRangeVarID; // var ID of "ANGRANGE"
extern int g_iAimAngleVarID; // var ID of "AUTOAIMANGLE"
extern int g_iLoTagID; // var ID of "LOTAG"
extern int g_iHiTagID; // ver ID of "HITAG"
extern int g_iTextureID; // var ID of "TEXTURE"
extern int g_iThisActorID; // var ID of "THISACTOR"
int AddGameVar(const char *pszLabel, intptr_t lValue, unsigned dwFlags);
int GetGameID(const char *szGameLabel);

View file

@ -413,18 +413,14 @@ void shoot_d(int i, int atwith)
if (p >= 0)
{
if (isWW2GI())
SetGameVarID(g_iAimAngleVarID, AUTO_AIM_ANGLE, i, p);
OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1);
j = -1;
if (GetGameVarID(g_iAimAngleVarID, i, p) > 0)
{
SetGameVarID(g_iAimAngleVarID, AUTO_AIM_ANGLE, i, p);
OnEvent(EVENT_GETAUTOAIMANGLE, i, p, -1);
j = -1;
if (GetGameVarID(g_iAimAngleVarID, i, p) > 0)
{
j = aim(s, GetGameVarID(g_iAimAngleVarID, i, p));
}
j = aim(s, GetGameVarID(g_iAimAngleVarID, i, p));
}
else
j = aim(s, AUTO_AIM_ANGLE);
if (j >= 0)
{
dal = ((sprite[j].xrepeat * tilesiz[sprite[j].picnum].y) << 1) + (5 << 8);
@ -2588,7 +2584,6 @@ static void processweapon(int snum, ESyncBits actions, int psect)
OnEvent(EVENT_HOLSTER, pi, snum, -1);
if (GetGameVarID(g_iReturnVarID, pi, snum) == 0)
{
// now it uses the game definitions...
if (aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_HOLSTER_CLEARS_CLIP)
{

View file

@ -280,6 +280,7 @@ void prelevel_d(int g)
while (i >= 0)
{
nexti = nextspritestat[i];
LoadActor(i, -1, -1);
if (sprite[i].lotag == -1 && (sprite[i].cstat & 16))
{

View file

@ -560,6 +560,7 @@ void prelevel_r(int g)
while (i >= 0)
{
nexti = nextspritestat[i];
LoadActor(i, -1, -1);
if (sprite[i].lotag == -1 && (sprite[i].cstat & 16))
{

View file

@ -394,9 +394,9 @@ void GameInterface::SerializeGameState(FSerializer& arc)
("respawn_monsters", ud.respawn_monsters)
("respawn_items", ud.respawn_items)
("respawn_inventory", ud.respawn_inventory)
("const_visibility", ud.const_visibility)
("god", ud.god)
("eog", ud.eog)
//("auto_run", ud.auto_run)
("monsters_off", ud.monsters_off)
("last_level", ud.last_level)
("coop", ud.coop)

View file

@ -47,13 +47,14 @@ struct ActorInfo
struct TileInfo
{
int flags;
int loadeventscriptptr;
};
struct user_defs
{
int levelclock;
unsigned char god, cashman, eog;
unsigned char show_help, scrollmode, clipping;
unsigned char clipping;
char user_name[MAXPLAYERS][32];
unsigned char showweapons;
unsigned char user_pals[MAXPLAYERS];
@ -63,16 +64,15 @@ struct user_defs
short last_level, secretlevel;
int const_visibility;
int reccnt;
int runkey_mode;
int entered_name, shadows, executions, auto_run;
int coords, tickrate, levelstats, m_coop, coop;
int wchoice[MAXPLAYERS][MAX_WEAPONS], playerai;
int shadows;
int coords, levelstats, m_coop, coop;
int wchoice[MAXPLAYERS][MAX_WEAPONS];
int respawn_monsters, respawn_items, respawn_inventory, recstat, monsters_off, brightness;
int m_respawn_items, m_respawn_monsters, m_respawn_inventory, m_recstat, m_monsters_off, detail;
int m_respawn_items, m_respawn_monsters, m_respawn_inventory, m_recstat, m_monsters_off;
int m_ffire, ffire, m_player_skill, multimode;
int player_skill, marker;
//MapRecord* nextLevel;