Exemple #1
0
int main()
{
  MY_STRUCT myStruct;

  myStruct.packet1 = ENUM_VAR3;
  printf("%s: %s\n", "Packet 1", ENUM2STRING(myStruct.packet1));

  myStruct.packet1 = 3;
  printf("%s: %s\n", "Packet 1", ENUM2STRING(myStruct.packet1));

  return 0;
}
Exemple #2
0
char		siege_info[MAX_SIEGE_INFO_SIZE];
int			siege_valid = 0;

siegeTeam_t *team1Theme = NULL;
siegeTeam_t *team2Theme = NULL;

siegeClass_t bgSiegeClasses[MAX_SIEGE_CLASSES];
int bgNumSiegeClasses = 0;

siegeTeam_t bgSiegeTeams[MAX_SIEGE_TEAMS];
int bgNumSiegeTeams = 0;

//class flags
stringID_table_t bgSiegeClassFlagNames[] =
{
	ENUM2STRING(CFL_MORESABERDMG),
	ENUM2STRING(CFL_STRONGAGAINSTPHYSICAL),
	ENUM2STRING(CFL_FASTFORCEREGEN),
	ENUM2STRING(CFL_STATVIEWER),
	ENUM2STRING(CFL_HEAVYMELEE),
	ENUM2STRING(CFL_SINGLE_ROCKET),
	ENUM2STRING(CFL_CUSTOMSKEL),
	ENUM2STRING(CFL_EXTRA_AMMO),
	{"", -1}
};

