1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345 |
- // leave this line at the top for all g_xxxx.cpp files...
- #include "g_headers.h"
- #include "Q3_Interface.h"
- #include "g_local.h"
- #include "wp_saber.h"
- extern void G_NextTestAxes( void );
- extern void G_ChangePlayerModel( gentity_t *ent, const char *newModel );
- extern void G_InitPlayerFromCvars( gentity_t *ent );
- extern void Q3_SetViewEntity(int entID, const char *name);
- extern qboolean G_ClearViewEntity( gentity_t *ent );
- extern void G_Knockdown( gentity_t *self, gentity_t *attacker, const vec3_t pushDir, float strength, qboolean breakSaberLock );
- extern void WP_SetSaber( gentity_t *ent, int saberNum, char *saberName );
- extern void WP_RemoveSaber( gentity_t *ent, int saberNum );
- extern saber_colors_t TranslateSaberColor( const char *name );
- extern void G_SetWeapon( gentity_t *self, int wp );
- extern stringID_table_t WPTable[];
- extern cvar_t *g_char_model;
- extern cvar_t *g_char_skin_head;
- extern cvar_t *g_char_skin_torso;
- extern cvar_t *g_char_skin_legs;
- extern cvar_t *g_char_color_red;
- extern cvar_t *g_char_color_green;
- extern cvar_t *g_char_color_blue;
- extern cvar_t *g_saber;
- extern cvar_t *g_saber2;
- extern cvar_t *g_saber_color;
- extern cvar_t *g_saber2_color;
- /*
- ===================
- Svcmd_EntityList_f
- ===================
- */
- void Svcmd_EntityList_f (void) {
- int e;
- gentity_t *check;
- check = g_entities+1;
- for (e = 1; e < globals.num_entities ; e++, check++) {
- if ( !check->inuse ) {
- continue;
- }
- gi.Printf("%3i:", e);
- switch ( check->s.eType ) {
- case ET_GENERAL:
- gi.Printf("ET_GENERAL ");
- break;
- case ET_PLAYER:
- gi.Printf("ET_PLAYER ");
- break;
- case ET_ITEM:
- gi.Printf("ET_ITEM ");
- break;
- case ET_MISSILE:
- gi.Printf("ET_MISSILE ");
- break;
- case ET_MOVER:
- gi.Printf("ET_MOVER ");
- break;
- case ET_BEAM:
- gi.Printf("ET_BEAM ");
- break;
- default:
- gi.Printf("#%i", check->s.eType);
- break;
- }
- if ( check->classname ) {
- gi.Printf("%s", check->classname);
- }
- gi.Printf("\n");
- }
- }
- gclient_t *ClientForString( const char *s ) {
- gclient_t *cl;
- int i;
- int idnum;
- // numeric values are just slot numbers
- if ( s[0] >= '0' && s[0] <= '9' ) {
- idnum = atoi( s );
- if ( idnum < 0 || idnum >= level.maxclients ) {
- Com_Printf( "Bad client slot: %i\n", idnum );
- return NULL;
- }
- cl = &level.clients[idnum];
- if ( cl->pers.connected == CON_DISCONNECTED ) {
- gi.Printf( "Client %i is not connected\n", idnum );
- return NULL;
- }
- return cl;
- }
- // check for a name match
- for ( i=0 ; i < level.maxclients ; i++ ) {
- cl = &level.clients[i];
- if ( cl->pers.connected == CON_DISCONNECTED ) {
- continue;
- }
- if ( !Q_stricmp( cl->pers.netname, s ) ) {
- return cl;
- }
- }
- gi.Printf( "User %s is not on the server\n", s );
- return NULL;
- }
- //---------------------------
- extern void G_StopCinematicSkip( void );
- extern void G_StartCinematicSkip( void );
- extern void ExitEmplacedWeapon( gentity_t *ent );
- static void Svcmd_ExitView_f( void )
- {
- extern cvar_t *g_skippingcin;
- static int exitViewDebounce = 0;
- if ( exitViewDebounce > level.time )
- {
- return;
- }
- exitViewDebounce = level.time + 500;
- if ( in_camera )
- {//see if we need to exit an in-game cinematic
- if ( g_skippingcin->integer ) // already doing cinematic skip?
- {// yes... so stop skipping...
- G_StopCinematicSkip();
- }
- else
- {// no... so start skipping...
- G_StartCinematicSkip();
- }
- }
- else if ( !G_ClearViewEntity( player ) )
- {//didn't exit control of a droid or turret
- //okay, now try exiting emplaced guns or AT-ST's
- if ( player->s.eFlags & EF_LOCKED_TO_WEAPON )
- {//get out of emplaced gun
- ExitEmplacedWeapon( player );
- }
- else if ( player->client && player->client->NPC_class == CLASS_ATST )
- {//a player trying to get out of his ATST
- GEntity_UseFunc( player->activator, player, player );
- }
- }
- }
- gentity_t *G_GetSelfForPlayerCmd( void )
- {
- if ( g_entities[0].client->ps.viewEntity > 0
- && g_entities[0].client->ps.viewEntity < ENTITYNUM_WORLD
- && g_entities[g_entities[0].client->ps.viewEntity].client
- && g_entities[g_entities[0].client->ps.viewEntity].s.weapon == WP_SABER )
- {//you're controlling another NPC
- return (&g_entities[g_entities[0].client->ps.viewEntity]);
- }
- else
- {
- return (&g_entities[0]);
- }
- }
- static void Svcmd_Saber_f()
- {
- char *saber = gi.argv(1);
- char *saber2 = gi.argv(2);
- if ( !g_entities[0].client || !saber || !saber[0] )
- {
- return;
- }
- gi.cvar_set( "g_saber", saber );
- WP_SetSaber( &g_entities[0], 0, saber );
- if ( saber2 && saber2[0] && !g_entities[0].client->ps.saber[0].twoHanded )
- {//want to use a second saber and first one is not twoHanded
- gi.cvar_set( "g_saber2", saber2 );
- WP_SetSaber( &g_entities[0], 1, saber2 );
- }
- else
- {
- gi.cvar_set( "g_saber2", "" );
- WP_RemoveSaber( &g_entities[0], 1 );
- }
- }
- static void Svcmd_SaberBlade_f()
- {
- if ( gi.argc() < 2 )
- {
- gi.Printf( "USAGE: saberblade <sabernum> <bladenum> [0 = off, 1 = on, no arg = toggle]\n" );
- return;
- }
- if ( &g_entities[0] == NULL || &g_entities[0].client == NULL )
- {
- return;
- }
- int sabernum = atoi(gi.argv(1)) - 1;
- if ( sabernum < 0 || sabernum > 1 )
- {
- return;
- }
- if ( sabernum > 0 && !g_entities[0].client->ps.dualSabers )
- {
- return;
- }
- //FIXME: what if don't even have a single saber at all?
- int bladenum = atoi(gi.argv(2)) - 1;
- if ( bladenum < 0 || bladenum >= g_entities[0].client->ps.saber[sabernum].numBlades )
- {
- return;
- }
- qboolean turnOn;
- if ( gi.argc() > 2 )
- {//explicit
- turnOn = (atoi(gi.argv(3))!=0);
- }
- else
- {//toggle
- turnOn = (g_entities[0].client->ps.saber[sabernum].blade[bladenum].active==qfalse);
- }
- g_entities[0].client->ps.SaberBladeActivate( sabernum, bladenum, turnOn );
- }
- static void Svcmd_SaberColor_f()
- {//FIXME: just list the colors, each additional listing sets that blade
- int saberNum = atoi(gi.argv(1));
- char *color[MAX_BLADES];
- int bladeNum;
- for ( bladeNum = 0; bladeNum < MAX_BLADES; bladeNum++ )
- {
- color[bladeNum] = gi.argv(2+bladeNum);
- }
- if ( !VALIDSTRING( color ) || saberNum < 1 || saberNum > 2 )
- {
- gi.Printf( "Usage: saberColor <saberNum> <blade1 color> <blade2 color> ... <blade8 color> \n" );
- gi.Printf( "valid saberNums: 1 or 2\n" );
- gi.Printf( "valid colors: red, orange, yellow, green, blue, and purple\n" );
- return;
- }
- saberNum--;
-
- gentity_t *self = G_GetSelfForPlayerCmd();
- for ( bladeNum = 0; bladeNum < MAX_BLADES; bladeNum++ )
- {
- if ( !color[bladeNum] || !color[bladeNum][0] )
- {
- break;
- }
- else
- {
- self->client->ps.saber[saberNum].blade[bladeNum].color = TranslateSaberColor( color[bladeNum] );
- }
- }
- if ( saberNum == 0 )
- {
- gi.cvar_set( "g_saber_color", color[0] );
- }
- else if ( saberNum == 1 )
- {
- gi.cvar_set( "g_saber2_color", color[0] );
- }
- }
- static void Svcmd_ForceJump_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current forceJump level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_LEVITATION] );
- gi.Printf( "Usage: setForceJump <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_LEVITATION );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_LEVITATION );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_LEVITATION] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_LEVITATION] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_LEVITATION] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_LEVITATION] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_LEVITATION] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_SaberThrow_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current saberThrow level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_SABERTHROW] );
- gi.Printf( "Usage: setSaberThrow <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_SABERTHROW );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_SABERTHROW );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_SABERTHROW] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_SABERTHROW] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SABERTHROW] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_SABERTHROW] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SABERTHROW] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_ForceHeal_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current forceHeal level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_HEAL] );
- gi.Printf( "Usage: forceHeal <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_HEAL );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_HEAL );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_HEAL] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_HEAL] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_HEAL] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_HEAL] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_HEAL] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_ForcePush_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current forcePush level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_PUSH] );
- gi.Printf( "Usage: forcePush <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_PUSH );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_PUSH );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_PUSH] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_PUSH] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_PUSH] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_PUSH] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_PUSH] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_ForcePull_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current forcePull level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_PULL] );
- gi.Printf( "Usage: forcePull <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_PULL );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_PULL );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_PULL] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_PULL] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_PULL] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_PULL] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_PULL] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_ForceSpeed_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current forceSpeed level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_SPEED] );
- gi.Printf( "Usage: forceSpeed <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_SPEED );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_SPEED );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_SPEED] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_SPEED] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SPEED] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_SPEED] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SPEED] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_ForceGrip_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current forceGrip level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_GRIP] );
- gi.Printf( "Usage: forceGrip <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_GRIP );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_GRIP );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_GRIP] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_GRIP] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_GRIP] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_GRIP] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_GRIP] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_ForceLightning_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current forceLightning level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_LIGHTNING] );
- gi.Printf( "Usage: forceLightning <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_LIGHTNING );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_LIGHTNING );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_LIGHTNING] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_LIGHTNING] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_LIGHTNING] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_LIGHTNING] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_LIGHTNING] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_MindTrick_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current mindTrick level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_TELEPATHY] );
- gi.Printf( "Usage: mindTrick <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_TELEPATHY );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_TELEPATHY );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_TELEPATHY] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_TELEPATHY] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_TELEPATHY] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_TELEPATHY] > FORCE_LEVEL_4 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_TELEPATHY] = FORCE_LEVEL_4;
- }
- }
- static void Svcmd_SaberDefense_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current saberDefense level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_SABER_DEFENSE] );
- gi.Printf( "Usage: saberDefense <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_SABER_DEFENSE );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_SABER_DEFENSE );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_SABER_DEFENSE] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_SABER_DEFENSE] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SABER_DEFENSE] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_SABER_DEFENSE] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SABER_DEFENSE] = FORCE_LEVEL_3;
- }
- }
- static void Svcmd_SaberOffense_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current saberOffense level is %d\n", g_entities[0].client->ps.forcePowerLevel[FP_SABER_OFFENSE] );
- gi.Printf( "Usage: saberOffense <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << FP_SABER_OFFENSE );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << FP_SABER_OFFENSE );
- }
- g_entities[0].client->ps.forcePowerLevel[FP_SABER_OFFENSE] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[FP_SABER_OFFENSE] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SABER_OFFENSE] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[FP_SABER_OFFENSE] >= SS_NUM_SABER_STYLES )
- {
- g_entities[0].client->ps.forcePowerLevel[FP_SABER_OFFENSE] = SS_NUM_SABER_STYLES-1;
- }
- }
- static void Svcmd_ForceSetLevel_f( int forcePower )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return;
- }
- char *newVal = gi.argv(1);
- if ( !VALIDSTRING( newVal ) )
- {
- gi.Printf( "Current force level is %d\n", g_entities[0].client->ps.forcePowerLevel[forcePower] );
- gi.Printf( "Usage: force <level> (1 - 3)\n" );
- return;
- }
- int val = atoi(newVal);
- if ( val > FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << forcePower );
- }
- else
- {
- g_entities[0].client->ps.forcePowersKnown &= ~( 1 << forcePower );
- }
- g_entities[0].client->ps.forcePowerLevel[forcePower] = val;
- if ( g_entities[0].client->ps.forcePowerLevel[forcePower] < FORCE_LEVEL_0 )
- {
- g_entities[0].client->ps.forcePowerLevel[forcePower] = FORCE_LEVEL_0;
- }
- else if ( g_entities[0].client->ps.forcePowerLevel[forcePower] > FORCE_LEVEL_3 )
- {
- g_entities[0].client->ps.forcePowerLevel[forcePower] = FORCE_LEVEL_3;
- }
- }
- extern qboolean PM_SaberInStart( int move );
- extern qboolean PM_SaberInTransition( int move );
- extern qboolean PM_SaberInAttack( int move );
- void Svcmd_SaberAttackCycle_f( void )
- {
- if ( !&g_entities[0] || !g_entities[0].client )
- {
- return;
- }
- gentity_t *self = G_GetSelfForPlayerCmd();
- if ( self->s.weapon != WP_SABER )
- {// saberAttackCycle button also switches to saber
- gi.SendConsoleCommand("weapon 1" );
- return;
- }
- if ( self->client->ps.dualSabers )
- {//can't cycle styles with dualSabers, so just toggle second saber on/off
- if ( self->client->ps.saber[1].Active() )
- {//turn it off
- self->client->ps.saber[1].Deactivate();
- G_SoundIndexOnEnt( self, CHAN_WEAPON, self->client->ps.saber[0].soundOff );
- }
- else if ( !self->client->ps.saber[0].Active() )
- {//first one is off, too, so just turn that one on
- if ( !self->client->ps.saberInFlight )
- {//but only if it's in your hand!
- self->client->ps.saber[0].Activate();
- }
- }
- else
- {//turn on the second one
- self->client->ps.saber[1].Activate();
- }
- return;
- }
- else if ( self->client->ps.saber[0].numBlades > 1 )//self->client->ps.saber[0].type == SABER_STAFF )
- {//can't cycle styles with saberstaff, so just toggles saber blades on/off
- if ( self->client->ps.saberInFlight )
- {//can't turn second blade back on if it's in the air, you naughty boy!
- return;
- }
- qboolean playedSound = qfalse;
- if ( !self->client->ps.saber[0].blade[0].active )
- {//first one is not even on
- //turn only it on
- self->client->ps.SaberBladeActivate( 0, 0, qtrue );
- return;
- }
- for ( int i = 1; i < self->client->ps.saber[0].numBlades; i++ )
- {
- if ( !self->client->ps.saber[0].blade[i].active )
- {//extra is off, turn it on
- self->client->ps.SaberBladeActivate( 0, i, qtrue );
- }
- else
- {//turn extra off
- self->client->ps.SaberBladeActivate( 0, i, qfalse );
- if ( !playedSound )
- {
- G_SoundIndexOnEnt( self, CHAN_WEAPON, self->client->ps.saber[0].soundOff );
- playedSound = qtrue;
- }
- }
- }
- return;
- }
- //FIXME: if dualSabers and both on, do something here, too... maybe toggle the second one on/off?
- if ( !self->client->ps.saberStylesKnown )
- {
- return;
- }
- int saberAnimLevel;
- if ( !self->s.number )
- {
- saberAnimLevel = cg.saberAnimLevelPending;
- }
- else
- {
- saberAnimLevel = self->client->ps.saberAnimLevel;
- }
- saberAnimLevel++;
- int sanityCheck = 0;
- while ( self->client->ps.saberAnimLevel != saberAnimLevel
- && !(self->client->ps.saberStylesKnown&(1<<saberAnimLevel))
- && sanityCheck < SS_NUM_SABER_STYLES+1 )
- {
- saberAnimLevel++;
- if ( saberAnimLevel > SS_STAFF )
- {
- saberAnimLevel = SS_FAST;
- }
- sanityCheck++;
- }
- if ( !(self->client->ps.saberStylesKnown&(1<<saberAnimLevel)) )
- {
- return;
- }
- if ( !self->s.number )
- {
- cg.saberAnimLevelPending = saberAnimLevel;
- }
- else
- {
- self->client->ps.saberAnimLevel = saberAnimLevel;
- }
- #ifndef FINAL_BUILD
- switch ( saberAnimLevel )
- {
- case SS_FAST:
- gi.Printf( S_COLOR_BLUE"Lightsaber Combat Style: Fast\n" );
- //LIGHTSABERCOMBATSTYLE_FAST
- break;
- case SS_MEDIUM:
- gi.Printf( S_COLOR_YELLOW"Lightsaber Combat Style: Medium\n" );
- //LIGHTSABERCOMBATSTYLE_MEDIUM
- break;
- case SS_STRONG:
- gi.Printf( S_COLOR_RED"Lightsaber Combat Style: Strong\n" );
- //LIGHTSABERCOMBATSTYLE_STRONG
- break;
- case SS_DESANN:
- gi.Printf( S_COLOR_CYAN"Lightsaber Combat Style: Desann\n" );
- //LIGHTSABERCOMBATSTYLE_DESANN
- break;
- case SS_TAVION:
- gi.Printf( S_COLOR_MAGENTA"Lightsaber Combat Style: Tavion\n" );
- //LIGHTSABERCOMBATSTYLE_TAVION
- break;
- case SS_DUAL:
- gi.Printf( S_COLOR_MAGENTA"Lightsaber Combat Style: Dual\n" );
- //LIGHTSABERCOMBATSTYLE_TAVION
- break;
- case SS_STAFF:
- gi.Printf( S_COLOR_MAGENTA"Lightsaber Combat Style: Staff\n" );
- //LIGHTSABERCOMBATSTYLE_TAVION
- break;
- }
- //gi.Printf("\n");
- #endif
- }
- qboolean G_ReleaseEntity( gentity_t *grabber )
- {
- if ( grabber && grabber->client && grabber->client->ps.heldClient < ENTITYNUM_WORLD )
- {
- gentity_t *heldClient = &g_entities[grabber->client->ps.heldClient];
- grabber->client->ps.heldClient = ENTITYNUM_NONE;
- if ( heldClient && heldClient->client )
- {
- heldClient->client->ps.heldByClient = ENTITYNUM_NONE;
- heldClient->owner = NULL;
- }
- return qtrue;
- }
- return qfalse;
- }
- void G_GrabEntity( gentity_t *grabber, char *target )
- {
- if ( !grabber || !grabber->client )
- {
- return;
- }
- gentity_t *heldClient = G_Find( NULL, FOFS(targetname), (char *)target );
- if ( heldClient && heldClient->client && heldClient != grabber )//don't grab yourself, it's not polite
- {//found him
- grabber->client->ps.heldClient = heldClient->s.number;
- heldClient->client->ps.heldByClient = grabber->s.number;
- heldClient->owner = grabber;
- }
- }
- /*
- =================
- ConsoleCommand
- // these are added in cg_main, CG_Init so they tab-complete
- =================
- */
- qboolean ConsoleCommand( void ) {
- char *cmd;
- cmd = gi.argv(0);
- if ( Q_stricmp (cmd, "entitylist") == 0 )
- {
- Svcmd_EntityList_f();
- return qtrue;
- }
- if (Q_stricmp (cmd, "game_memory") == 0) {
- Svcmd_GameMem_f();
- return qtrue;
- }
- // if (Q_stricmp (cmd, "addbot") == 0) {
- // Svcmd_AddBot_f();
- // return qtrue;
- // }
- if (Q_stricmp (cmd, "nav") == 0)
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- Svcmd_Nav_f ();
- return qtrue;
- }
- if (Q_stricmp (cmd, "npc") == 0)
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- Svcmd_NPC_f ();
- return qtrue;
- }
- if (Q_stricmp (cmd, "use") == 0)
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- Svcmd_Use_f ();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "ICARUS" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- Quake3Game()->Svcmd();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "saberColor" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- Svcmd_SaberColor_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "saber" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- Svcmd_Saber_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "saberblade" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- Svcmd_SaberBlade_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceJump" ) == 0 )
- {
- Svcmd_ForceJump_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setSaberThrow" ) == 0 )
- {
- Svcmd_SaberThrow_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceHeal" ) == 0 )
- {
- Svcmd_ForceHeal_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForcePush" ) == 0 )
- {
- Svcmd_ForcePush_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForcePull" ) == 0 )
- {
- Svcmd_ForcePull_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceSpeed" ) == 0 )
- {
- Svcmd_ForceSpeed_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceGrip" ) == 0 )
- {
- Svcmd_ForceGrip_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceLightning" ) == 0 )
- {
- Svcmd_ForceLightning_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setMindTrick" ) == 0 )
- {
- Svcmd_MindTrick_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setSaberDefense" ) == 0 )
- {
- Svcmd_SaberDefense_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setSaberOffense" ) == 0 )
- {
- Svcmd_SaberOffense_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceRage" ) == 0 )
- {
- Svcmd_ForceSetLevel_f( FP_RAGE );
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceDrain" ) == 0 )
- {
- Svcmd_ForceSetLevel_f( FP_DRAIN );
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceProtect" ) == 0 )
- {
- Svcmd_ForceSetLevel_f( FP_PROTECT );
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceAbsorb" ) == 0 )
- {
- Svcmd_ForceSetLevel_f( FP_ABSORB );
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceSight" ) == 0 )
- {
- Svcmd_ForceSetLevel_f( FP_SEE );
- return qtrue;
- }
- if ( Q_stricmp( cmd, "setForceAll" ) == 0 )
- {
- Svcmd_ForceJump_f();
- Svcmd_SaberThrow_f();
- Svcmd_ForceHeal_f();
- Svcmd_ForcePush_f();
- Svcmd_ForcePull_f();
- Svcmd_ForceSpeed_f();
- Svcmd_ForceGrip_f();
- Svcmd_ForceLightning_f();
- Svcmd_MindTrick_f();
- Svcmd_SaberDefense_f();
- Svcmd_SaberOffense_f();
- Svcmd_ForceSetLevel_f( FP_RAGE );
- Svcmd_ForceSetLevel_f( FP_DRAIN );
- Svcmd_ForceSetLevel_f( FP_PROTECT );
- Svcmd_ForceSetLevel_f( FP_ABSORB );
- Svcmd_ForceSetLevel_f( FP_SEE );
- for ( int i = SS_FAST; i < SS_NUM_SABER_STYLES; i++ )
- {
- g_entities[0].client->ps.saberStylesKnown |= (1<<i);
- }
- return qtrue;
- }
- if ( Q_stricmp( cmd, "saberAttackCycle" ) == 0 )
- {
- Svcmd_SaberAttackCycle_f();
- return qtrue;
- }
- if ( Q_stricmp( cmd, "runscript" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- char *cmd2 = gi.argv(1);
- if ( cmd2 && cmd2[0] )
- {
- char *cmd3 = gi.argv(2);
- if ( cmd3 && cmd3[0] )
- {
- gentity_t *found = NULL;
- if ( (found = G_Find(NULL, FOFS(targetname), cmd2 ) ) != NULL )
- {
- Quake3Game()->RunScript( found, cmd3 );
- }
- else
- {
- //can't find cmd2
- gi.Printf( S_COLOR_RED"runscript: can't find targetname %s\n", cmd2 );
- }
- }
- else
- {
- Quake3Game()->RunScript( &g_entities[0], cmd2 );
- }
- }
- else
- {
- gi.Printf( S_COLOR_RED"usage: runscript <ent targetname> scriptname\n" );
- }
- //FIXME: else warning
- return qtrue;
- }
- if ( Q_stricmp( cmd, "playerteam" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- char *cmd2 = gi.argv(1);
- int n;
- if ( !*cmd2 || !cmd2[0] )
- {
- gi.Printf( S_COLOR_RED"'playerteam' - change player team, requires a team name!\n" );
- gi.Printf( S_COLOR_RED"Valid team names are:\n");
- for ( n = (TEAM_FREE + 1); n < TEAM_NUM_TEAMS; n++ )
- {
- gi.Printf( S_COLOR_RED"%s\n", GetStringForID( TeamTable, n ) );
- }
- }
- else
- {
- team_t team;
- team = (team_t)GetIDForString( TeamTable, cmd2 );
- if ( team == -1 )
- {
- gi.Printf( S_COLOR_RED"'playerteam' unrecognized team name %s!\n", cmd2 );
- gi.Printf( S_COLOR_RED"Valid team names are:\n");
- for ( n = TEAM_FREE; n < TEAM_NUM_TEAMS; n++ )
- {
- gi.Printf( S_COLOR_RED"%s\n", GetStringForID( TeamTable, n ) );
- }
- }
- else
- {
- g_entities[0].client->playerTeam = team;
- //FIXME: convert Imperial, Malon, Hirogen and Klingon to Scavenger?
- }
- }
- return qtrue;
- }
- if ( Q_stricmp( cmd, "control" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- char *cmd2 = gi.argv(1);
- if ( !*cmd2 || !cmd2[0] )
- {
- if ( !G_ClearViewEntity( &g_entities[0] ) )
- {
- gi.Printf( S_COLOR_RED"control <NPC_targetname>\n", cmd2 );
- }
- }
- else
- {
- Q3_SetViewEntity( 0, cmd2 );
- }
- return qtrue;
- }
- if ( Q_stricmp( cmd, "grab" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- char *cmd2 = gi.argv(1);
- if ( !*cmd2 || !cmd2[0] )
- {
- if ( !G_ReleaseEntity( &g_entities[0] ) )
- {
- gi.Printf( S_COLOR_RED"grab <NPC_targetname>\n", cmd2 );
- }
- }
- else
- {
- G_GrabEntity( &g_entities[0], cmd2 );
- }
- return qtrue;
- }
- if ( Q_stricmp( cmd, "knockdown" ) == 0 )
- {
- if ( !g_cheats->integer )
- {
- gi.SendServerCommand( 0, "print \"Cheats are not enabled on this server.\n\"");
- return qfalse;
- }
- G_Knockdown( &g_entities[0], &g_entities[0], vec3_origin, 300, qtrue );
- return qtrue;
- }
- if ( Q_stricmp( cmd, "playerModel" ) == 0 )
- {
- if ( gi.argc() == 1 )
- {
- gi.Printf( S_COLOR_RED"USAGE: playerModel <NPC Name>\n playerModel <g2model> <skinhead> <skintorso> <skinlower>\n playerModel player (builds player from customized menu settings)\n" );
- gi.Printf( "playerModel = %s ", va("%s %s %s %s\n", g_char_model->string, g_char_skin_head->string, g_char_skin_torso->string, g_char_skin_legs->string ) );
- }
- else if ( gi.argc() == 2 )
- {
- G_ChangePlayerModel( &g_entities[0], gi.argv(1) );
- }
- else if ( gi.argc() == 5 )
- {
- //instead of setting it directly via a command, we now store it in cvars
- //G_ChangePlayerModel( &g_entities[0], va("%s|%s|%s|%s", gi.argv(1), gi.argv(2), gi.argv(3), gi.argv(4)) );
- gi.cvar_set("g_char_model", gi.argv(1) );
- gi.cvar_set("g_char_skin_head", gi.argv(2) );
- gi.cvar_set("g_char_skin_torso", gi.argv(3) );
- gi.cvar_set("g_char_skin_legs", gi.argv(4) );
- G_InitPlayerFromCvars( &g_entities[0] );
- }
- return qtrue;
- }
- if ( Q_stricmp( cmd, "playerTint" ) == 0 )
- {
- if ( gi.argc() == 4 )
- {
- g_entities[0].client->renderInfo.customRGBA[0] = atoi(gi.argv(1));
- g_entities[0].client->renderInfo.customRGBA[1] = atoi(gi.argv(2));
- g_entities[0].client->renderInfo.customRGBA[2] = atoi(gi.argv(3));
- gi.cvar_set("g_char_color_red", gi.argv(1) );
- gi.cvar_set("g_char_color_green", gi.argv(2) );
- gi.cvar_set("g_char_color_blue", gi.argv(3) );
- }
- else
- {
- gi.Printf( S_COLOR_RED"USAGE: playerTint <red 0 - 255> <green 0 - 255> <blue 0 - 255>\n" );
- gi.Printf( "playerTint = %s\n", va("%d %d %d", g_char_color_red->integer, g_char_color_green->integer, g_char_color_blue->integer ) );
- }
- return qtrue;
- }
- if ( Q_stricmp( cmd, "nexttestaxes" ) == 0 )
- {
- G_NextTestAxes();
- }
- if ( Q_stricmp( cmd, "exitview" ) == 0 )
- {
- Svcmd_ExitView_f();
- }
-
- if (Q_stricmp (cmd, "iknowkungfu") == 0)
- {
- gi.cvar_set( "g_debugMelee", "1" );
- G_SetWeapon( &g_entities[0], WP_MELEE );
- /*
- for ( int i = FP_FIRST; i < NUM_FORCE_POWERS; i++ )
- {
- g_entities[0].client->ps.forcePowersKnown |= ( 1 << i );
- if ( i == FP_TELEPATHY )
- {
- g_entities[0].client->ps.forcePowerLevel[i] = FORCE_LEVEL_4;
- }
- else
- {
- g_entities[0].client->ps.forcePowerLevel[i] = FORCE_LEVEL_3;
- }
- }
- */
- }
- return qfalse;
- }
|