#library

#ifdef __INCLUDED__
   #error you must #import this file
#endif

// ==========================================================================
strict namespace {
// ==========================================================================

// Instruction opcodes.
enum {
   PCD_NOP,
   PCD_TERMINATE,
   PCD_SUSPEND,
   PCD_PUSHNUMBER,
   PCD_LSPEC1,
   PCD_LSPEC2,
   PCD_LSPEC3,
   PCD_LSPEC4,
   PCD_LSPEC5,
   PCD_LSPEC1DIRECT,
   PCD_LSPEC2DIRECT,
   PCD_LSPEC3DIRECT,
   PCD_LSPEC4DIRECT,
   PCD_LSPEC5DIRECT,
   PCD_ADD,
   PCD_SUBTRACT,
   PCD_MULTIPLY,
   PCD_DIVIDE,
   PCD_MODULUS,
   PCD_EQ,
   PCD_NE,
   PCD_LT,
   PCD_GT,
   PCD_LE,
   PCD_GE,
   PCD_ASSIGNSCRIPTVAR,
   PCD_ASSIGNMAPVAR,
   PCD_ASSIGNWORLDVAR,
   PCD_PUSHSCRIPTVAR,
   PCD_PUSHMAPVAR,
   PCD_PUSHWORLDVAR,
   PCD_ADDSCRIPTVAR,
   PCD_ADDMAPVAR,
   PCD_ADDWORLDVAR,
   PCD_SUBSCRIPTVAR,
   PCD_SUBMAPVAR,
   PCD_SUBWORLDVAR,
   PCD_MULSCRIPTVAR,
   PCD_MULMAPVAR,
   PCD_MULWORLDVAR,
   PCD_DIVSCRIPTVAR,
   PCD_DIVMAPVAR,
   PCD_DIVWORLDVAR,
   PCD_MODSCRIPTVAR,
   PCD_MODMAPVAR,
   PCD_MODWORLDVAR,
   PCD_INCSCRIPTVAR,
   PCD_INCMAPVAR,
   PCD_INCWORLDVAR,
   PCD_DECSCRIPTVAR,
   PCD_DECMAPVAR,
   PCD_DECWORLDVAR,
   PCD_GOTO,
   PCD_IFGOTO,
   PCD_DROP,
   PCD_DELAY,
   PCD_DELAYDIRECT,
   PCD_RANDOM,
   PCD_RANDOMDIRECT,
   PCD_THINGCOUNT,
   PCD_THINGCOUNTDIRECT,
   PCD_TAGWAIT,
   PCD_TAGWAITDIRECT,
   PCD_POLYWAIT,
   PCD_POLYWAITDIRECT,
   PCD_CHANGEFLOOR,
   PCD_CHANGEFLOORDIRECT,
   PCD_CHANGECEILING,
   PCD_CHANGECEILINGDIRECT,
   PCD_RESTART,
   PCD_ANDLOGICAL,
   PCD_ORLOGICAL,
   PCD_ANDBITWISE,
   PCD_ORBITWISE,
   PCD_EORBITWISE,
   PCD_NEGATELOGICAL,
   PCD_LSHIFT,
   PCD_RSHIFT,
   PCD_UNARYMINUS,
   PCD_IFNOTGOTO,
   PCD_LINESIDE,
   PCD_SCRIPTWAIT,
   PCD_SCRIPTWAITDIRECT,
   PCD_CLEARLINESPECIAL,
   PCD_CASEGOTO,
   PCD_BEGINPRINT,
   PCD_ENDPRINT,
   PCD_PRINTSTRING,
   PCD_PRINTNUMBER,
   PCD_PRINTCHARACTER,
   PCD_PLAYERCOUNT,
   PCD_GAMETYPE,
   PCD_GAMESKILL,
   PCD_TIMER,
   PCD_SECTORSOUND,
   PCD_AMBIENTSOUND,
   PCD_SOUNDSEQUENCE,
   PCD_SETLINETEXTURE,
   PCD_SETLINEBLOCKING,
   PCD_SETLINESPECIAL,
   PCD_THINGSOUND,
   PCD_ENDPRINTBOLD,
   PCD_ACTIVATORSOUND,
   PCD_LOCALAMBIENTSOUND,
   PCD_SETLINEMONSTERBLOCKING,
   PCD_PLAYERBLUESKULL,
   PCD_PLAYERREDSKULL,
   PCD_PLAYERYELLOWSKULL,
   PCD_PLAYERMASTERSKULL,
   PCD_PLAYERBLUECARD,
   PCD_PLAYERREDCARD,
   PCD_PLAYERYELLOWCARD,
   PCD_PLAYERMASTERCARD,
   PCD_PLAYERBLACKSKULL,
   PCD_PLAYERSILVERSKULL,
   PCD_PLAYERGOLDSKULL,
   PCD_PLAYERBLACKCARD,
   PCD_PLAYERSILVERCARD,
   PCD_ISMULTIPLAYER,
   PCD_PLAYERTEAM,
   PCD_PLAYERHEALTH,
   PCD_PLAYERARMORPOINTS,
   PCD_PLAYERFRAGS,
   PCD_PLAYEREXPERT,
   PCD_BLUETEAMCOUNT,
   PCD_REDTEAMCOUNT,
   PCD_BLUETEAMSCORE,
   PCD_REDTEAMSCORE,
   PCD_ISONEFLAGCTF,
   PCD_GETINVASIONWAVE,
   PCD_GETINVASIONSTATE,
   PCD_PRINTNAME,
   PCD_MUSICCHANGE,
   PCD_CONSOLECOMMANDDIRECT,
   PCD_CONSOLECOMMAND,
   PCD_SINGLEPLAYER,
   PCD_FIXEDMUL,
   PCD_FIXEDDIV,
   PCD_SETGRAVITY,
   PCD_SETGRAVITYDIRECT,
   PCD_SETAIRCONTROL,
   PCD_SETAIRCONTROLDIRECT,
   PCD_CLEARINVENTORY,
   PCD_GIVEINVENTORY,
   PCD_GIVEINVENTORYDIRECT,
   PCD_TAKEINVENTORY,
   PCD_TAKEINVENTORYDIRECT,
   PCD_CHECKINVENTORY,
   PCD_CHECKINVENTORYDIRECT,
   PCD_SPAWN,
   PCD_SPAWNDIRECT,
   PCD_SPAWNSPOT,
   PCD_SPAWNSPOTDIRECT,
   PCD_SETMUSIC,
   PCD_SETMUSICDIRECT,
   PCD_LOCALSETMUSIC,
   PCD_LOCALSETMUSICDIRECT,
   PCD_PRINTFIXED,
   PCD_PRINTLOCALIZED,
   PCD_MOREHUDMESSAGE,
   PCD_OPTHUDMESSAGE,
   PCD_ENDHUDMESSAGE,
   PCD_ENDHUDMESSAGEBOLD,
   PCD_SETSTYLE,
   PCD_SETSTYLEDIRECT,
   PCD_SETFONT,
   PCD_SETFONTDIRECT,
   PCD_PUSHBYTE,
   PCD_LSPEC1DIRECTB,
   PCD_LSPEC2DIRECTB,
   PCD_LSPEC3DIRECTB,
   PCD_LSPEC4DIRECTB,
   PCD_LSPEC5DIRECTB,
   PCD_DELAYDIRECTB,
   PCD_RANDOMDIRECTB,
   PCD_PUSHBYTES,
   PCD_PUSH2BYTES,
   PCD_PUSH3BYTES,
   PCD_PUSH4BYTES,
   PCD_PUSH5BYTES,
   PCD_SETTHINGSPECIAL,
   PCD_ASSIGNGLOBALVAR,
   PCD_PUSHGLOBALVAR,
   PCD_ADDGLOBALVAR,
   PCD_SUBGLOBALVAR,
   PCD_MULGLOBALVAR,
   PCD_DIVGLOBALVAR,
   PCD_MODGLOBALVAR,
   PCD_INCGLOBALVAR,
   PCD_DECGLOBALVAR,
   PCD_FADETO,
   PCD_FADERANGE,
   PCD_CANCELFADE,
   PCD_PLAYMOVIE,
   PCD_SETFLOORTRIGGER,
   PCD_SETCEILINGTRIGGER,
   PCD_GETACTORX,
   PCD_GETACTORY,
   PCD_GETACTORZ,
   PCD_STARTTRANSLATION,
   PCD_TRANSLATIONRANGE1,
   PCD_TRANSLATIONRANGE2,
   PCD_ENDTRANSLATION,
   PCD_CALL,
   PCD_CALLDISCARD,
   PCD_RETURNVOID,
   PCD_RETURNVAL,
   PCD_PUSHMAPARRAY,
   PCD_ASSIGNMAPARRAY,
   PCD_ADDMAPARRAY,
   PCD_SUBMAPARRAY,
   PCD_MULMAPARRAY,
   PCD_DIVMAPARRAY,
   PCD_MODMAPARRAY,
   PCD_INCMAPARRAY,
   PCD_DECMAPARRAY,
   PCD_DUP,
   PCD_SWAP,
   PCD_WRITETOINI,
   PCD_GETFROMINI,
   PCD_SIN,
   PCD_COS,
   PCD_VECTORANGLE,
   PCD_CHECKWEAPON,
   PCD_SETWEAPON,
   PCD_TAGSTRING,
   PCD_PUSHWORLDARRAY,
   PCD_ASSIGNWORLDARRAY,
   PCD_ADDWORLDARRAY,
   PCD_SUBWORLDARRAY,
   PCD_MULWORLDARRAY,
   PCD_DIVWORLDARRAY,
   PCD_MODWORLDARRAY,
   PCD_INCWORLDARRAY,
   PCD_DECWORLDARRAY,
   PCD_PUSHGLOBALARRAY,
   PCD_ASSIGNGLOBALARRAY,
   PCD_ADDGLOBALARRAY,
   PCD_SUBGLOBALARRAY,
   PCD_MULGLOBALARRAY,
   PCD_DIVGLOBALARRAY,
   PCD_MODGLOBALARRAY,
   PCD_INCGLOBALARRAY,
   PCD_DECGLOBALARRAY,
   PCD_SETMARINEWEAPON,
   PCD_SETACTORPROPERTY,
   PCD_GETACTORPROPERTY,
   PCD_PLAYERNUMBER,
   PCD_ACTIVATORTID,
   PCD_SETMARINESPRITE,
   PCD_GETSCREENWIDTH,
   PCD_GETSCREENHEIGHT,
   PCD_THINGPROJECTILE2,
   PCD_STRLEN,
   PCD_SETHUDSIZE,
   PCD_GETCVAR,
   PCD_CASEGOTOSORTED,
   PCD_SETRESULTVALUE,
   PCD_GETLINEROWOFFSET,
   PCD_GETACTORFLOORZ,
   PCD_GETACTORANGLE,
   PCD_GETSECTORFLOORZ,
   PCD_GETSECTORCEILINGZ,
   PCD_LSPEC5RESULT,
   PCD_GETSIGILPIECES,
   PCD_GETLEVELINFO,
   PCD_CHANGESKY,
   PCD_PLAYERINGAME,
   PCD_PLAYERISBOT,
   PCD_SETCAMERATOTEXTURE,
   PCD_ENDLOG,
   PCD_GETAMMOCAPACITY,
   PCD_SETAMMOCAPACITY,
   PCD_PRINTMAPCHARARRAY,
   PCD_PRINTWORLDCHARARRAY,
   PCD_PRINTGLOBALCHARARRAY,
   PCD_SETACTORANGLE,
   PCD_GRAPINPUT,
   PCD_SETMOUSEPOINTER,
   PCD_MOVEMOUSEPOINTER,
   PCD_SPAWNPROJECTILE,
   PCD_GETSECTORLIGHTLEVEL,
   PCD_GETACTORCEILINGZ,
   PCD_SETACTORPOSITION,
   PCD_CLEARACTORINVENTORY,
   PCD_GIVEACTORINVENTORY,
   PCD_TAKEACTORINVENTORY,
   PCD_CHECKACTORINVENTORY,
   PCD_THINGCOUNTNAME,
   PCD_SPAWNSPOTFACING,
   PCD_PLAYERCLASS,
   PCD_ANDSCRIPTVAR,
   PCD_ANDMAPVAR,
   PCD_ANDWORLDVAR,
   PCD_ANDGLOBALVAR,
   PCD_ANDMAPARRAY,
   PCD_ANDWORLDARRAY,
   PCD_ANDGLOBALARRAY,
   PCD_EORSCRIPTVAR,
   PCD_EORMAPVAR,
   PCD_EORWORLDVAR,
   PCD_EORGLOBALVAR,
   PCD_EORMAPARRAY,
   PCD_EORWORLDARRAY,
   PCD_EORGLOBALARRAY,
   PCD_ORSCRIPTVAR,
   PCD_ORMAPVAR,
   PCD_ORWORLDVAR,
   PCD_ORGLOBALVAR,
   PCD_ORMAPARRAY,
   PCD_ORWORLDARRAY,
   PCD_ORGLOBALARRAY,
   PCD_LSSCRIPTVAR,
   PCD_LSMAPVAR,
   PCD_LSWORLDVAR,
   PCD_LSGLOBALVAR,
   PCD_LSMAPARRAY,
   PCD_LSWORLDARRAY,
   PCD_LSGLOBALARRAY,
   PCD_RSSCRIPTVAR,
   PCD_RSMAPVAR,
   PCD_RSWORLDVAR,
   PCD_RSGLOBALVAR,
   PCD_RSMAPARRAY,
   PCD_RSWORLDARRAY,
   PCD_RSGLOBALARRAY,
   PCD_GETPLAYERINFO,
   PCD_CHANGELEVEL,
   PCD_SECTORDAMAGE,
   PCD_REPLACETEXTURES,
   PCD_NEGATEBINARY,
   PCD_GETACTORPITCH,
   PCD_SETACTORPITCH,
   PCD_PRINTBIND,
   PCD_SETACTORSTATE,
   PCD_THINGDAMAGE2,
   PCD_USEINVENTORY,
   PCD_USEACTORINVENTORY,
   PCD_CHECKACTORCEILINGTEXTURE,
   PCD_CHECKACTORFLOORTEXTURE,
   PCD_GETACTORLIGHTLEVEL,
   PCD_SETMUGSHOTSTATE,
   PCD_THINGCOUNTSECTOR,
   PCD_THINGCOUNTNAMESECTOR,
   PCD_CHECKPLAYERCAMERA,
   PCD_MORPHACTOR,
   PCD_UNMORPHACTOR,
   PCD_GETPLAYERINPUT,
   PCD_CLASSIFYACTOR,
   PCD_PRINTBINARY,
   PCD_PRINTHEX,
   PCD_CALLFUNC,
   PCD_SAVESTRING,
   PCD_PRINTMAPCHRANGE,
   PCD_PRINTWORLDCHRANGE,
   PCD_PRINTGLOBALCHRANGE,
   PCD_STRCPYTOMAPCHRANGE,
   PCD_STRCPYTOWORLDCHRANGE,
   PCD_STRCPYTOGLOBALCHRANGE,
   PCD_PUSHFUNCTION,
   PCD_CALLSTACK,
   PCD_SCRIPTWAITNAMED,
   PCD_TRANSLATIONRANGE3,
   PCD_GOTOSTACK,
   PCD_ASSIGNSCRIPTARRAY,
   PCD_PUSHSCRIPTARRAY,
   PCD_ADDSCRIPTARRAY,
   PCD_SUBSCRIPTARRAY,
   PCD_MULSCRIPTARRAY,
   PCD_DIVSCRIPTARRAY,
   PCD_MODSCRIPTARRAY,
   PCD_INCSCRIPTARRAY,
   PCD_DECSCRIPTARRAY,
   PCD_ANDSCRIPTARRAY,
   PCD_EORSCRIPTARRAY,
   PCD_ORSCRIPTARRAY,
   PCD_LSSCRIPTARRAY,
   PCD_RSSCRIPTARRAY,
   PCD_PRINTSCRIPTCHARARRAY,
   PCD_PRINTSCRIPTCHRANGE,
   PCD_STRCPYTOSCRIPTCHRANGE,
   PCD_LSPEC5EX,
   PCD_LSPEC5EXRESULT
};

// Extension functions.
enum {
   ACSF_GETLINEUDMFINT = 1,
   ACSF_GETLINEUDMFFIXED,
   ACSF_GETTHINGUDMFINT,
   ACSF_GETTHINGUDMFFIXED,
   ACSF_GETSECTORUDMFINT,
   ACSF_GETSECTORUDMFFIXED,
   ACSF_GETSIDEUDMFINT,
   ACSF_GETSIDEUDMFFIXED,
   ACSF_GETACTORVELX,
   ACSF_GETACTORVELY,
   ACSF_GETACTORVELZ,
   ACSF_SETACTIVATOR,
   ACSF_SETACTIVATORTOTARGET,
   ACSF_GETACTORVIEWHEIGHT,
   ACSF_GETCHAR,
   ACSF_GETAIRSUPPLY,
   ACSF_SETAIRSUPPLY,
   ACSF_SETSKYSCROLLSPEED,
   ACSF_GETARMORTYPE,
   ACSF_SPAWNSPOTFORCED,
   ACSF_SPAWNSPOTFACINGFORCED,
   ACSF_CHECKACTORPROPERTY,
   ACSF_SETACTORVELOCITY,
   ACSF_SETUSERVARIABLE,
   ACSF_GETUSERVARIABLE,
   ACSF_RADIUS_QUAKE2,
   ACSF_CHECKACTORCLASS,
   ACSF_SETUSERARRAY,
   ACSF_GETUSERARRAY,
   ACSF_SOUNDSEQUENCEONACTOR,
   ACSF_SOUNDSEQUENCEONSECTOR,
   ACSF_SOUNDSEQUENCEONPOLYOBJ,
   ACSF_GETPOLYOBJX,
   ACSF_GETPOLYOBJY,
   ACSF_CHECKSIGHT,
   ACSF_SPAWNFORCED,
   ACSF_ANNOUNCERSOUND,
   ACSF_SETPOINTER,
   ACSF_ACS_NAMEDEXECUTE,
   ACSF_ACS_NAMEDSUSPEND,
   ACSF_ACS_NAMEDTERMINATE,
   ACSF_ACS_NAMEDLOCKEDEXECUTE,
   ACSF_ACS_NAMEDLOCKEDEXECUTEDOOR,
   ACSF_ACS_NAMEDEXECUTEWITHRESULT,
   ACSF_ACS_NAMEDEXECUTEALWAYS,
   ACSF_UNIQUETID,
   ACSF_ISTIDUSED,
   ACSF_SQRT,
   ACSF_FIXEDSQRT,
   ACSF_VECTORLENGTH,
   ACSF_SETHUDCLIPRECT,
   ACSF_SETHUDWRAPWIDTH,
   ACSF_SETCVAR,
   ACSF_GETUSERCVAR,
   ACSF_SETUSERCVAR,
   ACSF_GETCVARSTRING,
   ACSF_SETCVARSTRING,
   ACSF_GETUSERCVARSTRING,
   ACSF_SETUSERCVARSTRING,
   ACSF_LINEATTACK,
   ACSF_PLAYSOUND,
   ACSF_STOPSOUND,
   ACSF_STRCMP,
   ACSF_STRICMP,
   ACSF_STRCASECMP = ACSF_STRICMP,
   ACSF_STRLEFT,
   ACSF_STRRIGHT,
   ACSF_STRMID,
   ACSF_GETACTORCLASS,
   ACSF_GETWEAPON,
   ACSF_SOUNDVOLUME,
   ACSF_PLAYACTORSOUND,
   ACSF_SPAWNDECAL,
   ACSF_CHECKFONT,
   ACSF_DROPITEM,
   ACSF_CHECKFLAG,
   ACSF_SETLINEACTIVATION,
   ACSF_GETLINEACTIVATION,
   ACSF_GETACTORPOWERUPTICS,
   ACSF_CHANGEACTORANGLE,
   ACSF_CHANGEACTORPITCH,
   ACSF_GETARMORINFO,
   ACSF_DROPINVENTORY,
   ACSF_PICKACTOR,
   ACSF_ISPOINTEREQUAL,
   ACSF_CANRAISEACTOR,
   ACSF_SETACTORTELEFOG,
   ACSF_SWAPACTORTELEFOG,
   ACSF_SETACTORROLL,
   ACSF_CHANGEACTORROLL,
   ACSF_GETACTORROLL,
   ACSF_QUAKEEX,
   ACSF_WARP,
   ACSF_GETMAXINVENTORY,
   ACSF_SETSECTORDAMAGE,
   ACSF_SETSECTORTERRAIN,
   ACSF_SPAWNPARTICLE,
   ACSF_SETMUSICVOLUME,
   ACSF_CHECKPROXIMITY,
   ACSF_RESETMAP = 100,
   ACSF_PLAYERISSPECTATOR,
   ACSF_CONSOLEPLAYERNUMBER,
   ACSF_GETTEAMPROPERTY,
   ACSF_GETPLAYERLIVESLEFT,
   ACSF_SETPLAYERLIVESLEFT,
   ACSF_KICKFROMGAME,
   ACSF_GETGAMEMODESTATE,
   ACSF_SETDBENTRY,
   ACSF_GETDBENTRY,
   ACSF_SETDBENTRYSTRING,
   ACSF_GETDBENTRYSTRING,
   ACSF_INCREMENTDBENTRY,
   ACSF_PLAYERISLOGGEDIN,
   ACSF_GETPLAYERACCOUNTNAME,
   ACSF_SORTDBENTRIES,
   ACSF_COUNTDBRESULTS,
   ACSF_FREEDBRESULTS,
   ACSF_GETDBRESULTKEYSTRING,
   ACSF_GETDBRESULTVALUESTRING,
   ACSF_GETDBRESULTVALUE,
   ACSF_GETDBENTRYRANK,
   ACSF_REQUESTSCRIPTPUKE,
   ACSF_BEGINDBTRANSACTION,
   ACSF_ENDDBTRANSACTION,
   ACSF_GETDBENTRIES,
   ACSF_NAMEDREQUESTSCRIPTPUKE,
   ACSF_SYSTEMTIME,
   ACSF_GETTIMEPROPERTY,
   ACSF_STRFTIME,
   ACSF_GETTEAMSCORE = 19620,
   ACSF_SETTEAMSCORE
};

}