2006-04-13 20:47:06 +00:00
//-------------------------------------------------------------------------
/*
2007-02-08 04:19:39 +00:00
Copyright ( C ) 1996 , 2003 - 3 D Realms Entertainment
Copyright ( C ) 2000 , 2003 - Matt Saettler ( EDuke Enhancements )
Copyright ( C ) 2004 , 2007 - EDuke32 developers
2006-04-13 20:47:06 +00:00
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 .
*/
//-------------------------------------------------------------------------
# include <time.h>
# include "duke3d.h"
# include "gamedef.h"
# include "scriplib.h"
# include "osd.h"
2007-02-08 04:19:39 +00:00
int g_i , g_p ;
2008-02-18 08:10:54 +00:00
static int g_x ;
static intptr_t * g_t ;
2006-04-13 20:47:06 +00:00
static spritetype * g_sp ;
2007-02-08 04:19:39 +00:00
static int killit_flag ;
2006-04-13 20:47:06 +00:00
2008-02-16 22:18:48 +00:00
static int parse ( void ) ;
2006-12-18 09:32:17 +00:00
static void DoUserDef ( int iSet , int lLabelID , int lVar2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue ;
2006-04-13 20:47:06 +00:00
2007-04-28 21:24:36 +00:00
if ( g_p ! = myconnectindex )
{
2008-02-14 08:35:30 +00:00
// if (lVar2 == MAXGAMEVARS)
// insptr++;
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2007-04-28 21:24:36 +00:00
return ;
}
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case USERDEFS_GOD :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . god = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . god , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_WARP_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . warp_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . warp_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_CASHMAN :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . cashman = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . cashman , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_EOG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . eog = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . eog , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SHOWALLMAP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . showallmap = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . showallmap , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SHOW_HELP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . show_help = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . show_help , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SCROLLMODE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . scrollmode = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . scrollmode , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_CLIPPING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . clipping = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . clipping , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
// case USERDEFS_USER_NAME:
2006-12-18 08:37:12 +00:00
// if(iSet)
2006-11-16 03:02:42 +00:00
// {
// ud.user_name[MAXPLAYERS][32] = lValue;
2008-02-18 08:10:54 +00:00
// return;
2006-11-16 03:02:42 +00:00
// }
2008-02-18 08:10:54 +00:00
// SetGameVarID(lVar2, ud.user_name[MAXPLAYERS][32], g_i, g_p);
2008-02-14 08:35:30 +00:00
// return;
2006-11-16 03:02:42 +00:00
// case USERDEFS_RIDECULE:
2006-12-18 08:37:12 +00:00
// if(iSet)
2006-11-16 03:02:42 +00:00
// {
// ud.ridecule = lValue;
2008-02-18 08:10:54 +00:00
// return;
2006-11-16 03:02:42 +00:00
// }
2008-02-18 08:10:54 +00:00
// SetGameVarID(lVar2, ud.ridecule, g_i, g_p);
2008-02-14 08:35:30 +00:00
// return;
2006-11-16 03:02:42 +00:00
// case USERDEFS_SAVEGAME:
2006-12-18 08:37:12 +00:00
// if(iSet)
2006-11-16 03:02:42 +00:00
// {
// ud.savegame = lValue;
2008-02-18 08:10:54 +00:00
// return;
2006-11-16 03:02:42 +00:00
// }
2008-02-18 08:10:54 +00:00
// SetGameVarID(lVar2, ud.savegame, g_i, g_p);
2008-02-14 08:35:30 +00:00
// return;
2006-11-16 03:02:42 +00:00
// case USERDEFS_PWLOCKOUT:
2006-12-18 08:37:12 +00:00
// if(iSet)
2006-11-16 03:02:42 +00:00
// {
// ud.pwlockout = lValue;
2008-02-18 08:10:54 +00:00
// return;
2006-11-16 03:02:42 +00:00
// }
2008-02-18 08:10:54 +00:00
// SetGameVarID(lVar2, ud.pwlockout, g_i, g_p);
2008-02-14 08:35:30 +00:00
// return;
2006-11-16 03:02:42 +00:00
// case USERDEFS_RTSNAME:
2006-12-18 08:37:12 +00:00
// if(iSet)
2006-11-16 03:02:42 +00:00
// {
// ud.rtsname = lValue;
2008-02-18 08:10:54 +00:00
// return;
2006-11-16 03:02:42 +00:00
// }
2008-02-18 08:10:54 +00:00
// SetGameVarID(lVar2, ud.rtsname, g_i, g_p);
2008-02-14 08:35:30 +00:00
// return;
2006-11-16 03:02:42 +00:00
case USERDEFS_OVERHEAD_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . overhead_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . overhead_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_LAST_OVERHEAD :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . last_overhead = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . last_overhead , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SHOWWEAPONS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . showweapons = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . showweapons , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_PAUSE_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . pause_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . pause_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FROM_BONUS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . from_bonus = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . from_bonus , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_CAMERASPRITE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . camerasprite = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . camerasprite , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_LAST_CAMSPRITE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . last_camsprite = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . last_camsprite , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_LAST_LEVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . last_level = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . last_level , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SECRETLEVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . secretlevel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . secretlevel , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_CONST_VISIBILITY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . const_visibility = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . const_visibility , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_UW_FRAMERATE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . uw_framerate = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . uw_framerate , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_CAMERA_TIME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . camera_time = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . camera_time , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FOLFVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . folfvel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . folfvel , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FOLAVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . folavel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . folavel , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FOLX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . folx = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . folx , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FOLY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . foly = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . foly , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FOLA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . fola = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . fola , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_RECCNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . reccnt = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . reccnt , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_ENTERED_NAME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . entered_name = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . entered_name , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SCREEN_TILTING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . screen_tilting = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . screen_tilting , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SHADOWS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . shadows = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . shadows , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FTA_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . fta_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . fta_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_EXECUTIONS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . executions = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . executions , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_AUTO_RUN :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . auto_run = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . auto_run , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_COORDS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . coords = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . coords , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_TICKRATE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . tickrate = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . tickrate , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_COOP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_coop = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_coop , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_COOP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . coop = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . coop , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_SCREEN_SIZE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2006-12-11 21:18:21 +00:00
{
2008-03-26 09:28:21 +00:00
if ( ud . screen_size ! = lValue )
2006-12-11 21:18:21 +00:00
{
2008-03-26 09:28:21 +00:00
ud . screen_size = lValue ;
vscrn ( ) ;
2006-12-11 21:18:21 +00:00
}
2008-02-14 08:35:30 +00:00
return ;
2006-12-11 21:18:21 +00:00
}
2008-02-14 08:35:30 +00:00
SetGameVarID ( lVar2 , ud . screen_size , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_LOCKOUT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . lockout = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . lockout , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_CROSSHAIR :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . crosshair = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . crosshair , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
// case USERDEFS_WCHOICE:
2006-12-18 08:37:12 +00:00
// if(iSet)
2006-11-16 03:02:42 +00:00
// {
// ud.wchoice = lValue;
2008-02-18 08:10:54 +00:00
// return;
2006-11-16 03:02:42 +00:00
// }
2008-02-18 08:10:54 +00:00
// SetGameVarID(lVar2, ud.wchoice, g_i, g_p);
2008-02-14 08:35:30 +00:00
// return;
2006-11-16 03:02:42 +00:00
case USERDEFS_PLAYERAI :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . playerai = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . playerai , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_RESPAWN_MONSTERS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . respawn_monsters = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . respawn_monsters , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_RESPAWN_ITEMS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . respawn_items = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . respawn_items , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_RESPAWN_INVENTORY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . respawn_inventory = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . respawn_inventory , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_RECSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . recstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . recstat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_MONSTERS_OFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . monsters_off = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . monsters_off , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_BRIGHTNESS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . brightness = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . brightness , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_RESPAWN_ITEMS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_respawn_items = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_respawn_items , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_RESPAWN_MONSTERS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_respawn_monsters = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_respawn_monsters , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_RESPAWN_INVENTORY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_respawn_inventory = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_respawn_inventory , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_RECSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_recstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_recstat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_MONSTERS_OFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_monsters_off = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_monsters_off , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_DETAIL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . detail = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . detail , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_FFIRE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_ffire = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_ffire , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_FFIRE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . ffire = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . ffire , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_PLAYER_SKILL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_player_skill = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_player_skill , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_LEVEL_NUMBER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_level_number = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_level_number , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_VOLUME_NUMBER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_volume_number = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_volume_number , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_MULTIMODE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . multimode = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . multimode , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_PLAYER_SKILL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . player_skill = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . player_skill , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_LEVEL_NUMBER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . level_number = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . level_number , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_VOLUME_NUMBER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . volume_number = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . volume_number , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_MARKER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_marker = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_marker , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_MARKER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . marker = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . marker , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_MOUSEFLIP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . mouseflip = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . mouseflip , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_STATUSBARSCALE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . statusbarscale = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . statusbarscale , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_DRAWWEAPON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . drawweapon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . drawweapon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_MOUSEAIMING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . mouseaiming = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . mouseaiming , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_WEAPONSWITCH :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . weaponswitch = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . weaponswitch , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_DEMOCAMS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . democams = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . democams , g_i , g_p ) ;
return ;
2006-04-17 01:01:32 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_COLOR :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . color = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . color , g_i , g_p ) ;
return ;
2006-04-18 06:01:16 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_MSGDISPTIME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . msgdisptime = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . msgdisptime , g_i , g_p ) ;
return ;
2006-04-22 07:00:31 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_STATUSBARMODE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . statusbarmode = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . statusbarmode , g_i , g_p ) ;
return ;
2006-04-30 01:39:58 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_M_NOEXITS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . m_noexits = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . m_noexits , g_i , g_p ) ;
return ;
2006-05-04 03:14:49 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_NOEXITS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . noexits = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . noexits , g_i , g_p ) ;
return ;
2006-05-04 03:14:49 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_AUTOVOTE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . autovote = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . autovote , g_i , g_p ) ;
return ;
2006-05-04 04:18:55 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_AUTOMSG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . automsg = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . automsg , g_i , g_p ) ;
return ;
2006-05-05 01:20:19 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_IDPLAYERS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . idplayers = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . idplayers , g_i , g_p ) ;
return ;
2006-05-05 22:39:34 +00:00
2006-11-16 03:02:42 +00:00
case USERDEFS_TEAM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
ud . team = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . team , g_i , g_p ) ;
return ;
2006-08-18 23:52:26 +00:00
2007-02-25 21:11:59 +00:00
case USERDEFS_VIEWBOB :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-02-25 21:11:59 +00:00
ud . viewbob = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . viewbob , g_i , g_p ) ;
return ;
2007-02-25 21:11:59 +00:00
case USERDEFS_WEAPONSWAY :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-02-25 21:11:59 +00:00
ud . weaponsway = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . weaponsway , g_i , g_p ) ;
return ;
2007-02-25 21:11:59 +00:00
2007-03-24 23:17:56 +00:00
case USERDEFS_ANGLEINTERPOLATION :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-03-24 23:17:56 +00:00
ud . angleinterpolation = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . angleinterpolation , g_i , g_p ) ;
return ;
2007-03-24 23:17:56 +00:00
case USERDEFS_DEATHMSGS :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-03-24 23:17:56 +00:00
ud . deathmsgs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , ud . deathmsgs , g_i , g_p ) ;
return ;
2007-03-24 23:17:56 +00:00
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-18 09:32:17 +00:00
static void DoThisProjectile ( int iSet , int lVar1 , int lLabelID , int lVar2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue , proj = g_i ;
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
if ( lVar1 ! = g_iThisActorID )
proj = GetGameVarID ( lVar1 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( proj < 0 | | proj > = MAXSPRITES )
2006-12-21 09:33:26 +00:00
{
OSD_Printf ( " DoThisProjectile(): invalid projectile (%d) \n " , proj ) ;
2008-02-14 08:35:30 +00:00
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2006-06-14 03:31:34 +00:00
return ;
2006-12-21 09:33:26 +00:00
}
2006-06-14 03:31:34 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case PROJ_WORKSLIKE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . workslike = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . workslike , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SPAWNS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . spawns = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . spawns , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SXREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . sxrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . sxrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SYREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . syrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . syrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SOUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . sound = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . sound , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_ISOUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . isound = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . isound , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_VEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . vel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . vel , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_EXTRA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . extra = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . extra , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_DECAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . decal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . decal , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TRAIL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . trail = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . trail , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TXREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . txrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . txrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TYREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . tyrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . tyrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TOFFSET :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . toffset = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . toffset , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . tnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . tnum , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_DROP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . drop = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . drop , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_CSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . cstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . cstat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_CLIPDIST :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . clipdist = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . clipdist , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SHADE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . shade = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . shade , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_XREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . xrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . xrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_YREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . yrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . yrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_PAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . pal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . pal , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_EXTRA_RAND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . extra_rand = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . extra_rand , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_HITRADIUS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . hitradius = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . hitradius , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_VEL_MULT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . velmult = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . velmult , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_OFFSET :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . offset = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . offset , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_BOUNCES :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . bounces = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . bounces , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_BSOUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . bsound = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . bsound , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_RANGE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-09-11 05:26:38 +00:00
hittype [ proj ] . projectile . range = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ proj ] . projectile . range , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-18 09:32:17 +00:00
static void DoPlayer ( int iSet , int lVar1 , int lLabelID , int lVar2 , int lParm2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue ;
int lTemp ;
2006-12-18 08:37:12 +00:00
int iPlayer = g_p ;
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
if ( lVar1 ! = g_iThisActorID )
iPlayer = GetGameVarID ( lVar1 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2007-08-27 06:46:31 +00:00
if ( iPlayer < 0 | | iPlayer > = ud . multimode )
2007-04-28 21:24:36 +00:00
{
2008-02-14 08:35:30 +00:00
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2007-08-27 06:46:31 +00:00
OSD_Printf ( " DoPlayer(): invalid target player (%d) %d \n " , iPlayer , g_i ) ;
2006-04-13 20:47:06 +00:00
return ;
2007-04-28 21:24:36 +00:00
}
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case PLAYER_ZOOM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > zoom = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > zoom , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_EXITX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > exitx = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > exitx , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_EXITY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > exity = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > exity , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LOOGIEX :
2006-12-18 09:32:17 +00:00
lTemp = lParm2 ;
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > loogiex [ lTemp ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > loogiex [ lTemp ] , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LOOGIEY :
2006-12-18 09:32:17 +00:00
lTemp = lParm2 ;
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > loogiey [ lTemp ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > loogiey [ lTemp ] , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_NUMLOOGS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > numloogs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > numloogs , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LOOGCNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > loogcnt = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > loogcnt , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_POSX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > posx = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > posx , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_POSY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > posy = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > posy , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_POSZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > posz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > posz , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HORIZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > horiz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > horiz , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OHORIZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > ohoriz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > ohoriz , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OHORIZOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > ohorizoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > ohorizoff , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_INVDISPTIME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > invdisptime = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > invdisptime , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_BOBPOSX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > bobposx = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > bobposx , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_BOBPOSY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > bobposy = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > bobposy , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OPOSX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > oposx = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > oposx , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OPOSY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > oposy = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > oposy , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OPOSZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > oposz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > oposz , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_PYOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > pyoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > pyoff , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OPYOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > opyoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > opyoff , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_POSXV :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > posxv = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > posxv , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_POSYV :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > posyv = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > posyv , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_POSZV :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > poszv = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > poszv , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LAST_PISSED_TIME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > last_pissed_time = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > last_pissed_time , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_TRUEFZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > truefz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > truefz , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_TRUECZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > truecz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > truecz , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_PLAYER_PAR :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > player_par = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > player_par , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_VISIBILITY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > visibility = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > visibility , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_BOBCOUNTER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > bobcounter = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > bobcounter , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WEAPON_SWAY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > weapon_sway = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > weapon_sway , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_PALS_TIME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > pals_time = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > pals_time , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_RANDOMFLAMEX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > randomflamex = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > randomflamex , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_CRACK_TIME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > crack_time = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > crack_time , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_AIM_MODE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > aim_mode = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > aim_mode , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > ang = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > ang , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > oang = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > oang , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ANGVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > angvel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > angvel , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_CURSECTNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > cursectnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > cursectnum , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LOOK_ANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > look_ang = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > look_ang , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LAST_EXTRA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > last_extra = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > last_extra , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SUBWEAPON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > subweapon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > subweapon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_AMMO_AMOUNT :
2006-12-18 09:32:17 +00:00
lTemp = lParm2 ;
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > ammo_amount [ lTemp ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > ammo_amount [ lTemp ] , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WACKEDBYACTOR :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > wackedbyactor = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > wackedbyactor , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FRAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > frag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > frag , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FRAGGEDSELF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > fraggedself = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > fraggedself , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_CURR_WEAPON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > curr_weapon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > curr_weapon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LAST_WEAPON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > last_weapon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > last_weapon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_TIPINCS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > tipincs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > tipincs , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HORIZOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > horizoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > horizoff , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WANTWEAPONFIRE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > wantweaponfire = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > wantweaponfire , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HOLODUKE_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > holoduke_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > holoduke_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_NEWOWNER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > newowner = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > newowner , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HURT_DELAY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > hurt_delay = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > hurt_delay , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HBOMB_HOLD_DELAY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > hbomb_hold_delay = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > hbomb_hold_delay , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_JUMPING_COUNTER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > jumping_counter = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > jumping_counter , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_AIRLEFT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > airleft = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > airleft , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_KNEE_INCS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > knee_incs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > knee_incs , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ACCESS_INCS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > access_incs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > access_incs , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FTA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > fta = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > fta , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FTQ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > ftq = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > ftq , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ACCESS_WALLNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > access_wallnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > access_wallnum , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ACCESS_SPRITENUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > access_spritenum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > access_spritenum , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_KICKBACK_PIC :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > kickback_pic = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > kickback_pic , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_GOT_ACCESS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > got_access = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > got_access , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WEAPON_ANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > weapon_ang = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > weapon_ang , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FIRSTAID_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > firstaid_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > firstaid_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SOMETHINGONPLAYER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > somethingonplayer = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > somethingonplayer , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ON_CRANE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > on_crane = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > on_crane , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_I :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > i = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > i , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ONE_PARALLAX_SECTNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > one_parallax_sectnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > one_parallax_sectnum , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_OVER_SHOULDER_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > over_shoulder_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > over_shoulder_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_RANDOM_CLUB_FRAME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > random_club_frame = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > random_club_frame , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FIST_INCS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > fist_incs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > fist_incs , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ONE_EIGHTY_COUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > one_eighty_count = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > one_eighty_count , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_CHEAT_PHASE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > cheat_phase = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > cheat_phase , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_DUMMYPLAYERSPRITE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > dummyplayersprite = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > dummyplayersprite , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_EXTRA_EXTRA8 :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > extra_extra8 = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > extra_extra8 , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_QUICK_KICK :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > quick_kick = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > quick_kick , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HEAT_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > heat_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > heat_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ACTORSQU :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > actorsqu = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > actorsqu , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_TIMEBEFOREEXIT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > timebeforeexit = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > timebeforeexit , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_CUSTOMEXITSOUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > customexitsound = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > customexitsound , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WEAPRECS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > weaprecs [ 16 ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > weaprecs [ 16 ] , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WEAPRECCNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > weapreccnt = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > weapreccnt , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_INTERFACE_TOGGLE_FLAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > interface_toggle_flag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > interface_toggle_flag , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ROTSCRNANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > rotscrnang = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > rotscrnang , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_DEAD_FLAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > dead_flag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > dead_flag , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SHOW_EMPTY_WEAPON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > show_empty_weapon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > show_empty_weapon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SCUBA_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > scuba_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > scuba_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_JETPACK_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > jetpack_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > jetpack_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_STEROIDS_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > steroids_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > steroids_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SHIELD_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > shield_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > shield_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HOLODUKE_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > holoduke_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > holoduke_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_PYCOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > pycount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > pycount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WEAPON_POS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > weapon_pos = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > weapon_pos , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FRAG_PS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > frag_ps = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > frag_ps , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_TRANSPORTER_HOLD :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > transporter_hold = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > transporter_hold , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LAST_FULL_WEAPON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > last_full_weapon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > last_full_weapon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FOOTPRINTSHADE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > footprintshade = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > footprintshade , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_BOOT_AMOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > boot_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > boot_amount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SCREAM_VOICE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > scream_voice = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > scream_voice , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_GM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > gm = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > gm , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ON_WARPING_SECTOR :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > on_warping_sector = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > on_warping_sector , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FOOTPRINTCOUNT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > footprintcount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > footprintcount , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HBOMB_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > hbomb_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > hbomb_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_JUMPING_TOGGLE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > jumping_toggle = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > jumping_toggle , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_RAPID_FIRE_HOLD :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > rapid_fire_hold = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > rapid_fire_hold , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ON_GROUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > on_ground = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > on_ground , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_NAME :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > name [ 32 ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > name [ 32 ] , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_INVEN_ICON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > inven_icon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > inven_icon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_BUTTONPALETTE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > buttonpalette = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > buttonpalette , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_JETPACK_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > jetpack_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > jetpack_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SPRITEBRIDGE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > spritebridge = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > spritebridge , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_LASTRANDOMSPOT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > lastrandomspot = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > lastrandomspot , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SCUBA_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > scuba_on = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > scuba_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FOOTPRINTPAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > footprintpal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > footprintpal , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HEAT_ON :
2006-12-18 08:37:12 +00:00
if ( iSet )
{
{
2008-02-14 08:35:30 +00:00
if ( g_player [ iPlayer ] . ps - > heat_on ! = lValue )
{
g_player [ iPlayer ] . ps - > heat_on = lValue ;
setpal ( g_player [ iPlayer ] . ps ) ;
}
2006-12-18 08:37:12 +00:00
}
2008-02-14 08:35:30 +00:00
return ;
2006-12-18 08:37:12 +00:00
}
2008-02-14 08:35:30 +00:00
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > heat_on , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HOLSTER_WEAPON :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > holster_weapon = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > holster_weapon , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_FALLING_COUNTER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > falling_counter = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > falling_counter , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_GOTWEAPON :
2006-12-18 09:32:17 +00:00
lTemp = lParm2 ;
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > gotweapon [ lTemp ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > gotweapon [ lTemp ] , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_REFRESH_INVENTORY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > refresh_inventory = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > refresh_inventory , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
// case PLAYER_PALETTE:
2006-12-18 08:37:12 +00:00
// if(iSet)
2006-11-16 03:02:42 +00:00
// {
2007-08-27 06:46:31 +00:00
// g_player[iPlayer].ps->palette=lValue;
2006-11-16 03:02:42 +00:00
// }
2008-02-14 08:35:30 +00:00
// return; }
2006-11-16 03:02:42 +00:00
// {
2007-08-27 06:46:31 +00:00
// SetGameVarID(lVar2, g_player[iPlayer].ps->palette, g_i, g_p);
2006-11-16 03:02:42 +00:00
// }
2008-02-14 08:35:30 +00:00
// return;
2006-11-16 03:02:42 +00:00
case PLAYER_TOGGLE_KEY_FLAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > toggle_key_flag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > toggle_key_flag , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_KNUCKLE_INCS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > knuckle_incs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > knuckle_incs , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WALKING_SND_TOGGLE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > walking_snd_toggle = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > walking_snd_toggle , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_PALOOKUP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > palookup = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > palookup , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_HARD_LANDING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > hard_landing = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > hard_landing , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_MAX_SECRET_ROOMS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > max_secret_rooms = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > max_secret_rooms , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SECRET_ROOMS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > secret_rooms = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > secret_rooms , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_PALS :
2006-12-18 09:32:17 +00:00
lTemp = lParm2 ;
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > pals [ lTemp ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > pals [ lTemp ] , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_MAX_ACTORS_KILLED :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > max_actors_killed = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > max_actors_killed , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_ACTORS_KILLED :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > actors_killed = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > actors_killed , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_RETURN_TO_CENTER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > return_to_center = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > return_to_center , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_RUNSPEED :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > runspeed = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > runspeed , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SBS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > sbs = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > sbs , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_RELOADING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > reloading = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > reloading , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_AUTO_AIM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > auto_aim = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > auto_aim , g_i , g_p ) ;
return ;
2006-08-18 23:52:26 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_MOVEMENT_LOCK :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > movement_lock = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > movement_lock , g_i , g_p ) ;
return ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_SOUND_PITCH :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > sound_pitch = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > sound_pitch , g_i , g_p ) ;
return ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case PLAYER_WEAPONSWITCH :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > weaponswitch = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > weaponswitch , g_i , g_p ) ;
return ;
2006-11-16 03:02:42 +00:00
case PLAYER_TEAM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . ps - > team = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > team , g_i , g_p ) ;
return ;
2006-11-16 03:02:42 +00:00
2007-08-27 23:11:49 +00:00
case PLAYER_MAX_PLAYER_HEALTH :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 23:11:49 +00:00
g_player [ iPlayer ] . ps - > max_player_health = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > max_player_health , g_i , g_p ) ;
return ;
2007-08-27 23:11:49 +00:00
case PLAYER_MAX_SHIELD_AMOUNT :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 23:11:49 +00:00
g_player [ iPlayer ] . ps - > max_shield_amount = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > max_shield_amount , g_i , g_p ) ;
return ;
2007-08-27 23:11:49 +00:00
case PLAYER_MAX_AMMO_AMOUNT :
lTemp = lParm2 ;
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 23:11:49 +00:00
g_player [ iPlayer ] . ps - > max_ammo_amount [ lTemp ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . ps - > max_ammo_amount [ lTemp ] , g_i , g_p ) ;
return ;
2007-08-27 23:11:49 +00:00
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-18 09:32:17 +00:00
static void DoInput ( int iSet , int lVar1 , int lLabelID , int lVar2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue ;
2006-12-18 08:37:12 +00:00
int iPlayer = g_p ;
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
if ( lVar1 ! = g_iThisActorID )
iPlayer = GetGameVarID ( lVar1 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2007-08-27 06:46:31 +00:00
if ( iPlayer < 0 | | iPlayer > = ud . multimode )
2007-04-28 21:24:36 +00:00
{
2008-02-14 08:35:30 +00:00
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2007-08-27 06:46:31 +00:00
OSD_Printf ( " DoInput(): invalid target player (%d) %d \n " , iPlayer , g_i ) ;
2006-04-13 20:47:06 +00:00
return ;
2007-04-28 21:24:36 +00:00
}
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case INPUT_AVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . sync - > avel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . sync - > avel , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case INPUT_HORZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . sync - > horz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . sync - > horz , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case INPUT_FVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . sync - > fvel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . sync - > fvel , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case INPUT_SVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . sync - > svel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . sync - > svel , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case INPUT_BITS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . sync - > bits = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . sync - > bits , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case INPUT_EXTBITS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ iPlayer ] . sync - > extbits = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , g_player [ iPlayer ] . sync - > extbits , g_i , g_p ) ;
return ;
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-18 09:32:17 +00:00
static void DoWall ( int iSet , int lVar1 , int lLabelID , int lVar2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue ;
2006-12-18 09:32:17 +00:00
int iWall = GetGameVarID ( lVar1 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( iWall < 0 | | iWall > = MAXWALLS )
2007-04-28 21:24:36 +00:00
{
2008-02-14 08:35:30 +00:00
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2006-04-13 20:47:06 +00:00
return ;
2007-04-28 21:24:36 +00:00
}
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case WALL_X :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . x = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . x , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_Y :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . y = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . y , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_POINT2 :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . point2 = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . point2 , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_NEXTWALL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . nextwall = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . nextwall , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_NEXTSECTOR :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . nextsector = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . nextsector , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_CSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . cstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . cstat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_PICNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . picnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . picnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_OVERPICNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . overpicnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . overpicnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_SHADE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . shade = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . shade , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_PAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . pal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . pal , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_XREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . xrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . xrepeat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_YREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . yrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . yrepeat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_XPANNING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . xpanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . xpanning , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_YPANNING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . ypanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . ypanning , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_LOTAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . lotag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . lotag , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_HITAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . hitag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . hitag , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case WALL_EXTRA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
wall [ iWall ] . extra = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , wall [ iWall ] . extra , g_i , g_p ) ;
return ;
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-18 09:32:17 +00:00
static void DoSector ( int iSet , int lVar1 , int lLabelID , int lVar2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue ;
2006-12-18 08:37:12 +00:00
int iSector = sprite [ g_i ] . sectnum ;
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
if ( lVar1 ! = g_iThisActorID )
iSector = GetGameVarID ( lVar1 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( iSector < 0 | | iSector > = MAXSECTORS )
2007-04-28 21:24:36 +00:00
{
2008-02-14 08:35:30 +00:00
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2006-04-13 20:47:06 +00:00
return ;
2007-04-28 21:24:36 +00:00
}
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case SECTOR_WALLPTR :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . wallptr = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . wallptr , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_WALLNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . wallnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . wallnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_CEILINGZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . ceilingz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingz , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorz , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_CEILINGSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . ceilingstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingstat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorstat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_CEILINGPICNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . ceilingpicnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingpicnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_CEILINGSLOPE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . ceilingheinum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingheinum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_CEILINGSHADE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . ceilingshade = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingshade , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_CEILINGPAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . ceilingpal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingpal , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_CEILINGXPANNING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . ceilingxpanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingxpanning , g_i , g_p ) ;
return ;
2007-06-02 23:31:43 +00:00
case SECTOR_CEILINGYPANNING :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-06-02 23:31:43 +00:00
sector [ iSector ] . ceilingypanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . ceilingypanning , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORPICNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorpicnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorpicnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORSLOPE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorheinum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorheinum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORSHADE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorshade = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorshade , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORPAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorpal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorpal , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORXPANNING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorxpanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorxpanning , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_FLOORYPANNING :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . floorypanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . floorypanning , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_VISIBILITY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . visibility = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . visibility , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_ALIGNTO :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . filler = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . filler , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_LOTAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . lotag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . lotag , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_HITAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . hitag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . hitag , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case SECTOR_EXTRA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sector [ iSector ] . extra = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sector [ iSector ] . extra , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-18 09:32:17 +00:00
static void DoActor ( int iSet , int lVar1 , int lLabelID , int lVar2 , int lParm2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue ;
int lTemp ;
2006-12-18 08:37:12 +00:00
int iActor = g_i ;
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
if ( lVar1 ! = g_iThisActorID )
iActor = GetGameVarID ( lVar1 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( iActor < 0 | | iActor > = MAXSPRITES )
2006-12-21 09:33:26 +00:00
{
2006-12-23 02:38:47 +00:00
OSD_Printf ( " DoActor(): invalid target sprite (%d) %d %d \n " , iActor , g_i , g_sp - > picnum ) ;
2008-02-14 08:35:30 +00:00
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2006-04-13 20:47:06 +00:00
return ;
2006-12-21 09:33:26 +00:00
}
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case ACTOR_X :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . x = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . x , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_Y :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . y = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . y , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_Z :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . z = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . z , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_CSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . cstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . cstat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_PICNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . picnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . picnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_SHADE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . shade = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . shade , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_PAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . pal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . pal , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_CLIPDIST :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . clipdist = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . clipdist , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_DETAIL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . filler = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . filler , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_XREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . xrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . xrepeat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_YREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . yrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . yrepeat , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_XOFFSET :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . xoffset = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . xoffset , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_YOFFSET :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . yoffset = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . yoffset , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_SECTNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
changespritesect ( iActor , lValue ) ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . sectnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_STATNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
changespritestat ( iActor , lValue ) ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . statnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_ANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . ang = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . ang , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_OWNER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . owner = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . owner , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_XVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . xvel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . xvel , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_YVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . yvel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . yvel , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_ZVEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . zvel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . zvel , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_LOTAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . lotag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . lotag , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HITAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . hitag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . hitag , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_EXTRA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
sprite [ iActor ] . extra = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , sprite [ iActor ] . extra , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTCGG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . cgg = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . cgg , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTPICNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . picnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . picnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . ang = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . ang , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTEXTRA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . extra = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . extra , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTOWNER :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . owner = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . owner , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTMOVFLAG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . movflag = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . movflag , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTTEMPANG :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
hittype [ iActor ] . tempang = lValue ;
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . tempang , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTACTORSTAYPUT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . actorstayput = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . actorstayput , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTDISPICNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . dispicnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . dispicnum , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTTIMETOSLEEP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . timetosleep = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . timetosleep , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTFLOORZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . floorz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . floorz , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTCEILINGZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . ceilingz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . ceilingz , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTLASTVX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . lastvx = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . lastvx , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTLASTVY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . lastvy = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . lastvy , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTBPOSX :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . bposx = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . bposx , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTBPOSY :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . bposy = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . bposy , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTBPOSZ :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . bposz = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . bposz , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_HTG_T :
2006-12-18 09:32:17 +00:00
lTemp = lParm2 ;
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ iActor ] . temp_data [ lTemp ] = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , hittype [ iActor ] . temp_data [ lTemp ] , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_ANGOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
spriteext [ iActor ] . angoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . angoff , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_PITCH :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
spriteext [ iActor ] . pitch = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . pitch , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_ROLL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
spriteext [ iActor ] . roll = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . roll , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_MDXOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
spriteext [ iActor ] . xoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . xoff , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_MDYOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
spriteext [ iActor ] . yoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . yoff , g_i , g_p ) ;
return ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case ACTOR_MDZOFF :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-11-16 03:02:42 +00:00
spriteext [ iActor ] . zoff = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . zoff , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2007-08-19 00:15:30 +00:00
case ACTOR_MDFLAGS :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2007-08-19 00:15:30 +00:00
spriteext [ iActor ] . flags = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . flags , g_i , g_p ) ;
return ;
2007-08-19 00:15:30 +00:00
2008-01-03 21:54:58 +00:00
case ACTOR_XPANNING :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2008-01-03 21:54:58 +00:00
spriteext [ iActor ] . xpanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . xpanning , g_i , g_p ) ;
return ;
2008-01-03 21:54:58 +00:00
case ACTOR_YPANNING :
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2008-01-03 21:54:58 +00:00
spriteext [ iActor ] . ypanning = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , spriteext [ iActor ] . ypanning , g_i , g_p ) ;
return ;
2008-01-03 21:54:58 +00:00
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-18 09:32:17 +00:00
static void DoProjectile ( int iSet , int lVar1 , int lLabelID , int lVar2 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int lValue ;
2006-04-18 03:11:38 +00:00
2006-12-21 09:33:26 +00:00
if ( lVar1 < 0 | | lVar1 > = MAXTILES )
{
OSD_Printf ( " DoProjectile(): invalid tile (%d) \n " , lVar1 ) ;
2008-02-14 08:35:30 +00:00
insptr + = ( lVar2 = = MAXGAMEVARS ) ;
2006-04-18 03:11:38 +00:00
return ;
2006-12-21 09:33:26 +00:00
}
2006-04-18 03:11:38 +00:00
2006-12-18 09:32:17 +00:00
lValue = GetGameVarID ( lVar2 , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-12-18 09:32:17 +00:00
switch ( lLabelID )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case PROJ_WORKSLIKE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . workslike = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . workslike , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SPAWNS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . spawns = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . spawns , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SXREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . sxrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . sxrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SYREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . syrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . syrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SOUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . sound = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . sound , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_ISOUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . isound = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . isound , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_VEL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . vel = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . vel , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_EXTRA :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . extra = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . extra , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_DECAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . decal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . decal , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TRAIL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . trail = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . trail , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TXREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . txrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . txrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TYREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . tyrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . tyrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TOFFSET :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . toffset = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . toffset , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_TNUM :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . tnum = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . tnum , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_DROP :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . drop = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . drop , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_CSTAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . cstat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . cstat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_CLIPDIST :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . clipdist = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . clipdist , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_SHADE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . shade = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . shade , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_XREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . xrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . xrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_YREPEAT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . yrepeat = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . yrepeat , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_PAL :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . pal = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . pal , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_EXTRA_RAND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . extra_rand = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . extra_rand , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_HITRADIUS :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . hitradius = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . hitradius , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_VEL_MULT :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . velmult = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . velmult , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_OFFSET :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . offset = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . offset , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_BOUNCES :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . bounces = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . bounces , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_BSOUND :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . bsound = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . bsound , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case PROJ_RANGE :
2006-12-18 08:37:12 +00:00
if ( iSet )
2008-02-14 08:35:30 +00:00
{
2006-12-21 09:33:26 +00:00
projectile [ lVar1 ] . range = lValue ;
2008-02-14 08:35:30 +00:00
return ;
}
SetGameVarID ( lVar2 , projectile [ lVar1 ] . range , g_i , g_p ) ;
return ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
default :
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
}
2007-12-12 17:42:14 +00:00
void OnEvent ( int iEventID , int iActor , int iPlayer , int lDist )
2006-04-13 20:47:06 +00:00
{
2006-12-23 02:38:47 +00:00
if ( iEventID > = MAXGAMEEVENTS )
2006-12-21 09:33:26 +00:00
{
2007-02-08 04:19:39 +00:00
OSD_Printf ( " OnEvent(): invalid event ID " ) ;
2006-12-21 09:33:26 +00:00
return ;
}
2006-04-13 20:47:06 +00:00
2006-12-23 02:38:47 +00:00
if ( apScriptGameEvent [ iEventID ] = = 0 )
2006-04-13 20:47:06 +00:00
{
2006-12-23 02:38:47 +00:00
//Bsprintf(g_szBuf,"No event found for %d",iEventID);
//AddLog(g_szBuf);
2006-04-13 20:47:06 +00:00
return ;
}
{
2006-12-21 09:33:26 +00:00
int og_i = g_i , og_p = g_p , okillit_flag = killit_flag ;
2007-12-12 17:42:14 +00:00
int og_x = g_x , * og_t = g_t , * oinsptr = insptr ;
2006-12-21 09:33:26 +00:00
spritetype * og_sp = g_sp ;
2007-02-08 04:19:39 +00:00
2006-12-21 09:33:26 +00:00
g_i = iActor ; // current sprite ID
g_p = iPlayer ; // current player ID
g_x = lDist ; // ?
g_sp = & sprite [ g_i ] ;
g_t = & hittype [ g_i ] . temp_data [ 0 ] ;
insptr = ( apScriptGameEvent [ iEventID ] ) ;
//Bsprintf(g_szBuf,"Executing event for %d at %lX",iEventID, insptr);
2006-04-13 20:47:06 +00:00
//AddLog(g_szBuf);
2006-12-21 09:33:26 +00:00
killit_flag = 0 ;
2006-04-13 20:47:06 +00:00
2006-12-21 09:33:26 +00:00
while ( 1 ) if ( parse ( ) ) break ;
2006-11-13 23:12:47 +00:00
2006-12-21 09:33:26 +00:00
if ( killit_flag = = 1 )
2006-11-13 23:12:47 +00:00
{
2006-12-21 09:33:26 +00:00
// if player was set to squish, first stop that...
if ( g_p > = 0 )
{
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > actorsqu = = g_i )
g_player [ g_p ] . ps - > actorsqu = - 1 ;
2006-12-21 09:33:26 +00:00
}
deletesprite ( g_i ) ;
2006-11-13 23:12:47 +00:00
}
2006-04-13 20:47:06 +00:00
2006-12-21 09:33:26 +00:00
// restore old values...
g_i = og_i ;
g_p = og_p ;
g_x = og_x ;
g_sp = og_sp ;
g_t = og_t ;
killit_flag = okillit_flag ;
insptr = oinsptr ;
2006-04-13 20:47:06 +00:00
2006-12-21 09:33:26 +00:00
//AddLog("End of Execution");
}
2006-04-13 20:47:06 +00:00
}
2006-12-23 02:38:47 +00:00
static int ifsquished ( int i , int p )
2006-12-10 03:15:56 +00:00
{
2006-12-21 09:33:26 +00:00
sectortype * sc = & sector [ SECT ] ;
int squishme ;
2006-12-10 03:15:56 +00:00
if ( PN = = APLAYER & & ud . clipping )
return 0 ;
if ( sc - > lotag ! = 23 )
{
2006-12-23 02:38:47 +00:00
squishme = ( sc - > floorz - sc - > ceilingz < ( 12 < < 8 ) ) ; // && (sc->lotag&32768) == 0;
2006-12-18 08:37:12 +00:00
2006-12-10 03:15:56 +00:00
if ( sprite [ i ] . pal = = 1 )
2006-12-23 02:38:47 +00:00
squishme = ( sc - > floorz - sc - > ceilingz < ( 32 < < 8 ) & & ( sc - > lotag & 32768 ) = = 0 ) ;
2006-12-10 03:15:56 +00:00
}
else squishme = 0 ;
if ( squishme )
{
2007-08-27 06:46:31 +00:00
FTA ( 10 , g_player [ p ] . ps ) ;
2006-12-10 03:15:56 +00:00
if ( badguy ( & sprite [ i ] ) ) sprite [ i ] . xvel = 0 ;
if ( sprite [ i ] . pal = = 1 )
{
hittype [ i ] . picnum = SHOTSPARK1 ;
hittype [ i ] . extra = 1 ;
return 0 ;
}
return 1 ;
}
return 0 ;
}
2007-08-27 00:20:15 +00:00
static void forceplayerangle ( player_struct * p )
2006-12-10 06:49:01 +00:00
{
2006-12-20 03:27:25 +00:00
int n = 128 - ( TRAND & 255 ) ;
2006-12-10 06:49:01 +00:00
p - > horiz + = 64 ;
p - > return_to_center = 9 ;
p - > look_ang = n > > 1 ;
p - > rotscrnang = n > > 1 ;
}
2006-12-10 03:15:56 +00:00
static char dodge ( spritetype * s )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int bx , by , bxvect , byvect , d , i ;
int mx = s - > x , my = s - > y ;
int mxvect = sintable [ ( s - > ang + 512 ) & 2047 ] ;
int myvect = sintable [ s - > ang & 2047 ] ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
for ( i = headspritestat [ 4 ] ; i > = 0 ; i = nextspritestat [ i ] ) //weapons list
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( OW = = i | | SECT ! = s - > sectnum )
2006-04-13 20:47:06 +00:00
continue ;
bx = SX - mx ;
by = SY - my ;
2006-11-15 01:16:55 +00:00
bxvect = sintable [ ( SA + 512 ) & 2047 ] ;
byvect = sintable [ SA & 2047 ] ;
2006-04-13 20:47:06 +00:00
if ( mxvect * bx + myvect * by > = 0 )
if ( bxvect * bx + byvect * by < 0 )
{
d = bxvect * by - byvect * bx ;
if ( klabs ( d ) < 65536 * 64 )
{
s - > ang - = 512 + ( TRAND & 1024 ) ;
return 1 ;
}
}
}
return 0 ;
}
2006-12-20 03:27:25 +00:00
int furthestangle ( int iActor , int angs )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
short hitsect , hitwall , hitspr , furthest_angle = 0 ;
2007-12-12 17:42:14 +00:00
int hx , hy , hz , d ;
2006-12-20 03:27:25 +00:00
spritetype * s = & sprite [ iActor ] ;
2007-12-12 17:42:14 +00:00
int greatestd = - ( 1 < < 30 ) ;
2006-12-20 03:27:25 +00:00
int angincs = 2048 / angs , j ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( s - > picnum ! = APLAYER )
2006-11-14 21:35:50 +00:00
if ( ( g_t [ 0 ] & 63 ) > 2 ) return ( s - > ang + 1024 ) ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
for ( j = s - > ang ; j < ( 2048 + s - > ang ) ; j + = angincs )
2006-04-13 20:47:06 +00:00
{
hitscan ( s - > x , s - > y , s - > z - ( 8 < < 8 ) , s - > sectnum ,
sintable [ ( j + 512 ) & 2047 ] ,
sintable [ j & 2047 ] , 0 ,
& hitsect , & hitwall , & hitspr , & hx , & hy , & hz , CLIPMASK1 ) ;
d = klabs ( hx - s - > x ) + klabs ( hy - s - > y ) ;
2006-11-13 23:12:47 +00:00
if ( d > greatestd )
2006-04-13 20:47:06 +00:00
{
greatestd = d ;
furthest_angle = j ;
}
}
return ( furthest_angle & 2047 ) ;
}
2007-12-12 17:42:14 +00:00
int furthestcanseepoint ( int iActor , spritetype * ts , int * dax , int * day )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
short hitsect , hitwall , hitspr , angincs ;
2007-12-12 17:42:14 +00:00
int hx , hy , hz , d , da ; //, d, cd, ca,tempx,tempy,cx,cy;
2006-12-20 03:27:25 +00:00
int j ;
spritetype * s = & sprite [ iActor ] ;
2006-04-13 20:47:06 +00:00
2006-11-14 21:35:50 +00:00
if ( ( g_t [ 0 ] & 63 ) ) return - 1 ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( ud . multimode < 2 & & ud . player_skill < 3 )
2006-04-13 20:47:06 +00:00
angincs = 2048 / 2 ;
else angincs = 2048 / ( 1 + ( TRAND & 1 ) ) ;
2006-11-13 23:12:47 +00:00
for ( j = ts - > ang ; j < ( 2048 + ts - > ang ) ; j + = ( angincs - ( TRAND & 511 ) ) )
2006-04-13 20:47:06 +00:00
{
hitscan ( ts - > x , ts - > y , ts - > z - ( 16 < < 8 ) , ts - > sectnum ,
sintable [ ( j + 512 ) & 2047 ] ,
sintable [ j & 2047 ] , 16384 - ( TRAND & 32767 ) ,
& hitsect , & hitwall , & hitspr , & hx , & hy , & hz , CLIPMASK1 ) ;
d = klabs ( hx - ts - > x ) + klabs ( hy - ts - > y ) ;
da = klabs ( hx - s - > x ) + klabs ( hy - s - > y ) ;
2006-11-14 21:35:50 +00:00
if ( d < da )
2006-11-13 23:12:47 +00:00
if ( cansee ( hx , hy , hz , hitsect , s - > x , s - > y , s - > z - ( 16 < < 8 ) , s - > sectnum ) )
2006-04-13 20:47:06 +00:00
{
* dax = hx ;
* day = hy ;
return hitsect ;
}
}
return - 1 ;
}
2006-12-20 03:27:25 +00:00
void getglobalz ( int iActor )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
spritetype * s = & sprite [ iActor ] ;
2006-04-13 20:47:06 +00:00
2006-11-14 21:35:50 +00:00
if ( s - > statnum = = 10 | | s - > statnum = = 6 | | s - > statnum = = 2 | | s - > statnum = = 1 | | s - > statnum = = 4 )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int hz , lz , zr = 127L ;
2006-12-18 08:37:12 +00:00
2006-11-13 23:12:47 +00:00
if ( s - > statnum = = 4 )
2006-04-13 20:47:06 +00:00
zr = 4L ;
2006-12-20 03:27:25 +00:00
getzrange ( s - > x , s - > y , s - > z - ( FOURSLEIGHT ) , s - > sectnum , & hittype [ iActor ] . ceilingz , & hz , & hittype [ iActor ] . floorz , & lz , zr , CLIPMASK0 ) ;
2006-04-13 20:47:06 +00:00
2006-11-14 21:35:50 +00:00
if ( ( lz & 49152 ) = = 49152 & & ( sprite [ lz & ( MAXSPRITES - 1 ) ] . cstat & 48 ) = = 0 )
2006-04-13 20:47:06 +00:00
{
lz & = ( MAXSPRITES - 1 ) ;
2006-11-14 21:35:50 +00:00
if ( badguy ( & sprite [ lz ] ) & & sprite [ lz ] . pal ! = 1 )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( s - > statnum ! = 4 )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
hittype [ iActor ] . dispicnum = - 4 ; // No shadows on actors
2006-04-13 20:47:06 +00:00
s - > xvel = - 256 ;
2006-12-20 03:27:25 +00:00
ssp ( iActor , CLIPMASK0 ) ;
2006-04-13 20:47:06 +00:00
}
}
2006-11-14 21:35:50 +00:00
else if ( sprite [ lz ] . picnum = = APLAYER & & badguy ( s ) )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
hittype [ iActor ] . dispicnum = - 4 ; // No shadows on actors
2006-04-13 20:47:06 +00:00
s - > xvel = - 256 ;
2006-12-20 03:27:25 +00:00
ssp ( iActor , CLIPMASK0 ) ;
2006-04-13 20:47:06 +00:00
}
2006-11-13 23:12:47 +00:00
else if ( s - > statnum = = 4 & & sprite [ lz ] . picnum = = APLAYER )
if ( s - > owner = = lz )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
hittype [ iActor ] . ceilingz = sector [ s - > sectnum ] . ceilingz ;
hittype [ iActor ] . floorz = sector [ s - > sectnum ] . floorz ;
2006-04-13 20:47:06 +00:00
}
}
}
else
{
2006-12-20 03:27:25 +00:00
hittype [ iActor ] . ceilingz = sector [ s - > sectnum ] . ceilingz ;
hittype [ iActor ] . floorz = sector [ s - > sectnum ] . floorz ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-20 03:27:25 +00:00
void makeitfall ( int iActor )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
spritetype * s = & sprite [ iActor ] ;
2007-12-12 17:42:14 +00:00
int hz , lz , c = gc ;
2006-04-13 20:47:06 +00:00
2006-11-14 21:35:50 +00:00
if ( floorspace ( s - > sectnum ) )
2006-04-13 20:47:06 +00:00
c = 0 ;
else
{
2006-11-14 21:35:50 +00:00
if ( ceilingspace ( s - > sectnum ) | | sector [ s - > sectnum ] . lotag = = 2 )
2006-04-13 20:47:06 +00:00
c = gc / 6 ;
}
2006-11-14 21:35:50 +00:00
if ( ( s - > statnum = = 1 | | s - > statnum = = 10 | | s - > statnum = = 2 | | s - > statnum = = 6 ) )
2006-12-20 03:27:25 +00:00
getzrange ( s - > x , s - > y , s - > z - ( FOURSLEIGHT ) , s - > sectnum , & hittype [ iActor ] . ceilingz , & hz , & hittype [ iActor ] . floorz , & lz , 127L , CLIPMASK0 ) ;
2006-04-13 20:47:06 +00:00
else
{
2006-12-20 03:27:25 +00:00
hittype [ iActor ] . ceilingz = sector [ s - > sectnum ] . ceilingz ;
hittype [ iActor ] . floorz = sector [ s - > sectnum ] . floorz ;
2006-04-13 20:47:06 +00:00
}
2006-12-20 03:27:25 +00:00
if ( s - > z < hittype [ iActor ] . floorz - ( FOURSLEIGHT ) )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( sector [ s - > sectnum ] . lotag = = 2 & & s - > zvel > 3122 )
2006-04-13 20:47:06 +00:00
s - > zvel = 3144 ;
2006-11-13 23:12:47 +00:00
if ( s - > zvel < 6144 )
2006-04-13 20:47:06 +00:00
s - > zvel + = c ;
else s - > zvel = 6144 ;
s - > z + = s - > zvel ;
}
2006-12-20 03:27:25 +00:00
if ( s - > z > = hittype [ iActor ] . floorz - ( FOURSLEIGHT ) )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
s - > z = hittype [ iActor ] . floorz - FOURSLEIGHT ;
2006-04-13 20:47:06 +00:00
s - > zvel = 0 ;
}
}
2006-12-20 03:27:25 +00:00
int getincangle ( int a , int na )
2006-04-13 20:47:06 +00:00
{
a & = 2047 ;
na & = 2047 ;
2006-11-13 23:12:47 +00:00
if ( klabs ( a - na ) < 1024 )
2007-03-11 00:20:32 +00:00
{
// OSD_Printf("getincangle() returning %d\n",na-a);
2006-04-13 20:47:06 +00:00
return ( na - a ) ;
2007-03-11 00:47:32 +00:00
}
2006-04-13 20:47:06 +00:00
2006-12-18 08:37:12 +00:00
if ( na > 1024 ) na - = 2048 ;
if ( a > 1024 ) a - = 2048 ;
na - = 2048 ;
a - = 2048 ;
2007-03-11 00:20:32 +00:00
// OSD_Printf("getincangle() returning %d\n",na-a);
2006-12-18 08:37:12 +00:00
return ( na - a ) ;
2006-04-13 20:47:06 +00:00
}
2006-12-20 03:27:25 +00:00
static void alterang ( int a )
2006-04-13 20:47:06 +00:00
{
2006-12-23 02:38:47 +00:00
int aang = g_sp - > ang , angdif , goalang ;
2008-02-17 05:08:18 +00:00
int ticselapsed = ( g_t [ 0 ] ) & 31 ;
intptr_t * moveptr = ( intptr_t * ) g_t [ 1 ] ;
2007-08-27 06:46:31 +00:00
int j = g_player [ g_p ] . ps - > holoduke_on ;
2006-04-13 20:47:06 +00:00
g_sp - > xvel + = ( * moveptr - g_sp - > xvel ) / 5 ;
2006-11-13 23:12:47 +00:00
if ( g_sp - > zvel < 648 ) g_sp - > zvel + = ( ( * ( moveptr + 1 ) < < 4 ) - g_sp - > zvel ) / 5 ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( a & seekplayer )
2006-04-13 20:47:06 +00:00
{
// NOTE: looks like 'owner' is set to target sprite ID...
2006-11-14 21:35:50 +00:00
if ( j > = 0 & & cansee ( sprite [ j ] . x , sprite [ j ] . y , sprite [ j ] . z , sprite [ j ] . sectnum , g_sp - > x , g_sp - > y , g_sp - > z , g_sp - > sectnum ) )
2006-04-13 20:47:06 +00:00
g_sp - > owner = j ;
2007-08-27 06:46:31 +00:00
else g_sp - > owner = g_player [ g_p ] . ps - > i ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( sprite [ g_sp - > owner ] . picnum = = APLAYER )
2006-04-13 20:47:06 +00:00
goalang = getangle ( hittype [ g_i ] . lastvx - g_sp - > x , hittype [ g_i ] . lastvy - g_sp - > y ) ;
else
goalang = getangle ( sprite [ g_sp - > owner ] . x - g_sp - > x , sprite [ g_sp - > owner ] . y - g_sp - > y ) ;
2006-11-13 23:12:47 +00:00
if ( g_sp - > xvel & & g_sp - > picnum ! = DRONE )
2006-04-13 20:47:06 +00:00
{
angdif = getincangle ( aang , goalang ) ;
2006-11-13 23:12:47 +00:00
if ( ticselapsed < 2 )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( klabs ( angdif ) < 256 )
2006-04-13 20:47:06 +00:00
{
j = 128 - ( TRAND & 256 ) ;
g_sp - > ang + = j ;
2006-11-14 21:35:50 +00:00
if ( hits ( g_i ) < 844 )
2006-04-13 20:47:06 +00:00
g_sp - > ang - = j ;
}
}
2006-11-13 23:12:47 +00:00
else if ( ticselapsed > 18 & & ticselapsed < 26 ) // choose
2006-04-13 20:47:06 +00:00
{
2006-11-13 23:12:47 +00:00
if ( klabs ( angdif > > 2 ) < 128 ) g_sp - > ang = goalang ;
2006-04-13 20:47:06 +00:00
else g_sp - > ang + = angdif > > 2 ;
}
}
else g_sp - > ang = goalang ;
}
2006-11-13 23:12:47 +00:00
if ( ticselapsed < 1 )
2006-04-13 20:47:06 +00:00
{
j = 2 ;
2006-11-13 23:12:47 +00:00
if ( a & furthestdir )
2006-04-13 20:47:06 +00:00
{
goalang = furthestangle ( g_i , j ) ;
g_sp - > ang = goalang ;
2007-08-27 06:46:31 +00:00
g_sp - > owner = g_player [ g_p ] . ps - > i ;
2006-04-13 20:47:06 +00:00
}
2006-11-13 23:12:47 +00:00
if ( a & fleeenemy )
2006-04-13 20:47:06 +00:00
{
goalang = furthestangle ( g_i , j ) ;
g_sp - > ang = goalang ; // += angdif; // = getincangle(aang,goalang)>>1;
}
}
}
2006-12-10 03:15:56 +00:00
static void move ( void )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int l , * moveptr ;
2006-12-23 02:38:47 +00:00
int a = g_sp - > hitag , goalang , angdif ;
2007-12-12 17:42:14 +00:00
int daxvel ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( a = = - 1 ) a = 0 ;
2006-04-13 20:47:06 +00:00
g_t [ 0 ] + + ;
2006-11-13 23:12:47 +00:00
if ( a & face_player )
2006-04-13 20:47:06 +00:00
{
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > newowner > = 0 )
goalang = getangle ( g_player [ g_p ] . ps - > oposx - g_sp - > x , g_player [ g_p ] . ps - > oposy - g_sp - > y ) ;
else goalang = getangle ( g_player [ g_p ] . ps - > posx - g_sp - > x , g_player [ g_p ] . ps - > posy - g_sp - > y ) ;
2006-04-13 20:47:06 +00:00
angdif = getincangle ( g_sp - > ang , goalang ) > > 2 ;
2007-03-08 21:07:10 +00:00
if ( ( angdif > - 8 & & angdif < 0 ) | | ( angdif < 8 & & angdif > 0 ) )
angdif * = 2 ;
2006-04-13 20:47:06 +00:00
g_sp - > ang + = angdif ;
}
2006-11-13 23:12:47 +00:00
if ( a & spin )
2006-11-14 21:35:50 +00:00
g_sp - > ang + = sintable [ ( ( g_t [ 0 ] < < 3 ) & 2047 ) ] > > 6 ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( a & face_player_slow )
2006-04-13 20:47:06 +00:00
{
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > newowner > = 0 )
goalang = getangle ( g_player [ g_p ] . ps - > oposx - g_sp - > x , g_player [ g_p ] . ps - > oposy - g_sp - > y ) ;
else goalang = getangle ( g_player [ g_p ] . ps - > posx - g_sp - > x , g_player [ g_p ] . ps - > posy - g_sp - > y ) ;
2007-03-08 01:01:55 +00:00
angdif = getincangle ( g_sp - > ang , goalang ) > > 4 ;
2007-03-08 21:07:10 +00:00
if ( ( angdif > - 8 & & angdif < 0 ) | | ( angdif < 8 & & angdif > 0 ) )
angdif * = 2 ;
2006-04-13 20:47:06 +00:00
g_sp - > ang + = angdif ;
}
2006-11-13 23:12:47 +00:00
if ( ( a & jumptoplayer ) = = jumptoplayer )
2006-04-13 20:47:06 +00:00
{
2006-11-13 23:12:47 +00:00
if ( g_t [ 0 ] < 16 )
2006-04-13 20:47:06 +00:00
g_sp - > zvel - = ( sintable [ ( 512 + ( g_t [ 0 ] < < 4 ) ) & 2047 ] > > 5 ) ;
}
2006-11-13 23:12:47 +00:00
if ( a & face_player_smart )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
int newx = g_player [ g_p ] . ps - > posx + ( g_player [ g_p ] . ps - > posxv / 768 ) ;
int newy = g_player [ g_p ] . ps - > posy + ( g_player [ g_p ] . ps - > posyv / 768 ) ;
2007-03-11 00:47:32 +00:00
2006-04-13 20:47:06 +00:00
goalang = getangle ( newx - g_sp - > x , newy - g_sp - > y ) ;
angdif = getincangle ( g_sp - > ang , goalang ) > > 2 ;
2007-03-08 21:07:10 +00:00
if ( ( angdif > - 8 & & angdif < 0 ) | | ( angdif < 8 & & angdif > 0 ) )
angdif * = 2 ;
2006-04-13 20:47:06 +00:00
g_sp - > ang + = angdif ;
}
2006-11-14 21:35:50 +00:00
if ( g_t [ 1 ] = = 0 | | a = = 0 )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( ( badguy ( g_sp ) & & g_sp - > extra < = 0 ) | | ( hittype [ g_i ] . bposx ! = g_sp - > x ) | | ( hittype [ g_i ] . bposy ! = g_sp - > y ) )
2006-04-13 20:47:06 +00:00
{
hittype [ g_i ] . bposx = g_sp - > x ;
hittype [ g_i ] . bposy = g_sp - > y ;
setsprite ( g_i , g_sp - > x , g_sp - > y , g_sp - > z ) ;
}
return ;
}
2008-02-17 05:08:18 +00:00
moveptr = ( intptr_t * ) g_t [ 1 ] ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( a & geth ) g_sp - > xvel + = ( * moveptr - g_sp - > xvel ) > > 1 ;
if ( a & getv ) g_sp - > zvel + = ( ( * ( moveptr + 1 ) < < 4 ) - g_sp - > zvel ) > > 1 ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( a & dodgebullet )
2006-04-13 20:47:06 +00:00
dodge ( g_sp ) ;
2006-11-13 23:12:47 +00:00
if ( g_sp - > picnum ! = APLAYER )
2006-04-13 20:47:06 +00:00
alterang ( a ) ;
2006-11-14 21:35:50 +00:00
if ( g_sp - > xvel > - 6 & & g_sp - > xvel < 6 ) g_sp - > xvel = 0 ;
2006-04-13 20:47:06 +00:00
a = badguy ( g_sp ) ;
2006-11-13 23:12:47 +00:00
if ( g_sp - > xvel | | g_sp - > zvel )
2006-04-13 20:47:06 +00:00
{
2006-11-13 23:12:47 +00:00
if ( a & & g_sp - > picnum ! = ROTATEGUN )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( ( g_sp - > picnum = = DRONE | | g_sp - > picnum = = COMMANDER ) & & g_sp - > extra > 0 )
2006-04-13 20:47:06 +00:00
{
2006-11-13 23:12:47 +00:00
if ( g_sp - > picnum = = COMMANDER )
2006-04-13 20:47:06 +00:00
{
hittype [ g_i ] . floorz = l = getflorzofslope ( g_sp - > sectnum , g_sp - > x , g_sp - > y ) ;
2006-11-14 21:35:50 +00:00
if ( g_sp - > z > ( l - ( 8 < < 8 ) ) )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( g_sp - > z > ( l - ( 8 < < 8 ) ) ) g_sp - > z = l - ( 8 < < 8 ) ;
2006-04-13 20:47:06 +00:00
g_sp - > zvel = 0 ;
}
hittype [ g_i ] . ceilingz = l = getceilzofslope ( g_sp - > sectnum , g_sp - > x , g_sp - > y ) ;
2006-11-14 21:35:50 +00:00
if ( ( g_sp - > z - l ) < ( 80 < < 8 ) )
2006-04-13 20:47:06 +00:00
{
g_sp - > z = l + ( 80 < < 8 ) ;
g_sp - > zvel = 0 ;
}
}
else
{
2006-11-14 21:35:50 +00:00
if ( g_sp - > zvel > 0 )
2006-04-13 20:47:06 +00:00
{
hittype [ g_i ] . floorz = l = getflorzofslope ( g_sp - > sectnum , g_sp - > x , g_sp - > y ) ;
2006-11-14 21:35:50 +00:00
if ( g_sp - > z > ( l - ( 30 < < 8 ) ) )
2006-04-13 20:47:06 +00:00
g_sp - > z = l - ( 30 < < 8 ) ;
}
else
{
hittype [ g_i ] . ceilingz = l = getceilzofslope ( g_sp - > sectnum , g_sp - > x , g_sp - > y ) ;
2006-11-14 21:35:50 +00:00
if ( ( g_sp - > z - l ) < ( 50 < < 8 ) )
2006-04-13 20:47:06 +00:00
{
g_sp - > z = l + ( 50 < < 8 ) ;
g_sp - > zvel = 0 ;
}
}
}
}
2006-11-13 23:12:47 +00:00
else if ( g_sp - > picnum ! = ORGANTIC )
2006-04-13 20:47:06 +00:00
{
2006-11-13 23:12:47 +00:00
if ( g_sp - > zvel > 0 & & hittype [ g_i ] . floorz < g_sp - > z )
2006-04-13 20:47:06 +00:00
g_sp - > z = hittype [ g_i ] . floorz ;
2006-11-14 21:35:50 +00:00
if ( g_sp - > zvel < 0 )
2006-04-13 20:47:06 +00:00
{
l = getceilzofslope ( g_sp - > sectnum , g_sp - > x , g_sp - > y ) ;
2006-11-14 21:35:50 +00:00
if ( ( g_sp - > z - l ) < ( 66 < < 8 ) )
2006-04-13 20:47:06 +00:00
{
g_sp - > z = l + ( 66 < < 8 ) ;
g_sp - > zvel > > = 1 ;
}
}
}
}
2006-11-13 23:12:47 +00:00
else if ( g_sp - > picnum = = APLAYER )
2006-11-14 21:35:50 +00:00
if ( ( g_sp - > z - hittype [ g_i ] . ceilingz ) < ( 32 < < 8 ) )
2006-04-13 20:47:06 +00:00
g_sp - > z = hittype [ g_i ] . ceilingz + ( 32 < < 8 ) ;
daxvel = g_sp - > xvel ;
angdif = g_sp - > ang ;
2006-11-14 21:35:50 +00:00
if ( a & & g_sp - > picnum ! = ROTATEGUN )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( g_x < 960 & & g_sp - > xrepeat > 16 )
2006-04-13 20:47:06 +00:00
{
daxvel = - ( 1024 - g_x ) ;
2007-08-27 06:46:31 +00:00
angdif = getangle ( g_player [ g_p ] . ps - > posx - g_sp - > x , g_player [ g_p ] . ps - > posy - g_sp - > y ) ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( g_x < 512 )
2006-04-13 20:47:06 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > posxv = 0 ;
g_player [ g_p ] . ps - > posyv = 0 ;
2006-04-13 20:47:06 +00:00
}
else
{
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > posxv = mulscale ( g_player [ g_p ] . ps - > posxv , g_player [ g_p ] . ps - > runspeed - 0x2000 , 16 ) ;
g_player [ g_p ] . ps - > posyv = mulscale ( g_player [ g_p ] . ps - > posyv , g_player [ g_p ] . ps - > runspeed - 0x2000 , 16 ) ;
2006-04-13 20:47:06 +00:00
}
}
2006-11-13 23:12:47 +00:00
else if ( g_sp - > picnum ! = DRONE & & g_sp - > picnum ! = SHARK & & g_sp - > picnum ! = COMMANDER )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( hittype [ g_i ] . bposz ! = g_sp - > z | | ( ud . multimode < 2 & & ud . player_skill < 2 ) )
2006-04-13 20:47:06 +00:00
{
2007-08-27 06:46:31 +00:00
if ( ( g_t [ 0 ] & 1 ) | | g_player [ g_p ] . ps - > actorsqu = = g_i ) return ;
2006-04-13 20:47:06 +00:00
else daxvel < < = 1 ;
}
else
{
2007-08-27 06:46:31 +00:00
if ( ( g_t [ 0 ] & 3 ) | | g_player [ g_p ] . ps - > actorsqu = = g_i ) return ;
2006-04-13 20:47:06 +00:00
else daxvel < < = 2 ;
}
}
}
hittype [ g_i ] . movflag = movesprite ( g_i ,
( daxvel * ( sintable [ ( angdif + 512 ) & 2047 ] ) ) > > 14 ,
( daxvel * ( sintable [ angdif & 2047 ] ) ) > > 14 , g_sp - > zvel , CLIPMASK0 ) ;
}
2006-11-14 21:35:50 +00:00
if ( a )
2006-04-13 20:47:06 +00:00
{
if ( sector [ g_sp - > sectnum ] . ceilingstat & 1 )
g_sp - > shade + = ( sector [ g_sp - > sectnum ] . ceilingshade - g_sp - > shade ) > > 1 ;
else g_sp - > shade + = ( sector [ g_sp - > sectnum ] . floorshade - g_sp - > shade ) > > 1 ;
2006-11-14 21:35:50 +00:00
if ( sector [ g_sp - > sectnum ] . floorpicnum = = MIRROR )
2006-04-13 20:47:06 +00:00
deletesprite ( g_i ) ;
}
}
2008-02-14 08:35:30 +00:00
static inline void parseifelse ( int condition )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( condition )
2006-04-13 20:47:06 +00:00
{
// skip 'else' pointer.. and...
insptr + = 2 ;
parse ( ) ;
2008-02-14 08:35:30 +00:00
return ;
2006-04-13 20:47:06 +00:00
}
2008-02-17 05:08:18 +00:00
insptr = ( intptr_t * ) * ( insptr + 1 ) ;
2008-02-14 08:35:30 +00:00
if ( * insptr = = CON_ELSE )
2006-04-13 20:47:06 +00:00
{
2008-02-14 08:35:30 +00:00
// else...
// skip 'else' and...
insptr + = 2 ;
parse ( ) ;
2006-04-13 20:47:06 +00:00
}
}
2007-12-12 17:42:14 +00:00
// int *it = 0x00589a04;
2006-04-13 20:47:06 +00:00
2006-12-18 08:37:12 +00:00
static int parse ( void )
2006-04-13 20:47:06 +00:00
{
2008-02-14 08:35:30 +00:00
int j , l , s , tw = * insptr ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( killit_flag ) return 1 ;
2006-04-13 20:47:06 +00:00
// if(*it == 1668249134L) gameexit("\nERR");
// Bsprintf(g_szBuf,"Parsing: %d",*insptr);
// AddLog(g_szBuf);
2006-11-13 23:12:47 +00:00
switch ( tw )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case CON_REDEFINEQUOTE :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-18 21:29:55 +00:00
{
2007-02-08 04:19:39 +00:00
int q = * insptr + + , i = * insptr + + ;
if ( fta_quotes [ q ] = = NULL | | redefined_quotes [ i ] = = NULL )
{
OSD_Printf ( " %s %d null quote %d %d \n " , __FILE__ , __LINE__ , q , i ) ;
break ;
}
Bstrcpy ( fta_quotes [ q ] , redefined_quotes [ i ] ) ;
2006-12-18 21:29:55 +00:00
break ;
}
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETTHISPROJECTILE :
case CON_SETTHISPROJECTILE :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax [gs]etplayer[<var>].x <VAR>
// <varid> <xxxid> <varid>
int lVar1 = * insptr + + , lLabelID = * insptr + + , lVar2 = * insptr + + ;
DoThisProjectile ( tw = = CON_SETTHISPROJECTILE , lVar1 , lLabelID , lVar2 ) ;
break ;
}
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFRND :
insptr + + ;
parseifelse ( rnd ( * insptr ) ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFCANSHOOTTARGET :
if ( g_x > 1024 )
{
2006-12-18 08:37:12 +00:00
short temphit , sclip = 768 , angdif = 16 ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( badguy ( g_sp ) & & g_sp - > xrepeat > 56 )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
sclip = 3084 ;
angdif = 48 ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
j = hitasprite ( g_i , & temphit ) ;
if ( j = = ( 1 < < 30 ) )
{
parseifelse ( 1 ) ;
break ;
}
if ( j > sclip )
{
if ( temphit > = 0 & & sprite [ temphit ] . picnum = = g_sp - > picnum )
j = 0 ;
2006-04-13 20:47:06 +00:00
else
{
2006-11-16 03:02:42 +00:00
g_sp - > ang + = angdif ;
j = hitasprite ( g_i , & temphit ) ;
g_sp - > ang - = angdif ;
if ( j > sclip )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
if ( temphit > = 0 & & sprite [ temphit ] . picnum = = g_sp - > picnum )
j = 0 ;
else
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
g_sp - > ang - = angdif ;
j = hitasprite ( g_i , & temphit ) ;
g_sp - > ang + = angdif ;
if ( j > 768 )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
if ( temphit > = 0 & & sprite [ temphit ] . picnum = = g_sp - > picnum )
j = 0 ;
else j = 1 ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
else j = 0 ;
2006-04-13 20:47:06 +00:00
}
}
2006-11-16 03:02:42 +00:00
else j = 0 ;
2006-04-13 20:47:06 +00:00
}
}
2006-11-16 03:02:42 +00:00
else j = 0 ;
}
else j = 1 ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
parseifelse ( j ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFCANSEETARGET :
2007-08-27 06:46:31 +00:00
j = cansee ( g_sp - > x , g_sp - > y , g_sp - > z - ( ( TRAND & 41 ) < < 8 ) , g_sp - > sectnum , g_player [ g_p ] . ps - > posx , g_player [ g_p ] . ps - > posy , g_player [ g_p ] . ps - > posz /*-((TRAND&41)<<8)*/ , sprite [ g_player [ g_p ] . ps - > i ] . sectnum ) ;
2006-11-16 03:02:42 +00:00
parseifelse ( j ) ;
if ( j ) hittype [ g_i ] . timetosleep = SLEEPTIME ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFACTORNOTSTAYPUT :
parseifelse ( hittype [ g_i ] . actorstayput = = - 1 ) ;
break ;
case CON_IFCANSEE :
{
spritetype * s ;
2006-11-13 23:12:47 +00:00
2006-11-16 03:02:42 +00:00
// select sprite for monster to target
// if holoduke is on, let them target holoduke first.
//
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > holoduke_on > = 0 )
2006-04-13 20:47:06 +00:00
{
2007-08-27 06:46:31 +00:00
s = & sprite [ g_player [ g_p ] . ps - > holoduke_on ] ;
2006-11-16 03:02:42 +00:00
j = cansee ( g_sp - > x , g_sp - > y , g_sp - > z - ( TRAND & ( ( 32 < < 8 ) - 1 ) ) , g_sp - > sectnum ,
s - > x , s - > y , s - > z , s - > sectnum ) ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( j = = 0 )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
// they can't see player's holoduke
// check for player...
2007-08-27 06:46:31 +00:00
s = & sprite [ g_player [ g_p ] . ps - > i ] ;
2006-11-15 01:16:55 +00:00
}
2006-11-16 03:02:42 +00:00
}
2007-08-27 06:46:31 +00:00
else s = & sprite [ g_player [ g_p ] . ps - > i ] ; // holoduke not on. look for player
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
// can they see player, (or player's holoduke)
j = cansee ( g_sp - > x , g_sp - > y , g_sp - > z - ( TRAND & ( ( 47 < < 8 ) ) ) , g_sp - > sectnum ,
s - > x , s - > y , s - > z - ( 24 < < 8 ) , s - > sectnum ) ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( j = = 0 )
{
// they can't see it.
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
// Huh?. This does nothing....
// (the result is always j==0....)
if ( ( klabs ( hittype [ g_i ] . lastvx - g_sp - > x ) + klabs ( hittype [ g_i ] . lastvy - g_sp - > y ) ) <
( klabs ( hittype [ g_i ] . lastvx - s - > x ) + klabs ( hittype [ g_i ] . lastvy - s - > y ) ) )
j = 0 ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
// um yeah, this if() will always fire....
if ( j = = 0 )
{
// search around for target player
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
// also modifies 'target' x&y if found..
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
j = furthestcanseepoint ( g_i , s , & hittype [ g_i ] . lastvx , & hittype [ g_i ] . lastvy ) ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( j = = - 1 ) j = 0 ;
else j = 1 ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
}
else
{
// else, they did see it.
// save where we were looking...
hittype [ g_i ] . lastvx = s - > x ;
hittype [ g_i ] . lastvy = s - > y ;
2006-11-15 01:16:55 +00:00
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( j = = 1 & & ( g_sp - > statnum = = 1 | | g_sp - > statnum = = 6 ) )
hittype [ g_i ] . timetosleep = SLEEPTIME ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
parseifelse ( j = = 1 ) ;
break ;
}
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFHITWEAPON :
parseifelse ( ifhitbyweapon ( g_i ) > = 0 ) ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFSQUISHED :
parseifelse ( ifsquished ( g_i , g_p ) = = 1 ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFDEAD :
j = g_sp - > extra ;
if ( g_sp - > picnum = = APLAYER )
j - - ;
parseifelse ( j < 0 ) ;
2007-02-08 04:19:39 +00:00
break ;
2006-11-16 03:02:42 +00:00
case CON_AI :
insptr + + ;
g_t [ 5 ] = * insptr + + ; // Ai
2008-02-17 05:08:18 +00:00
g_t [ 4 ] = * ( intptr_t * ) ( g_t [ 5 ] ) ; // Action
g_t [ 1 ] = * ( intptr_t * ) ( g_t [ 5 ] + 4 ) ; // move
g_sp - > hitag = * ( intptr_t * ) ( g_t [ 5 ] + 8 ) ; // move flags
2006-11-16 03:02:42 +00:00
g_t [ 0 ] = g_t [ 2 ] = g_t [ 3 ] = 0 ; // count, actioncount... g_t[3] = ???
if ( g_sp - > hitag & random_angle )
g_sp - > ang = TRAND & 2047 ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_ACTION :
insptr + + ;
g_t [ 2 ] = 0 ;
g_t [ 3 ] = 0 ;
g_t [ 4 ] = * insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFPDISTL :
insptr + + ;
parseifelse ( g_x < * insptr ) ;
if ( g_x > MAXSLEEPDIST & & hittype [ g_i ] . timetosleep = = 0 )
hittype [ g_i ] . timetosleep = SLEEPTIME ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFPDISTG :
insptr + + ;
parseifelse ( g_x > * insptr ) ;
if ( g_x > MAXSLEEPDIST & & hittype [ g_i ] . timetosleep = = 0 )
hittype [ g_i ] . timetosleep = SLEEPTIME ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_ELSE :
2008-02-17 05:08:18 +00:00
insptr = ( intptr_t * ) * ( insptr + 1 ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDSTRENGTH :
insptr + + ;
g_sp - > extra + = * insptr + + ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_STRENGTH :
insptr + + ;
g_sp - > extra = * insptr + + ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFGOTWEAPONCE :
insptr + + ;
if ( ( gametype_flags [ ud . coop ] & GAMETYPE_FLAG_WEAPSTAY ) & & ud . multimode > 1 )
{
if ( * insptr = = 0 )
2006-04-13 20:47:06 +00:00
{
2007-08-27 06:46:31 +00:00
for ( j = 0 ; j < g_player [ g_p ] . ps - > weapreccnt ; j + + )
if ( g_player [ g_p ] . ps - > weaprecs [ j ] = = g_sp - > picnum )
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2007-08-27 06:46:31 +00:00
parseifelse ( j < g_player [ g_p ] . ps - > weapreccnt & & g_sp - > owner = = g_i ) ;
2006-11-15 01:16:55 +00:00
}
2007-08-27 06:46:31 +00:00
else if ( g_player [ g_p ] . ps - > weapreccnt < 16 )
2006-11-16 03:02:42 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > weaprecs [ g_player [ g_p ] . ps - > weapreccnt + + ] = g_sp - > picnum ;
2006-11-16 03:02:42 +00:00
parseifelse ( g_sp - > owner = = g_i ) ;
}
2006-12-01 22:34:32 +00:00
else parseifelse ( 0 ) ;
2006-11-16 03:02:42 +00:00
}
else parseifelse ( 0 ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETLASTPAL :
insptr + + ;
if ( g_sp - > picnum = = APLAYER )
2007-08-27 06:46:31 +00:00
g_sp - > pal = g_player [ g_sp - > yvel ] . ps - > palookup ;
2006-11-16 03:02:42 +00:00
else g_sp - > pal = hittype [ g_i ] . tempang ;
hittype [ g_i ] . tempang = 0 ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_TOSSWEAPON :
insptr + + ;
2007-08-27 06:46:31 +00:00
checkweapons ( g_player [ g_sp - > yvel ] . ps ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_NULLOP :
insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_MIKESND :
insptr + + ;
if ( ! isspritemakingsound ( g_i , g_sp - > yvel ) )
spritesound ( g_sp - > yvel , g_i ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_PKICK :
insptr + + ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
if ( ud . multimode > 1 & & g_sp - > picnum = = APLAYER )
{
2007-08-27 06:46:31 +00:00
if ( g_player [ otherp ] . ps - > quick_kick = = 0 )
g_player [ otherp ] . ps - > quick_kick = 14 ;
2006-11-16 03:02:42 +00:00
}
2007-08-27 06:46:31 +00:00
else if ( g_sp - > picnum ! = APLAYER & & g_player [ g_p ] . ps - > quick_kick = = 0 )
g_player [ g_p ] . ps - > quick_kick = 14 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SIZETO :
insptr + + ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
j = ( * insptr + + - g_sp - > xrepeat ) < < 1 ;
g_sp - > xrepeat + = ksgn ( j ) ;
2006-04-18 21:18:30 +00:00
2006-11-16 03:02:42 +00:00
if ( ( g_sp - > picnum = = APLAYER & & g_sp - > yrepeat < 36 ) | | * insptr < g_sp - > yrepeat | | ( ( g_sp - > yrepeat * ( tilesizy [ g_sp - > picnum ] + 8 ) ) < < 2 ) < ( hittype [ g_i ] . floorz - hittype [ g_i ] . ceilingz ) )
{
j = ( ( * insptr ) - g_sp - > yrepeat ) < < 1 ;
if ( klabs ( j ) ) g_sp - > yrepeat + = ksgn ( j ) ;
}
insptr + + ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_SIZEAT :
insptr + + ;
g_sp - > xrepeat = ( char ) * insptr + + ;
g_sp - > yrepeat = ( char ) * insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_SHOOT :
insptr + + ;
shoot ( g_i , ( short ) * insptr + + ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_SOUNDONCE :
insptr + + ;
if ( ! isspritemakingsound ( g_i , * insptr ) )
spritesound ( ( short ) * insptr , g_i ) ;
insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFSOUND :
insptr + + ;
parseifelse ( isspritemakingsound ( g_i , * insptr ) ) ;
// parseifelse(SoundOwner[*insptr][0].i == g_i);
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_STOPSOUND :
insptr + + ;
if ( isspritemakingsound ( g_i , * insptr ) )
stopspritesound ( ( short ) * insptr , g_i ) ;
insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_GLOBALSOUND :
insptr + + ;
if ( g_p = = screenpeek | | ( gametype_flags [ ud . coop ] & GAMETYPE_FLAG_COOPSOUND ) )
2007-08-27 06:46:31 +00:00
spritesound ( ( short ) * insptr , g_player [ screenpeek ] . ps - > i ) ;
2006-11-16 03:02:42 +00:00
insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_SOUND :
insptr + + ;
spritesound ( ( short ) * insptr + + , g_i ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_TIP :
insptr + + ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > tipincs = 26 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_FALL :
insptr + + ;
g_sp - > xoffset = 0 ;
g_sp - > yoffset = 0 ;
2007-04-15 20:04:52 +00:00
j = gc ;
if ( ceilingspace ( g_sp - > sectnum ) | | sector [ g_sp - > sectnum ] . lotag = = 2 )
j = gc / 6 ;
else if ( floorspace ( g_sp - > sectnum ) )
j = 0 ;
if ( hittype [ g_i ] . cgg < = 0 | | ( sector [ g_sp - > sectnum ] . floorstat & 2 ) )
2006-11-16 03:02:42 +00:00
{
2007-04-15 20:04:52 +00:00
getglobalz ( g_i ) ;
hittype [ g_i ] . cgg = 3 ;
}
else hittype [ g_i ] . cgg - - ;
2006-11-16 03:02:42 +00:00
2007-04-15 20:04:52 +00:00
if ( g_sp - > z < ( hittype [ g_i ] . floorz - FOURSLEIGHT ) )
{
g_sp - > zvel + = j ;
g_sp - > z + = g_sp - > zvel ;
2006-04-13 20:47:06 +00:00
2007-04-15 20:04:52 +00:00
if ( g_sp - > zvel > 6144 ) g_sp - > zvel = 6144 ;
2006-04-13 20:47:06 +00:00
2007-04-15 20:04:52 +00:00
if ( g_sp - > z > ( hittype [ g_i ] . floorz - FOURSLEIGHT ) )
g_sp - > z = ( hittype [ g_i ] . floorz - FOURSLEIGHT ) ;
}
else
{
g_sp - > z = hittype [ g_i ] . floorz - FOURSLEIGHT ;
2006-04-13 20:47:06 +00:00
2007-04-15 20:04:52 +00:00
if ( badguy ( g_sp ) | | ( g_sp - > picnum = = APLAYER & & g_sp - > owner > = 0 ) )
2006-11-16 03:02:42 +00:00
{
2007-04-15 20:04:52 +00:00
if ( g_sp - > zvel > 3084 & & g_sp - > extra < = 1 )
2006-04-13 20:47:06 +00:00
{
2007-04-15 20:04:52 +00:00
if ( g_sp - > pal ! = 1 & & g_sp - > picnum ! = DRONE )
2006-04-13 20:47:06 +00:00
{
2007-04-15 20:04:52 +00:00
if ( ! ( g_sp - > picnum = = APLAYER & & g_sp - > extra > 0 ) )
2006-04-13 20:47:06 +00:00
{
2008-03-21 04:01:38 +00:00
guts ( g_i , JIBS6 , 15 ) ;
2007-04-15 20:04:52 +00:00
spritesound ( SQUISHED , g_i ) ;
spawn ( g_i , BLOODPOOL ) ;
2006-11-16 03:02:42 +00:00
}
}
2006-04-13 20:47:06 +00:00
2007-04-15 20:04:52 +00:00
hittype [ g_i ] . picnum = SHOTSPARK1 ;
hittype [ g_i ] . extra = 1 ;
g_sp - > zvel = 0 ;
}
else if ( g_sp - > zvel > 2048 & & sector [ g_sp - > sectnum ] . lotag ! = 1 )
{
j = g_sp - > sectnum ;
pushmove ( & g_sp - > x , & g_sp - > y , & g_sp - > z , ( short * ) & j , 128L , ( 4L < < 8 ) , ( 4L < < 8 ) , CLIPMASK0 ) ;
if ( j ! = g_sp - > sectnum & & j > = 0 & & j < MAXSECTORS )
changespritesect ( g_i , j ) ;
spritesound ( THUD , g_i ) ;
2006-04-13 20:47:06 +00:00
}
}
2006-12-09 23:41:43 +00:00
2007-04-15 20:04:52 +00:00
if ( g_sp - > z > ( hittype [ g_i ] . floorz - FOURSLEIGHT ) )
{
getglobalz ( g_i ) ;
if ( hittype [ g_i ] . floorz ! = sector [ g_sp - > sectnum ] . floorz )
g_sp - > z = ( hittype [ g_i ] . floorz - FOURSLEIGHT ) ;
}
else if ( sector [ g_sp - > sectnum ] . lotag = = 1 )
{
switch ( dynamictostatic [ g_sp - > picnum ] )
{
case OCTABRAIN__STATIC :
case COMMANDER__STATIC :
case DRONE__STATIC :
break ;
default :
g_sp - > z + = ( 24 < < 8 ) ;
break ;
}
}
else g_sp - > zvel = 0 ;
2006-11-16 03:02:42 +00:00
}
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_ENDA :
case CON_BREAK :
case CON_ENDS :
return 1 ;
case CON_RIGHTBRACE :
insptr + + ;
return 1 ;
case CON_ADDAMMO :
insptr + + ;
2007-08-27 23:11:49 +00:00
if ( g_player [ g_p ] . ps - > ammo_amount [ * insptr ] > = g_player [ g_p ] . ps - > max_ammo_amount [ * insptr ] )
2006-11-16 03:02:42 +00:00
{
killit_flag = 2 ;
break ;
}
2007-08-27 06:46:31 +00:00
addammo ( * insptr , g_player [ g_p ] . ps , * ( insptr + 1 ) ) ;
if ( g_player [ g_p ] . ps - > curr_weapon = = KNEE_WEAPON )
if ( g_player [ g_p ] . ps - > gotweapon [ * insptr ] )
2006-11-15 01:16:55 +00:00
{
2007-08-27 06:46:31 +00:00
if ( ! ( g_player [ g_p ] . ps - > weaponswitch & 1 ) ) addweaponnoswitch ( g_player [ g_p ] . ps , * insptr ) ;
else addweapon ( g_player [ g_p ] . ps , * insptr ) ;
2006-11-15 01:16:55 +00:00
}
2006-11-16 03:02:42 +00:00
insptr + = 2 ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_MONEY :
insptr + + ;
2008-02-06 21:02:11 +00:00
lotsofmoneymailpaper ( g_i , * insptr + + , MONEY ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_MAIL :
insptr + + ;
2008-02-06 21:02:11 +00:00
lotsofmoneymailpaper ( g_i , * insptr + + , MAIL ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_SLEEPTIME :
insptr + + ;
hittype [ g_i ] . timetosleep = ( short ) * insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_PAPER :
insptr + + ;
2008-02-06 21:02:11 +00:00
lotsofmoneymailpaper ( g_i , * insptr + + , PAPER ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDKILLS :
insptr + + ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > actors_killed + = * insptr + + ;
2006-11-16 03:02:42 +00:00
hittype [ g_i ] . actorstayput = - 1 ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_LOTSOFGLASS :
insptr + + ;
spriteglass ( g_i , * insptr + + ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_KILLIT :
insptr + + ;
killit_flag = 1 ;
break ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDWEAPON :
insptr + + ;
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > gotweapon [ * insptr ] = = 0 )
2006-11-16 03:02:42 +00:00
{
2007-08-27 06:46:31 +00:00
if ( ! ( g_player [ g_p ] . ps - > weaponswitch & 1 ) ) addweaponnoswitch ( g_player [ g_p ] . ps , * insptr ) ;
else addweapon ( g_player [ g_p ] . ps , * insptr ) ;
2006-11-16 03:02:42 +00:00
}
2007-08-27 23:11:49 +00:00
else if ( g_player [ g_p ] . ps - > ammo_amount [ * insptr ] > = g_player [ g_p ] . ps - > max_ammo_amount [ * insptr ] )
2006-11-16 03:02:42 +00:00
{
killit_flag = 2 ;
break ;
}
2007-08-27 06:46:31 +00:00
addammo ( * insptr , g_player [ g_p ] . ps , * ( insptr + 1 ) ) ;
if ( g_player [ g_p ] . ps - > curr_weapon = = KNEE_WEAPON )
if ( g_player [ g_p ] . ps - > gotweapon [ * insptr ] )
2006-11-15 01:16:55 +00:00
{
2007-08-27 06:46:31 +00:00
if ( ! ( g_player [ g_p ] . ps - > weaponswitch & 1 ) ) addweaponnoswitch ( g_player [ g_p ] . ps , * insptr ) ;
else addweapon ( g_player [ g_p ] . ps , * insptr ) ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
insptr + = 2 ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_DEBUG :
insptr + + ;
2007-12-12 17:42:14 +00:00
initprintf ( " %d \n " , * insptr + + ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_ENDOFGAME :
insptr + + ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > timebeforeexit = * insptr + + ;
g_player [ g_p ] . ps - > customexitsound = - 1 ;
2006-11-16 03:02:42 +00:00
ud . eog = 1 ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDPHEALTH :
insptr + + ;
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > newowner > = 0 )
2006-11-16 03:02:42 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > newowner = - 1 ;
g_player [ g_p ] . ps - > posx = g_player [ g_p ] . ps - > oposx ;
g_player [ g_p ] . ps - > posy = g_player [ g_p ] . ps - > oposy ;
g_player [ g_p ] . ps - > posz = g_player [ g_p ] . ps - > oposz ;
g_player [ g_p ] . ps - > ang = g_player [ g_p ] . ps - > oang ;
updatesector ( g_player [ g_p ] . ps - > posx , g_player [ g_p ] . ps - > posy , & g_player [ g_p ] . ps - > cursectnum ) ;
setpal ( g_player [ g_p ] . ps ) ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
j = headspritestat [ 1 ] ;
while ( j > = 0 )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
if ( sprite [ j ] . picnum = = CAMERA1 )
sprite [ j ] . yvel = 0 ;
j = nextspritestat [ j ] ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
}
2006-04-13 20:47:06 +00:00
2007-08-27 06:46:31 +00:00
j = sprite [ g_player [ g_p ] . ps - > i ] . extra ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( g_sp - > picnum ! = ATOMICHEALTH )
{
2007-08-27 23:11:49 +00:00
if ( j > g_player [ g_p ] . ps - > max_player_health & & * insptr > 0 )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
insptr + + ;
break ;
2006-04-13 20:47:06 +00:00
}
else
{
2006-11-13 23:12:47 +00:00
if ( j > 0 )
2006-04-13 20:47:06 +00:00
j + = * insptr ;
2007-08-27 23:11:49 +00:00
if ( j > g_player [ g_p ] . ps - > max_player_health & & * insptr > 0 )
j = g_player [ g_p ] . ps - > max_player_health ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
}
else
{
if ( j > 0 )
j + = * insptr ;
2007-08-27 23:11:49 +00:00
if ( j > ( g_player [ g_p ] . ps - > max_player_health < < 1 ) )
j = ( g_player [ g_p ] . ps - > max_player_health < < 1 ) ;
2006-11-16 03:02:42 +00:00
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( j < 0 ) j = 0 ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( ud . god = = 0 )
{
if ( * insptr > 0 )
2006-04-13 20:47:06 +00:00
{
2007-08-27 23:11:49 +00:00
if ( ( j - * insptr ) < ( g_player [ g_p ] . ps - > max_player_health > > 2 ) & &
j > = ( g_player [ g_p ] . ps - > max_player_health > > 2 ) )
2007-08-27 06:46:31 +00:00
spritesound ( DUKE_GOTHEALTHATLOW , g_player [ g_p ] . ps - > i ) ;
2006-04-13 20:47:06 +00:00
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > last_extra = j ;
2006-11-15 01:16:55 +00:00
}
2006-04-18 03:11:38 +00:00
2007-08-27 06:46:31 +00:00
sprite [ g_player [ g_p ] . ps - > i ] . extra = j ;
2006-11-16 03:02:42 +00:00
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
insptr + + ;
break ;
case CON_STATE :
{
2008-02-17 05:08:18 +00:00
intptr_t * tempscrptr = insptr + 2 ;
2006-04-18 03:11:38 +00:00
2008-02-17 05:08:18 +00:00
insptr = ( intptr_t * ) * ( insptr + 1 ) ;
2006-11-16 03:02:42 +00:00
while ( 1 ) if ( parse ( ) ) break ;
insptr = tempscrptr ;
}
break ;
case CON_LEFTBRACE :
insptr + + ;
while ( 1 ) if ( parse ( ) ) break ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_MOVE :
insptr + + ;
g_t [ 0 ] = 0 ;
g_t [ 1 ] = * insptr + + ;
g_sp - > hitag = * insptr + + ;
if ( g_sp - > hitag & random_angle )
g_sp - > ang = TRAND & 2047 ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDWEAPONVAR :
insptr + + ;
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > gotweapon [ GetGameVarID ( * ( insptr ) , g_i , g_p ) ] = = 0 )
2006-11-16 03:02:42 +00:00
{
2007-08-27 06:46:31 +00:00
if ( ! ( g_player [ g_p ] . ps - > weaponswitch & 1 ) ) addweaponnoswitch ( g_player [ g_p ] . ps , GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
else addweapon ( g_player [ g_p ] . ps , GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
2006-11-16 03:02:42 +00:00
}
2007-08-27 23:11:49 +00:00
else if ( g_player [ g_p ] . ps - > ammo_amount [ GetGameVarID ( * ( insptr ) , g_i , g_p ) ] > = g_player [ g_p ] . ps - > max_ammo_amount [ GetGameVarID ( * ( insptr ) , g_i , g_p ) ] )
2006-11-16 03:02:42 +00:00
{
killit_flag = 2 ;
2006-04-13 20:47:06 +00:00
break ;
2006-11-16 03:02:42 +00:00
}
2007-08-27 06:46:31 +00:00
addammo ( GetGameVarID ( * ( insptr ) , g_i , g_p ) , g_player [ g_p ] . ps , GetGameVarID ( * ( insptr + 1 ) , g_i , g_p ) ) ;
if ( g_player [ g_p ] . ps - > curr_weapon = = KNEE_WEAPON )
if ( g_player [ g_p ] . ps - > gotweapon [ GetGameVarID ( * ( insptr ) , g_i , g_p ) ] )
2006-11-15 01:16:55 +00:00
{
2007-08-27 06:46:31 +00:00
if ( ! ( g_player [ g_p ] . ps - > weaponswitch & 1 ) ) addweaponnoswitch ( g_player [ g_p ] . ps , GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
else addweapon ( g_player [ g_p ] . ps , GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
insptr + = 2 ;
break ;
case CON_ACTIVATEBYSECTOR :
case CON_OPERATESECTORS :
case CON_OPERATEACTIVATORS :
case CON_SETASPECT :
case CON_SSP :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
int var1 = GetGameVarID ( * insptr + + , g_i , g_p ) , var2 ;
if ( tw = = CON_OPERATEACTIVATORS & & * insptr = = g_iThisActorID )
{
var2 = g_p ;
insptr + + ;
}
else var2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
2007-02-08 04:19:39 +00:00
switch ( tw )
{
case CON_ACTIVATEBYSECTOR :
activatebysector ( var1 , var2 ) ;
break ;
case CON_OPERATESECTORS :
operatesectors ( var1 , var2 ) ;
break ;
case CON_OPERATEACTIVATORS :
operateactivators ( var1 , var2 ) ;
break ;
case CON_SETASPECT :
setaspect ( var1 , var2 ) ;
break ;
case CON_SSP :
ssp ( var1 , var2 ) ;
break ;
}
2006-11-15 01:16:55 +00:00
break ;
}
2006-04-24 05:42:29 +00:00
2006-11-16 03:02:42 +00:00
case CON_CANSEESPR :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
int lVar1 = GetGameVarID ( * insptr + + , g_i , g_p ) , lVar2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
SetGameVarID ( * insptr + + , cansee ( sprite [ lVar1 ] . x , sprite [ lVar1 ] . y , sprite [ lVar1 ] . z , sprite [ lVar1 ] . sectnum ,
sprite [ lVar2 ] . x , sprite [ lVar2 ] . y , sprite [ lVar2 ] . z , sprite [ lVar2 ] . sectnum ) , g_i , g_p ) ;
break ;
}
2006-11-16 03:02:42 +00:00
case CON_OPERATERESPAWNS :
case CON_OPERATEMASTERSWITCHES :
case CON_CHECKACTIVATORMOTION :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
int var1 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
switch ( tw )
{
case CON_OPERATERESPAWNS :
operaterespawns ( var1 ) ;
break ;
case CON_OPERATEMASTERSWITCHES :
operatemasterswitches ( var1 ) ;
break ;
case CON_CHECKACTIVATORMOTION :
SetGameVarID ( g_iReturnVarID , check_activator_motion ( var1 ) , g_i , g_p ) ;
break ;
}
2006-11-15 01:16:55 +00:00
break ;
}
2006-09-30 06:51:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_INSERTSPRITEQ :
insptr + + ;
insertspriteq ( g_i ) ;
break ;
case CON_QSTRLEN :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-18 21:29:55 +00:00
{
2007-02-08 04:19:39 +00:00
int i = * insptr + + ;
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( fta_quotes [ j ] = = NULL )
{
SetGameVarID ( i , - 1 , g_i , g_p ) ;
break ;
}
SetGameVarID ( i , Bstrlen ( fta_quotes [ j ] ) , g_i , g_p ) ;
2006-12-18 21:29:55 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
2007-08-19 00:15:30 +00:00
case CON_HEADSPRITESTAT :
case CON_PREVSPRITESTAT :
case CON_NEXTSPRITESTAT :
case CON_HEADSPRITESECT :
case CON_PREVSPRITESECT :
case CON_NEXTSPRITESECT :
insptr + + ;
{
int i = * insptr + + ;
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
switch ( tw )
{
2007-08-25 01:05:00 +00:00
case CON_HEADSPRITESTAT :
if ( j < MAXSTATUS )
SetGameVarID ( i , headspritestat [ j ] , g_i , g_p ) ;
break ;
case CON_PREVSPRITESTAT :
if ( j < MAXSPRITES )
SetGameVarID ( i , prevspritestat [ j ] , g_i , g_p ) ;
break ;
case CON_NEXTSPRITESTAT :
if ( j < MAXSPRITES )
SetGameVarID ( i , nextspritestat [ j ] , g_i , g_p ) ;
break ;
case CON_HEADSPRITESECT :
if ( j < MAXSECTORS )
SetGameVarID ( i , headspritesect [ j ] , g_i , g_p ) ;
break ;
case CON_PREVSPRITESECT :
if ( j < MAXSPRITES )
SetGameVarID ( i , prevspritesect [ j ] , g_i , g_p ) ;
break ;
case CON_NEXTSPRITESECT :
if ( j < MAXSPRITES )
SetGameVarID ( i , nextspritesect [ j ] , g_i , g_p ) ;
break ;
2007-08-19 00:15:30 +00:00
}
break ;
}
2007-12-20 19:14:38 +00:00
case CON_GETKEYNAME :
insptr + + ;
{
int i = GetGameVarID ( * insptr + + , g_i , g_p ) ,
f = GetGameVarID ( * insptr + + , g_i , g_p ) ;
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( i < MAXQUOTES & & fta_quotes [ i ] ! = NULL & & f < NUMGAMEFUNCTIONS )
{
2008-02-18 08:10:54 +00:00
if ( j < 2 )
Bstrcpy ( tempbuf , KB_ScanCodeToString ( ud . config . KeyboardKeys [ f ] [ j ] ) ) ;
else
2007-12-20 19:14:38 +00:00
{
Bstrcpy ( tempbuf , KB_ScanCodeToString ( ud . config . KeyboardKeys [ f ] [ 0 ] ) ) ;
if ( ! * tempbuf )
2008-02-18 08:10:54 +00:00
Bstrcpy ( tempbuf , KB_ScanCodeToString ( ud . config . KeyboardKeys [ f ] [ 1 ] ) ) ;
2007-12-20 19:14:38 +00:00
}
}
2008-02-18 08:10:54 +00:00
if ( * tempbuf )
Bstrcpy ( fta_quotes [ i ] , tempbuf ) ;
2007-12-20 19:14:38 +00:00
break ;
}
case CON_QSUBSTR :
insptr + + ;
{
2008-02-18 08:10:54 +00:00
char * s1 , * s2 ;
int q1 , q2 , st , ln ;
2007-12-20 19:14:38 +00:00
q1 = GetGameVarID ( * insptr + + , g_i , g_p ) ,
q2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
st = GetGameVarID ( * insptr + + , g_i , g_p ) ;
ln = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2008-02-18 08:10:54 +00:00
2007-12-20 19:14:38 +00:00
if ( q1 < MAXQUOTES & & fta_quotes [ q1 ] ! = NULL & & q2 < MAXQUOTES & & fta_quotes [ q2 ] ! = NULL )
{
s1 = fta_quotes [ q1 ] ;
s2 = fta_quotes [ q2 ] ;
while ( * s2 & & st - - ) s2 + + ;
while ( ( * s1 = * s2 ) & & ln - - ) { s1 + + ; s2 + + ; }
* s1 = 0 ;
}
break ;
}
2006-11-16 03:02:42 +00:00
case CON_GETPNAME :
case CON_QSTRCAT :
case CON_QSTRCPY :
case CON_CHANGESPRITESTAT :
case CON_CHANGESPRITESECT :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
int i = GetGameVarID ( * insptr + + , g_i , g_p ) , j ;
if ( tw = = CON_GETPNAME & & * insptr = = g_iThisActorID )
{
j = g_p ;
insptr + + ;
}
else j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-05-13 01:07:06 +00:00
2007-02-08 04:19:39 +00:00
switch ( tw )
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
case CON_GETPNAME :
if ( fta_quotes [ i ] ! = NULL )
{
2007-08-27 00:20:15 +00:00
if ( g_player [ j ] . user_name [ 0 ] )
Bstrcpy ( fta_quotes [ i ] , g_player [ j ] . user_name ) ;
2007-02-08 04:19:39 +00:00
else Bsprintf ( fta_quotes [ i ] , " %d " , j ) ;
}
else OSD_Printf ( " %s %d null quote %d \n " , __FILE__ , __LINE__ , i ) ;
break ;
case CON_QSTRCAT :
if ( fta_quotes [ i ] ! = NULL & & fta_quotes [ j ] ! = NULL )
Bstrncat ( fta_quotes [ i ] , fta_quotes [ j ] , ( MAXQUOTELEN - 1 ) - Bstrlen ( fta_quotes [ i ] ) ) ;
else OSD_Printf ( " %s %d null quote %d %d \n " , __FILE__ , __LINE__ , i , j ) ;
break ;
case CON_QSTRCPY :
if ( fta_quotes [ i ] ! = NULL & & fta_quotes [ j ] ! = NULL )
Bstrcpy ( fta_quotes [ i ] , fta_quotes [ j ] ) ;
else OSD_Printf ( " %s %d null quote %d %d \n " , __FILE__ , __LINE__ , i , j ) ;
break ;
case CON_CHANGESPRITESTAT :
changespritestat ( i , j ) ;
break ;
case CON_CHANGESPRITESECT :
changespritesect ( i , j ) ;
break ;
2006-11-16 03:02:42 +00:00
}
break ;
}
case CON_STARTLEVEL :
2007-02-08 04:19:39 +00:00
insptr + + ; // skip command
2006-12-21 09:33:26 +00:00
{
2007-02-08 04:19:39 +00:00
// from 'level' cheat in game.c (about line 6250)
int volnume = GetGameVarID ( * insptr + + , g_i , g_p ) , levnume = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
if ( volnume > MAXVOLUMES - 1 | | volnume < 0 )
{
OSD_Printf ( " parse():CON_STARTLEVEL: invalid volume (%d) \n " , volnume ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
if ( levnume > MAXLEVELS - 1 | | levnume < 0 )
{
OSD_Printf ( " parse():CON_STARTLEVEL: invalid level (%d) \n " , levnume ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
ud . m_volume_number = ud . volume_number = volnume ;
ud . m_level_number = ud . level_number = levnume ;
if ( numplayers > 1 & & myconnectindex = = connecthead )
mpchangemap ( volnume , levnume ) ;
else
{
2007-08-27 06:46:31 +00:00
g_player [ myconnectindex ] . ps - > gm | = MODE_EOL ;
2007-02-08 04:19:39 +00:00
display_bonus_screen = 0 ;
} // MODE_RESTART;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_MYOSX :
case CON_MYOSPALX :
case CON_MYOS :
case CON_MYOSPAL :
insptr + + ;
{
2006-12-18 08:37:12 +00:00
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) , tilenum = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int shade = GetGameVarID ( * insptr + + , g_i , g_p ) , orientation = GetGameVarID ( * insptr + + , g_i , g_p ) ;
switch ( tw )
{
case CON_MYOS :
myos ( x , y , tilenum , shade , orientation ) ;
break ;
case CON_MYOSPAL :
{
int pal = GetGameVarID ( * insptr + + , g_i , g_p ) ;
myospal ( x , y , tilenum , shade , orientation , pal ) ;
break ;
}
case CON_MYOSX :
myosx ( x , y , tilenum , shade , orientation ) ;
break ;
case CON_MYOSPALX :
{
int pal = GetGameVarID ( * insptr + + , g_i , g_p ) ;
myospalx ( x , y , tilenum , shade , orientation , pal ) ;
break ;
}
}
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
case CON_SWITCH :
insptr + + ; // p-code
2006-04-13 20:47:06 +00:00
{
2006-12-18 08:37:12 +00:00
// command format:
// variable ID to check
// script offset to 'end'
// count of case statements
// script offset to default case (null if none)
// For each case: value, ptr to code
//AddLog("Processing Switch...");
2007-12-12 17:42:14 +00:00
int lValue = GetGameVarID ( * insptr + + , g_i , g_p ) , lEnd = * insptr + + , lCases = * insptr + + ;
2008-02-17 05:08:18 +00:00
intptr_t * lpDefault = insptr + + , * lpCases = insptr , * lTempInsPtr ;
int bMatched = 0 , lCheckCase ;
2008-01-26 03:59:34 +00:00
int left , right ;
2006-12-18 08:37:12 +00:00
insptr + = lCases * 2 ;
lTempInsPtr = insptr ;
2007-12-12 17:42:14 +00:00
//Bsprintf(g_szBuf,"lEnd= %d *lpDefault=%d",lEnd,*lpDefault);
2006-04-13 20:47:06 +00:00
//AddLog(g_szBuf);
2007-12-12 17:42:14 +00:00
//Bsprintf(g_szBuf,"Checking %d cases for %d",lCases, lValue);
2006-12-18 08:37:12 +00:00
//AddLog(g_szBuf);
2008-01-26 03:59:34 +00:00
left = 0 ; right = lCases - 1 ;
while ( ! bMatched )
2006-04-13 20:47:06 +00:00
{
2007-12-12 17:42:14 +00:00
//Bsprintf(g_szBuf,"Checking #%d Value= %d",lCheckCase, lpCases[lCheckCase*2]);
2006-04-13 20:47:06 +00:00
//AddLog(g_szBuf);
2008-01-26 03:59:34 +00:00
lCheckCase = ( left + right ) / 2 ;
// initprintf("(%2d..%2d..%2d) [%2d..%2d..%2d]==%2d\n",left,lCheckCase,right,lpCases[left*2],lpCases[lCheckCase*2],lpCases[right*2],lValue);
if ( lpCases [ lCheckCase * 2 ] > lValue ) right = lCheckCase - 1 ; else
if ( lpCases [ lCheckCase * 2 ] < lValue ) left = lCheckCase + 1 ; else
if ( lpCases [ lCheckCase * 2 ] = = lValue )
{
//AddLog("Found Case Match");
//Bsprintf(g_szBuf,"insptr=%d. lCheckCase=%d, offset=%d, &script[0]=%d",
// (int)insptr,(int)lCheckCase,lpCases[lCheckCase*2+1],(int)&script[0]);
//AddLog(g_szBuf);
// fake a 2-d Array
2008-02-17 05:08:18 +00:00
insptr = ( intptr_t * ) ( lpCases [ lCheckCase * 2 + 1 ] + & script [ 0 ] ) ;
2008-01-26 03:59:34 +00:00
//Bsprintf(g_szBuf,"insptr=%d. ", (int)insptr);
//AddLog(g_szBuf);
while ( 1 )
{
if ( parse ( ) )
break ;
}
//AddLog("Done Executing Case");
bMatched = 1 ;
}
if ( right - left < 0 ) break ;
2006-11-16 03:02:42 +00:00
}
2006-12-18 08:37:12 +00:00
if ( ! bMatched )
2006-11-16 03:02:42 +00:00
{
2006-12-18 08:37:12 +00:00
if ( * lpDefault )
{
//AddLog("No Matching Case: Using Default");
2007-12-12 17:42:14 +00:00
insptr = ( int * ) ( * lpDefault + & script [ 0 ] ) ;
2006-12-18 08:37:12 +00:00
while ( 1 ) if ( parse ( ) ) break ;
}
else
{
//AddLog("No Matching Case: No Default to use");
}
2006-04-13 20:47:06 +00:00
}
2008-02-17 05:08:18 +00:00
insptr = ( intptr_t * ) ( lEnd + ( intptr_t ) & script [ 0 ] ) ;
2007-12-12 17:42:14 +00:00
//Bsprintf(g_szBuf,"insptr=%d. ", (int)insptr);
2006-12-18 08:37:12 +00:00
//AddLog(g_szBuf);
//AddLog("Done Processing Switch");
2006-11-13 23:12:47 +00:00
2006-12-18 08:37:12 +00:00
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_ENDSWITCH :
case CON_ENDEVENT :
insptr + + ;
return 1 ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_DISPLAYRAND :
insptr + + ;
2006-12-18 08:37:12 +00:00
SetGameVarID ( * insptr + + , rand ( ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_DRAGPOINT :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
int wallnum = GetGameVarID ( * insptr + + , g_i , g_p ) , newx = GetGameVarID ( * insptr + + , g_i , g_p ) , newy = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-12-18 08:37:12 +00:00
dragpoint ( wallnum , newx , newy ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_DIST :
case CON_LDIST :
insptr + + ;
{
2007-08-29 04:01:21 +00:00
int distvar = * insptr + + , xvar = GetGameVarID ( * insptr + + , g_i , g_p ) , yvar = GetGameVarID ( * insptr + + , g_i , g_p ) , distx = 0 ;
2006-12-18 08:37:12 +00:00
2007-09-10 23:38:42 +00:00
if ( xvar > - 1 & & xvar < MAXSPRITES & & yvar > - 1 & & yvar < MAXSPRITES )
2006-12-18 08:37:12 +00:00
{
2007-09-10 23:38:42 +00:00
switch ( tw )
{
2007-12-12 17:42:14 +00:00
case CON_DIST :
distx = dist ( & sprite [ xvar ] , & sprite [ yvar ] ) ;
break ;
case CON_LDIST :
distx = ldist ( & sprite [ xvar ] , & sprite [ yvar ] ) ;
break ;
2007-09-10 23:38:42 +00:00
}
2007-12-12 17:42:14 +00:00
}
else OSD_Printf ( " error: invalid sprite \n " ) ;
2006-12-18 08:37:12 +00:00
SetGameVarID ( distvar , distx , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
case CON_GETINCANGLE :
case CON_GETANGLE :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
2007-08-29 04:01:21 +00:00
int angvar = * insptr + + ;
int xvar = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int yvar = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
2006-12-18 08:37:12 +00:00
if ( tw = = CON_GETANGLE )
{
2007-08-29 04:01:21 +00:00
SetGameVarID ( angvar , getangle ( xvar , yvar ) , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
break ;
}
2007-08-29 04:01:21 +00:00
SetGameVarID ( angvar , getincangle ( xvar , yvar ) , g_i , g_p ) ;
2006-12-18 08:37:12 +00:00
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_MULSCALE :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
int var1 = * insptr + + , var2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int var3 = GetGameVarID ( * insptr + + , g_i , g_p ) , var4 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-12-18 08:37:12 +00:00
SetGameVarID ( var1 , mulscale ( var2 , var3 , var4 ) , g_i , g_p ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_INITTIMER :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-19 20:31:40 +00:00
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( timer ! = j )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
uninittimer ( ) ;
2006-12-19 20:31:40 +00:00
inittimer ( j ) ;
timer = j ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_TIME :
insptr + = 2 ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_ESPAWNVAR :
case CON_EQSPAWNVAR :
case CON_QSPAWNVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
int lIn = GetGameVarID ( * insptr + + , g_i , g_p ) ;
j = - 1 ;
if ( g_sp - > sectnum > = 0 & & g_sp - > sectnum < MAXSECTORS )
j = spawn ( g_i , lIn ) ;
switch ( tw )
{
case CON_EQSPAWNVAR :
if ( j ! = - 1 )
insertspriteq ( j ) ;
case CON_ESPAWNVAR :
SetGameVarID ( g_iReturnVarID , j , g_i , g_p ) ;
break ;
case CON_QSPAWNVAR :
if ( j ! = - 1 )
insertspriteq ( j ) ;
break ;
}
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
case CON_ESPAWN :
case CON_EQSPAWN :
case CON_QSPAWN :
insptr + + ;
2007-02-08 04:19:39 +00:00
2006-12-19 20:31:40 +00:00
j = - 1 ;
2007-02-08 04:19:39 +00:00
2006-11-16 03:02:42 +00:00
if ( g_sp - > sectnum > = 0 & & g_sp - > sectnum < MAXSECTORS )
2006-12-19 20:31:40 +00:00
j = spawn ( g_i , * insptr + + ) ;
2006-11-22 01:25:35 +00:00
else insptr + + ;
2006-11-16 03:02:42 +00:00
switch ( tw )
{
2006-11-15 01:16:55 +00:00
case CON_EQSPAWN :
2006-12-19 20:31:40 +00:00
if ( j ! = - 1 )
insertspriteq ( j ) ;
2006-11-16 03:02:42 +00:00
case CON_ESPAWN :
2006-12-19 20:31:40 +00:00
SetGameVarID ( g_iReturnVarID , j , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-11-13 23:12:47 +00:00
case CON_QSPAWN :
2006-12-19 20:31:40 +00:00
if ( j ! = - 1 )
insertspriteq ( j ) ;
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_ESHOOT :
case CON_EZSHOOT :
case CON_ZSHOOT :
insptr + + ;
2007-02-08 04:19:39 +00:00
2006-11-16 03:02:42 +00:00
if ( tw = = CON_ZSHOOT | | tw = = CON_EZSHOOT )
2006-11-13 23:12:47 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ g_i ] . temp_data [ 9 ] = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( hittype [ g_i ] . temp_data [ 9 ] = = 0 )
hittype [ g_i ] . temp_data [ 9 ] = 1 ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
if ( g_sp - > sectnum > = 0 & & g_sp - > sectnum < MAXSECTORS )
2006-11-15 01:16:55 +00:00
{
2006-11-16 03:02:42 +00:00
if ( tw = = CON_EZSHOOT | | tw = = CON_ESHOOT )
2006-12-18 21:29:55 +00:00
SetGameVarID ( g_iReturnVarID , shoot ( g_i , * insptr + + ) , g_i , g_p ) ;
else shoot ( g_i , * insptr + + ) ;
2006-11-16 03:02:42 +00:00
}
2006-11-22 01:25:35 +00:00
else insptr + + ;
2006-11-16 03:02:42 +00:00
hittype [ g_i ] . temp_data [ 9 ] = 0 ;
break ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case CON_SHOOTVAR :
case CON_ESHOOTVAR :
case CON_EZSHOOTVAR :
case CON_ZSHOOTVAR :
{
2007-12-12 17:42:14 +00:00
int lReturn = - 1 ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
insptr + + ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
if ( tw = = CON_ZSHOOTVAR | | tw = = CON_EZSHOOTVAR )
2006-11-13 23:12:47 +00:00
{
2006-11-16 03:02:42 +00:00
hittype [ g_i ] . temp_data [ 9 ] = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( hittype [ g_i ] . temp_data [ 9 ] = = 0 )
hittype [ g_i ] . temp_data [ 9 ] = 1 ;
2006-11-13 23:12:47 +00:00
}
2007-02-11 00:49:03 +00:00
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
if ( g_sp - > sectnum > = 0 & & g_sp - > sectnum < MAXSECTORS )
2006-11-13 23:12:47 +00:00
{
2007-02-11 00:49:03 +00:00
lReturn = shoot ( g_i , j ) ;
2006-11-16 03:02:42 +00:00
if ( tw = = CON_ESHOOTVAR | | tw = = CON_EZSHOOTVAR )
SetGameVarID ( g_iReturnVarID , lReturn , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
hittype [ g_i ] . temp_data [ 9 ] = 0 ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SOUNDVAR :
case CON_STOPSOUNDVAR :
case CON_SOUNDONCEVAR :
case CON_GLOBALSOUNDVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-19 20:31:40 +00:00
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
switch ( tw )
2006-11-13 23:12:47 +00:00
{
2006-11-16 03:02:42 +00:00
case CON_SOUNDONCEVAR :
2006-12-19 20:31:40 +00:00
if ( ! isspritemakingsound ( g_i , j ) )
spritesound ( ( short ) j , g_i ) ;
2006-04-13 20:47:06 +00:00
break ;
2006-11-16 03:02:42 +00:00
case CON_GLOBALSOUNDVAR :
2007-08-27 06:46:31 +00:00
spritesound ( ( short ) j , g_player [ screenpeek ] . ps - > i ) ;
2006-11-15 01:16:55 +00:00
break ;
2006-11-16 03:02:42 +00:00
case CON_STOPSOUNDVAR :
2006-12-19 20:31:40 +00:00
if ( isspritemakingsound ( g_i , j ) )
stopspritesound ( ( short ) j , g_i ) ;
2006-11-16 03:02:42 +00:00
break ;
case CON_SOUNDVAR :
2006-12-19 20:31:40 +00:00
spritesound ( ( short ) j , g_i ) ;
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_GUNIQHUDID :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
2006-12-18 21:29:55 +00:00
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( j < MAXUNIQHUDID - 1 )
guniqhudid = j ;
2006-12-18 08:37:12 +00:00
break ;
}
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case CON_SAVEGAMEVAR :
case CON_READGAMEVAR :
{
int32 i = 0 ;
insptr + + ;
2007-08-27 00:20:15 +00:00
if ( ud . config . scripthandle < 0 ) break ;
2006-11-16 03:02:42 +00:00
switch ( tw )
{
case CON_SAVEGAMEVAR :
i = GetGameVarID ( * insptr , g_i , g_p ) ;
2007-08-27 00:20:15 +00:00
SCRIPT_PutNumber ( ud . config . scripthandle , " Gamevars " , aGameVars [ * insptr + + ] . szLabel , i , false , false ) ;
2006-11-16 03:02:42 +00:00
break ;
case CON_READGAMEVAR :
2007-08-27 00:20:15 +00:00
SCRIPT_GetNumber ( ud . config . scripthandle , " Gamevars " , aGameVars [ * insptr ] . szLabel , & i ) ;
2006-11-16 03:02:42 +00:00
SetGameVarID ( * insptr + + , i , g_i , g_p ) ;
2006-11-15 01:16:55 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
break ;
}
2006-11-15 01:16:55 +00:00
2007-02-08 04:19:39 +00:00
case CON_SHOWVIEW :
insptr + + ;
{
int x = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int y = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int z = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int a = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int horiz = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int sect = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-12-12 17:42:14 +00:00
int x1 = scale ( GetGameVarID ( * insptr + + , g_i , g_p ) , xdim , 320 ) ;
int y1 = scale ( GetGameVarID ( * insptr + + , g_i , g_p ) , ydim , 200 ) ;
int x2 = scale ( GetGameVarID ( * insptr + + , g_i , g_p ) , xdim , 320 ) ;
int y2 = scale ( GetGameVarID ( * insptr + + , g_i , g_p ) , ydim , 200 ) ;
int smoothratio = 65536 ;
2007-03-11 00:47:32 +00:00
2007-02-08 04:19:39 +00:00
if ( x1 > x2 ) swaplong ( & x1 , & x2 ) ;
if ( y1 > y2 ) swaplong ( & y1 , & y2 ) ;
2007-02-13 01:28:50 +00:00
2007-02-13 09:50:58 +00:00
if ( x1 < 0 | | y1 < 0 | | x2 > xdim - 1 | | y2 > ydim - 1 | | x2 - x1 < 2 | | y2 - y1 < 2 )
2007-02-11 00:49:03 +00:00
break ;
2007-02-13 01:28:50 +00:00
2007-02-08 04:19:39 +00:00
# if defined(USE_OPENGL) && defined(POLYMOST)
j = glprojectionhacks ;
glprojectionhacks = 0 ;
2007-02-11 00:49:03 +00:00
# endif
2007-02-08 04:19:39 +00:00
setview ( x1 , y1 , x2 , y2 ) ;
2007-03-11 00:20:32 +00:00
#if 0
2007-08-27 06:46:31 +00:00
if ( ! ud . pause_on & & ( ( ud . show_help = = 0 & & ud . multimode < 2 & & ! ( g_player [ myconnectindex ] . ps - > gm & MODE_MENU ) ) | | ud . multimode > 1 | | ud . recstat = = 2 ) )
2007-03-11 00:20:32 +00:00
smoothratio = min ( max ( ( totalclock - ototalclock ) * ( 65536L / TICSPERFRAME ) , 0 ) , 65536 ) ;
# endif
2007-03-11 00:47:32 +00:00
dointerpolations ( smoothratio ) ;
2007-03-13 18:37:46 +00:00
# define SE40
2007-03-11 00:20:32 +00:00
# ifdef SE40
se40code ( x , y , z , a , horiz , smoothratio ) ;
# endif
if ( ( gotpic [ MIRROR > > 3 ] & ( 1 < < ( MIRROR & 7 ) ) ) > 0 )
{
2007-12-12 17:42:14 +00:00
int j , i = 0 , k , dst = 0x7fffffff ;
2007-03-11 00:20:32 +00:00
for ( k = 0 ; k < mirrorcnt ; k + + )
{
j = klabs ( wall [ mirrorwall [ k ] ] . x - x ) ;
j + = klabs ( wall [ mirrorwall [ k ] ] . y - y ) ;
if ( j < dst ) dst = j , i = k ;
}
if ( wall [ mirrorwall [ i ] ] . overpicnum = = MIRROR )
{
2007-12-12 17:42:14 +00:00
int tposx , tposy ;
2007-03-11 00:20:32 +00:00
short tang ;
2007-03-11 00:47:32 +00:00
2007-03-11 00:20:32 +00:00
preparemirror ( x , y , z , a , horiz , mirrorwall [ i ] , mirrorsector [ i ] , & tposx , & tposy , & tang ) ;
j = visibility ;
visibility = ( j > > 1 ) + ( j > > 2 ) ;
drawrooms ( tposx , tposy , z , tang , horiz , mirrorsector [ i ] + MAXSECTORS ) ;
display_mirror = 1 ;
animatesprites ( tposx , tposy , tang , smoothratio ) ;
display_mirror = 0 ;
drawmasks ( ) ;
completemirror ( ) ; //Reverse screen x-wise in this function
visibility = j ;
}
gotpic [ MIRROR > > 3 ] & = ~ ( 1 < < ( MIRROR & 7 ) ) ;
}
2007-02-08 04:19:39 +00:00
drawrooms ( x , y , z , a , horiz , sect ) ;
2007-03-11 00:20:32 +00:00
display_mirror = 2 ;
animatesprites ( x , y , a , smoothratio ) ;
display_mirror = 0 ;
2007-02-08 04:19:39 +00:00
drawmasks ( ) ;
2007-03-11 00:20:32 +00:00
restoreinterpolations ( ) ;
2007-02-08 04:19:39 +00:00
vscrn ( ) ;
# if defined(USE_OPENGL) && defined(POLYMOST)
glprojectionhacks = j ;
2007-02-13 01:28:50 +00:00
# endif
2007-02-08 04:19:39 +00:00
break ;
}
2008-03-14 21:04:28 +00:00
case CON_ROTATESPRITE16 :
2006-11-16 03:02:42 +00:00
case CON_ROTATESPRITE :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) , z = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int a = GetGameVarID ( * insptr + + , g_i , g_p ) , tilenum = GetGameVarID ( * insptr + + , g_i , g_p ) , shade = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int pal = GetGameVarID ( * insptr + + , g_i , g_p ) , orientation = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-12-12 17:42:14 +00:00
int x1 = GetGameVarID ( * insptr + + , g_i , g_p ) , y1 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int x2 = GetGameVarID ( * insptr + + , g_i , g_p ) , y2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
2008-03-14 21:04:28 +00:00
if ( tw = = CON_ROTATESPRITE ) { x < < = 16 ; y < < = 16 ; }
rotatesprite ( x , y , z , a , tilenum , shade , pal , 2 | orientation , x1 , y1 , x2 , y2 ) ;
2006-12-18 08:37:12 +00:00
break ;
}
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case CON_MINITEXT :
case CON_GAMETEXT :
2007-12-20 19:14:38 +00:00
case CON_GAMETEXTZ :
2006-11-16 03:02:42 +00:00
case CON_DIGITALNUMBER :
2007-12-20 19:14:38 +00:00
case CON_DIGITALNUMBERZ :
2006-12-18 08:37:12 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-12-20 19:14:38 +00:00
int tilenum = ( tw = = CON_GAMETEXT | | tw = = CON_GAMETEXTZ | | tw = = CON_DIGITALNUMBER | | tw = = CON_DIGITALNUMBERZ ) ? GetGameVarID ( * insptr + + , g_i , g_p ) : 0 ;
2006-12-18 08:37:12 +00:00
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) , q = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int shade = GetGameVarID ( * insptr + + , g_i , g_p ) , pal = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-12-20 19:14:38 +00:00
if ( tw = = CON_GAMETEXT | | tw = = CON_GAMETEXTZ | | tw = = CON_DIGITALNUMBER | | tw = = CON_DIGITALNUMBERZ )
2006-12-18 08:37:12 +00:00
{
int orientation = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int x1 = GetGameVarID ( * insptr + + , g_i , g_p ) , y1 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int x2 = GetGameVarID ( * insptr + + , g_i , g_p ) , y2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-12-28 20:04:58 +00:00
int z = 65536 ;
2006-12-18 08:37:12 +00:00
2007-12-20 19:14:38 +00:00
if ( tw = = CON_GAMETEXT | | tw = = CON_GAMETEXTZ )
2006-12-18 08:37:12 +00:00
{
2007-12-28 20:04:58 +00:00
int z = 65536 ;
2006-12-18 08:37:12 +00:00
if ( fta_quotes [ q ] = = NULL )
{
OSD_Printf ( " %s %d null quote %d \n " , __FILE__ , __LINE__ , q ) ;
break ;
}
2007-12-20 19:14:38 +00:00
if ( tw = = CON_GAMETEXTZ ) z = GetGameVarID ( * insptr + + , g_i , g_p ) ;
gametext_z ( 0 , tilenum , x > > 1 , y , fta_quotes [ q ] , shade , pal , orientation , x1 , y1 , x2 , y2 , z ) ;
2006-12-18 08:37:12 +00:00
break ;
}
2007-12-20 19:14:38 +00:00
if ( tw = = CON_DIGITALNUMBERZ ) z = GetGameVarID ( * insptr + + , g_i , g_p ) ;
txdigitalnumberz ( tilenum , x , y , q , shade , pal , orientation , x1 , y1 , x2 , y2 , z ) ;
2006-12-18 08:37:12 +00:00
break ;
}
if ( fta_quotes [ q ] = = NULL )
{
OSD_Printf ( " %s %d null quote %d \n " , __FILE__ , __LINE__ , q ) ;
break ;
}
minitextshade ( x , y , fta_quotes [ q ] , shade , pal , 26 ) ;
break ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
case CON_ANGOFF :
insptr + + ;
spriteext [ g_i ] . angoff = * insptr + + ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETZRANGE :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) , z = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int sectnum = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int ceilzvar = * insptr + + , ceilhitvar = * insptr + + , florzvar = * insptr + + , florhitvar = * insptr + + ;
int walldist = GetGameVarID ( * insptr + + , g_i , g_p ) , clipmask = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-12-12 17:42:14 +00:00
int ceilz , ceilhit , florz , florhit ;
2006-12-18 08:37:12 +00:00
getzrange ( x , y , z , sectnum , & ceilz , & ceilhit , & florz , & florhit , walldist , clipmask ) ;
SetGameVarID ( ceilzvar , ceilz , g_i , g_p ) ;
SetGameVarID ( ceilhitvar , ceilhit , g_i , g_p ) ;
SetGameVarID ( florzvar , florz , g_i , g_p ) ;
SetGameVarID ( florhitvar , florhit , g_i , g_p ) ;
break ;
}
2006-04-23 06:00:08 +00:00
2006-11-16 03:02:42 +00:00
case CON_HITSCAN :
2006-12-18 08:37:12 +00:00
insptr + + ;
{
int xs = GetGameVarID ( * insptr + + , g_i , g_p ) , ys = GetGameVarID ( * insptr + + , g_i , g_p ) , zs = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int sectnum = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int vx = GetGameVarID ( * insptr + + , g_i , g_p ) , vy = GetGameVarID ( * insptr + + , g_i , g_p ) , vz = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int hitsectvar = * insptr + + , hitwallvar = * insptr + + , hitspritevar = * insptr + + ;
int hitxvar = * insptr + + , hityvar = * insptr + + , hitzvar = * insptr + + , cliptype = GetGameVarID ( * insptr + + , g_i , g_p ) ;
short hitsect , hitwall , hitsprite ;
2007-12-12 17:42:14 +00:00
int hitx , hity , hitz ;
2006-12-18 08:37:12 +00:00
hitscan ( xs , ys , zs , sectnum , vx , vy , vz , & hitsect , & hitwall , & hitsprite , & hitx , & hity , & hitz , cliptype ) ;
SetGameVarID ( hitsectvar , hitsect , g_i , g_p ) ;
SetGameVarID ( hitwallvar , hitwall , g_i , g_p ) ;
SetGameVarID ( hitspritevar , hitsprite , g_i , g_p ) ;
SetGameVarID ( hitxvar , hitx , g_i , g_p ) ;
SetGameVarID ( hityvar , hity , g_i , g_p ) ;
SetGameVarID ( hitzvar , hitz , g_i , g_p ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_CANSEE :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
int x1 = GetGameVarID ( * insptr + + , g_i , g_p ) , y1 = GetGameVarID ( * insptr + + , g_i , g_p ) , z1 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int sect1 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int x2 = GetGameVarID ( * insptr + + , g_i , g_p ) , y2 = GetGameVarID ( * insptr + + , g_i , g_p ) , z2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int sect2 = GetGameVarID ( * insptr + + , g_i , g_p ) , rvar = * insptr + + ;
2006-11-16 03:02:42 +00:00
2006-12-18 08:37:12 +00:00
SetGameVarID ( rvar , cansee ( x1 , y1 , z1 , sect1 , x2 , y2 , z2 , sect2 ) , g_i , g_p ) ;
break ;
}
2006-11-16 03:02:42 +00:00
2006-12-18 08:37:12 +00:00
case CON_ROTATEPOINT :
2006-11-16 03:02:42 +00:00
insptr + + ;
2006-12-18 08:37:12 +00:00
{
int xpivot = GetGameVarID ( * insptr + + , g_i , g_p ) , ypivot = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) , daang = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int x2var = * insptr + + , y2var = * insptr + + ;
2007-12-12 17:42:14 +00:00
int x2 , y2 ;
2006-12-18 08:37:12 +00:00
rotatepoint ( xpivot , ypivot , x , y , daang , & x2 , & y2 ) ;
SetGameVarID ( x2var , x2 , g_i , g_p ) ;
SetGameVarID ( y2var , y2 , g_i , g_p ) ;
break ;
}
2006-11-16 03:02:42 +00:00
case CON_NEARTAG :
2006-12-18 08:37:12 +00:00
insptr + + ;
{
2007-12-12 17:42:14 +00:00
// neartag(int x, int y, int z, short sectnum, short ang, //Starting position & angle
2006-12-18 08:37:12 +00:00
// short *neartagsector, //Returns near sector if sector[].tag != 0
// short *neartagwall, //Returns near wall if wall[].tag != 0
// short *neartagsprite, //Returns near sprite if sprite[].tag != 0
2007-12-12 17:42:14 +00:00
// int *neartaghitdist, //Returns actual distance to object (scale: 1024=largest grid size)
// int neartagrange, //Choose maximum distance to scan (scale: 1024=largest grid size)
2006-12-18 08:37:12 +00:00
// char tagsearch) //1-lotag only, 2-hitag only, 3-lotag&hitag
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) , z = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int sectnum = GetGameVarID ( * insptr + + , g_i , g_p ) , ang = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int neartagsectorvar = * insptr + + , neartagwallvar = * insptr + + , neartagspritevar = * insptr + + , neartaghitdistvar = * insptr + + ;
int neartagrange = GetGameVarID ( * insptr + + , g_i , g_p ) , tagsearch = GetGameVarID ( * insptr + + , g_i , g_p ) ;
neartag ( x , y , z , sectnum , ang , & neartagsector , & neartagwall , & neartagsprite , & neartaghitdist , neartagrange , tagsearch ) ;
SetGameVarID ( neartagsectorvar , neartagsector , g_i , g_p ) ;
SetGameVarID ( neartagwallvar , neartagwall , g_i , g_p ) ;
SetGameVarID ( neartagspritevar , neartagsprite , g_i , g_p ) ;
SetGameVarID ( neartaghitdistvar , neartaghitdist , g_i , g_p ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_MOVESPRITE :
case CON_SETSPRITE :
insptr + + ;
{
2006-12-18 08:37:12 +00:00
int spritenum = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) , z = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( tw = = CON_SETSPRITE )
{
setsprite ( spritenum , x , y , z ) ;
break ;
}
{
int cliptype = GetGameVarID ( * insptr + + , g_i , g_p ) ;
SetGameVarID ( * insptr + + , movesprite ( spritenum , x , y , z , cliptype ) , g_i , g_p ) ;
break ;
}
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
case CON_GETFLORZOFSLOPE :
case CON_GETCEILZOFSLOPE :
insptr + + ;
{
2006-12-18 08:37:12 +00:00
int sectnum = GetGameVarID ( * insptr + + , g_i , g_p ) , x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( tw = = CON_GETFLORZOFSLOPE )
{
SetGameVarID ( * insptr + + , getflorzofslope ( sectnum , x , y ) , g_i , g_p ) ;
break ;
}
SetGameVarID ( * insptr + + , getceilzofslope ( sectnum , x , y ) , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
case CON_UPDATESECTOR :
case CON_UPDATESECTORZ :
insptr + + ;
2006-12-18 08:37:12 +00:00
{
int x = GetGameVarID ( * insptr + + , g_i , g_p ) , y = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int z = ( tw = = CON_UPDATESECTORZ ) ? GetGameVarID ( * insptr + + , g_i , g_p ) : 0 ;
int var = * insptr + + ;
short w = sprite [ g_i ] . sectnum ;
2006-04-13 20:47:06 +00:00
2006-12-18 08:37:12 +00:00
if ( tw = = CON_UPDATESECTOR ) updatesector ( x , y , & w ) ;
else if ( tw = = CON_UPDATESECTORZ ) updatesectorz ( x , y , z , & w ) ;
2006-04-13 20:47:06 +00:00
2006-12-18 08:37:12 +00:00
SetGameVarID ( var , w , g_i , g_p ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SPAWN :
insptr + + ;
if ( g_sp - > sectnum > = 0 & & g_sp - > sectnum < MAXSECTORS )
spawn ( g_i , * insptr ) ;
insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFWASWEAPON :
insptr + + ;
parseifelse ( hittype [ g_i ] . picnum = = * insptr ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFAI :
insptr + + ;
parseifelse ( g_t [ 5 ] = = * insptr ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFACTION :
insptr + + ;
parseifelse ( g_t [ 4 ] = = * insptr ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFACTIONCOUNT :
insptr + + ;
parseifelse ( g_t [ 2 ] > = * insptr ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_RESETACTIONCOUNT :
insptr + + ;
g_t [ 2 ] = 0 ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_DEBRIS :
insptr + + ;
2007-02-08 04:19:39 +00:00
{
int dnum = * insptr + + ;
if ( g_sp - > sectnum > = 0 & & g_sp - > sectnum < MAXSECTORS )
for ( j = ( * insptr ) - 1 ; j > = 0 ; j - - )
{
if ( g_sp - > picnum = = BLIMP & & dnum = = SCRAP1 )
s = 0 ;
else s = ( TRAND % 3 ) ;
l = EGS ( g_sp - > sectnum ,
g_sp - > x + ( TRAND & 255 ) - 128 , g_sp - > y + ( TRAND & 255 ) - 128 , g_sp - > z - ( 8 < < 8 ) - ( TRAND & 8191 ) ,
dnum + s , g_sp - > shade , 32 + ( TRAND & 15 ) , 32 + ( TRAND & 15 ) ,
TRAND & 2047 , ( TRAND & 127 ) + 32 ,
- ( TRAND & 2047 ) , g_i , 5 ) ;
if ( g_sp - > picnum = = BLIMP & & dnum = = SCRAP1 )
sprite [ l ] . yvel = weaponsandammosprites [ j % 14 ] ;
else sprite [ l ] . yvel = - 1 ;
sprite [ l ] . pal = g_sp - > pal ;
}
insptr + + ;
}
break ;
2006-11-16 03:02:42 +00:00
case CON_COUNT :
insptr + + ;
g_t [ 0 ] = ( short ) * insptr + + ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_CSTATOR :
insptr + + ;
g_sp - > cstat | = ( short ) * insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_CLIPDIST :
insptr + + ;
g_sp - > clipdist = ( short ) * insptr + + ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_CSTAT :
insptr + + ;
g_sp - > cstat = ( short ) * insptr + + ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SAVE :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
time_t curtime ;
2006-11-16 03:02:42 +00:00
2007-02-08 04:19:39 +00:00
lastsavedpos = * insptr + + ;
2006-12-19 20:31:40 +00:00
2007-02-08 04:19:39 +00:00
if ( ( movesperpacket = = 4 & & connecthead ! = myconnectindex ) | | lastsavedpos > 9 )
break ;
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
curtime = time ( NULL ) ;
Bstrcpy ( tempbuf , asctime ( localtime ( & curtime ) ) ) ;
clearbuf ( ud . savegame [ lastsavedpos ] , sizeof ( ud . savegame [ lastsavedpos ] ) , 0 ) ;
Bsprintf ( ud . savegame [ lastsavedpos ] , " Auto " ) ;
2008-02-14 08:35:30 +00:00
// for (j=0;j<13;j++)
// Bmemcpy(&ud.savegame[lastsavedpos][j+4],&tempbuf[j+3],sizeof(tempbuf[j+3]));
// ud.savegame[lastsavedpos][j+4] = '\0';
Bmemcpy ( & ud . savegame [ lastsavedpos ] [ 4 ] , & tempbuf [ 3 ] , sizeof ( tempbuf [ 0 ] ) * 13 ) ;
ud . savegame [ lastsavedpos ] [ 17 ] = ' \0 ' ;
2007-02-08 04:19:39 +00:00
OSD_Printf ( " Saving to slot %d \n " , lastsavedpos ) ;
2006-11-13 23:12:47 +00:00
2007-02-08 04:19:39 +00:00
KB_FlushKeyboardQueue ( ) ;
2006-11-13 23:12:47 +00:00
2007-02-08 04:19:39 +00:00
screencapt = 1 ;
displayrooms ( myconnectindex , 65536 ) ;
screencapt = 0 ;
if ( ud . multimode > 1 )
saveplayer ( - 1 - ( lastsavedpos ) ) ;
else saveplayer ( lastsavedpos ) ;
2006-04-18 02:01:48 +00:00
2007-02-08 04:19:39 +00:00
break ;
}
2006-04-18 03:11:38 +00:00
2007-01-05 22:30:35 +00:00
case CON_QUAKE :
insptr + + ;
earthquaketime = ( char ) GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-08-27 06:46:31 +00:00
spritesound ( EARTHQUAKE , g_player [ screenpeek ] . ps - > i ) ;
2007-01-05 22:30:35 +00:00
break ;
2006-11-16 03:02:42 +00:00
case CON_IFMOVE :
insptr + + ;
parseifelse ( g_t [ 1 ] = = * insptr ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_RESETPLAYER :
{
insptr + + ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
//AddLog("resetplayer");
if ( ud . multimode < 2 )
{
if ( lastsavedpos > = 0 & & ud . recstat ! = 2 )
2006-11-15 01:16:55 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > gm = MODE_MENU ;
2006-11-16 03:02:42 +00:00
KB_ClearKeyDown ( sc_Space ) ;
cmenu ( 15000 ) ;
2006-11-15 01:16:55 +00:00
}
2007-08-27 06:46:31 +00:00
else g_player [ g_p ] . ps - > gm = MODE_RESTART ;
2006-11-16 03:02:42 +00:00
killit_flag = 2 ;
}
else
{
pickrandomspot ( g_p ) ;
2007-08-27 06:46:31 +00:00
g_sp - > x = hittype [ g_i ] . bposx = g_player [ g_p ] . ps - > bobposx = g_player [ g_p ] . ps - > oposx = g_player [ g_p ] . ps - > posx ;
g_sp - > y = hittype [ g_i ] . bposy = g_player [ g_p ] . ps - > bobposy = g_player [ g_p ] . ps - > oposy = g_player [ g_p ] . ps - > posy ;
g_sp - > z = hittype [ g_i ] . bposy = g_player [ g_p ] . ps - > oposz = g_player [ g_p ] . ps - > posz ;
updatesector ( g_player [ g_p ] . ps - > posx , g_player [ g_p ] . ps - > posy , & g_player [ g_p ] . ps - > cursectnum ) ;
setsprite ( g_player [ g_p ] . ps - > i , g_player [ g_p ] . ps - > posx , g_player [ g_p ] . ps - > posy , g_player [ g_p ] . ps - > posz + PHEIGHT ) ;
2006-11-16 03:02:42 +00:00
g_sp - > cstat = 257 ;
g_sp - > shade = - 12 ;
g_sp - > clipdist = 64 ;
g_sp - > xrepeat = 42 ;
g_sp - > yrepeat = 36 ;
g_sp - > owner = g_i ;
g_sp - > xoffset = 0 ;
2007-08-27 06:46:31 +00:00
g_sp - > pal = g_player [ g_p ] . ps - > palookup ;
2007-08-27 23:11:49 +00:00
g_player [ g_p ] . ps - > last_extra = g_sp - > extra = g_player [ g_p ] . ps - > max_player_health ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > wantweaponfire = - 1 ;
g_player [ g_p ] . ps - > horiz = 100 ;
g_player [ g_p ] . ps - > on_crane = - 1 ;
g_player [ g_p ] . ps - > frag_ps = g_p ;
g_player [ g_p ] . ps - > horizoff = 0 ;
g_player [ g_p ] . ps - > opyoff = 0 ;
g_player [ g_p ] . ps - > wackedbyactor = - 1 ;
2007-08-27 23:11:49 +00:00
g_player [ g_p ] . ps - > shield_amount = start_armour_amount ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > dead_flag = 0 ;
g_player [ g_p ] . ps - > pals_time = 0 ;
g_player [ g_p ] . ps - > footprintcount = 0 ;
g_player [ g_p ] . ps - > weapreccnt = 0 ;
g_player [ g_p ] . ps - > fta = 0 ;
g_player [ g_p ] . ps - > ftq = 0 ;
g_player [ g_p ] . ps - > posxv = g_player [ g_p ] . ps - > posyv = 0 ;
g_player [ g_p ] . ps - > rotscrnang = 0 ;
g_player [ g_p ] . ps - > runspeed = dukefriction ;
g_player [ g_p ] . ps - > falling_counter = 0 ;
2006-11-16 03:02:42 +00:00
hittype [ g_i ] . extra = - 1 ;
hittype [ g_i ] . owner = g_i ;
hittype [ g_i ] . cgg = 0 ;
hittype [ g_i ] . movflag = 0 ;
hittype [ g_i ] . tempang = 0 ;
hittype [ g_i ] . actorstayput = - 1 ;
hittype [ g_i ] . dispicnum = 0 ;
2007-08-27 06:46:31 +00:00
hittype [ g_i ] . owner = g_player [ g_p ] . ps - > i ;
2006-11-16 03:02:42 +00:00
resetinventory ( g_p ) ;
resetweapons ( g_p ) ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > reloading = 0 ;
2006-11-16 03:02:42 +00:00
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > movement_lock = 0 ;
2006-11-16 03:02:42 +00:00
2007-08-27 06:46:31 +00:00
OnEvent ( EVENT_RESETPLAYER , g_player [ g_p ] . ps - > i , g_p , - 1 ) ;
2006-11-16 03:02:42 +00:00
cameradist = 0 ;
cameraclock = totalclock ;
2006-11-13 23:12:47 +00:00
}
2007-08-27 06:46:31 +00:00
setpal ( g_player [ g_p ] . ps ) ;
2006-11-16 03:02:42 +00:00
//AddLog("EOF: resetplayer");
}
break ;
case CON_IFONWATER :
parseifelse ( klabs ( g_sp - > z - sector [ g_sp - > sectnum ] . floorz ) < ( 32 < < 8 ) & & sector [ g_sp - > sectnum ] . lotag = = 1 ) ;
break ;
case CON_IFINWATER :
parseifelse ( sector [ g_sp - > sectnum ] . lotag = = 2 ) ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFCOUNT :
insptr + + ;
parseifelse ( g_t [ 0 ] > = * insptr ) ;
break ;
case CON_IFACTOR :
insptr + + ;
parseifelse ( g_sp - > picnum = = * insptr ) ;
break ;
case CON_RESETCOUNT :
insptr + + ;
g_t [ 0 ] = 0 ;
break ;
case CON_ADDINVENTORY :
insptr + = 2 ;
switch ( * ( insptr - 1 ) )
{
case GET_STEROIDS :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > steroids_amount = * insptr ;
g_player [ g_p ] . ps - > inven_icon = 2 ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_SHIELD :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > shield_amount + = * insptr ; // 100;
2007-08-27 23:11:49 +00:00
if ( g_player [ g_p ] . ps - > shield_amount > g_player [ g_p ] . ps - > max_shield_amount )
g_player [ g_p ] . ps - > shield_amount = g_player [ g_p ] . ps - > max_shield_amount ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_SCUBA :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > scuba_amount = * insptr ; // 1600;
g_player [ g_p ] . ps - > inven_icon = 6 ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_HOLODUKE :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > holoduke_amount = * insptr ; // 1600;
g_player [ g_p ] . ps - > inven_icon = 3 ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_JETPACK :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > jetpack_amount = * insptr ; // 1600;
g_player [ g_p ] . ps - > inven_icon = 4 ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_ACCESS :
switch ( g_sp - > pal )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case 0 :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > got_access | = 1 ;
2006-11-16 03:02:42 +00:00
break ;
case 21 :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > got_access | = 2 ;
2006-11-16 03:02:42 +00:00
break ;
case 23 :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > got_access | = 4 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
}
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_HEATS :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > heat_amount = * insptr ;
g_player [ g_p ] . ps - > inven_icon = 5 ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_FIRSTAID :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > inven_icon = 1 ;
g_player [ g_p ] . ps - > firstaid_amount = * insptr ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case GET_BOOTS :
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > inven_icon = 7 ;
g_player [ g_p ] . ps - > boot_amount = * insptr ;
2006-11-16 03:02:42 +00:00
break ;
2006-11-15 01:16:55 +00:00
}
2006-11-16 03:02:42 +00:00
insptr + + ;
2006-04-13 20:47:06 +00:00
break ;
2006-04-18 03:11:38 +00:00
2008-02-16 22:18:48 +00:00
case CON_HITRADIUSVAR :
insptr + + ;
{
int v1 = GetGameVarID ( * insptr + + , g_i , g_p ) , v2 = GetGameVarID ( * insptr + + , g_i , g_p ) , v3 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int v4 = GetGameVarID ( * insptr + + , g_i , g_p ) , v5 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
hitradius ( g_i , v1 , v2 , v3 , v4 , v5 ) ;
}
break ;
2006-11-16 03:02:42 +00:00
case CON_HITRADIUS :
hitradius ( g_i , * ( insptr + 1 ) , * ( insptr + 2 ) , * ( insptr + 3 ) , * ( insptr + 4 ) , * ( insptr + 5 ) ) ;
insptr + = 6 ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFP :
{
2008-02-16 22:18:48 +00:00
// insptr++;
2006-11-16 03:02:42 +00:00
2008-02-16 22:18:48 +00:00
l = * ( + + insptr ) ;
2006-11-16 03:02:42 +00:00
j = 0 ;
2007-08-27 06:46:31 +00:00
s = sprite [ g_player [ g_p ] . ps - > i ] . xvel ;
2006-11-16 03:02:42 +00:00
2007-08-27 06:46:31 +00:00
if ( ( l & 8 ) & & g_player [ g_p ] . ps - > on_ground & & ( g_player [ g_p ] . sync - > bits & 2 ) )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 16 ) & & g_player [ g_p ] . ps - > jumping_counter = = 0 & & ! g_player [ g_p ] . ps - > on_ground & &
g_player [ g_p ] . ps - > poszv > 2048 )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 32 ) & & g_player [ g_p ] . ps - > jumping_counter > 348 )
2006-11-16 03:02:42 +00:00
j = 1 ;
else if ( ( l & 1 ) & & s > = 0 & & s < 8 )
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 2 ) & & s > = 8 & & ! ( g_player [ g_p ] . sync - > bits & ( 1 < < 5 ) ) )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 4 ) & & s > = 8 & & g_player [ g_p ] . sync - > bits & ( 1 < < 5 ) )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 64 ) & & g_player [ g_p ] . ps - > posz < ( g_sp - > z - ( 48 < < 8 ) ) )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 128 ) & & s < = - 8 & & ! ( g_player [ g_p ] . sync - > bits & ( 1 < < 5 ) ) )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 256 ) & & s < = - 8 & & ( g_player [ g_p ] . sync - > bits & ( 1 < < 5 ) ) )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 512 ) & & ( g_player [ g_p ] . ps - > quick_kick > 0 | | ( g_player [ g_p ] . ps - > curr_weapon = = KNEE_WEAPON & & g_player [ g_p ] . ps - > kickback_pic > 0 ) ) )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 1024 ) & & sprite [ g_player [ g_p ] . ps - > i ] . xrepeat < 32 )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 2048 ) & & g_player [ g_p ] . ps - > jetpack_on )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 4096 ) & & g_player [ g_p ] . ps - > steroids_amount > 0 & & g_player [ g_p ] . ps - > steroids_amount < 400 )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 8192 ) & & g_player [ g_p ] . ps - > on_ground )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 16384 ) & & sprite [ g_player [ g_p ] . ps - > i ] . xrepeat > 32 & & sprite [ g_player [ g_p ] . ps - > i ] . extra > 0 & & g_player [ g_p ] . ps - > timebeforeexit = = 0 )
2006-11-16 03:02:42 +00:00
j = 1 ;
2007-08-27 06:46:31 +00:00
else if ( ( l & 32768 ) & & sprite [ g_player [ g_p ] . ps - > i ] . extra < = 0 )
2006-11-16 03:02:42 +00:00
j = 1 ;
else if ( ( l & 65536L ) )
{
if ( g_sp - > picnum = = APLAYER & & ud . multimode > 1 )
2007-08-27 06:46:31 +00:00
j = getincangle ( g_player [ otherp ] . ps - > ang , getangle ( g_player [ g_p ] . ps - > posx - g_player [ otherp ] . ps - > posx , g_player [ g_p ] . ps - > posy - g_player [ otherp ] . ps - > posy ) ) ;
2006-11-16 03:02:42 +00:00
else
2007-08-27 06:46:31 +00:00
j = getincangle ( g_player [ g_p ] . ps - > ang , getangle ( g_sp - > x - g_player [ g_p ] . ps - > posx , g_sp - > y - g_player [ g_p ] . ps - > posy ) ) ;
2006-11-16 03:02:42 +00:00
if ( j > - 128 & & j < 128 )
j = 1 ;
else
j = 0 ;
}
2008-02-17 05:08:18 +00:00
parseifelse ( ( intptr_t ) j ) ;
2006-11-16 03:02:42 +00:00
}
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFSTRENGTH :
insptr + + ;
parseifelse ( g_sp - > extra < = * insptr ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_GUTS :
insptr + = 2 ;
2008-03-21 04:01:38 +00:00
guts ( g_i , * ( insptr - 1 ) , * insptr ) ;
2006-11-16 03:02:42 +00:00
insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFSPAWNEDBY :
insptr + + ;
parseifelse ( hittype [ g_i ] . picnum = = * insptr ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_WACKPLAYER :
insptr + + ;
2007-08-27 06:46:31 +00:00
forceplayerangle ( g_player [ g_p ] . ps ) ;
2006-11-16 03:02:42 +00:00
return 0 ;
case CON_FLASH :
insptr + + ;
sprite [ g_i ] . shade = - 127 ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > visibility = - 127 ;
2006-11-16 03:02:42 +00:00
lastvisinc = totalclock + 32 ;
return 0 ;
case CON_STOPALLSOUNDS :
insptr + + ;
if ( screenpeek = = g_p )
FX_StopAllSounds ( ) ;
return 0 ;
case CON_IFGAPZL :
insptr + + ;
parseifelse ( ( ( hittype [ g_i ] . floorz - hittype [ g_i ] . ceilingz ) > > 8 ) < * insptr ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFHITSPACE :
2007-08-27 06:46:31 +00:00
parseifelse ( g_player [ g_p ] . sync - > bits & ( 1 < < 29 ) ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFOUTSIDE :
parseifelse ( sector [ g_sp - > sectnum ] . ceilingstat & 1 ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFMULTIPLAYER :
parseifelse ( ud . multimode > 1 ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_OPERATE :
insptr + + ;
if ( sector [ g_sp - > sectnum ] . lotag = = 0 )
{
neartag ( g_sp - > x , g_sp - > y , g_sp - > z - ( 32 < < 8 ) , g_sp - > sectnum , g_sp - > ang , & neartagsector , & neartagwall , & neartagsprite , & neartaghitdist , 768L , 1 ) ;
if ( neartagsector > = 0 & & isanearoperator ( sector [ neartagsector ] . lotag ) )
if ( ( sector [ neartagsector ] . lotag & 0xff ) = = 23 | | sector [ neartagsector ] . floorz = = sector [ neartagsector ] . ceilingz )
if ( ( sector [ neartagsector ] . lotag & 16384 ) = = 0 )
if ( ( sector [ neartagsector ] . lotag & 32768 ) = = 0 )
{
j = headspritesect [ neartagsector ] ;
while ( j > = 0 )
2006-11-15 01:16:55 +00:00
{
2006-11-16 03:02:42 +00:00
if ( sprite [ j ] . picnum = = ACTIVATOR )
break ;
j = nextspritesect [ j ] ;
2006-11-15 01:16:55 +00:00
}
2006-11-16 03:02:42 +00:00
if ( j = = - 1 )
operatesectors ( neartagsector , g_i ) ;
}
}
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFINSPACE :
parseifelse ( ceilingspace ( g_sp - > sectnum ) ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_SPRITEPAL :
insptr + + ;
if ( g_sp - > picnum ! = APLAYER )
hittype [ g_i ] . tempang = g_sp - > pal ;
g_sp - > pal = * insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_CACTOR :
insptr + + ;
g_sp - > picnum = * insptr + + ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFBULLETNEAR :
parseifelse ( dodge ( g_sp ) = = 1 ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFRESPAWN :
if ( badguy ( g_sp ) )
parseifelse ( ud . respawn_monsters ) ;
else if ( inventory ( g_sp ) )
parseifelse ( ud . respawn_inventory ) ;
else
parseifelse ( ud . respawn_items ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFFLOORDISTL :
insptr + + ;
parseifelse ( ( hittype [ g_i ] . floorz - g_sp - > z ) < = ( ( * insptr ) < < 8 ) ) ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFCEILINGDISTL :
insptr + + ;
parseifelse ( ( g_sp - > z - hittype [ g_i ] . ceilingz ) < = ( ( * insptr ) < < 8 ) ) ;
break ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case CON_PALFROM :
insptr + + ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > pals_time = * insptr + + ;
2006-11-16 03:02:42 +00:00
for ( j = 0 ; j < 3 ; j + + )
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > pals [ j ] = * insptr + + ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_QSPRINTF :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
int dq = * insptr + + , sq = * insptr + + ;
if ( fta_quotes [ sq ] ! = NULL & & fta_quotes [ dq ] ! = NULL )
{
int var1 = GetGameVarID ( * insptr + + , g_i , g_p ) , var2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int var3 = GetGameVarID ( * insptr + + , g_i , g_p ) , var4 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
Bstrcpy ( tempbuf , fta_quotes [ sq ] ) ;
Bsprintf ( fta_quotes [ dq ] , tempbuf , var1 , var2 , var3 , var4 ) ;
break ;
}
if ( fta_quotes [ sq ] = = NULL ) OSD_Printf ( " %s %d null quote %d \n " , __FILE__ , __LINE__ , sq ) ;
if ( fta_quotes [ dq ] = = NULL ) OSD_Printf ( " %s %d null quote %d \n " , __FILE__ , __LINE__ , dq ) ;
2008-03-14 21:04:28 +00:00
insptr + = 4 ;
2006-12-18 08:37:12 +00:00
break ;
2006-11-15 01:16:55 +00:00
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDLOG :
{
insptr + + ;
2007-12-12 17:42:14 +00:00
OSD_Printf ( " CONLOG: L=%d \n " , * insptr + + ) ;
2006-11-16 03:02:42 +00:00
break ;
}
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDLOGVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
int m = 1 ;
char szBuf [ 256 ] ;
2007-12-12 17:42:14 +00:00
int l = * insptr + + , lVarID = * insptr ;
2007-02-08 04:19:39 +00:00
if ( ( lVarID > = iGameVarCount ) | | lVarID < 0 )
{
if ( * insptr = = MAXGAMEVARS ) // addlogvar for a constant? Har.
insptr + + ;
else if ( * insptr & ( MAXGAMEVARS < < 1 ) )
{
m = - 1 ;
lVarID ^ = ( MAXGAMEVARS < < 1 ) ;
}
else
{
// invalid varID
insptr + + ;
2007-12-12 17:42:14 +00:00
OSD_Printf ( " CONLOGVAR: L=%d INVALID VARIABLE \n " , l ) ;
2007-02-08 04:19:39 +00:00
break ; // out of switch
}
}
2007-12-12 17:42:14 +00:00
Bsprintf ( szBuf , " CONLOGVAR: L=%d %s " , l , aGameVars [ lVarID ] . szLabel ) ;
2007-02-08 04:19:39 +00:00
strcpy ( g_szBuf , szBuf ) ;
if ( aGameVars [ lVarID ] . dwFlags & GAMEVAR_FLAG_READONLY )
2006-11-15 01:16:55 +00:00
{
2007-02-08 04:19:39 +00:00
Bsprintf ( szBuf , " (read-only) " ) ;
strcat ( g_szBuf , szBuf ) ;
}
if ( aGameVars [ lVarID ] . dwFlags & GAMEVAR_FLAG_PERPLAYER )
{
Bsprintf ( szBuf , " (Per Player. Player=%d) " , g_p ) ;
}
else if ( aGameVars [ lVarID ] . dwFlags & GAMEVAR_FLAG_PERACTOR )
{
Bsprintf ( szBuf , " (Per Actor. Actor=%d) " , g_i ) ;
2006-11-15 01:16:55 +00:00
}
2006-12-19 20:31:40 +00:00
else
{
2007-02-08 04:19:39 +00:00
Bsprintf ( szBuf , " (Global) " ) ;
2006-12-19 20:31:40 +00:00
}
2007-02-08 04:19:39 +00:00
Bstrcat ( g_szBuf , szBuf ) ;
2007-12-12 17:42:14 +00:00
Bsprintf ( szBuf , " =%d \n " , GetGameVarID ( lVarID , g_i , g_p ) * m ) ;
2007-02-08 04:19:39 +00:00
Bstrcat ( g_szBuf , szBuf ) ;
OSD_Printf ( g_szBuf ) ;
insptr + + ;
break ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
case CON_SETSECTOR :
case CON_GETSECTOR :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax [gs]etsector[<var>].x <VAR>
// <varid> <xxxid> <varid>
int lVar1 = * insptr + + , lLabelID = * insptr + + , lVar2 = * insptr + + ;
DoSector ( tw = = CON_SETSECTOR , lVar1 , lLabelID , lVar2 ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SQRT :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax sqrt <invar> <outvar>
int lInVarID = * insptr + + , lOutVarID = * insptr + + ;
SetGameVarID ( lOutVarID , ksqrt ( GetGameVarID ( lInVarID , g_i , g_p ) ) , g_i , g_p ) ;
break ;
}
2006-11-16 03:02:42 +00:00
case CON_FINDNEARACTOR :
case CON_FINDNEARSPRITE :
case CON_FINDNEARACTOR3D :
case CON_FINDNEARSPRITE3D :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
// syntax findnearactorvar <type> <maxdist> <getvar>
// gets the sprite ID of the nearest actor within max dist
// that is of <type> into <getvar>
// -1 for none found
// <type> <maxdist> <varid>
int lType = * insptr + + , lMaxDist = * insptr + + , lVarID = * insptr + + ;
int lFound = - 1 , lTemp , j , k ;
for ( k = 0 ; k < MAXSTATUS ; k + + )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
j = headspritestat [ ( tw = = CON_FINDNEARACTOR | | tw = = CON_FINDNEARACTOR3D ) ? 1 : k ] ; // all sprites
while ( j > = 0 )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
if ( sprite [ j ] . picnum = = lType & & j ! = g_i )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
if ( tw = = CON_FINDNEARACTOR3D | | tw = = CON_FINDNEARSPRITE3D )
lTemp = dist ( & sprite [ g_i ] , & sprite [ j ] ) ;
else lTemp = ldist ( & sprite [ g_i ] , & sprite [ j ] ) ;
if ( lTemp < lMaxDist )
{
lFound = j ;
j = MAXSPRITES ;
break ;
}
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
j = nextspritestat [ j ] ;
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
if ( ( tw = = CON_FINDNEARACTOR | | tw = = CON_FINDNEARACTOR3D ) | | j = = MAXSPRITES )
break ;
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
SetGameVarID ( lVarID , lFound , g_i , g_p ) ;
break ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
case CON_FINDNEARACTORVAR :
case CON_FINDNEARSPRITEVAR :
case CON_FINDNEARACTOR3DVAR :
case CON_FINDNEARSPRITE3DVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
// syntax findnearactorvar <type> <maxdistvar> <getvar>
// gets the sprite ID of the nearest actor within max dist
// that is of <type> into <getvar>
// -1 for none found
// <type> <maxdistvarid> <varid>
int lType = * insptr + + , lMaxDist = GetGameVarID ( * insptr + + , g_i , g_p ) , lVarID = * insptr + + ;
int lFound = - 1 , lTemp , j , k ;
for ( k = 0 ; k < MAXSTATUS ; k + + )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
j = headspritestat [ ( tw = = CON_FINDNEARACTORVAR | | tw = = CON_FINDNEARACTOR3DVAR ) ? 1 : k ] ; // all sprites
while ( j > = 0 )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
if ( sprite [ j ] . picnum = = lType & & j ! = g_i )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
if ( tw = = CON_FINDNEARACTOR3DVAR | | tw = = CON_FINDNEARSPRITE3DVAR )
lTemp = dist ( & sprite [ g_i ] , & sprite [ j ] ) ;
else lTemp = ldist ( & sprite [ g_i ] , & sprite [ j ] ) ;
if ( lTemp < lMaxDist )
{
lFound = j ;
j = MAXSPRITES ;
break ;
}
2006-11-15 01:16:55 +00:00
}
2007-02-08 04:19:39 +00:00
j = nextspritestat [ j ] ;
2006-11-15 01:16:55 +00:00
}
2007-02-08 04:19:39 +00:00
if ( ( tw = = CON_FINDNEARACTORVAR | | tw = = CON_FINDNEARACTOR3DVAR ) | | j = = MAXSPRITES )
break ;
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
SetGameVarID ( lVarID , lFound , g_i , g_p ) ;
break ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
case CON_FINDNEARACTORZVAR :
case CON_FINDNEARSPRITEZVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
// syntax findnearactorvar <type> <maxdistvar> <getvar>
// gets the sprite ID of the nearest actor within max dist
// that is of <type> into <getvar>
// -1 for none found
// <type> <maxdistvarid> <varid>
int lType = * insptr + + , lMaxDist = GetGameVarID ( * insptr + + , g_i , g_p ) , lMaxZDist = GetGameVarID ( * insptr + + , g_i , g_p ) ;
int lVarID = * insptr + + , lFound = - 1 , lTemp , lTemp2 , j , k ;
for ( k = 0 ; k < MAXSTATUS ; k + + )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
j = headspritestat [ tw = = CON_FINDNEARACTORZVAR ? 1 : k ] ; // all sprites
while ( j > = 0 )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
if ( sprite [ j ] . picnum = = lType & & j ! = g_i )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
lTemp = ldist ( & sprite [ g_i ] , & sprite [ j ] ) ;
if ( lTemp < lMaxDist )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
lTemp2 = klabs ( sprite [ g_i ] . z - sprite [ j ] . z ) ;
if ( lTemp2 < lMaxZDist )
{
lFound = j ;
j = MAXSPRITES ;
break ;
}
2006-04-13 20:47:06 +00:00
}
}
2007-02-08 04:19:39 +00:00
j = nextspritestat [ j ] ;
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
if ( tw = = CON_FINDNEARACTORZVAR | | j = = MAXSPRITES )
break ;
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
SetGameVarID ( lVarID , lFound , g_i , g_p ) ;
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_FINDNEARACTORZ :
case CON_FINDNEARSPRITEZ :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
// syntax findnearactorvar <type> <maxdist> <getvar>
// gets the sprite ID of the nearest actor within max dist
// that is of <type> into <getvar>
// -1 for none found
// <type> <maxdist> <varid>
int lType = * insptr + + , lMaxDist = * insptr + + , lMaxZDist = * insptr + + , lVarID = * insptr + + ;
int lTemp , lTemp2 , lFound = - 1 , j , k ;
for ( k = 0 ; k < MAXSTATUS ; k + + )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
j = headspritestat [ tw = = CON_FINDNEARACTORZ ? 1 : k ] ; // all sprites
while ( j > = 0 )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
if ( sprite [ j ] . picnum = = lType & & j ! = g_i )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
lTemp = ldist ( & sprite [ g_i ] , & sprite [ j ] ) ;
if ( lTemp < lMaxDist )
2006-04-13 20:47:06 +00:00
{
2007-02-08 04:19:39 +00:00
lTemp2 = klabs ( sprite [ g_i ] . z - sprite [ j ] . z ) ;
if ( lTemp2 < lMaxZDist )
{
lFound = j ;
j = MAXSPRITES ;
break ;
}
2006-04-13 20:47:06 +00:00
}
}
2007-02-08 04:19:39 +00:00
j = nextspritestat [ j ] ;
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
if ( tw = = CON_FINDNEARACTORZ | | j = = MAXSPRITES )
break ;
2006-04-13 20:47:06 +00:00
}
2007-02-08 04:19:39 +00:00
SetGameVarID ( lVarID , lFound , g_i , g_p ) ;
break ;
2006-04-13 20:47:06 +00:00
}
2006-05-22 07:11:30 +00:00
2006-11-16 03:02:42 +00:00
case CON_FINDPLAYER :
case CON_FINDOTHERPLAYER :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax findnearactorvar <type> <maxdistvar> <getvar>
// gets the sprite ID of the nearest actor within max dist
// that is of <type> into <getvar>
// -1 for none found
// <type> <maxdistvarid> <varid>
2007-12-12 17:42:14 +00:00
int var1 = * insptr + + , d ;
2006-11-16 03:02:42 +00:00
2007-02-08 04:19:39 +00:00
if ( tw = = CON_FINDPLAYER ) j = findplayer ( & sprite [ g_i ] , & d ) ;
else if ( tw = = CON_FINDOTHERPLAYER ) j = findotherplayer ( g_i , & d ) ;
2006-11-16 03:02:42 +00:00
2007-02-08 04:19:39 +00:00
SetGameVarID ( g_iReturnVarID , j , g_i , g_p ) ;
SetGameVarID ( var1 , d , g_i , g_p ) ;
2006-05-22 07:11:30 +00:00
2007-02-08 04:19:39 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
case CON_SETPLAYER :
case CON_GETPLAYER :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
// syntax [gs]etplayer[<var>].x <VAR>
// <varid> <xxxid> <varid>
2007-08-27 23:11:49 +00:00
int lVar1 = * insptr + + , lLabelID = * insptr + + , lParm2 = 0 , lVar2 ;
2007-02-08 04:19:39 +00:00
// HACK: need to have access to labels structure at run-time...
2007-08-27 23:11:49 +00:00
if ( playerlabels [ lLabelID ] . flags & LABEL_HASPARM2 )
2007-02-08 04:19:39 +00:00
lParm2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
lVar2 = * insptr + + ;
DoPlayer ( tw = = CON_SETPLAYER , lVar1 , lLabelID , lVar2 , lParm2 ) ;
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
case CON_SETINPUT :
case CON_GETINPUT :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax [gs]etplayer[<var>].x <VAR>
// <varid> <xxxid> <varid>
int lVar1 = * insptr + + , lLabelID = * insptr + + , lVar2 = * insptr + + ;
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
DoInput ( tw = = CON_SETINPUT , lVar1 , lLabelID , lVar2 ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETUSERDEF :
case CON_SETUSERDEF :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax [gs]etuserdef.xxx <VAR>
// <xxxid> <varid>
int lLabelID = * insptr + + , lVar2 = * insptr + + ;
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
DoUserDef ( tw = = CON_SETUSERDEF , lLabelID , lVar2 ) ;
break ;
}
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETPROJECTILE :
case CON_SETPROJECTILE :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax [gs]etplayer[<var>].x <VAR>
// <varid> <xxxid> <varid>
int lVar1 = GetGameVarID ( * insptr + + , g_i , g_p ) , lLabelID = * insptr + + , lVar2 = * insptr + + ;
DoProjectile ( tw = = CON_SETPROJECTILE , lVar1 , lLabelID , lVar2 ) ;
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SETWALL :
case CON_GETWALL :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax [gs]etwall[<var>].x <VAR>
// <varid> <xxxid> <varid>
int lVar1 = * insptr + + , lLabelID = * insptr + + , lVar2 = * insptr + + ;
2006-04-13 20:47:06 +00:00
2007-02-08 04:19:39 +00:00
DoWall ( tw = = CON_SETWALL , lVar1 , lLabelID , lVar2 ) ;
break ;
}
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SETACTORVAR :
case CON_GETACTORVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
// syntax [gs]etactorvar[<var>].<varx> <VAR>
// gets the value of the per-actor variable varx into VAR
// <var> <varx> <VAR>
int lSprite = GetGameVarID ( * insptr + + , g_i , g_p ) , lVar1 = * insptr + + , lVar2 = * insptr + + ;
if ( tw = = CON_SETACTORVAR )
{
SetGameVarID ( lVar1 , GetGameVarID ( lVar2 , g_i , g_p ) , lSprite , g_p ) ;
break ;
}
SetGameVarID ( lVar2 , GetGameVarID ( lVar1 , lSprite , g_p ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SETPLAYERVAR :
case CON_GETPLAYERVAR :
2007-02-05 01:33:08 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
{
2007-02-08 04:19:39 +00:00
int iPlayer ;
if ( * insptr ! = g_iThisActorID )
iPlayer = GetGameVarID ( * insptr , g_i , g_p ) ;
else iPlayer = g_p ;
insptr + + ;
2007-02-05 01:33:08 +00:00
{
2007-02-08 04:19:39 +00:00
int lVar1 = * insptr + + , lVar2 = * insptr + + ;
if ( tw = = CON_SETPLAYERVAR )
{
SetGameVarID ( lVar1 , GetGameVarID ( lVar2 , g_i , g_p ) , g_i , iPlayer ) ;
break ;
}
SetGameVarID ( lVar2 , GetGameVarID ( lVar1 , g_i , iPlayer ) , g_i , g_p ) ;
2007-02-05 01:33:08 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
}
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SETACTOR :
case CON_GETACTOR :
2007-02-08 04:19:39 +00:00
insptr + + ;
{
// syntax [gs]etactor[<var>].x <VAR>
// <varid> <xxxid> <varid>
2006-04-13 20:47:06 +00:00
2007-08-27 23:11:49 +00:00
int lVar1 = * insptr + + , lLabelID = * insptr + + , lParm2 = 0 , lVar2 ;
2006-04-13 20:47:06 +00:00
2007-08-27 23:11:49 +00:00
if ( actorlabels [ lLabelID ] . flags & LABEL_HASPARM2 )
2007-02-08 04:19:39 +00:00
lParm2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
lVar2 = * insptr + + ;
DoActor ( tw = = CON_SETACTOR , lVar1 , lLabelID , lVar2 , lParm2 ) ;
2006-04-13 20:47:06 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
case CON_GETANGLETOTARGET :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-11-16 03:02:42 +00:00
// hittype[g_i].lastvx and lastvy are last known location of target.
2006-12-18 21:29:55 +00:00
SetGameVarID ( * insptr + + , getangle ( hittype [ g_i ] . lastvx - g_sp - > x , hittype [ g_i ] . lastvy - g_sp - > y ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_ANGOFFVAR :
insptr + + ;
2006-12-18 09:32:17 +00:00
spriteext [ g_i ] . angoff = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_LOCKPLAYER :
insptr + + ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > transporter_hold = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_CHECKAVAILWEAPON :
case CON_CHECKAVAILINVEN :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-18 21:29:55 +00:00
j = g_p ;
2006-04-18 02:01:48 +00:00
2006-12-18 09:32:17 +00:00
if ( * insptr ! = g_iThisActorID )
2006-12-23 02:38:47 +00:00
j = GetGameVarID ( * insptr , g_i , g_p ) ;
2007-02-08 04:19:39 +00:00
2006-12-23 02:38:47 +00:00
insptr + + ;
2007-02-08 04:19:39 +00:00
2007-08-27 06:46:31 +00:00
if ( j < ud . multimode )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
if ( tw = = CON_CHECKAVAILWEAPON )
2007-08-27 06:46:31 +00:00
checkavailweapon ( g_player [ j ] . ps ) ;
else checkavailinven ( g_player [ j ] . ps ) ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
break ;
2006-11-13 23:12:47 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETPLAYERANGLE :
insptr + + ;
2007-08-27 06:46:31 +00:00
SetGameVarID ( * insptr + + , g_player [ g_p ] . ps - > ang , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-11-13 23:12:47 +00:00
2006-11-16 03:02:42 +00:00
case CON_SETPLAYERANGLE :
insptr + + ;
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > ang = GetGameVarID ( * insptr + + , g_i , g_p ) ;
g_player [ g_p ] . ps - > ang & = 2047 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETACTORANGLE :
insptr + + ;
2006-12-18 09:32:17 +00:00
SetGameVarID ( * insptr + + , g_sp - > ang , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SETACTORANGLE :
insptr + + ;
2006-12-18 09:32:17 +00:00
g_sp - > ang = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
g_sp - > ang & = 2047 ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SETVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_RANDVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( * insptr , mulscale ( krand ( ) , * ( insptr + 1 ) + 1 , 16 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_DISPLAYRANDVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( * insptr , mulscale ( rand ( ) , * ( insptr + 1 ) + 1 , 15 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_MULVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) * * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_DIVVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
if ( * ( insptr + 1 ) = = 0 )
2006-11-16 03:02:42 +00:00
gameexit ( " CON_DIVVAR: Divide by zero. " ) ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) / * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_MODVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
if ( * ( insptr + 1 ) = = 0 )
2006-11-16 03:02:42 +00:00
gameexit ( " CON_MODVAR: Mod by zero. " ) ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) % * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_ANDVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) & * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_ORVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) | * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_XORVAR :
2007-02-08 04:19:39 +00:00
insptr + + ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) ^ * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-12-19 20:31:40 +00:00
case CON_SETVARVAR :
insptr + + ;
2007-02-08 04:19:39 +00:00
j = * insptr + + ;
2006-12-19 20:31:40 +00:00
SetGameVarID ( j , GetGameVarID ( * insptr + + , g_i , g_p ) , g_i , g_p ) ;
break ;
2006-11-16 03:02:42 +00:00
case CON_RANDVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
SetGameVarID ( j , mulscale ( krand ( ) , GetGameVarID ( * insptr + + , g_i , g_p ) + 1 , 16 ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_DISPLAYRANDVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
SetGameVarID ( j , mulscale ( rand ( ) , GetGameVarID ( * insptr + + , g_i , g_p ) + 1 , 15 ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_GMAXAMMO :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-08-27 23:11:49 +00:00
SetGameVarID ( * insptr + + , g_player [ g_p ] . ps - > max_ammo_amount [ j ] , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SMAXAMMO :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-08-27 23:11:49 +00:00
g_player [ g_p ] . ps - > max_ammo_amount [ j ] = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_MULVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
2007-02-08 04:19:39 +00:00
j = * insptr + + ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) * GetGameVarID ( * insptr + + , g_i , g_p ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_DIVVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
{
int l2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-02-08 04:19:39 +00:00
2006-12-18 21:29:55 +00:00
if ( l2 = = 0 )
gameexit ( " CON_DIVVARVAR: Divide by zero. " ) ;
2007-02-08 04:19:39 +00:00
2006-12-18 21:29:55 +00:00
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) / l2 , g_i , g_p ) ;
break ;
}
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_MODVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
2007-02-08 04:19:39 +00:00
j = * insptr + + ;
2006-12-18 21:29:55 +00:00
{
int l2 = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2007-02-08 04:19:39 +00:00
2006-12-18 21:29:55 +00:00
if ( l2 = = 0 )
gameexit ( " CON_MODVARVAR: Mod by zero. " ) ;
2007-02-08 04:19:39 +00:00
2006-12-18 21:29:55 +00:00
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) % l2 , g_i , g_p ) ;
break ;
}
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_ANDVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
2007-02-08 04:19:39 +00:00
j = * insptr + + ;
2006-12-18 21:29:55 +00:00
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) & GetGameVarID ( * insptr + + , g_i , g_p ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_XORVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) ^ GetGameVarID ( * insptr + + , g_i , g_p ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_ORVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) | GetGameVarID ( * insptr + + , g_i , g_p ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SUBVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) - * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SUBVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) - GetGameVarID ( * insptr + + , g_i , g_p ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) + * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SHIFTVARL :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) < < * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SHIFTVARR :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , GetGameVarID ( * insptr , g_i , g_p ) > > * ( insptr + 1 ) , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SIN :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , sintable [ GetGameVarID ( * ( insptr + 1 ) , g_i , g_p ) & 2047 ] , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_COS :
2006-12-18 21:29:55 +00:00
insptr + + ;
SetGameVarID ( * insptr , sintable [ ( GetGameVarID ( * ( insptr + 1 ) , g_i , g_p ) + 512 ) & 2047 ] , g_i , g_p ) ;
insptr + = 2 ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_ADDVARVAR :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
SetGameVarID ( j , GetGameVarID ( j , g_i , g_p ) + GetGameVarID ( * insptr + + , g_i , g_p ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SPGETLOTAG :
insptr + + ;
SetGameVarID ( g_iLoTagID , g_sp - > lotag , g_i , g_p ) ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SPGETHITAG :
insptr + + ;
SetGameVarID ( g_iHiTagID , g_sp - > hitag , g_i , g_p ) ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SECTGETLOTAG :
insptr + + ;
SetGameVarID ( g_iLoTagID , sector [ g_sp - > sectnum ] . lotag , g_i , g_p ) ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_SECTGETHITAG :
insptr + + ;
SetGameVarID ( g_iHiTagID , sector [ g_sp - > sectnum ] . hitag , g_i , g_p ) ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETTEXTUREFLOOR :
insptr + + ;
SetGameVarID ( g_iTextureID , sector [ g_sp - > sectnum ] . floorpicnum , g_i , g_p ) ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_STARTTRACK :
insptr + + ;
2007-08-27 23:11:49 +00:00
music_select = ( ud . volume_number * MAXLEVELS ) + ( * ( insptr + + ) ) ;
2007-08-26 11:28:32 +00:00
if ( map [ ( unsigned char ) music_select ] . musicfn ! = NULL )
2008-03-08 05:23:15 +00:00
playmusicMAP ( & map [ ( unsigned char ) music_select ] . musicfn [ 0 ] , music_select ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETTEXTURECEILING :
insptr + + ;
SetGameVarID ( g_iTextureID , sector [ g_sp - > sectnum ] . ceilingpicnum , g_i , g_p ) ;
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARVARAND :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) & GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARVARN :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) ! = GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARVARE :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) = = GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARVARG :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) > GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARVARL :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) < GetGameVarID ( * ( insptr ) , g_i , g_p ) ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARE :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) = = * insptr ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-11-13 23:12:47 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARN :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) ! = * insptr ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-11-13 23:12:47 +00:00
2006-11-16 03:02:42 +00:00
case CON_WHILEVARN :
{
int i ;
2008-02-17 05:08:18 +00:00
intptr_t * savedinsptr = insptr ;
2006-11-16 03:02:42 +00:00
j = 1 ;
while ( j )
2006-11-15 01:16:55 +00:00
{
2006-11-16 03:02:42 +00:00
insptr = savedinsptr ;
2006-11-15 01:16:55 +00:00
insptr + + ;
2007-02-08 04:19:39 +00:00
i = * insptr + + ;
2006-11-15 01:16:55 +00:00
j = 0 ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
if ( GetGameVarID ( i , g_i , g_p ) ! = * insptr )
2006-11-15 01:16:55 +00:00
j = 1 ;
parseifelse ( j ) ;
}
2006-11-16 03:02:42 +00:00
break ;
}
2006-11-13 23:12:47 +00:00
2006-11-16 03:02:42 +00:00
case CON_WHILEVARVARN :
{
int i , k ;
2008-02-17 05:08:18 +00:00
intptr_t * savedinsptr = insptr ;
2006-11-16 03:02:42 +00:00
j = 1 ;
while ( j )
2006-11-15 01:16:55 +00:00
{
2006-11-16 03:02:42 +00:00
insptr = savedinsptr ;
2006-11-15 01:16:55 +00:00
insptr + + ;
2007-02-08 04:19:39 +00:00
i = * insptr + + ;
k = * ( insptr ) ;
2006-11-15 01:16:55 +00:00
j = 0 ;
2006-11-16 03:02:42 +00:00
if ( GetGameVarID ( i , g_i , g_p ) ! = GetGameVarID ( k , g_i , g_p ) )
2006-04-13 20:47:06 +00:00
j = 1 ;
2006-11-14 21:35:50 +00:00
parseifelse ( j ) ;
2006-04-13 20:47:06 +00:00
}
2006-11-16 03:02:42 +00:00
break ;
}
2006-11-13 23:12:47 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARAND :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) & * insptr ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARG :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) > * insptr ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 02:01:48 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFVARL :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = * insptr + + ;
parseifelse ( GetGameVarID ( j , g_i , g_p ) < * insptr ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFPHEALTHL :
insptr + + ;
2007-08-27 06:46:31 +00:00
parseifelse ( sprite [ g_player [ g_p ] . ps - > i ] . extra < * insptr ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFPINVENTORY :
{
insptr + + ;
j = 0 ;
switch ( * insptr + + )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case GET_STEROIDS :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > steroids_amount ! = * insptr )
2006-11-16 03:02:42 +00:00
j = 1 ;
2006-11-13 23:12:47 +00:00
break ;
2006-11-16 03:02:42 +00:00
case GET_SHIELD :
2007-08-27 23:11:49 +00:00
if ( g_player [ g_p ] . ps - > shield_amount ! = g_player [ g_p ] . ps - > max_shield_amount )
2006-11-16 03:02:42 +00:00
j = 1 ;
2006-11-13 23:12:47 +00:00
break ;
2006-11-16 03:02:42 +00:00
case GET_SCUBA :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > scuba_amount ! = * insptr ) j = 1 ;
2006-04-13 20:47:06 +00:00
break ;
2006-11-16 03:02:42 +00:00
case GET_HOLODUKE :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > holoduke_amount ! = * insptr ) j = 1 ;
2006-11-15 01:16:55 +00:00
break ;
2006-11-16 03:02:42 +00:00
case GET_JETPACK :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > jetpack_amount ! = * insptr ) j = 1 ;
2006-11-16 03:02:42 +00:00
break ;
case GET_ACCESS :
switch ( g_sp - > pal )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case 0 :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > got_access & 1 ) j = 1 ;
2006-11-16 03:02:42 +00:00
break ;
case 21 :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > got_access & 2 ) j = 1 ;
2006-11-16 03:02:42 +00:00
break ;
case 23 :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > got_access & 4 ) j = 1 ;
2006-11-16 03:02:42 +00:00
break ;
2006-11-15 01:16:55 +00:00
}
2006-11-16 03:02:42 +00:00
break ;
case GET_HEATS :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > heat_amount ! = * insptr ) j = 1 ;
2006-11-16 03:02:42 +00:00
break ;
case GET_FIRSTAID :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > firstaid_amount ! = * insptr ) j = 1 ;
2006-11-16 03:02:42 +00:00
break ;
case GET_BOOTS :
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > boot_amount ! = * insptr ) j = 1 ;
2006-11-15 01:16:55 +00:00
break ;
}
2006-11-16 03:02:42 +00:00
parseifelse ( j ) ;
break ;
}
case CON_PSTOMP :
insptr + + ;
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > knee_incs = = 0 & & sprite [ g_player [ g_p ] . ps - > i ] . xrepeat > = 40 )
if ( cansee ( g_sp - > x , g_sp - > y , g_sp - > z - ( 4 < < 8 ) , g_sp - > sectnum , g_player [ g_p ] . ps - > posx , g_player [ g_p ] . ps - > posy , g_player [ g_p ] . ps - > posz + ( 16 < < 8 ) , sprite [ g_player [ g_p ] . ps - > i ] . sectnum ) )
2006-11-16 03:02:42 +00:00
{
2007-08-27 20:36:36 +00:00
for ( j = 0 ; j < ud . multimode ; j + + )
2006-04-29 02:23:07 +00:00
{
2007-08-27 06:46:31 +00:00
if ( g_player [ j ] . ps - > actorsqu = = g_i )
2006-11-16 03:02:42 +00:00
break ;
2006-04-29 02:23:07 +00:00
}
2007-08-27 20:36:36 +00:00
if ( j = = ud . multimode )
2006-11-16 03:02:42 +00:00
{
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > knee_incs = 1 ;
if ( g_player [ g_p ] . ps - > weapon_pos = = 0 )
g_player [ g_p ] . ps - > weapon_pos = - 1 ;
g_player [ g_p ] . ps - > actorsqu = g_i ;
2006-11-16 03:02:42 +00:00
}
}
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFAWAYFROMWALL :
{
2006-12-18 09:32:17 +00:00
short s1 = g_sp - > sectnum ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
j = 0 ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
updatesector ( g_sp - > x + 108 , g_sp - > y + 108 , & s1 ) ;
if ( s1 = = g_sp - > sectnum )
{
updatesector ( g_sp - > x - 108 , g_sp - > y - 108 , & s1 ) ;
2006-11-14 21:35:50 +00:00
if ( s1 = = g_sp - > sectnum )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
updatesector ( g_sp - > x + 108 , g_sp - > y - 108 , & s1 ) ;
2006-11-14 21:35:50 +00:00
if ( s1 = = g_sp - > sectnum )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
updatesector ( g_sp - > x - 108 , g_sp - > y + 108 , & s1 ) ;
2006-11-14 21:35:50 +00:00
if ( s1 = = g_sp - > sectnum )
2006-11-16 03:02:42 +00:00
j = 1 ;
2006-04-13 20:47:06 +00:00
}
}
2006-04-24 00:49:44 +00:00
}
2006-11-16 03:02:42 +00:00
parseifelse ( j ) ;
}
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_QUOTE :
insptr + + ;
2007-02-08 04:19:39 +00:00
2006-12-23 02:38:47 +00:00
if ( fta_quotes [ * insptr ] = = NULL )
2006-11-16 03:02:42 +00:00
{
OSD_Printf ( " %s %d null quote %d \n " , __FILE__ , __LINE__ , * insptr ) ;
2006-04-24 00:49:44 +00:00
insptr + + ;
2006-12-23 02:38:47 +00:00
break ;
2006-11-16 03:02:42 +00:00
}
2007-08-27 06:46:31 +00:00
FTA ( * insptr + + , g_player [ g_p ] . ps ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_USERQUOTE :
insptr + + ;
{
2007-06-12 19:47:34 +00:00
int i = GetGameVarID ( * insptr + + , g_i , g_p ) ;
if ( fta_quotes [ i ] = = NULL )
{
OSD_Printf ( " %s %d null quote %d \n " , __FILE__ , __LINE__ , i ) ;
break ;
}
adduserquote ( fta_quotes [ i ] ) ;
2006-11-16 03:02:42 +00:00
}
break ;
2007-08-25 01:05:00 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFINOUTERSPACE :
parseifelse ( floorspace ( g_sp - > sectnum ) ) ;
break ;
2006-04-18 03:11:38 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFNOTMOVING :
parseifelse ( ( hittype [ g_i ] . movflag & 49152 ) > 16384 ) ;
break ;
2006-11-15 01:16:55 +00:00
2006-11-16 03:02:42 +00:00
case CON_RESPAWNHITAG :
insptr + + ;
switch ( dynamictostatic [ g_sp - > picnum ] )
{
case FEM1__STATIC :
case FEM2__STATIC :
case FEM3__STATIC :
case FEM4__STATIC :
case FEM5__STATIC :
case FEM6__STATIC :
case FEM7__STATIC :
case FEM8__STATIC :
case FEM9__STATIC :
case FEM10__STATIC :
case PODFEM1__STATIC :
case NAKED1__STATIC :
case STATUE__STATIC :
if ( g_sp - > yvel ) operaterespawns ( g_sp - > yvel ) ;
2006-04-13 20:47:06 +00:00
break ;
2006-11-16 03:02:42 +00:00
default :
if ( g_sp - > hitag > = 0 ) operaterespawns ( g_sp - > hitag ) ;
2006-11-15 01:16:55 +00:00
break ;
2006-11-16 03:02:42 +00:00
}
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFSPRITEPAL :
insptr + + ;
parseifelse ( g_sp - > pal = = * insptr ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFANGDIFFL :
insptr + + ;
2007-08-27 06:46:31 +00:00
j = klabs ( getincangle ( g_player [ g_p ] . ps - > ang , g_sp - > ang ) ) ;
2006-11-16 03:02:42 +00:00
parseifelse ( j < = * insptr ) ;
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_IFNOSOUNDS :
2007-10-24 06:48:13 +00:00
for ( j = 1 ; j < MAXSOUNDS ; j + + )
2007-09-11 05:26:38 +00:00
if ( g_sounds [ j ] . SoundOwner [ 0 ] . i = = g_i )
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2007-10-24 06:48:13 +00:00
parseifelse ( j = = MAXSOUNDS ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-04-13 20:47:06 +00:00
2006-11-16 03:02:42 +00:00
case CON_SPRITEFLAGS :
insptr + + ;
2007-09-11 05:26:38 +00:00
hittype [ g_i ] . flags = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-08-28 19:18:05 +00:00
2006-11-16 03:02:42 +00:00
case CON_GETCURRADDRESS :
insptr + + ;
2006-12-18 21:29:55 +00:00
j = * insptr + + ;
2008-02-18 08:10:54 +00:00
SetGameVarID ( j , ( intptr_t ) ( insptr - script ) , g_i , g_p ) ;
2006-11-16 03:02:42 +00:00
break ;
2006-08-28 19:18:05 +00:00
2006-11-16 03:02:42 +00:00
case CON_JUMP :
2006-12-18 21:29:55 +00:00
insptr + + ;
j = GetGameVarID ( * insptr + + , g_i , g_p ) ;
2008-02-18 08:10:54 +00:00
insptr = ( intptr_t * ) ( j + script ) ;
2006-11-16 03:02:42 +00:00
break ;
default :
2007-12-12 17:42:14 +00:00
OSD_Printf ( " fatal error: default processing: prev inst: %d, curr inst: %d, next inst: %d \n current actor: %d (%d) \n " , * ( insptr - 1 ) , * insptr , * ( insptr + 1 ) , g_i , g_sp - > picnum ) ;
2006-11-16 03:02:42 +00:00
gameexit ( " An error has occurred in the EDuke32 CON executor. \n \n Please mail all of your CON files along with the file eduke32.log \n to terminx@gmail.com. \n \n Thank you. " ) ;
break ;
2006-04-13 20:47:06 +00:00
}
return 0 ;
}
2007-12-12 17:42:14 +00:00
void LoadActor ( int iActor )
2006-04-13 20:47:06 +00:00
{
2006-12-20 03:27:25 +00:00
g_i = iActor ; // Sprite ID
g_p = - 1 ; // iPlayer; // Player ID
2006-12-10 01:52:35 +00:00
g_x = - 1 ; // lDist; // ??
2006-04-13 20:47:06 +00:00
g_sp = & sprite [ g_i ] ; // Pointer to sprite structure
g_t = & hittype [ g_i ] . temp_data [ 0 ] ; // Sprite's 'extra' data
2006-11-14 21:35:50 +00:00
if ( actorLoadEventScrptr [ g_sp - > picnum ] = = 0 ) return ;
2006-04-13 20:47:06 +00:00
insptr = actorLoadEventScrptr [ g_sp - > picnum ] ;
killit_flag = 0 ;
2006-11-13 23:12:47 +00:00
if ( g_sp - > sectnum < 0 | | g_sp - > sectnum > = MAXSECTORS )
2006-04-13 20:47:06 +00:00
{
// if(badguy(g_sp))
2007-08-27 06:46:31 +00:00
// g_player[g_p].ps->actors_killed++;
2006-04-13 20:47:06 +00:00
deletesprite ( g_i ) ;
return ;
}
2007-02-08 04:19:39 +00:00
2006-12-20 03:27:25 +00:00
while ( 1 ) if ( parse ( ) ) break ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( killit_flag = = 1 )
2006-04-13 20:47:06 +00:00
{
// if player was set to squish, first stop that...
2006-11-14 21:35:50 +00:00
if ( g_p > = 0 )
2006-04-13 20:47:06 +00:00
{
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > actorsqu = = g_i )
g_player [ g_p ] . ps - > actorsqu = - 1 ;
2006-04-13 20:47:06 +00:00
}
deletesprite ( g_i ) ;
}
}
2007-12-12 17:42:14 +00:00
void execute ( int iActor , int iPlayer , int lDist )
2006-04-13 20:47:06 +00:00
{
2007-03-22 18:28:41 +00:00
short temp , temp2 ;
2006-12-18 08:37:12 +00:00
g_i = iActor ; // Sprite ID
g_p = iPlayer ; // Player ID
g_x = lDist ; // ??
2006-04-13 20:47:06 +00:00
g_sp = & sprite [ g_i ] ; // Pointer to sprite structure
g_t = & hittype [ g_i ] . temp_data [ 0 ] ; // Sprite's 'extra' data
2006-11-14 21:35:50 +00:00
if ( actorscrptr [ g_sp - > picnum ] = = 0 ) return ;
2006-04-13 20:47:06 +00:00
insptr = 4 + ( actorscrptr [ g_sp - > picnum ] ) ;
killit_flag = 0 ;
2006-11-13 23:12:47 +00:00
if ( g_sp - > sectnum < 0 | | g_sp - > sectnum > = MAXSECTORS )
2006-04-13 20:47:06 +00:00
{
2006-11-13 23:12:47 +00:00
if ( badguy ( g_sp ) )
2007-08-27 06:46:31 +00:00
g_player [ g_p ] . ps - > actors_killed + + ;
2006-04-13 20:47:06 +00:00
deletesprite ( g_i ) ;
return ;
}
2006-11-13 23:12:47 +00:00
if ( g_t [ 4 ] )
2006-04-13 20:47:06 +00:00
{
g_sp - > lotag + = TICSPERFRAME ;
2008-02-17 05:08:18 +00:00
if ( g_sp - > lotag > * ( intptr_t * ) ( g_t [ 4 ] + 16 ) )
2006-04-13 20:47:06 +00:00
{
g_t [ 2 ] + + ;
g_sp - > lotag = 0 ;
2008-02-17 05:08:18 +00:00
g_t [ 3 ] + = * ( intptr_t * ) ( g_t [ 4 ] + 12 ) ;
2006-04-13 20:47:06 +00:00
}
2008-02-17 05:08:18 +00:00
if ( klabs ( g_t [ 3 ] ) > = klabs ( * ( intptr_t * ) ( g_t [ 4 ] + 4 ) * * ( intptr_t * ) ( g_t [ 4 ] + 12 ) ) )
2006-04-13 20:47:06 +00:00
g_t [ 3 ] = 0 ;
}
2006-12-20 03:27:25 +00:00
while ( 1 ) if ( parse ( ) ) break ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( killit_flag = = 1 )
2006-04-13 20:47:06 +00:00
{
// if player was set to squish, first stop that...
2007-08-27 06:46:31 +00:00
if ( g_player [ g_p ] . ps - > actorsqu = = g_i )
g_player [ g_p ] . ps - > actorsqu = - 1 ;
2006-04-13 20:47:06 +00:00
deletesprite ( g_i ) ;
}
else
{
move ( ) ;
2007-03-22 18:28:41 +00:00
if ( ud . angleinterpolation )
{
temp = ( g_sp - > ang & 2047 ) - sprpos [ g_i ] . ang ;
sprpos [ g_i ] . oldang = sprpos [ g_i ] . ang ;
if ( temp )
{
temp2 = temp / klabs ( temp ) ;
if ( klabs ( temp ) > 1024 ) temp2 = - ( temp2 ) ;
sprpos [ g_i ] . angdir = temp2 ;
sprpos [ g_i ] . angdif = min ( ud . angleinterpolation , klabs ( temp ) ) ;
sprpos [ g_i ] . ang + = sprpos [ g_i ] . angdif * sprpos [ g_i ] . angdir ;
sprpos [ g_i ] . ang & = 2047 ;
}
}
2006-11-14 21:35:50 +00:00
if ( g_sp - > statnum = = 1 )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( badguy ( g_sp ) )
2006-04-13 20:47:06 +00:00
{
2006-11-14 21:35:50 +00:00
if ( g_sp - > xrepeat > 60 ) return ;
if ( ud . respawn_monsters = = 1 & & g_sp - > extra < = 0 ) return ;
2006-04-13 20:47:06 +00:00
}
2006-11-14 21:35:50 +00:00
else if ( ud . respawn_items = = 1 & & ( g_sp - > cstat & 32768 ) ) return ;
2006-04-13 20:47:06 +00:00
2006-11-13 23:12:47 +00:00
if ( hittype [ g_i ] . timetosleep > 1 )
2006-04-13 20:47:06 +00:00
hittype [ g_i ] . timetosleep - - ;
2006-11-13 23:12:47 +00:00
else if ( hittype [ g_i ] . timetosleep = = 1 )
2006-04-13 20:47:06 +00:00
changespritestat ( g_i , 2 ) ;
}
2006-11-13 23:12:47 +00:00
else if ( g_sp - > statnum = = 6 )
switch ( dynamictostatic [ g_sp - > picnum ] )
2006-04-13 20:47:06 +00:00
{
2006-11-16 03:02:42 +00:00
case RUBBERCAN__STATIC :
case EXPLODINGBARREL__STATIC :
case WOODENHORSE__STATIC :
case HORSEONSIDE__STATIC :
case CANWITHSOMETHING__STATIC :
case FIREBARREL__STATIC :
case NUKEBARREL__STATIC :
case NUKEBARRELDENTED__STATIC :
case NUKEBARRELLEAKED__STATIC :
case TRIPBOMB__STATIC :
case EGG__STATIC :
if ( hittype [ g_i ] . timetosleep > 1 )
hittype [ g_i ] . timetosleep - - ;
else if ( hittype [ g_i ] . timetosleep = = 1 )
changespritestat ( g_i , 2 ) ;
break ;
2006-04-13 20:47:06 +00:00
}
}
}