//saber stances
stringID_table_t StanceTable[] =
{
	ENUM2STRING(SS_NONE),
	ENUM2STRING(SS_FAST),
Exemple #3
0
//[VisualWeapons]
#include "cg_local.h"

extern int BG_SiegeGetPairedValue(char *buf, char *key, char *outbuf);
extern int BG_SiegeGetValueGroup(char *buf, char *group, char *outbuf);

stringID_table_t holsterTypeTable[] =
{
	ENUM2STRING(HLR_NONE),
	ENUM2STRING(HLR_SINGLESABER_1),	//first single saber
	ENUM2STRING(HLR_SINGLESABER_2),	//second single saber
	ENUM2STRING(HLR_STAFFSABER),		//staff saber
	ENUM2STRING(HLR_PISTOL_L),		//left hip blaster pistol
	ENUM2STRING(HLR_PISTOL_R),		//right hip blaster pistol
	ENUM2STRING(HLR_BLASTER_L),		//left hip blaster rifle
	ENUM2STRING(HLR_BLASTER_R),		//right hip blaster rifle
	ENUM2STRING(HLR_BRYARPISTOL_L),	//left hip bryer pistol
	ENUM2STRING(HLR_BRYARPISTOL_R),	//right hip bryer pistol
	ENUM2STRING(HLR_BOWCASTER),		//bowcaster
	ENUM2STRING(HLR_ROCKET_LAUNCHER),//rocket launcher
	ENUM2STRING(HLR_DEMP2),			//demp2
	ENUM2STRING(HLR_CONCUSSION),		//concussion
	ENUM2STRING(HLR_REPEATER),		//repeater
	ENUM2STRING(HLR_FLECHETTE),		//flechette
	ENUM2STRING(HLR_DISRUPTOR),		//disruptor
	ENUM2STRING(MAX_HOLSTER)	
};

stringID_table_t holsterBoneTable[] =
{
	ENUM2STRING(HOLSTER_NONE),
Exemple #4
0
#include "g_local.h"
#include "g_lua.h"

#ifdef JPLUA

//================================
//		EVENT HANDLERS
//================================

stringID_table_t jplua_events[JPLUA_EVENT_MAX] = 
{
	ENUM2STRING(JPLUA_EVENT_UNLOAD),
	ENUM2STRING(JPLUA_EVENT_RUNFRAME),
//	ENUM2STRING(JPLUA_EVENT_CLIENTCONNECT),
};

int JPLua_Event_AddListener( lua_State *L )
{//Called by Lua!
	int i = 0;
	const char *listenerArg = lua_tostring( L, -2 );

	if ( lua_type( L, -1 ) != LUA_TFUNCTION || lua_type( L, -2 ) != LUA_TSTRING )
	{
		G_LogPrintf( "JPLua: AddListener failed, function signature invalid registering %s (plugin: %s) - Is it up to date?\n", listenerArg, JPLua.currentPlugin->name );
		return 0;
	}

	for ( i=0; i<JPLUA_EVENT_MAX; i++ )
	{//Loop 'til we find the event we want to listen for
		if ( !Q_stricmp( listenerArg, jplua_events[i].name ) )
		{
Exemple #5
0
	#if defined(PROJECT_GAME)
	static int Player_GetAdminPrivs( lua_State *L, jpluaEntity_t *ent ) {
		if ( ent->client->pers.adminUser ) {
			lua_pushinteger( L, ent->client->pers.adminUser->privileges );
		}
		else {
			lua_pushinteger( L, ent->client->pers.tempprivs );
		}
		return 1;
	}
	#endif

	#if 0
	static const stringID_table_t ammo_strings[AMMO_MAX] = {
		ENUM2STRING(AMMO_NONE),
		ENUM2STRING(AMMO_FORCE),
		ENUM2STRING(AMMO_BLASTER),
		ENUM2STRING(AMMO_POWERCELL),
		ENUM2STRING(AMMO_METAL_BOLTS),
		ENUM2STRING(AMMO_ROCKETS),
		ENUM2STRING(AMMO_EMPLACED),
		ENUM2STRING(AMMO_THERMAL),
		ENUM2STRING(AMMO_TRIPMINE),
		ENUM2STRING(AMMO_DETPACK),
	};
	#endif

	static int Player_GetAmmo( lua_State *L, jpluaEntity_t *ent ) {
	#if defined(PROJECT_GAME)
		lua_newtable( L );
Exemple #6
0
#include "cg_local.h"
#include "cg_lua.h"
#include "cg_engine.h"

#ifdef JPLUA

//================================
//		EVENT HANDLERS
//================================

stringID_table_t jplua_events[JPLUA_EVENT_MAX] = 
{
	ENUM2STRING(JPLUA_EVENT_UNLOAD),
	ENUM2STRING(JPLUA_EVENT_RUNFRAME),
	ENUM2STRING(JPLUA_EVENT_HUD),
	ENUM2STRING(JPLUA_EVENT_CHATMSGRECV),
	ENUM2STRING(JPLUA_EVENT_CHATMSGSEND),
	ENUM2STRING(JPLUA_EVENT_CLIENTCONNECT),
	ENUM2STRING(JPLUA_EVENT_PAIN),
	ENUM2STRING(JPLUA_EVENT_SABERTOUCH),
};

int JPLua_Event_AddListener( lua_State *L )
{//Called by Lua!
	int i = 0;
	const char *listenerArg = lua_tostring( L, -2 );

	if ( lua_type( L, -1 ) != LUA_TFUNCTION || lua_type( L, -2 ) != LUA_TSTRING )
	{
		CG_Printf( "JPLua: AddListener failed, function signature invalid registering %s (plugin: %s) - Is it up to date?\n", listenerArg, JPLua.currentPlugin->name );
		return 0;
Exemple #7
0
	}
	for ( i = 1; i < 7; i++ )
	{
		G_SoundIndex( va( "sound/weapons/sword/fall%d.wav", i ) );
	}
	/*
	for ( i = 1; i < 4; i++ )
	{
		G_SoundIndex( va( "sound/weapons/sword/spin%d.wav", i ) );
	}
	*/
}

stringID_table_t SaberTable[] =
{
	ENUM2STRING(SABER_NONE),
	ENUM2STRING(SABER_SINGLE),
	ENUM2STRING(SABER_STAFF),
	ENUM2STRING(SABER_BROAD),
	ENUM2STRING(SABER_PRONG),
	ENUM2STRING(SABER_DAGGER),
	ENUM2STRING(SABER_ARC),
	ENUM2STRING(SABER_SAI),
	ENUM2STRING(SABER_CLAW),
	ENUM2STRING(SABER_LANCE),
	ENUM2STRING(SABER_STAR),
	ENUM2STRING(SABER_TRIDENT),
	ENUM2STRING(SABER_SITH_SWORD),
	"",	-1
};
Exemple #8
0
//This file contains functions relate to the saber impact behavior of OJP Enhanced's saber system.
#include "g_local.h"
#include "g_saberbeh.h"
#include "ai_main.h"

extern vmCvar_t		g_debugsaberbehavior;
extern stringID_table_t SaberMoveTable[];
extern stringID_table_t SaberBlockedTable[];

stringID_table_t sabBehaveTable[] =
{
	ENUM2STRING(SABBEHAVE_NONE),
	ENUM2STRING(SABBEHAVE_ATTACK),
	ENUM2STRING(SABBEHAVE_ATTACKPARRIED),
	ENUM2STRING(SABBEHAVE_ATTACKBLOCKED),
	ENUM2STRING(SABBEHAVE_BLOCK),
	ENUM2STRING(SABBEHAVE_BLOCKFAKED),
	ENUM2STRING(SABBEHAVE_PARRY)
};

char* DebugPrintSabMech(sabmech_t* sabmech, char* output, int bufferSize)
{
	char tempBuffer[64];

	if(!sabmech || !output)
	{
		return output;
	}
	
	output[0]= '\0';
	Com_sprintf(tempBuffer, 64, "BehaveMode: %s", GetStringForID(sabBehaveTable, sabmech->behaveMode));
Exemple #9
0
#if defined(_GAME)
#include "g_local.h"
#elif defined(_CGAME)
#include "cg_local.h"
#endif
#include "bg_lua.h"

#ifdef JPLUA

static const stringID_table_t jplua_events[JPLUA_EVENT_MAX] = {
	ENUM2STRING( JPLUA_EVENT_UNLOAD ),
	ENUM2STRING( JPLUA_EVENT_RUNFRAME ),
	ENUM2STRING( JPLUA_EVENT_CHATMSGRECV ),
	ENUM2STRING( JPLUA_EVENT_CHATMSGSEND ),
	ENUM2STRING( JPLUA_EVENT_CLIENTBEGIN ),
	ENUM2STRING( JPLUA_EVENT_CLIENTCOMMAND ),
	ENUM2STRING( JPLUA_EVENT_CLIENTCONNECT ),
	ENUM2STRING( JPLUA_EVENT_CLIENTDISCONNECT ),
	ENUM2STRING( JPLUA_EVENT_CLIENTINFO ),
	ENUM2STRING( JPLUA_EVENT_CLIENTSPAWN ),
	ENUM2STRING( JPLUA_EVENT_CLIENTUSERINFOCHANGED ),
	ENUM2STRING( JPLUA_EVENT_HUD ),
	ENUM2STRING( JPLUA_EVENT_PAIN ),
	ENUM2STRING( JPLUA_EVENT_PLAYERDEATH ),
	ENUM2STRING( JPLUA_EVENT_SABERTOUCH ),
};

// called by lua
int JPLua_Event_AddListener( lua_State *L ) {
	int i = 0;
	const char *listenerArg = lua_tostring( L, 1 );
        return qfalse;
    }
    
    if ( Q_stricmp (modelPath + len - 4, ".glm") == 0 )
    {
        return qtrue;
    }
    
    return qfalse;
}

#define MAX_WEAPON_ANIMFILE_LENGTH (4096)

const stringID_table_t weaponAnimTable[MAX_WEAPON_ANIMATIONS + 1] =
{
    ENUM2STRING (ABASE),
    ENUM2STRING (E11_IDLE),
    ENUM2STRING (WPROOT),
    
    { NULL, -1 }
};

//=========================================================
// Description:
// Loads an animation config file for a view weapon.
//=========================================================
static qboolean CG_LoadViewWeaponAnimations ( weaponInfo_t *weapon, const char *animationPath )
{
    fileHandle_t f;
    char weaponFileData[MAX_WEAPON_ANIMFILE_LENGTH];
    int fileLength;
    {
        fireMode->firingType = FT_AUTOMATIC;
    }
    else if ( Q_stricmp (firingTypeStr, "semi") == 0 )
    {
        fireMode->firingType = FT_SEMI;
    }
    else if ( Q_stricmp (firingTypeStr, "burst") == 0 )
    {
        fireMode->firingType = FT_BURST;
    }
}

static const stringID_table_t MODTable[] =
{
	ENUM2STRING (MOD_STUN_BATON),
	ENUM2STRING (MOD_MELEE),
	ENUM2STRING (MOD_SABER),
	ENUM2STRING (MOD_BRYAR_PISTOL),
	ENUM2STRING (MOD_BRYAR_PISTOL_ALT),
	ENUM2STRING (MOD_BLASTER),
	ENUM2STRING (MOD_TURBLAST),
	ENUM2STRING (MOD_DISRUPTOR),
	ENUM2STRING (MOD_DISRUPTOR_SPLASH),
	ENUM2STRING (MOD_DISRUPTOR_SNIPER),
	ENUM2STRING (MOD_BOWCASTER),
	ENUM2STRING (MOD_REPEATER),
	ENUM2STRING (MOD_REPEATER_ALT),
	ENUM2STRING (MOD_REPEATER_ALT_SPLASH),
	ENUM2STRING (MOD_DEMP2),
	ENUM2STRING (MOD_DEMP2_ALT),