codemp/game/bg_misc.c

Go to the documentation of this file.
00001 // Copyright (C) 1999-2000 Id Software, Inc.
00002 //
00003 // bg_misc.c -- both games misc functions, all completely stateless
00004 
00005 #include "q_shared.h"
00006 #include "bg_public.h"
00007 #include "bg_strap.h"
00008 
00009 #ifdef QAGAME
00010 #include "g_local.h"
00011 #endif
00012 
00013 #ifdef UI_EXPORTS
00014 #include "../ui/ui_local.h"
00015 #endif
00016 
00017 #ifndef UI_EXPORTS
00018 #ifndef QAGAME
00019 #include "../cgame/cg_local.h"
00020 #endif
00021 #endif
00022 
00023 #ifdef _XBOX
00024 extern void *Z_Malloc(int iSize, memtag_t eTag, qboolean bZeroit, int iAlign);
00025 extern void Z_Free(void *pvAddress);
00026 #endif
00027 
00028 #ifdef QAGAME
00029 extern void Q3_SetParm (int entID, int parmNum, const char *parmValue);
00030 #endif
00031 
00032 #include "../namespace_begin.h"
00033 
00034 const char *bgToggleableSurfaces[BG_NUM_TOGGLEABLE_SURFACES] = 
00035 {
00036         "l_arm_key",                                    //0
00037         "torso_canister1",
00038         "torso_canister2",
00039         "torso_canister3",
00040         "torso_tube1",
00041         "torso_tube2",                                  //5
00042         "torso_tube3",
00043         "torso_tube4",
00044         "torso_tube5",
00045         "torso_tube6",
00046         "r_arm",                                                //10
00047         "l_arm",
00048         "torso_shield",
00049         "torso_galaktorso",
00050         "torso_collar",
00051 //      "torso_eyes_mouth",                             //15
00052 //      "torso_galakhead",
00053 //      "torso_galakface",
00054 //      "torso_antenna_base_cap",
00055 //      "torso_antenna",
00056 //      "l_arm_augment",                                //20
00057 //      "l_arm_middle",
00058 //      "l_arm_wrist",
00059 //      "r_arm_middle", //yeah.. galak's surf stuff is no longer auto, sorry! need the space for vehicle surfs.
00060         "r_wing1",                                              //15
00061         "r_wing2",
00062         "l_wing1",
00063         "l_wing2",
00064         "r_gear",
00065         "l_gear",                                               //20
00066         "nose",
00067         "blah4",
00068         "blah5",
00069         "l_hand",
00070         "r_hand",                                               //25
00071         "helmet",
00072         "head",
00073         "head_concussion_charger",
00074         "head_light_blaster_cann",              //29
00075         NULL
00076 };
00077 
00078 const int bgToggleableSurfaceDebris[BG_NUM_TOGGLEABLE_SURFACES] =
00079 {
00080         0,                                      //0
00081         0,
00082         0,
00083         0,
00084         0,
00085         0,                                      //5
00086         0,
00087         0,
00088         0,
00089         0,
00090         0,                                      //10
00091         0,
00092         0,
00093         0,
00094         0, //>= 2 means it should create a flame trail when destroyed (for vehicles)
00095         3,                                      //15
00096         5, //rwing2
00097         4,
00098         6, //lwing2
00099         0, //rgear
00100         0, //lgear                      //20
00101         7, //nose
00102         0, //blah
00103         0, //blah
00104         0,
00105         0,                                      //25
00106         0,
00107         0,
00108         0,
00109         0,                                      //29
00110         -1
00111 };
00112 
00113 const char      *bg_customSiegeSoundNames[MAX_CUSTOM_SIEGE_SOUNDS] = 
00114 {
00115         "*att_attack",
00116         "*att_primary",
00117         "*att_second",
00118         "*def_guns",
00119         "*def_position",
00120         "*def_primary",
00121         "*def_second",
00122         "*reply_coming",
00123         "*reply_go",
00124         "*reply_no",
00125         "*reply_stay",
00126         "*reply_yes",
00127         "*req_assist",
00128         "*req_demo",
00129         "*req_hvy",
00130         "*req_medic",
00131         "*req_sup",
00132         "*req_tech",
00133         "*spot_air",
00134         "*spot_defenses",
00135         "*spot_emplaced",
00136         "*spot_sniper",
00137         "*spot_troops",
00138         "*tac_cover",
00139         "*tac_fallback",
00140         "*tac_follow",
00141         "*tac_hold",
00142         "*tac_split",
00143         "*tac_together",
00144         NULL
00145 };
00146 
00147 //rww - not putting @ in front of these because
00148 //we don't need them in a cgame StringEd lookup.
00149 //Let me know if this causes problems, pat.
00150 char *forceMasteryLevels[NUM_FORCE_MASTERY_LEVELS] = 
00151 {
00152         "MASTERY0",     //"Uninitiated",        // FORCE_MASTERY_UNINITIATED,
00153         "MASTERY1",     //"Initiate",           // FORCE_MASTERY_INITIATE,
00154         "MASTERY2",     //"Padawan",            // FORCE_MASTERY_PADAWAN,
00155         "MASTERY3",     //"Jedi",                       // FORCE_MASTERY_JEDI,
00156         "MASTERY4",     //"Jedi Adept",         // FORCE_MASTERY_JEDI_GUARDIAN,
00157         "MASTERY5",     //"Jedi Guardian",      // FORCE_MASTERY_JEDI_ADEPT,
00158         "MASTERY6",     //"Jedi Knight",        // FORCE_MASTERY_JEDI_KNIGHT,
00159         "MASTERY7",     //"Jedi Master"         // FORCE_MASTERY_JEDI_MASTER,
00160 };
00161 
00162 int forceMasteryPoints[NUM_FORCE_MASTERY_LEVELS] =
00163 {
00164         0,              // FORCE_MASTERY_UNINITIATED,
00165         5,              // FORCE_MASTERY_INITIATE,
00166         10,             // FORCE_MASTERY_PADAWAN,
00167         20,             // FORCE_MASTERY_JEDI,
00168         30,             // FORCE_MASTERY_JEDI_GUARDIAN,
00169         50,             // FORCE_MASTERY_JEDI_ADEPT,
00170         75,             // FORCE_MASTERY_JEDI_KNIGHT,
00171         100             // FORCE_MASTERY_JEDI_MASTER,
00172 };
00173 
00174 int bgForcePowerCost[NUM_FORCE_POWERS][NUM_FORCE_POWER_LEVELS] = //0 == neutral
00175 {
00176         {       0,      2,      4,      6       },      // Heal                 // FP_HEAL
00177         {       0,      0,      2,      6       },      // Jump                 //FP_LEVITATION,//hold/duration
00178         {       0,      2,      4,      6       },      // Speed                //FP_SPEED,//duration
00179         {       0,      1,      3,      6       },      // Push                 //FP_PUSH,//hold/duration
00180         {       0,      1,      3,      6       },      // Pull                 //FP_PULL,//hold/duration
00181         {       0,      4,      6,      8       },      // Mind Trick   //FP_TELEPATHY,//instant
00182         {       0,      1,      3,      6       },      // Grip                 //FP_GRIP,//hold/duration
00183         {       0,      2,      5,      8       },      // Lightning    //FP_LIGHTNING,//hold/duration
00184         {       0,      4,      6,      8       },      // Dark Rage    //FP_RAGE,//duration
00185         {       0,      2,      5,      8       },      // Protection   //FP_PROTECT,//duration
00186         {       0,      1,      3,      6       },      // Absorb               //FP_ABSORB,//duration
00187         {       0,      1,      3,      6       },      // Team Heal    //FP_TEAM_HEAL,//instant
00188         {       0,      1,      3,      6       },      // Team Force   //FP_TEAM_FORCE,//instant
00189         {       0,      2,      4,      6       },      // Drain                //FP_DRAIN,//hold/duration
00190         {       0,      2,      5,      8       },      // Sight                //FP_SEE,//duration
00191         {       0,      1,      5,      8       },      // Saber Attack //FP_SABER_OFFENSE,
00192         {       0,      1,      5,      8       },      // Saber Defend //FP_SABER_DEFENSE,
00193         {       0,      4,      6,      8       }       // Saber Throw  //FP_SABERTHROW,
00194         //NUM_FORCE_POWERS
00195 };
00196 
00197 int forcePowerSorted[NUM_FORCE_POWERS] = 
00198 { //rww - always use this order when drawing force powers for any reason
00199         FP_TELEPATHY,
00200         FP_HEAL,
00201         FP_ABSORB,
00202         FP_PROTECT,
00203         FP_TEAM_HEAL,
00204         FP_LEVITATION,
00205         FP_SPEED,
00206         FP_PUSH,
00207         FP_PULL,
00208         FP_SEE,
00209         FP_LIGHTNING,
00210         FP_DRAIN,
00211         FP_RAGE,
00212         FP_GRIP,
00213         FP_TEAM_FORCE,
00214         FP_SABER_OFFENSE,
00215         FP_SABER_DEFENSE,
00216         FP_SABERTHROW
00217 };
00218 
00219 int forcePowerDarkLight[NUM_FORCE_POWERS] = //0 == neutral
00220 { //nothing should be usable at rank 0..
00221         FORCE_LIGHTSIDE,//FP_HEAL,//instant
00222         0,//FP_LEVITATION,//hold/duration
00223         0,//FP_SPEED,//duration
00224         0,//FP_PUSH,//hold/duration
00225         0,//FP_PULL,//hold/duration
00226         FORCE_LIGHTSIDE,//FP_TELEPATHY,//instant
00227         FORCE_DARKSIDE,//FP_GRIP,//hold/duration
00228         FORCE_DARKSIDE,//FP_LIGHTNING,//hold/duration
00229         FORCE_DARKSIDE,//FP_RAGE,//duration
00230         FORCE_LIGHTSIDE,//FP_PROTECT,//duration
00231         FORCE_LIGHTSIDE,//FP_ABSORB,//duration
00232         FORCE_LIGHTSIDE,//FP_TEAM_HEAL,//instant
00233         FORCE_DARKSIDE,//FP_TEAM_FORCE,//instant
00234         FORCE_DARKSIDE,//FP_DRAIN,//hold/duration
00235         0,//FP_SEE,//duration
00236         0,//FP_SABER_OFFENSE,
00237         0,//FP_SABER_DEFENSE,
00238         0//FP_SABERTHROW,
00239                 //NUM_FORCE_POWERS
00240 };
00241 
00242 int WeaponReadyAnim[WP_NUM_WEAPONS] =
00243 {
00244         TORSO_DROPWEAP1,//WP_NONE,
00245 
00246         TORSO_WEAPONREADY3,//WP_STUN_BATON,
00247         TORSO_WEAPONREADY3,//WP_MELEE,
00248         BOTH_STAND2,//WP_SABER,
00249         TORSO_WEAPONREADY2,//WP_BRYAR_PISTOL,
00250         TORSO_WEAPONREADY3,//WP_BLASTER,
00251         TORSO_WEAPONREADY3,//TORSO_WEAPONREADY4,//WP_DISRUPTOR,
00252         TORSO_WEAPONREADY3,//TORSO_WEAPONREADY5,//WP_BOWCASTER,
00253         TORSO_WEAPONREADY3,//TORSO_WEAPONREADY6,//WP_REPEATER,
00254         TORSO_WEAPONREADY3,//TORSO_WEAPONREADY7,//WP_DEMP2,
00255         TORSO_WEAPONREADY3,//TORSO_WEAPONREADY8,//WP_FLECHETTE,
00256         TORSO_WEAPONREADY3,//TORSO_WEAPONREADY9,//WP_ROCKET_LAUNCHER,
00257         TORSO_WEAPONREADY10,//WP_THERMAL,
00258         TORSO_WEAPONREADY10,//TORSO_WEAPONREADY11,//WP_TRIP_MINE,
00259         TORSO_WEAPONREADY10,//TORSO_WEAPONREADY12,//WP_DET_PACK,
00260         TORSO_WEAPONREADY3,//WP_CONCUSSION
00261         TORSO_WEAPONREADY2,//WP_BRYAR_OLD,
00262 
00263         //NOT VALID (e.g. should never really be used):
00264         BOTH_STAND1,//WP_EMPLACED_GUN,
00265         TORSO_WEAPONREADY1//WP_TURRET,
00266 };
00267 
00268 int WeaponReadyLegsAnim[WP_NUM_WEAPONS] =
00269 {
00270         BOTH_STAND1,//WP_NONE,
00271 
00272         BOTH_STAND1,//WP_STUN_BATON,
00273         BOTH_STAND1,//WP_MELEE,
00274         BOTH_STAND2,//WP_SABER,
00275         BOTH_STAND1,//WP_BRYAR_PISTOL,
00276         BOTH_STAND1,//WP_BLASTER,
00277         BOTH_STAND1,//TORSO_WEAPONREADY4,//WP_DISRUPTOR,
00278         BOTH_STAND1,//TORSO_WEAPONREADY5,//WP_BOWCASTER,
00279         BOTH_STAND1,//TORSO_WEAPONREADY6,//WP_REPEATER,
00280         BOTH_STAND1,//TORSO_WEAPONREADY7,//WP_DEMP2,
00281         BOTH_STAND1,//TORSO_WEAPONREADY8,//WP_FLECHETTE,
00282         BOTH_STAND1,//TORSO_WEAPONREADY9,//WP_ROCKET_LAUNCHER,
00283         BOTH_STAND1,//WP_THERMAL,
00284         BOTH_STAND1,//TORSO_WEAPONREADY11,//WP_TRIP_MINE,
00285         BOTH_STAND1,//TORSO_WEAPONREADY12,//WP_DET_PACK,
00286         BOTH_STAND1,//WP_CONCUSSION
00287         BOTH_STAND1,//WP_BRYAR_OLD,
00288 
00289         //NOT VALID (e.g. should never really be used):
00290         BOTH_STAND1,//WP_EMPLACED_GUN,
00291         BOTH_STAND1//WP_TURRET,
00292 };
00293 
00294 int WeaponAttackAnim[WP_NUM_WEAPONS] =
00295 {
00296         BOTH_ATTACK1,//WP_NONE, //(shouldn't happen)
00297 
00298         BOTH_ATTACK3,//WP_STUN_BATON,
00299         BOTH_ATTACK3,//WP_MELEE,
00300         BOTH_STAND2,//WP_SABER, //(has its own handling)
00301         BOTH_ATTACK2,//WP_BRYAR_PISTOL,
00302         BOTH_ATTACK3,//WP_BLASTER,
00303         BOTH_ATTACK3,//BOTH_ATTACK4,//WP_DISRUPTOR,
00304         BOTH_ATTACK3,//BOTH_ATTACK5,//WP_BOWCASTER,
00305         BOTH_ATTACK3,//BOTH_ATTACK6,//WP_REPEATER,
00306         BOTH_ATTACK3,//BOTH_ATTACK7,//WP_DEMP2,
00307         BOTH_ATTACK3,//BOTH_ATTACK8,//WP_FLECHETTE,
00308         BOTH_ATTACK3,//BOTH_ATTACK9,//WP_ROCKET_LAUNCHER,
00309         BOTH_THERMAL_THROW,//WP_THERMAL,
00310         BOTH_ATTACK3,//BOTH_ATTACK11,//WP_TRIP_MINE,
00311         BOTH_ATTACK3,//BOTH_ATTACK12,//WP_DET_PACK,
00312         BOTH_ATTACK2,//WP_BRYAR_OLD,
00313 
00314         //NOT VALID (e.g. should never really be used):
00315         BOTH_STAND1,//WP_EMPLACED_GUN,
00316         BOTH_ATTACK1//WP_TURRET,
00317 };
00318 
00319 qboolean BG_FileExists(const char *fileName)
00320 {
00321         if (fileName && fileName[0])
00322         {
00323                 int fh = 0;
00324                 trap_FS_FOpenFile(fileName, &fh, FS_READ);
00325                 if (fh > 0)
00326                 {
00327                         trap_FS_FCloseFile(fh);
00328                         return qtrue;
00329                 }
00330         }
00331 
00332         return qfalse;
00333 }
00334 
00335 #ifndef UI_EXPORTS //don't need this stuff in the ui
00336 
00337 // Following functions don't need to be in namespace, they're already
00338 // different per-module
00339 #include "../namespace_end.h"
00340 
00341 #ifdef QAGAME
00342 char *G_NewString( const char *string );
00343 #else
00344 char *CG_NewString( const char *string );
00345 #endif
00346 
00347 #include "../namespace_begin.h"
00348 
00349 /*
00350 ===============
00351 BG_ParseField
00352 
00353 Takes a key/value pair and sets the binary values
00354 in a gentity/centity/whatever the hell you want
00355 ===============
00356 */
00357 
00358 void BG_ParseField( BG_field_t *l_fields, const char *key, const char *value, byte *ent )
00359 {
00360         BG_field_t      *f;
00361         byte    *b;
00362         float   v;
00363         vec3_t  vec;
00364 
00365         for ( f=l_fields ; f->name ; f++ ) {
00366                 if ( !Q_stricmp(f->name, key) ) {
00367                         // found it
00368                         b = (byte *)ent;
00369 
00370                         switch( f->type ) {
00371                         case F_LSTRING:
00372 #ifdef QAGAME
00373                                 *(char **)(b+f->ofs) = G_NewString (value);
00374 #else
00375                                 *(char **)(b+f->ofs) = CG_NewString (value);
00376 #endif
00377                                 break;
00378                         case F_VECTOR:
00379                                 sscanf (value, "%f %f %f", &vec[0], &vec[1], &vec[2]);
00380                                 ((float *)(b+f->ofs))[0] = vec[0];
00381                                 ((float *)(b+f->ofs))[1] = vec[1];
00382                                 ((float *)(b+f->ofs))[2] = vec[2];
00383                                 break;
00384                         case F_INT:
00385                                 *(int *)(b+f->ofs) = atoi(value);
00386                                 break;
00387                         case F_FLOAT:
00388                                 *(float *)(b+f->ofs) = atof(value);
00389                                 break;
00390                         case F_ANGLEHACK:
00391                                 v = atof(value);
00392                                 ((float *)(b+f->ofs))[0] = 0;
00393                                 ((float *)(b+f->ofs))[1] = v;
00394                                 ((float *)(b+f->ofs))[2] = 0;
00395                                 break;
00396 #ifdef QAGAME
00397                         case F_PARM1:
00398                         case F_PARM2:
00399                         case F_PARM3:
00400                         case F_PARM4:
00401                         case F_PARM5:
00402                         case F_PARM6:
00403                         case F_PARM7:
00404                         case F_PARM8:
00405                         case F_PARM9:
00406                         case F_PARM10:
00407                         case F_PARM11:
00408                         case F_PARM12:
00409                         case F_PARM13:
00410                         case F_PARM14:
00411                         case F_PARM15:
00412                         case F_PARM16:
00413                                 Q3_SetParm( ((gentity_t *)(ent))->s.number, (f->type - F_PARM1), (char *) value );
00414                                 break;
00415 #endif
00416                         default:
00417                         case F_IGNORE:
00418                                 break;
00419                         }
00420                         return;
00421                 }
00422         }
00423 }
00424 
00425 #endif
00426 
00427 /*
00428 ================
00429 BG_LegalizedForcePowers
00430 
00431 The magical function to end all functions.
00432 This will take the force power string in powerOut and parse through it, then legalize
00433 it based on the supposed rank and spit it into powerOut, returning true if it was legal
00434 to begin with and false if not.
00435 fpDisabled is actually only expected (needed) from the server, because the ui disables
00436 force power selection anyway when force powers are disabled on the server.
00437 ================
00438 */
00439 qboolean BG_LegalizedForcePowers(char *powerOut, int maxRank, qboolean freeSaber, int teamForce, int gametype, int fpDisabled)
00440 {
00441         char powerBuf[128];
00442         char readBuf[128];
00443         qboolean maintainsValidity = qtrue;
00444         int powerLen = strlen(powerOut);
00445         int i = 0;
00446         int c = 0;
00447         int allowedPoints = 0;
00448         int usedPoints = 0;
00449         int countDown = 0;
00450         
00451         int final_Side;
00452         int final_Powers[NUM_FORCE_POWERS];
00453 
00454         if (powerLen >= 128)
00455         { //This should not happen. If it does, this is obviously a bogus string.
00456                 //They can have this string. Because I said so.
00457                 strcpy(powerBuf, "7-1-032330000000001333");
00458                 maintainsValidity = qfalse;
00459         }
00460         else
00461         {
00462                 strcpy(powerBuf, powerOut); //copy it as the original
00463         }
00464 
00465         //first of all, print the max rank into the string as the rank
00466         strcpy(powerOut, va("%i-", maxRank));
00467 
00468         while (i < 128 && powerBuf[i] && powerBuf[i] != '-')
00469         {
00470                 i++;
00471         }
00472         i++;
00473         while (i < 128 && powerBuf[i] && powerBuf[i] != '-')
00474         {
00475                 readBuf[c] = powerBuf[i];
00476                 c++;
00477                 i++;
00478         }
00479         readBuf[c] = 0;
00480         i++;
00481         //at this point, readBuf contains the intended side
00482         final_Side = atoi(readBuf);
00483 
00484         if (final_Side != FORCE_LIGHTSIDE &&
00485                 final_Side != FORCE_DARKSIDE)
00486         { //Not a valid side. You will be dark. Because I said so. (this is something that should never actually happen unless you purposely feed in an invalid config)
00487                 final_Side = FORCE_DARKSIDE;
00488                 maintainsValidity = qfalse;
00489         }
00490 
00491         if (teamForce)
00492         { //If we are under force-aligned teams, make sure we're on the right side.
00493                 if (final_Side != teamForce)
00494                 {
00495                         final_Side = teamForce;
00496                         //maintainsValidity = qfalse;
00497                         //Not doing this, for now. Let them join the team with their filtered powers.
00498                 }
00499         }
00500 
00501         //Now we have established a valid rank, and a valid side.
00502         //Read the force powers in, and cut them down based on the various rules supplied.
00503         c = 0;
00504         while (i < 128 && powerBuf[i] && powerBuf[i] != '\n' && c < NUM_FORCE_POWERS)
00505         {
00506                 readBuf[0] = powerBuf[i];
00507                 readBuf[1] = 0;
00508                 final_Powers[c] = atoi(readBuf);
00509                 c++;
00510                 i++;
00511         }
00512 
00513         //final_Powers now contains all the stuff from the string
00514         //Set the maximum allowed points used based on the max rank level, and count the points actually used.
00515         allowedPoints = forceMasteryPoints[maxRank];
00516 
00517         i = 0;
00518         while (i < NUM_FORCE_POWERS)
00519         { //if this power doesn't match the side we're on, then 0 it now.
00520                 if (final_Powers[i] &&
00521                         forcePowerDarkLight[i] &&
00522                         forcePowerDarkLight[i] != final_Side)
00523                 {
00524                         final_Powers[i] = 0;
00525                         //This is only likely to happen with g_forceBasedTeams. Let it slide.
00526                 }
00527 
00528                 if ( final_Powers[i] &&
00529                         (fpDisabled & (1 << i)) )
00530                 { //if this power is disabled on the server via said server option, then we don't get it.
00531                         final_Powers[i] = 0;
00532                 }
00533 
00534                 i++;
00535         }
00536 
00537         if (gametype < GT_TEAM)
00538         { //don't bother with team powers then
00539                 final_Powers[FP_TEAM_HEAL] = 0;
00540                 final_Powers[FP_TEAM_FORCE] = 0;
00541         }
00542 
00543         usedPoints = 0;
00544         i = 0;
00545         while (i < NUM_FORCE_POWERS)
00546         {
00547                 countDown = 0;
00548 
00549                 countDown = final_Powers[i];
00550 
00551                 while (countDown > 0)
00552                 {
00553                         usedPoints += bgForcePowerCost[i][countDown]; //[fp index][fp level]
00554                         //if this is jump, or we have a free saber and it's offense or defense, take the level back down on level 1
00555                         if ( countDown == 1 &&
00556                                 ((i == FP_LEVITATION) ||
00557                                  (i == FP_SABER_OFFENSE && freeSaber) ||
00558                                  (i == FP_SABER_DEFENSE && freeSaber)) )
00559                         {
00560                                 usedPoints -= bgForcePowerCost[i][countDown];
00561                         }
00562                         countDown--;
00563                 }
00564 
00565                 i++;
00566         }
00567 
00568         if (usedPoints > allowedPoints)
00569         { //Time to do the fancy stuff. (meaning, slowly cut parts off while taking a guess at what is most or least important in the config)
00570                 int attemptedCycles = 0;
00571                 int powerCycle = 2;
00572                 int minPow = 0;
00573                 
00574                 if (freeSaber)
00575                 {
00576                         minPow = 1;
00577                 }
00578 
00579                 maintainsValidity = qfalse;
00580 
00581                 while (usedPoints > allowedPoints)
00582                 {
00583                         c = 0;
00584 
00585                         while (c < NUM_FORCE_POWERS && usedPoints > allowedPoints)
00586                         {
00587                                 if (final_Powers[c] && final_Powers[c] < powerCycle)
00588                                 { //kill in order of lowest powers, because the higher powers are probably more important
00589                                         if (c == FP_SABER_OFFENSE &&
00590                                                 (final_Powers[FP_SABER_DEFENSE] > minPow || final_Powers[FP_SABERTHROW] > 0))
00591                                         { //if we're on saber attack, only suck it down if we have no def or throw either
00592                                                 int whichOne = FP_SABERTHROW; //first try throw
00593 
00594                                                 if (!final_Powers[whichOne])
00595                                                 {
00596                                                         whichOne = FP_SABER_DEFENSE; //if no throw, drain defense
00597                                                 }
00598 
00599                                                 while (final_Powers[whichOne] > 0 && usedPoints > allowedPoints)
00600                                                 {
00601                                                         if ( final_Powers[whichOne] > 1 ||
00602                                                                 ( (whichOne != FP_SABER_OFFENSE || !freeSaber) &&
00603                                                                   (whichOne != FP_SABER_DEFENSE || !freeSaber) ) )
00604                                                         { //don't take attack or defend down on level 1 still, if it's free
00605                                                                 usedPoints -= bgForcePowerCost[whichOne][final_Powers[whichOne]];
00606                                                                 final_Powers[whichOne]--;
00607                                                         }
00608                                                         else
00609                                                         {
00610                                                                 break;
00611                                                         }
00612                                                 }
00613                                         }
00614                                         else
00615                                         {
00616                                                 while (final_Powers[c] > 0 && usedPoints > allowedPoints)
00617                                                 {
00618                                                         if ( final_Powers[c] > 1 ||
00619                                                                 ((c != FP_LEVITATION) &&
00620                                                                 (c != FP_SABER_OFFENSE || !freeSaber) &&
00621                                                                 (c != FP_SABER_DEFENSE || !freeSaber)) )
00622                                                         {
00623                                                                 usedPoints -= bgForcePowerCost[c][final_Powers[c]];
00624                                                                 final_Powers[c]--;
00625                                                         }
00626                                                         else
00627                                                         {
00628                                                                 break;
00629                                                         }
00630                                                 }
00631                                         }
00632                                 }
00633 
00634                                 c++;
00635                         }
00636 
00637                         powerCycle++;
00638                         attemptedCycles++;
00639 
00640                         if (attemptedCycles > NUM_FORCE_POWERS)
00641                         { //I think this should be impossible. But just in case.
00642                                 break;
00643                         }
00644                 }
00645 
00646                 if (usedPoints > allowedPoints)
00647                 { //Still? Fine then.. we will kill all of your powers, except the freebies.
00648                         i = 0;
00649 
00650                         while (i < NUM_FORCE_POWERS)
00651                         {
00652                                 final_Powers[i] = 0;
00653                                 if (i == FP_LEVITATION ||
00654                                         (i == FP_SABER_OFFENSE && freeSaber) ||
00655                                         (i == FP_SABER_DEFENSE && freeSaber))
00656                                 {
00657                                         final_Powers[i] = 1;
00658                                 }
00659                                 i++;
00660                         }
00661                         usedPoints = 0;
00662                 }
00663         }
00664 
00665         if (freeSaber)
00666         {
00667                 if (final_Powers[FP_SABER_OFFENSE] < 1)
00668                 {
00669                         final_Powers[FP_SABER_OFFENSE] = 1;
00670                 }
00671                 if (final_Powers[FP_SABER_DEFENSE] < 1)
00672                 {
00673                         final_Powers[FP_SABER_DEFENSE] = 1;
00674                 }
00675         }
00676         if (final_Powers[FP_LEVITATION] < 1)
00677         {
00678                 final_Powers[FP_LEVITATION] = 1;
00679         }
00680 
00681         i = 0;
00682         while (i < NUM_FORCE_POWERS)
00683         {
00684                 if (final_Powers[i] > FORCE_LEVEL_3)
00685                 {
00686                         final_Powers[i] = FORCE_LEVEL_3;
00687                 }
00688                 i++;
00689         }
00690 
00691         if (fpDisabled)
00692         { //If we specifically have attack or def disabled, force them up to level 3. It's the way
00693           //things work for the case of all powers disabled.
00694           //If jump is disabled, down-cap it to level 1. Otherwise don't do a thing.
00695                 if (fpDisabled & (1 << FP_LEVITATION))
00696                 {
00697                         final_Powers[FP_LEVITATION] = 1;
00698                 }
00699                 if (fpDisabled & (1 << FP_SABER_OFFENSE))
00700                 {
00701                         final_Powers[FP_SABER_OFFENSE] = 3;
00702                 }
00703                 if (fpDisabled & (1 << FP_SABER_DEFENSE))
00704                 {
00705                         final_Powers[FP_SABER_DEFENSE] = 3;
00706                 }
00707         }
00708 
00709         if (final_Powers[FP_SABER_OFFENSE] < 1)
00710         {
00711                 final_Powers[FP_SABER_DEFENSE] = 0;
00712                 final_Powers[FP_SABERTHROW] = 0;
00713         }
00714 
00715         //We finally have all the force powers legalized and stored locally.
00716         //Put them all into the string and return the result. We already have
00717         //the rank there, so print the side and the powers now.
00718         Q_strcat(powerOut, 128, va("%i-", final_Side));
00719 
00720         i = strlen(powerOut);
00721         c = 0;
00722         while (c < NUM_FORCE_POWERS)
00723         {
00724                 strcpy(readBuf, va("%i", final_Powers[c]));
00725                 powerOut[i] = readBuf[0];
00726                 c++;
00727                 i++;
00728         }
00729         powerOut[i] = 0;
00730 
00731         return maintainsValidity;
00732 }
00733 
00734 #ifdef __LCC__
00735 // given a boltmatrix, return in vec a normalised vector for the axis requested in flags
00736 void BG_GiveMeVectorFromMatrix(mdxaBone_t *boltMatrix, int flags, vec3_t vec)
00737 {
00738         switch (flags)
00739         {
00740         case ORIGIN:
00741                 vec[0] = boltMatrix->matrix[0][3];
00742                 vec[1] = boltMatrix->matrix[1][3];
00743                 vec[2] = boltMatrix->matrix[2][3];
00744                 break;
00745         case POSITIVE_Y:
00746                 vec[0] = boltMatrix->matrix[0][1];
00747                 vec[1] = boltMatrix->matrix[1][1];
00748                 vec[2] = boltMatrix->matrix[2][1];
00749                 break;
00750         case POSITIVE_X:
00751                 vec[0] = boltMatrix->matrix[0][0];
00752                 vec[1] = boltMatrix->matrix[1][0];
00753                 vec[2] = boltMatrix->matrix[2][0];
00754                 break;
00755         case POSITIVE_Z:
00756                 vec[0] = boltMatrix->matrix[0][2];
00757                 vec[1] = boltMatrix->matrix[1][2];
00758                 vec[2] = boltMatrix->matrix[2][2];
00759                 break;
00760         case NEGATIVE_Y:
00761                 vec[0] = -boltMatrix->matrix[0][1];
00762                 vec[1] = -boltMatrix->matrix[1][1];
00763                 vec[2] = -boltMatrix->matrix[2][1];
00764                 break;
00765         case NEGATIVE_X:
00766                 vec[0] = -boltMatrix->matrix[0][0];
00767                 vec[1] = -boltMatrix->matrix[1][0];
00768                 vec[2] = -boltMatrix->matrix[2][0];
00769                 break;
00770         case NEGATIVE_Z:
00771                 vec[0] = -boltMatrix->matrix[0][2];
00772                 vec[1] = -boltMatrix->matrix[1][2];
00773                 vec[2] = -boltMatrix->matrix[2][2];
00774                 break;
00775         }
00776 }
00777 #endif
00778 
00779 /*QUAKED item_***** ( 0 0 0 ) (-16 -16 -16) (16 16 16) suspended
00780 DO NOT USE THIS CLASS, IT JUST HOLDS GENERAL INFORMATION.
00781 The suspended flag will allow items to hang in the air, otherwise they are dropped to the next surface.
00782 
00783 If an item is the target of another entity, it will not spawn in until fired.
00784 
00785 An item fires all of its targets when it is picked up.  If the toucher can't carry it, the targets won't be fired.
00786 
00787 "notfree" if set to 1, don't spawn in free for all games
00788 "notteam" if set to 1, don't spawn in team games
00789 "notsingle" if set to 1, don't spawn in single player games
00790 "wait"  override the default wait before respawning.  -1 = never respawn automatically, which can be used with targeted spawning.
00791 "random" random number of plus or minus seconds varied from the respawn time
00792 "count" override quantity or duration on most items.
00793 */
00794 
00795 gitem_t bg_itemlist[] = 
00796 {
00797         {
00798                 NULL,                           // classname    
00799                 NULL,                           // pickup_sound
00800                 {       NULL,                   // world_model[0]
00801                         NULL,                   // world_model[1]
00802                         0, 0} ,                 // world_model[2],[3]
00803                 NULL,                           // view_model
00804 /* icon */              NULL,           // icon
00805 /* pickup */    //NULL,         // pickup_name
00806                 0,                                      // quantity
00807                 0,                                      // giType (IT_*)
00808                 0,                                      // giTag
00809 /* precache */ "",                      // precaches
00810 /* sounds */ "",                        // sounds
00811                 ""                                      // description
00812         },      // leave index 0 alone
00813 
00814         //
00815         // Pickups
00816         //
00817 
00818 /*QUAKED item_shield_sm_instant (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
00819 Instant shield pickup, restores 25
00820 */
00821         {
00822                 "item_shield_sm_instant", 
00823                 "sound/player/pickupshield.wav",
00824         { "models/map_objects/mp/psd_sm.md3",
00825                 0, 0, 0},
00826 /* view */              NULL,                   
00827 /* icon */              "gfx/mp/small_shield",
00828 /* pickup *///  "Shield Small",
00829                 25,
00830                 IT_ARMOR,
00831                 1, //special for shield - max on pickup is maxhealth*tag, thus small shield goes up to 100 shield
00832 /* precache */ "",
00833 /* sounds */ ""
00834                 ""                                      // description
00835         },
00836 
00837 /*QUAKED item_shield_lrg_instant (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
00838 Instant shield pickup, restores 100
00839 */
00840         {
00841                 "item_shield_lrg_instant", 
00842                 "sound/player/pickupshield.wav",
00843         { "models/map_objects/mp/psd.md3",
00844                 0, 0, 0},
00845 /* view */              NULL,                   
00846 /* icon */              "gfx/mp/large_shield",
00847 /* pickup *///  "Shield Large",
00848                 100,
00849                 IT_ARMOR,
00850                 2, //special for shield - max on pickup is maxhealth*tag, thus large shield goes up to 200 shield
00851 /* precache */ "",
00852 /* sounds */ "",
00853                 ""                                      // description
00854         },
00855 
00856 /*QUAKED item_medpak_instant (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
00857 Instant medpack pickup, heals 25
00858 */
00859         {
00860                 "item_medpak_instant",
00861                 "sound/player/pickuphealth.wav",
00862         { "models/map_objects/mp/medpac.md3", 
00863                 0, 0, 0 },
00864 /* view */              NULL,                   
00865 /* icon */              "gfx/hud/i_icon_medkit",
00866 /* pickup *///  "Medpack",
00867                 25,
00868                 IT_HEALTH,
00869                 0,
00870 /* precache */ "",
00871 /* sounds */ "",
00872                 ""                                      // description
00873         },
00874 
00875 
00876         //
00877         // ITEMS
00878         //
00879 
00880 /*QUAKED item_seeker (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
00881 30 seconds of seeker drone
00882 */
00883         {
00884                 "item_seeker", 
00885                 "sound/weapons/w_pkup.wav",
00886                 { "models/items/remote.md3", 
00887                 0, 0, 0} ,
00888 /* view */              NULL,                   
00889 /* icon */              "gfx/hud/i_icon_seeker",
00890 /* pickup *///  "Seeker Drone",
00891                 120,
00892                 IT_HOLDABLE,
00893                 HI_SEEKER,
00894 /* precache */ "",
00895 /* sounds */ "",
00896                 "@MENUS_AN_ATTACK_DRONE_SIMILAR"                                        // description
00897         },
00898 
00899 /*QUAKED item_shield (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
00900 Portable shield
00901 */
00902         {
00903                 "item_shield", 
00904                 "sound/weapons/w_pkup.wav",
00905                 { "models/map_objects/mp/shield.md3", 
00906                 0, 0, 0} ,
00907 /* view */              NULL,                   
00908 /* icon */              "gfx/hud/i_icon_shieldwall",
00909 /* pickup *///  "Forcefield",
00910                 120,
00911                 IT_HOLDABLE,
00912                 HI_SHIELD,
00913 /* precache */ "",
00914 /* sounds */ "sound/weapons/detpack/stick.wav sound/movers/doors/forcefield_on.wav sound/movers/doors/forcefield_off.wav sound/movers/doors/forcefield_lp.wav sound/effects/bumpfield.wav",
00915                 "@MENUS_THIS_STATIONARY_ENERGY"                                 // description
00916         },
00917 
00918 /*QUAKED item_medpac (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
00919 Bacta canister pickup, heals 25 on use
00920 */
00921         {
00922                 "item_medpac",  //should be item_bacta
00923                 "sound/weapons/w_pkup.wav",
00924                 { "models/map_objects/mp/bacta.md3", 
00925                 0, 0, 0} ,
00926 /* view */              NULL,                   
00927 /* icon */              "gfx/hud/i_icon_bacta",
00928 /* pickup *///  "Bacta Canister",
00929                 25,
00930                 IT_HOLDABLE,
00931                 HI_MEDPAC,
00932 /* precache */ "",
00933 /* sounds */ "",
00934                 "@SP_INGAME_BACTA_DESC"                                 // description
00935         },
00936 
00937 /*QUAKED item_medpac_big (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
00938 Big bacta canister pickup, heals 50 on use
00939 */
00940         {
00941                 "item_medpac_big",      //should be item_bacta
00942                 "sound/weapons/w_pkup.wav",
00943                 { "models/items/big_bacta.md3", 
00944                 0, 0, 0} ,
00945 /* view */              NULL,                   
00946 /* icon */              "gfx/hud/i_icon_big_bacta",
00947 /* pickup *///  "Bacta Canister",
00948                 25,
00949                 IT_HOLDABLE,
00950                 HI_MEDPAC_BIG,
00951 /* precache */ "",
00952 /* sounds */ "",
00953                 "@SP_INGAME_BACTA_DESC"                                 // description
00954         },
00955 
00956 /*QUAKED item_binoculars (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
00957 These will be standard equipment on the player - DO NOT PLACE
00958 */
00959         {
00960                 "item_binoculars", 
00961                 "sound/weapons/w_pkup.wav",
00962                 { "models/items/binoculars.md3", 
00963                 0, 0, 0} ,
00964 /* view */              NULL,                   
00965 /* icon */              "gfx/hud/i_icon_zoom",
00966 /* pickup *///  "Binoculars",
00967                 60,
00968                 IT_HOLDABLE,
00969                 HI_BINOCULARS,
00970 /* precache */ "",
00971 /* sounds */ "",
00972                 "@SP_INGAME_LA_GOGGLES_DESC"                                    // description
00973         },
00974 
00975 /*QUAKED item_sentry_gun (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
00976 Sentry gun inventory pickup.
00977 */
00978         {
00979                 "item_sentry_gun", 
00980                 "sound/weapons/w_pkup.wav",
00981                 { "models/items/psgun.glm", 
00982                 0, 0, 0} ,
00983 /* view */              NULL,                   
00984 /* icon */              "gfx/hud/i_icon_sentrygun",
00985 /* pickup *///  "Sentry Gun",
00986                 120,
00987                 IT_HOLDABLE,
00988                 HI_SENTRY_GUN,
00989 /* precache */ "",
00990 /* sounds */ "",
00991                 "@MENUS_THIS_DEADLY_WEAPON_IS"                                  // description
00992         },
00993 
00994 /*QUAKED item_jetpack (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
00995 Do not place.
00996 */
00997         {
00998                 "item_jetpack", 
00999                 "sound/weapons/w_pkup.wav",
01000                 { "models/items/psgun.glm", //FIXME: no model
01001                 0, 0, 0} ,
01002 /* view */              NULL,                   
01003 /* icon */              "gfx/hud/i_icon_jetpack",
01004 /* pickup *///  "Sentry Gun",
01005                 120,
01006                 IT_HOLDABLE,
01007                 HI_JETPACK,
01008 /* precache */ "effects/boba/jet.efx",
01009 /* sounds */ "sound/chars/boba/JETON.wav sound/chars/boba/JETHOVER.wav sound/effects/fire_lp.wav",
01010                 "@MENUS_JETPACK_DESC"                                   // description
01011         },
01012 
01013 /*QUAKED item_healthdisp (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
01014 Do not place. For siege classes ONLY.
01015 */
01016         {
01017                 "item_healthdisp", 
01018                 "sound/weapons/w_pkup.wav",
01019                 { "models/map_objects/mp/bacta.md3", //replace me
01020                 0, 0, 0} ,
01021 /* view */              NULL,                   
01022 /* icon */              "gfx/hud/i_icon_healthdisp",
01023 /* pickup *///  "Sentry Gun",
01024                 120,
01025                 IT_HOLDABLE,
01026                 HI_HEALTHDISP,
01027 /* precache */ "",
01028 /* sounds */ "",
01029                 ""                                      // description
01030         },
01031 
01032 /*QUAKED item_ammodisp (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
01033 Do not place. For siege classes ONLY.
01034 */
01035         {
01036                 "item_ammodisp", 
01037                 "sound/weapons/w_pkup.wav",
01038                 { "models/map_objects/mp/bacta.md3", //replace me
01039                 0, 0, 0} ,
01040 /* view */              NULL,                   
01041 /* icon */              "gfx/hud/i_icon_ammodisp",
01042 /* pickup *///  "Sentry Gun",
01043                 120,
01044                 IT_HOLDABLE,
01045                 HI_AMMODISP,
01046 /* precache */ "",
01047 /* sounds */ "",
01048                 ""                                      // description
01049         },
01050 
01051 /*QUAKED item_eweb_holdable (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
01052 Do not place. For siege classes ONLY.
01053 */
01054         {
01055                 "item_eweb_holdable", 
01056                 "sound/interface/shieldcon_empty",
01057                 { "models/map_objects/hoth/eweb_model.glm",
01058                 0, 0, 0} ,
01059 /* view */              NULL,                   
01060 /* icon */              "gfx/hud/i_icon_eweb",
01061 /* pickup *///  "Sentry Gun",
01062                 120,
01063                 IT_HOLDABLE,
01064                 HI_EWEB,
01065 /* precache */ "",
01066 /* sounds */ "",
01067                 "@MENUS_EWEB_DESC"                                      // description
01068         },
01069 
01070 /*QUAKED item_seeker (.3 .3 1) (-8 -8 -0) (8 8 16) suspended
01071 30 seconds of seeker drone
01072 */
01073         {
01074                 "item_cloak", 
01075                 "sound/weapons/w_pkup.wav",
01076                 { "models/items/psgun.glm", //FIXME: no model
01077                 0, 0, 0} ,
01078 /* view */              NULL,                   
01079 /* icon */              "gfx/hud/i_icon_cloak",
01080 /* pickup *///  "Seeker Drone",
01081                 120,
01082                 IT_HOLDABLE,
01083                 HI_CLOAK,
01084 /* precache */ "",
01085 /* sounds */ "",
01086                 "@MENUS_CLOAK_DESC"                                     // description
01087         },
01088 
01089 /*QUAKED item_force_enlighten_light (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01090 Adds one rank to all Force powers temporarily. Only light jedi can use.
01091 */
01092         {
01093                 "item_force_enlighten_light",
01094                 "sound/player/enlightenment.wav",
01095                 { "models/map_objects/mp/jedi_enlightenment.md3", 
01096                 0, 0, 0} ,
01097 /* view */              NULL,                   
01098 /* icon */              "gfx/hud/mpi_jlight",
01099 /* pickup *///  "Light Force Enlightenment",
01100                 25,
01101                 IT_POWERUP,
01102                 PW_FORCE_ENLIGHTENED_LIGHT,
01103 /* precache */ "",
01104 /* sounds */ "",
01105                 ""                                      // description
01106         },
01107 
01108 /*QUAKED item_force_enlighten_dark (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01109 Adds one rank to all Force powers temporarily. Only dark jedi can use.
01110 */
01111         {
01112                 "item_force_enlighten_dark",
01113                 "sound/player/enlightenment.wav",
01114                 { "models/map_objects/mp/dk_enlightenment.md3", 
01115                 0, 0, 0} ,
01116 /* view */              NULL,                   
01117 /* icon */              "gfx/hud/mpi_dklight",
01118 /* pickup *///  "Dark Force Enlightenment",
01119                 25,
01120                 IT_POWERUP,
01121                 PW_FORCE_ENLIGHTENED_DARK,
01122 /* precache */ "",
01123 /* sounds */ "",
01124                 ""                                      // description
01125         },
01126 
01127 /*QUAKED item_force_boon (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01128 Unlimited Force Pool for a short time.
01129 */
01130         {
01131                 "item_force_boon",
01132                 "sound/player/boon.wav",
01133                 { "models/map_objects/mp/force_boon.md3", 
01134                 0, 0, 0} ,
01135 /* view */              NULL,                   
01136 /* icon */              "gfx/hud/mpi_fboon",
01137 /* pickup *///  "Force Boon",
01138                 25,
01139                 IT_POWERUP,
01140                 PW_FORCE_BOON,
01141 /* precache */ "",
01142 /* sounds */ "",
01143                 ""                                      // description
01144         },
01145 
01146 /*QUAKED item_ysalimari (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01147 A small lizard carried on the player, which prevents the possessor from using any Force power.  However, he is unaffected by any Force power.
01148 */
01149         {
01150                 "item_ysalimari",
01151                 "sound/player/ysalimari.wav",
01152                 { "models/map_objects/mp/ysalimari.md3", 
01153                 0, 0, 0} ,
01154 /* view */              NULL,                   
01155 /* icon */              "gfx/hud/mpi_ysamari",
01156 /* pickup *///  "Ysalamiri",
01157                 25,
01158                 IT_POWERUP,
01159                 PW_YSALAMIRI,
01160 /* precache */ "",
01161 /* sounds */ "",
01162                 ""                                      // description
01163         },
01164 
01165         //
01166         // WEAPONS 
01167         //
01168 
01169 /*QUAKED weapon_stun_baton (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01170 Don't place this
01171 */
01172         {
01173                 "weapon_stun_baton", 
01174                 "sound/weapons/w_pkup.wav",
01175         { "models/weapons2/stun_baton/baton_w.glm", 
01176                 0, 0, 0},
01177 /* view */              "models/weapons2/stun_baton/baton.md3", 
01178 /* icon */              "gfx/hud/w_icon_stunbaton",
01179 /* pickup *///  "Stun Baton",
01180                 100,
01181                 IT_WEAPON,
01182                 WP_STUN_BATON,
01183 /* precache */ "",
01184 /* sounds */ "",
01185                 ""                                      // description
01186         },
01187 
01188 /*QUAKED weapon_melee (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01189 Don't place this
01190 */
01191         {
01192                 "weapon_melee", 
01193                 "sound/weapons/w_pkup.wav",
01194         { "models/weapons2/stun_baton/baton_w.glm", 
01195                 0, 0, 0},
01196 /* view */              "models/weapons2/stun_baton/baton.md3", 
01197 /* icon */              "gfx/hud/w_icon_melee",
01198 /* pickup *///  "Stun Baton",
01199                 100,
01200                 IT_WEAPON,
01201                 WP_MELEE,
01202 /* precache */ "",
01203 /* sounds */ "",
01204                 "@MENUS_MELEE_DESC"                                     // description
01205         },
01206 
01207 /*QUAKED weapon_saber (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01208 Don't place this
01209 */
01210         {
01211                 "weapon_saber", 
01212                 "sound/weapons/w_pkup.wav",
01213         { "models/weapons2/saber/saber_w.glm",
01214                 0, 0, 0},
01215 /* view */              "models/weapons2/saber/saber_w.md3",
01216 /* icon */              "gfx/hud/w_icon_lightsaber",
01217 /* pickup *///  "Lightsaber",
01218                 100,
01219                 IT_WEAPON,
01220                 WP_SABER,
01221 /* precache */ "",
01222 /* sounds */ "",
01223                 "@MENUS_AN_ELEGANT_WEAPON_FOR"                          // description
01224         },
01225 
01226 /*QUAKED weapon_bryar_pistol (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01227 Don't place this
01228 */
01229         {
01230                 //"weapon_bryar_pistol", 
01231                 "weapon_blaster_pistol", 
01232                 "sound/weapons/w_pkup.wav",
01233         { "models/weapons2/blaster_pistol/blaster_pistol_w.glm",//"models/weapons2/briar_pistol/briar_pistol_w.glm", 
01234                 0, 0, 0},
01235 /* view */              "models/weapons2/blaster_pistol/blaster_pistol.md3",//"models/weapons2/briar_pistol/briar_pistol.md3", 
01236 /* icon */              "gfx/hud/w_icon_blaster_pistol",//"gfx/hud/w_icon_rifle",
01237 /* pickup *///  "Bryar Pistol",
01238                 100,
01239                 IT_WEAPON,
01240                 WP_BRYAR_PISTOL,
01241 /* precache */ "",
01242 /* sounds */ "",
01243                 "@MENUS_BLASTER_PISTOL_DESC"                                    // description
01244         },
01245 
01246 /*QUAKED weapon_concussion_rifle (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01247 */
01248         {
01249                 "weapon_concussion_rifle", 
01250                 "sound/weapons/w_pkup.wav",
01251         { "models/weapons2/concussion/c_rifle_w.glm", 
01252                 0, 0, 0},
01253 /* view */              "models/weapons2/concussion/c_rifle.md3", 
01254 /* icon */              "gfx/hud/w_icon_c_rifle",//"gfx/hud/w_icon_rifle",
01255 /* pickup *///  "Concussion Rifle",
01256                 50,
01257                 IT_WEAPON,
01258                 WP_CONCUSSION,
01259 /* precache */ "",
01260 /* sounds */ "",
01261                 "@MENUS_CONC_RIFLE_DESC"                                        // description
01262         },
01263 
01264 /*QUAKED weapon_bryar_pistol_old (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01265 Don't place this
01266 */
01267         {
01268                 "weapon_bryar_pistol", 
01269                 "sound/weapons/w_pkup.wav",
01270         { "models/weapons2/briar_pistol/briar_pistol_w.glm", 
01271                 0, 0, 0},
01272 /* view */              "models/weapons2/briar_pistol/briar_pistol.md3", 
01273 /* icon */              "gfx/hud/w_icon_briar",//"gfx/hud/w_icon_rifle",
01274 /* pickup *///  "Bryar Pistol",
01275                 100,
01276                 IT_WEAPON,
01277                 WP_BRYAR_OLD,
01278 /* precache */ "",
01279 /* sounds */ "",
01280                 "@SP_INGAME_BLASTER_PISTOL"                                     // description
01281         },
01282 
01283 /*QUAKED weapon_blaster (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01284 */
01285         {
01286                 "weapon_blaster", 
01287                 "sound/weapons/w_pkup.wav",
01288         { "models/weapons2/blaster_r/blaster_w.glm", 
01289                 0, 0, 0},
01290 /* view */              "models/weapons2/blaster_r/blaster.md3", 
01291 /* icon */              "gfx/hud/w_icon_blaster",
01292 /* pickup *///  "E11 Blaster Rifle",
01293                 100,
01294                 IT_WEAPON,
01295                 WP_BLASTER,
01296 /* precache */ "",
01297 /* sounds */ "",
01298                 "@MENUS_THE_PRIMARY_WEAPON_OF"                          // description
01299         },
01300 
01301 /*QUAKED weapon_disruptor (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01302 */
01303         {
01304                 "weapon_disruptor",
01305                 "sound/weapons/w_pkup.wav",
01306         { "models/weapons2/disruptor/disruptor_w.glm", 
01307                 0, 0, 0},
01308 /* view */              "models/weapons2/disruptor/disruptor.md3", 
01309 /* icon */              "gfx/hud/w_icon_disruptor",
01310 /* pickup *///  "Tenloss Disruptor Rifle",
01311                 100,
01312                 IT_WEAPON,
01313                 WP_DISRUPTOR,
01314 /* precache */ "",
01315 /* sounds */ "",
01316                 "@MENUS_THIS_NEFARIOUS_WEAPON"                                  // description
01317         },
01318 
01319 /*QUAKED weapon_bowcaster (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01320 */
01321         {
01322                 "weapon_bowcaster",
01323                 "sound/weapons/w_pkup.wav",
01324         { "models/weapons2/bowcaster/bowcaster_w.glm", 
01325                 0, 0, 0},
01326 /* view */              "models/weapons2/bowcaster/bowcaster.md3", 
01327 /* icon */              "gfx/hud/w_icon_bowcaster",
01328 /* pickup *///  "Wookiee Bowcaster",
01329                 100,
01330                 IT_WEAPON,
01331                 WP_BOWCASTER,
01332 /* precache */ "",
01333 /* sounds */ "",
01334                 "@MENUS_THIS_ARCHAIC_LOOKING"                                   // description
01335         },
01336 
01337 /*QUAKED weapon_repeater (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01338 */
01339         {
01340                 "weapon_repeater", 
01341                 "sound/weapons/w_pkup.wav",
01342         { "models/weapons2/heavy_repeater/heavy_repeater_w.glm", 
01343                 0, 0, 0},
01344 /* view */              "models/weapons2/heavy_repeater/heavy_repeater.md3", 
01345 /* icon */              "gfx/hud/w_icon_repeater",
01346 /* pickup *///  "Imperial Heavy Repeater",
01347                 100,
01348                 IT_WEAPON,
01349                 WP_REPEATER,
01350 /* precache */ "",
01351 /* sounds */ "",
01352                 "@MENUS_THIS_DESTRUCTIVE_PROJECTILE"                                    // description
01353         },
01354 
01355 /*QUAKED weapon_demp2 (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01356 NOTENOTE This weapon is not yet complete.  Don't place it.
01357 */
01358         {
01359                 "weapon_demp2", 
01360                 "sound/weapons/w_pkup.wav",
01361         { "models/weapons2/demp2/demp2_w.glm", 
01362                 0, 0, 0},
01363 /* view */              "models/weapons2/demp2/demp2.md3", 
01364 /* icon */              "gfx/hud/w_icon_demp2",
01365 /* pickup *///  "DEMP2",
01366                 100,
01367                 IT_WEAPON,
01368                 WP_DEMP2,
01369 /* precache */ "",
01370 /* sounds */ "",
01371                 "@MENUS_COMMONLY_REFERRED_TO"                                   // description
01372         },
01373 
01374 /*QUAKED weapon_flechette (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01375 */
01376         {
01377                 "weapon_flechette", 
01378                 "sound/weapons/w_pkup.wav",
01379         { "models/weapons2/golan_arms/golan_arms_w.glm", 
01380                 0, 0, 0},
01381 /* view */              "models/weapons2/golan_arms/golan_arms.md3", 
01382 /* icon */              "gfx/hud/w_icon_flechette",
01383 /* pickup *///  "Golan Arms Flechette",
01384                 100,
01385                 IT_WEAPON,
01386                 WP_FLECHETTE,
01387 /* precache */ "",
01388 /* sounds */ "",
01389                 "@MENUS_WIDELY_USED_BY_THE_CORPORATE"                                   // description
01390         },
01391 
01392 /*QUAKED weapon_rocket_launcher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01393 */
01394         {
01395                 "weapon_rocket_launcher",
01396                 "sound/weapons/w_pkup.wav",
01397         { "models/weapons2/merr_sonn/merr_sonn_w.glm", 
01398                 0, 0, 0},
01399 /* view */              "models/weapons2/merr_sonn/merr_sonn.md3", 
01400 /* icon */              "gfx/hud/w_icon_merrsonn",
01401 /* pickup *///  "Merr-Sonn Missile System",
01402                 3,
01403                 IT_WEAPON,
01404                 WP_ROCKET_LAUNCHER,
01405 /* precache */ "",
01406 /* sounds */ "",
01407                 "@MENUS_THE_PLX_2M_IS_AN_EXTREMELY"                                     // description
01408         },
01409 
01410 /*QUAKED ammo_thermal (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01411 */
01412         {
01413                 "ammo_thermal",
01414                 "sound/weapons/w_pkup.wav",
01415         { "models/weapons2/thermal/thermal_pu.md3", 
01416                 "models/weapons2/thermal/thermal_w.glm", 0, 0},
01417 /* view */              "models/weapons2/thermal/thermal.md3", 
01418 /* icon */              "gfx/hud/w_icon_thermal",
01419 /* pickup *///  "Thermal Detonators",
01420                 4,
01421                 IT_AMMO,
01422                 AMMO_THERMAL,
01423 /* precache */ "",
01424 /* sounds */ "",
01425                 "@MENUS_THE_THERMAL_DETONATOR"                                  // description
01426         },
01427 
01428 /*QUAKED ammo_tripmine (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01429 */
01430         {
01431                 "ammo_tripmine", 
01432                 "sound/weapons/w_pkup.wav",
01433         { "models/weapons2/laser_trap/laser_trap_pu.md3", 
01434                 "models/weapons2/laser_trap/laser_trap_w.glm", 0, 0},
01435 /* view */              "models/weapons2/laser_trap/laser_trap.md3", 
01436 /* icon */              "gfx/hud/w_icon_tripmine",
01437 /* pickup *///  "Trip Mines",
01438                 3,
01439                 IT_AMMO,
01440                 AMMO_TRIPMINE,
01441 /* precache */ "",
01442 /* sounds */ "",
01443                 "@MENUS_TRIP_MINES_CONSIST_OF"                                  // description
01444         },
01445 
01446 /*QUAKED ammo_detpack (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01447 */
01448         {
01449                 "ammo_detpack", 
01450                 "sound/weapons/w_pkup.wav",
01451         { "models/weapons2/detpack/det_pack_pu.md3", "models/weapons2/detpack/det_pack_proj.glm", "models/weapons2/detpack/det_pack_w.glm", 0},
01452 /* view */              "models/weapons2/detpack/det_pack.md3", 
01453 /* icon */              "gfx/hud/w_icon_detpack",
01454 /* pickup *///  "Det Packs",
01455                 3,
01456                 IT_AMMO,
01457                 AMMO_DETPACK,
01458 /* precache */ "",
01459 /* sounds */ "",
01460                 "@MENUS_A_DETONATION_PACK_IS"                                   // description
01461         },
01462 
01463 /*QUAKED weapon_thermal (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01464 */
01465         {
01466                 "weapon_thermal",
01467                 "sound/weapons/w_pkup.wav",
01468         { "models/weapons2/thermal/thermal_w.glm", "models/weapons2/thermal/thermal_pu.md3",
01469                 0, 0 },
01470 /* view */              "models/weapons2/thermal/thermal.md3", 
01471 /* icon */              "gfx/hud/w_icon_thermal",
01472 /* pickup *///  "Thermal Detonator",
01473                 4,
01474                 IT_WEAPON,
01475                 WP_THERMAL,
01476 /* precache */ "",
01477 /* sounds */ "",
01478                 "@MENUS_THE_THERMAL_DETONATOR"                                  // description
01479         },
01480 
01481 /*QUAKED weapon_trip_mine (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01482 */
01483         {
01484                 "weapon_trip_mine", 
01485                 "sound/weapons/w_pkup.wav",
01486         { "models/weapons2/laser_trap/laser_trap_w.glm", "models/weapons2/laser_trap/laser_trap_pu.md3",
01487                 0, 0},
01488 /* view */              "models/weapons2/laser_trap/laser_trap.md3", 
01489 /* icon */              "gfx/hud/w_icon_tripmine",
01490 /* pickup *///  "Trip Mine",
01491                 3,
01492                 IT_WEAPON,
01493                 WP_TRIP_MINE,
01494 /* precache */ "",
01495 /* sounds */ "",
01496                 "@MENUS_TRIP_MINES_CONSIST_OF"                                  // description
01497         },
01498 
01499 /*QUAKED weapon_det_pack (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01500 */
01501         {
01502                 "weapon_det_pack", 
01503                 "sound/weapons/w_pkup.wav",
01504         { "models/weapons2/detpack/det_pack_proj.glm", "models/weapons2/detpack/det_pack_pu.md3", "models/weapons2/detpack/det_pack_w.glm", 0},
01505 /* view */              "models/weapons2/detpack/det_pack.md3", 
01506 /* icon */              "gfx/hud/w_icon_detpack",
01507 /* pickup *///  "Det Pack",
01508                 3,
01509                 IT_WEAPON,
01510                 WP_DET_PACK,
01511 /* precache */ "",
01512 /* sounds */ "",
01513                 "@MENUS_A_DETONATION_PACK_IS"                                   // description
01514         },
01515 
01516 /*QUAKED weapon_emplaced (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01517 */
01518         {
01519                 "weapon_emplaced", 
01520                 "sound/weapons/w_pkup.wav",
01521         { "models/weapons2/blaster_r/blaster_w.glm", 
01522                 0, 0, 0},
01523 /* view */              "models/weapons2/blaster_r/blaster.md3", 
01524 /* icon */              "gfx/hud/w_icon_blaster",
01525 /* pickup *///  "Emplaced Gun",
01526                 50,
01527                 IT_WEAPON,
01528                 WP_EMPLACED_GUN,
01529 /* precache */ "",
01530 /* sounds */ "",
01531                 ""                                      // description
01532         },
01533 
01534 
01535 //NOTE: This is to keep things from messing up because the turret weapon type isn't real
01536         {
01537                 "weapon_turretwp", 
01538                 "sound/weapons/w_pkup.wav",
01539         { "models/weapons2/blaster_r/blaster_w.glm", 
01540                 0, 0, 0},
01541 /* view */              "models/weapons2/blaster_r/blaster.md3", 
01542 /* icon */              "gfx/hud/w_icon_blaster",
01543 /* pickup *///  "Turret Gun",
01544                 50,
01545                 IT_WEAPON,
01546                 WP_TURRET,
01547 /* precache */ "",
01548 /* sounds */ "",
01549                 ""                                      // description
01550         },
01551 
01552         //
01553         // AMMO ITEMS
01554         //
01555 
01556 /*QUAKED ammo_force (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01557 Don't place this
01558 */
01559         {
01560                 "ammo_force",
01561                 "sound/player/pickupenergy.wav",
01562         { "models/items/energy_cell.md3", 
01563                 0, 0, 0},
01564 /* view */              NULL,                   
01565 /* icon */              "gfx/hud/w_icon_blaster",
01566 /* pickup *///  "Force??",
01567                 100,
01568                 IT_AMMO,
01569                 AMMO_FORCE,
01570 /* precache */ "",
01571 /* sounds */ "",
01572                 ""                                      // description
01573         },
01574 
01575 /*QUAKED ammo_blaster (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01576 Ammo for the Bryar and Blaster pistols.
01577 */
01578         {
01579                 "ammo_blaster",
01580                 "sound/player/pickupenergy.wav",
01581         { "models/items/energy_cell.md3", 
01582                 0, 0, 0},
01583 /* view */              NULL,                   
01584 /* icon */              "gfx/hud/i_icon_battery",
01585 /* pickup *///  "Blaster Pack",
01586                 100,
01587                 IT_AMMO,
01588                 AMMO_BLASTER,
01589 /* precache */ "",
01590 /* sounds */ "",
01591                 ""                                      // description
01592         },
01593 
01594 /*QUAKED ammo_powercell (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01595 Ammo for Tenloss Disruptor, Wookie Bowcaster, and the Destructive Electro Magnetic Pulse (demp2 ) guns
01596 */
01597         {
01598                 "ammo_powercell",
01599                 "sound/player/pickupenergy.wav",
01600         { "models/items/power_cell.md3", 
01601                 0, 0, 0},
01602 /* view */              NULL,                   
01603 /* icon */              "gfx/mp/ammo_power_cell",
01604 /* pickup *///  "Power Cell",
01605                 100,
01606                 IT_AMMO,
01607                 AMMO_POWERCELL,
01608 /* precache */ "",
01609 /* sounds */ "",
01610                 ""                                      // description
01611         },
01612 
01613 /*QUAKED ammo_metallic_bolts (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
01614 Ammo for Imperial Heavy Repeater and the Golan Arms Flechette
01615 */
01616         {
01617                 "ammo_metallic_bolts",
01618                 "sound/player/pickupenergy.wav",
01619         { "models/items/metallic_bolts.md3", 
01620                 0, 0, 0},
01621 /* view */              NULL,                   
01622 /* icon */              "gfx/mp/ammo_metallic_bolts",
01623 /* pickup *///  "Metallic Bolts",
01624                 100,
01625                 IT_AMMO,
01626                 AMMO_METAL_BOLTS,
01627 /* precache */ "",
01628 /* sounds */ "",
01629