#include "q_shared.h"#include "bg_saga.h"#include "bg_weapons.h"#include "bg_public.h"#include "../namespace_begin.h"#include "../namespace_end.h"Go to the source code of this file.
Defines | |
| #define | SIEGECHAR_TAB 9 |
Functions | |
| int | trap_FS_FOpenFile (const char *qpath, fileHandle_t *f, fsMode_t mode) |
| void | trap_FS_Read (void *buffer, int len, fileHandle_t f) |
| void | trap_FS_Write (const void *buffer, int len, fileHandle_t f) |
| void | trap_FS_FCloseFile (fileHandle_t f) |
| int | trap_FS_GetFileList (const char *path, const char *extension, char *listbuf, int bufsize) |
| qhandle_t | trap_R_RegisterShaderNoMip (const char *name) |
| void | BG_SiegeStripTabs (char *buf) |
| int | BG_SiegeGetValueGroup (char *buf, char *group, char *outbuf) |
| int | BG_SiegeGetPairedValue (char *buf, char *key, char *outbuf) |
| void | BG_SiegeTranslateForcePowers (char *buf, siegeClass_t *siegeClass) |
| int | BG_SiegeTranslateGenericTable (char *buf, stringID_table_t *table, qboolean bitflag) |
| void | BG_SiegeParseClassFile (const char *filename, siegeClassDesc_t *descBuffer) |
| int | BG_SiegeCountBaseClass (const int team, const short classIndex) |
| char * | BG_GetUIPortraitFile (const int team, const short classIndex, const short cntIndex) |
| int | BG_GetUIPortrait (const int team, const short classIndex, const short cntIndex) |
| siegeClass_t * | BG_GetClassOnBaseClass (const int team, const short classIndex, const short cntIndex) |
| void | BG_SiegeLoadClasses (siegeClassDesc_t *descBuffer) |
| siegeClass_t * | BG_SiegeFindClassByName (const char *classname) |
| void | BG_SiegeParseTeamFile (const char *filename) |
| void | BG_SiegeLoadTeams (void) |
| siegeTeam_t * | BG_SiegeFindThemeForTeam (int team) |
| qboolean | WP_SaberParseParms (const char *SaberName, saberInfo_t *saber) |
| int | BG_ModelCache (const char *modelName, const char *skinName) |
| void | BG_PrecacheSabersForSiegeTeam (int team) |
| qboolean | BG_SiegeCheckClassLegality (int team, char *classname) |
| siegeTeam_t * | BG_SiegeFindTeamForTheme (char *themeName) |
| void | BG_SiegeSetTeamTheme (int team, char *themeName) |
| int | BG_SiegeFindClassIndexByName (const char *classname) |
Variables | |
| char | siege_info [MAX_SIEGE_INFO_SIZE] |
| int | siege_valid = 0 |
| siegeTeam_t * | team1Theme = NULL |
| siegeTeam_t * | team2Theme = NULL |
| siegeClass_t | bgSiegeClasses [MAX_SIEGE_CLASSES] |
| int | bgNumSiegeClasses = 0 |
| siegeTeam_t | bgSiegeTeams [MAX_SIEGE_TEAMS] |
| int | bgNumSiegeTeams = 0 |
| stringID_table_t | bgSiegeClassFlagNames [] |
| stringID_table_t | StanceTable [] |
| stringID_table_t | WPTable [] |
| stringID_table_t | FPTable [] |
| stringID_table_t | HoldableTable [] |
| stringID_table_t | PowerupTable [] |
| char * | classTitles [SPC_MAX] |
|
|
Definition at line 17 of file bg_saga.c. Referenced by BG_SiegeGetPairedValue(), BG_SiegeGetValueGroup(), and BG_SiegeStripTabs(). |
|
||||||||||||||||
|
Definition at line 1153 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, and siegeClass_t::playerClass. Referenced by UI_UpdateCvarsForClass().
01154 {
01155 int count = 0,i;
01156 siegeTeam_t *stm;
01157
01158 stm = BG_SiegeFindThemeForTeam(team);
01159 if (!stm)
01160 {
01161 return(0);
01162 }
01163
01164 // Loop through all the classes for this team
01165 for (i=0;i<stm->numClasses;i++)
01166 {
01167 // does it match the base class?
01168 if (stm->classes[i]->playerClass == classIndex)
01169 {
01170 if (count==cntIndex)
01171 {
01172 return(stm->classes[i]);
01173 }
01174 ++count;
01175 }
01176 }
01177
01178 return(0);
01179 }
|
|
||||||||||||||||
|
Definition at line 1123 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, siegeClass_t::playerClass, and siegeClass_t::uiPortraitShader.
01124 {
01125 int count = 0,i;
01126 siegeTeam_t *stm;
01127
01128 stm = BG_SiegeFindThemeForTeam(team);
01129 if (!stm)
01130 {
01131 return(0);
01132
01133 }
01134
01135 // Loop through all the classes for this team
01136 for (i=0;i<stm->numClasses;i++)
01137 {
01138 // does it match the base class?
01139 if (stm->classes[i]->playerClass == classIndex)
01140 {
01141 if (count==cntIndex)
01142 {
01143 return(stm->classes[i]->uiPortraitShader);
01144 }
01145 ++count;
01146 }
01147 }
01148
01149 return(0);
01150 }
|
|
||||||||||||||||
|
Definition at line 1094 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, siegeClass_t::playerClass, and siegeClass_t::uiPortrait. Referenced by UI_UpdateCvarsForClass().
01095 {
01096 int count = 0,i;
01097 siegeTeam_t *stm;
01098
01099 stm = BG_SiegeFindThemeForTeam(team);
01100 if (!stm)
01101 {
01102 return(0);
01103
01104 }
01105
01106 // Loop through all the classes for this team
01107 for (i=0;i<stm->numClasses;i++)
01108 {
01109 // does it match the base class?
01110 if (stm->classes[i]->playerClass == classIndex)
01111 {
01112 if (count==cntIndex)
01113 {
01114 return(stm->classes[i]->uiPortrait);
01115 }
01116 ++count;
01117 }
01118 }
01119
01120 return(0);
01121 }
|
|
||||||||||||
|
Definition at line 3200 of file bg_misc.c. References NULL, trap_G2API_CleanGhoul2Models(), trap_G2API_InitGhoul2Model(), trap_R_RegisterModel(), and trap_R_RegisterSkin(). Referenced by BG_PrecacheSabersForSiegeTeam().
03201 {
03202 #ifdef QAGAME
03203 void *g2 = NULL;
03204
03205 if (skinName && skinName[0])
03206 {
03207 trap_R_RegisterSkin(skinName);
03208 }
03209
03210 //I could hook up a precache ghoul2 function, but oh well, this works
03211 trap_G2API_InitGhoul2Model(&g2, modelName, 0, 0, 0, 0, 0);
03212 if (g2)
03213 { //now get rid of it
03214 trap_G2API_CleanGhoul2Models(&g2);
03215 }
03216 return 0;
03217 #else
03218 if (skinName && skinName[0])
03219 {
03220 trap_R_RegisterSkin(skinName);
03221 }
03222 return trap_R_RegisterModel(modelName);
03223 #endif
03224 }
|
|
|
Definition at line 1363 of file bg_saga.c. References BG_ModelCache(), BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, MAX_SABERS, saberInfo_t::model, saberInfo_t::name, NULL, siegeTeam_t::numClasses, Q_stricmp(), siegeClass_t::saber1, siegeClass_t::saber2, and WP_SaberParseParms(). Referenced by CG_InitSiegeMode(), and InitSiegeMode().
01364 {
01365 siegeTeam_t *t;
01366 saberInfo_t saber;
01367 char *saberName;
01368 int sNum;
01369
01370 t = BG_SiegeFindThemeForTeam(team);
01371
01372 if (t)
01373 {
01374 int i = 0;
01375
01376 while (i < t->numClasses)
01377 {
01378 sNum = 0;
01379
01380 while (sNum < MAX_SABERS)
01381 {
01382 switch (sNum)
01383 {
01384 case 0:
01385 saberName = &t->classes[i]->saber1[0];
01386 break;
01387 case 1:
01388 saberName = &t->classes[i]->saber2[0];
01389 break;
01390 default:
01391 saberName = NULL;
01392 break;
01393 }
01394
01395 if (saberName && saberName[0])
01396 {
01397 WP_SaberParseParms(saberName, &saber);
01398 if (!Q_stricmp(saberName, saber.name))
01399 { //found the matching saber
01400 if (saber.model[0])
01401 {
01402 BG_ModelCache(saber.model, NULL);
01403 }
01404 }
01405 }
01406
01407 sNum++;
01408 }
01409
01410 i++;
01411 }
01412 }
01413 }
|
|
||||||||||||
|
Definition at line 1416 of file bg_saga.c. References NULL, Q_stricmp(), qboolean, qfalse, qtrue, SIEGETEAM_TEAM1, SIEGETEAM_TEAM2, strcpy(), team1Theme, and team2Theme. Referenced by ClientUserinfoChanged(), and Cmd_SiegeClass_f().
01417 {
01418 siegeTeam_t **teamPtr = NULL;
01419 int i = 0;
01420
01421 if (team == SIEGETEAM_TEAM1)
01422 {
01423 teamPtr = &team1Theme;
01424 }
01425 else if (team == SIEGETEAM_TEAM2)
01426 {
01427 teamPtr = &team2Theme;
01428 }
01429 else
01430 { //spectator? Whatever, you're legal then.
01431 return qtrue;
01432 }
01433
01434 if (!teamPtr || !(*teamPtr))
01435 { //Well, guess the class is ok, seeing as there is no team theme to begin with.
01436 return qtrue;
01437 }
01438
01439 //See if the class is listed on the team
01440 while (i < (*teamPtr)->numClasses)
01441 {
01442 if (!Q_stricmp(classname, (*teamPtr)->classes[i]->name))
01443 { //found it, so it's alright
01444 return qtrue;
01445 }
01446 i++;
01447 }
01448
01449 //Didn't find it, so copy the name of the first valid class over it.
01450 strcpy(classname, (*teamPtr)->classes[0]->name);
01451
01452 return qfalse;
01453 }
|
|
||||||||||||
|
Definition at line 1071 of file bg_saga.c. References BG_SiegeFindThemeForTeam(), siegeTeam_t::classes, siegeTeam_t::numClasses, and siegeClass_t::playerClass. Referenced by UI_UpdateCvarsForClass().
01072 {
01073 int count = 0,i;
01074 siegeTeam_t *stm;
01075
01076 stm = BG_SiegeFindThemeForTeam(team);
01077 if (!stm)
01078 {
01079 return(0);
01080
01081 }
01082
01083 for (i=0;i<stm->numClasses;i++)
01084 {
01085
01086 if (stm->classes[i]->playerClass == classIndex)
01087 {
01088 count++;
01089 }
01090 }
01091 return(count);
01092 }
|
|
|
Definition at line 1219 of file bg_saga.c. References bgNumSiegeClasses, bgSiegeClasses, name, NULL, and Q_stricmp(). Referenced by BG_SiegeParseTeamFile(), CG_DrawSiegeInfo(), and CG_NewClientInfo().
01220 {
01221 int i = 0;
01222
01223 while (i < bgNumSiegeClasses)
01224 {
01225 if (!Q_stricmp(bgSiegeClasses[i].name, classname))
01226 { //found it
01227 return &bgSiegeClasses[i];
01228 }
01229 i++;
01230 }
01231
01232 return NULL;
01233 }
|
|
|
Definition at line 1489 of file bg_saga.c. References bgNumSiegeClasses, bgSiegeClasses, name, and Q_stricmp(). Referenced by CG_NewClientInfo(), ClientUserinfoChanged(), and G_ValidateSiegeClassForTeam().
01490 {
01491 int i = 0;
01492
01493 while (i < bgNumSiegeClasses)
01494 {
01495 if (!Q_stricmp(bgSiegeClasses[i].name, classname))
01496 { //found it
01497 return i;
01498 }
01499 i++;
01500 }
01501
01502 return -1;
01503 }
|
|
|
Definition at line 1455 of file bg_saga.c. References bgNumSiegeTeams, bgSiegeTeams, name, siegeTeam_t::name, NULL, and Q_stricmp(). Referenced by BG_SiegeSetTeamTheme().
01456 {
01457 int i = 0;
01458
01459 while (i < bgNumSiegeTeams)
01460 {
01461 if (bgSiegeTeams[i].name &&
01462 !Q_stricmp(bgSiegeTeams[i].name, themeName))
01463 { //this is what we're looking for
01464 return &bgSiegeTeams[i];
01465 }
01466
01467 i++;
01468 }
01469
01470 return NULL;
01471 }
|
|
|
Definition at line 1344 of file bg_saga.c. References NULL, SIEGETEAM_TEAM1, SIEGETEAM_TEAM2, team1Theme, and team2Theme. Referenced by BG_GetClassOnBaseClass(), BG_GetUIPortrait(), BG_GetUIPortraitFile(), BG_PrecacheSabersForSiegeTeam(), BG_SiegeCountBaseClass(), CG_InitSiegeMode(), CG_PrecachePlayersForSiegeTeam(), G_SiegeRegisterWeaponsAndHoldables(), G_TeamForSiegeClass(), G_ValidateSiegeClassForTeam(), and UI_SetSiegeTeams().
01345 {
01346 if (team == SIEGETEAM_TEAM1)
01347 {
01348 return team1Theme;
01349 }
01350 else if (team == SIEGETEAM_TEAM2)
01351 {
01352 return team2Theme;
01353 }
01354
01355 return NULL;
01356 }
|
|
||||||||||||||||
|
Definition at line 408 of file bg_saga.c. References Com_Error(), ERR_DROP, Q_stricmp(), qboolean, qfalse, qtrue, and SIEGECHAR_TAB. Referenced by BG_SiegeParseClassFile(), BG_SiegeParseTeamFile(), CG_InitSiegeMode(), CG_ParseSiegeObjectiveStatus(), CG_PrecacheSiegeObjectiveAssetsForTeam(), CG_SiegeBriefingDisplay(), CG_SiegeGetObjectiveDescription(), CG_SiegeGetObjectiveFinal(), CG_SiegeObjectiveCompleted(), CG_SiegeRoundOver(), decompTriggerUse(), InitSiegeMode(), SiegeBeginRound(), SiegeRoundComplete(), siegeTriggerUse(), and UI_SetSiegeTeams().
00409 {
00410 int i = 0;
00411 int j;
00412 int k;
00413 char checkKey[4096];
00414
00415 while (buf[i])
00416 {
00417 if (buf[i] != ' ' && buf[i] != '{' && buf[i] != '}' && buf[i] != '\n' && buf[i] != '\r')
00418 { //we're on a valid character
00419 if (buf[i] == '/' &&
00420 buf[i+1] == '/')
00421 { //this is a comment, so skip over it
00422 while (buf[i] && buf[i] != '\n' && buf[i] != '\r')
00423 {
00424 i++;
00425 }
00426 }
00427 else
00428 { //parse to the next space/endline/eos and check this value against our key value.
00429 j = 0;
00430
00431 while (buf[i] != ' ' && buf[i] != '\n' && buf[i] != '\r' && buf[i] != SIEGECHAR_TAB && buf[i])
00432 {
00433 if (buf[i] == '/' && buf[i+1] == '/')
00434 { //hit a comment, break out.
00435 break;
00436 }
00437
00438 checkKey[j] = buf[i];
00439 j++;
00440 i++;
00441 }
00442 checkKey[j] = 0;
00443
00444 k = i;
00445
00446 while (buf[k] && (buf[k] == ' ' || buf[k] == '\n' || buf[k] == '\r'))
00447 {
00448 k++;
00449 }
00450
00451 if (buf[k] == '{')
00452 { //this is not the start of a value but rather of a group. We don't want to look in subgroups so skip over the whole thing.
00453 int openB = 0;
00454
00455 while (buf[i] && (buf[i] != '}' || openB))
00456 {
00457 if (buf[i] == '{')
00458 {
00459 openB++;
00460 }
00461 else if (buf[i] == '}')
00462 {
00463 openB--;
00464 }
00465
00466 if (openB < 0)
00467 {
00468 Com_Error(ERR_DROP, "Unexpected closing bracket (too many) while parsing to end of group '%s'", checkKey);
00469 }
00470
00471 if (buf[i] == '}' && !openB)
00472 { //this is the end of the group
00473 break;
00474 }
00475 i++;
00476 }
00477
00478 if (buf[i] == '}')
00479 {
00480 i++;
00481 }
00482 }
00483 else
00484 {
00485 //Is this the one we want?
00486 if (buf[i] != '/' || buf[i+1] != '/')
00487 { //make sure we didn't stop on a comment, if we did then this is considered an error in the file.
00488 if (!Q_stricmp(checkKey, key))
00489 { //guess so. Parse along to the next valid character, then put that into the output buffer and return 1.
00490 while ((buf[i] == ' ' || buf[i] == '\n' || buf[i] == '\r' || buf[i] == SIEGECHAR_TAB) && buf[i])
00491 {
00492 i++;
00493 }
00494
00495 if (buf[i])
00496 { //We're at the start of the value now.
00497 qboolean parseToQuote = qfalse;
00498
00499 if (buf[i] == '\"')
00500 { //if the value is in quotes, then stop at the next quote instead of ' '
00501 i++;
00502 parseToQuote = qtrue;
00503 }
00504
00505 j = 0;
00506 while ( ((!parseToQuote && buf[i] != ' ' && buf[i] != '\n' && buf[i] != '\r') || (parseToQuote && buf[i] != '\"')) )
00507 {
00508 if (buf[i] == '/' &&
00509 buf[i+1] == '/')
00510 { //hit a comment after the value? This isn't an ideal way to be writing things, but we'll support it anyway.
00511 break;
00512 }
00513 outbuf[j] = buf[i];
00514 j++;
00515 i++;
00516
00517 if (!buf[i])
00518 {
00519 if (parseToQuote)
00520 {
00521 Com_Error(ERR_DROP, "Unexpected EOF while looking for endquote, error finding paired value for '%s'", key);
00522 }
00523 else
00524 {
00525 Com_Error(ERR_DROP, "Unexpected EOF while looking for space or endline, error finding paired value for '%s'", key);
00526 }
00527 }
00528 }
00529 outbuf[j] = 0;
00530
00531 return 1; //we got it, so return 1.
00532 }
00533 else
00534 {
00535 Com_Error(ERR_DROP, "Error parsing file, unexpected EOF while looking for valud '%s'", key);
00536 }
00537 }
00538 else
00539 { //if that wasn't the desired key, then make sure we parse to the end of the line, so we don't mistake a value for a key
00540 while (buf[i] && buf[i] != '\n')
00541 {
00542 i++;
00543 }
00544 }
00545 }
00546 else
00547 {
00548 Com_Error(ERR_DROP, "Error parsing file, found comment, expected value for '%s'", key);
00549 }
00550 }
00551 }
00552 }
00553
00554 if (!buf[i])
00555 {
00556 break;
00557 }
00558 i++;
00559 }
00560
00561 return 0; //guess we never found it.
00562 }
|
|
||||||||||||||||
|
Definition at line 191 of file bg_saga.c. References BG_SiegeStripTabs(), Com_Error(), ERR_DROP, Q_stricmp(), qboolean, qfalse, qtrue, and SIEGECHAR_TAB. Referenced by BG_SiegeParseClassFile(), BG_SiegeParseTeamFile(), CG_InitSiegeMode(), CG_PrecacheSiegeObjectiveAssetsForTeam(), CG_SiegeBriefingDisplay(), CG_SiegeGetObjectiveDescription(), CG_SiegeGetObjectiveFinal(), CG_SiegeObjectiveCompleted(), CG_SiegeRoundOver(), decompTriggerUse(), InitSiegeMode(), SiegeRoundComplete(), siegeTriggerUse(), and UI_SetSiegeTeams().
00192 {
00193 int i = 0;
00194 int j;
00195 char checkGroup[4096];
00196 qboolean isGroup;
00197 int parseGroups = 0;
00198
00199 while (buf[i])
00200 {
00201 if (buf[i] != ' ' && buf[i] != '{' && buf[i] != '}' && buf[i] != '\n' && buf[i] != '\r' && buf[i] != SIEGECHAR_TAB)
00202 { //we're on a valid character
00203 if (buf[i] == '/' &&
00204 buf[i+1] == '/')
00205 { //this is a comment, so skip over it
00206 while (buf[i] && buf[i] != '\n' && buf[i] != '\r' && buf[i] != SIEGECHAR_TAB)
00207 {
00208 i++;
00209 }
00210 }
00211 else
00212 { //parse to the next space/endline/eos and check this value against our group value.
00213 j = 0;
00214
00215 while (buf[i] != ' ' && buf[i] != '\n' && buf[i] != '\r' && buf[i] != SIEGECHAR_TAB && buf[i] != '{' && buf[i])
00216 {
00217 if (buf[i] == '/' && buf[i+1] == '/')
00218 { //hit a comment, break out.
00219 break;
00220 }
00221
00222 checkGroup[j] = buf[i];
00223 j++;
00224 i++;
00225 }
00226 checkGroup[j] = 0;
00227
00228 //Make sure this is a group as opposed to a globally defined value.
00229 if (buf[i] == '/' && buf[i+1] == '/')
00230 { //stopped on a comment, so first parse to the end of it.
00231 while (buf[i] && buf[i] != '\n' && buf[i] != '\r')
00232 {
00233 i++;
00234 }
00235 while (buf[i] == '\n' || buf[i] == '\r')
00236 {
00237 i++;
00238 }
00239 }
00240
00241 if (!buf[i])
00242 {
00243 Com_Error(ERR_DROP, "Unexpected EOF while looking for group '%s'", group);
00244 }
00245
00246 isGroup = qfalse;
00247
00248 while (buf[i] && buf[i] == ' ' || buf[i] == SIEGECHAR_TAB || buf[i] == '\n' || buf[i] == '\r')
00249 { //parse to the next valid character
00250 i++;
00251 }
00252
00253 if (buf[i] == '{')
00254 { //if the next valid character is an opening bracket, then this is indeed a group
00255 isGroup = qtrue;
00256 }
00257
00258 //Is this the one we want?
00259 if (isGroup && !Q_stricmp(checkGroup, group))
00260 { //guess so. Parse until we hit the { indicating the beginning of the group.
00261 while (buf[i] != '{' && buf[i])
00262 {
00263 i++;
00264 }
00265
00266 if (buf[i])
00267 { //We're at the start of the group now, so parse to the closing bracket.
00268 j = 0;
00269
00270 parseGroups = 0;
00271
00272 while ((buf[i] != '}' || parseGroups) && buf[i])
00273 {
00274 if (buf[i] == '{')
00275 { //increment for the opening bracket.
00276 parseGroups++;
00277 }
00278 else if (buf[i] == '}')
00279 { //decrement for the closing bracket
00280 parseGroups--;
00281 }
00282
00283 if (parseGroups < 0)
00284 { //Syntax error, I guess.
00285 Com_Error(ERR_DROP, "Found a closing bracket without an opening bracket while looking for group '%s'", group);
00286 }
00287
00288 if ((buf[i] != '{' || parseGroups > 1) &&
00289 (buf[i] != '}' || parseGroups > 0))
00290 { //don't put the start and end brackets for this group into the output buffer
00291 outbuf[j] = buf[i];
00292 j++;
00293 }
00294
00295 if (buf[i] == '}' && !parseGroups)
00296 { //Alright, we can break out now.
00297 break;
00298 }
00299
00300 i++;
00301 }
00302 outbuf[j] = 0;
00303
00304 //Verify that we ended up on the closing bracket.
00305 if (buf[i] != '}')
00306 {
00307 Com_Error(ERR_DROP, "Group '%s' is missing a closing bracket", group);
00308 }
00309
00310 //Strip the tabs so we're friendly for value parsing.
00311 BG_SiegeStripTabs(outbuf);
00312
00313 return 1; //we got it, so return 1.
00314 }
00315 else
00316 {
00317 Com_Error(ERR_DROP, "Error parsing group in file, unexpected EOF before opening bracket while looking for group '%s'", group);
00318 }
00319 }
00320 else if (!isGroup)
00321 { //if it wasn't a group, parse to the end of the line
00322 while (buf[i] && buf[i] != '\n' && buf[i] != '\r')
00323 {
00324 i++;
00325 }
00326 }
00327 else
00328 { //this was a group but we not the one we wanted to find, so parse by it.
00329 parseGroups = 0;
00330
00331 while (buf[i] && (buf[i] != '}' || parseGroups))
00332 {
00333 if (buf[i] == '{')
00334 {
00335 parseGroups++;
00336 }
00337 else if (buf[i] == '}')
00338 {
00339 parseGroups--;
00340 }
00341
00342 if (parseGroups < 0)
00343 { //Syntax error, I guess.
00344 Com_Error(ERR_DROP, "Found a closing bracket without an opening bracket while looking for group '%s'", group);
00345 }
00346
00347 if (buf[i] == '}' && !parseGroups)
00348 { //Alright, we can break out now.
00349 break;
00350 }
00351
00352 i++;
00353 }
00354
00355 if (buf[i] != '}')
00356 {
00357 Com_Error(ERR_DROP, "Found an opening bracket without a matching closing bracket while looking for group '%s'", group);
00358 }
00359
00360 i++;
00361 }
00362 }
00363 }
00364 else if (buf[i] == '{')
00365 { //we're in a group that isn't the one we want, so parse to the end.
00366 parseGroups = 0;
00367
00368 while (buf[i] && (buf[i] != '}' || parseGroups))
00369 {
00370 if (buf[i] == '{')
00371 {
00372 parseGroups++;
00373 }
00374 else if (buf[i] == '}')
00375 {
00376 parseGroups--;
00377 }
00378
00379 if (parseGroups < 0)
00380 { //Syntax error, I guess.
00381 Com_Error(ERR_DROP, "Found a closing bracket without an opening bracket while looking for group '%s'", group);
00382 }
00383
00384 if (buf[i] == '}' && !parseGroups)
00385 { //Alright, we can break out now.
00386 break;
00387 }
00388
00389 i++;
00390 }
00391
00392 if (buf[i] != '}')
00393 {
00394 Com_Error(ERR_DROP, "Found an opening bracket without a matching closing bracket while looking for group '%s'", group);
00395 }
00396 }
00397
00398 if (!buf[i])
00399 {
00400 break;
00401 }
00402 i++;
00403 }
00404
00405 return 0; //guess we never found it.
00406 }
|
|
|
Definition at line 1181 of file bg_saga.c. References BG_SiegeParseClassFile(), bgNumSiegeClasses, MAX_QPATH, NULL, strcat(), strcpy(), strlen(), and trap_FS_GetFileList(). Referenced by CG_InitSiegeMode(), InitSiegeMode(), and UI_SiegeInit().
01182 {
01183 int numFiles;
01184 int filelen;
01185 char filelist[4096];
01186 char filename[MAX_QPATH];
01187 char* fileptr;
01188 int i;
01189
01190 bgNumSiegeClasses = 0;
01191
01192 numFiles = trap_FS_GetFileList("ext_data/Siege/Classes", ".scl", filelist, 4096 );
01193 fileptr = filelist;
01194
01195 for (i = 0; i < numFiles; i++, fileptr += filelen+1)
01196 {
01197 filelen = strlen(fileptr);
01198 strcpy(filename, "ext_data/Siege/Classes/");
01199 strcat(filename, fileptr);
01200
01201 if (descBuffer)
01202 {
01203 BG_SiegeParseClassFile(filename, &descBuffer[i]);
01204 }
01205 else
01206 {
01207 BG_SiegeParseClassFile(filename, NULL);
01208 }
01209 }
01210 }
|
|
|
Definition at line 1314 of file bg_saga.c. References BG_SiegeParseTeamFile(), bgNumSiegeTeams, MAX_QPATH, strcat(), strcpy(), strlen(), and trap_FS_GetFileList(). Referenced by CG_InitSiegeMode(), InitSiegeMode(), and UI_SiegeInit().
01315 {
01316 int numFiles;
01317 int filelen;
01318 char filelist[4096];
01319 char filename[MAX_QPATH];
01320 char* fileptr;
01321 int i;
01322
01323 bgNumSiegeTeams = 0;
01324
01325 numFiles = trap_FS_GetFileList("ext_data/Siege/Teams", ".team", filelist, 4096 );
01326 fileptr = filelist;
01327
01328 for (i = 0; i < numFiles; i++, fileptr += filelen+1)
01329 {
01330 filelen = strlen(fileptr);
01331 strcpy(filename, "ext_data/Siege/Teams/");
01332 strcat(filename, fileptr);
01333 BG_SiegeParseTeamFile(filename);
01334 }
01335 }
|
|
||||||||||||
|
Definition at line 759 of file bg_saga.c. References atof(), atoi(), BG_SiegeGetPairedValue(), BG_SiegeGetValueGroup(), BG_SiegeTranslateForcePowers(), BG_SiegeTranslateGenericTable(), bgNumSiegeClasses, bgSiegeClasses, bgSiegeClassFlagNames, classTitles, Com_Error(), Com_Printf(), siegeClassDesc_t::desc, ERR_DROP, fileHandle_t, FS_READ, HoldableTable, memcpy(), memset(), name, NUM_FORCE_POWERS, PowerupTable, qfalse, qtrue, SIEGE_CLASS_DESC_LEN, SPC_INFANTRY, SPC_MAX, StanceTable, strcmp(), strcpy(), strlen(), trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), trap_R_RegisterShaderNoMip(), WP_MELEE, WP_SABER, and WPTable. Referenced by BG_SiegeLoadClasses().
00760 {
00761 fileHandle_t f;
00762 int len;
00763 int i;
00764 char classInfo[4096];
00765 char parseBuf[4096];
00766
00767 len = trap_FS_FOpenFile(filename, &f, FS_READ);
00768
00769 if (!f || len >= 4096)
00770 {
00771 return;
00772 }
00773
00774 trap_FS_Read(classInfo, len, f);
00775
00776 trap_FS_FCloseFile(f);
00777
00778 classInfo[len] = 0;
00779
00780 //first get the description if we have a buffer for it
00781 if (descBuffer)
00782 {
00783 if (!BG_SiegeGetPairedValue(classInfo, "description", descBuffer->desc))
00784 {
00785 strcpy(descBuffer->desc, "DESCRIPTION UNAVAILABLE");
00786 }
00787
00788 //Hit this assert? Memory has already been trashed. Increase
00789 //SIEGE_CLASS_DESC_LEN.
00790 assert(strlen(descBuffer->desc) < SIEGE_CLASS_DESC_LEN);
00791 }
00792
00793 BG_SiegeGetValueGroup(classInfo, "ClassInfo", classInfo);
00794
00795 //Parse name
00796 if (BG_SiegeGetPairedValue(classInfo, "name", parseBuf))
00797 {
00798 strcpy(bgSiegeClasses[bgNumSiegeClasses].name, parseBuf);
00799 }
00800 else
00801 {
00802 Com_Error(ERR_DROP, "Siege class without name entry");
00803 }
00804
00805 //Parse forced model
00806 if (BG_SiegeGetPairedValue(classInfo, "model", parseBuf))
00807 {
00808 strcpy(bgSiegeClasses[bgNumSiegeClasses].forcedModel, parseBuf);
00809 }
00810 else
00811 { //It's ok if there isn't one, it's optional.
00812 bgSiegeClasses[bgNumSiegeClasses].forcedModel[0] = 0;
00813 }
00814
00815 //Parse forced skin
00816 if (BG_SiegeGetPairedValue(classInfo, "skin", parseBuf))
00817 {
00818 strcpy(bgSiegeClasses[bgNumSiegeClasses].forcedSkin, parseBuf);
00819 }
00820 else
00821 { //It's ok if there isn't one, it's optional.
00822 bgSiegeClasses[bgNumSiegeClasses].forcedSkin[0] = 0;
00823 }
00824
00825 //Parse first saber
00826 if (BG_SiegeGetPairedValue(classInfo, "saber1", parseBuf))
00827 {
00828 strcpy(bgSiegeClasses[bgNumSiegeClasses].saber1, parseBuf);
00829 }
00830 else
00831 { //It's ok if there isn't one, it's optional.
00832 bgSiegeClasses[bgNumSiegeClasses].saber1[0] = 0;
00833 }
00834
00835 //Parse second saber
00836 if (BG_SiegeGetPairedValue(classInfo, "saber2", parseBuf))
00837 {
00838 strcpy(bgSiegeClasses[bgNumSiegeClasses].saber2, parseBuf);
00839 }
00840 else
00841 { //It's ok if there isn't one, it's optional.
00842 bgSiegeClasses[bgNumSiegeClasses].saber2[0] = 0;
00843 }
00844
00845 //Parse forced saber stance
00846 if (BG_SiegeGetPairedValue(classInfo, "saberstyle", parseBuf))
00847 {
00848 bgSiegeClasses[bgNumSiegeClasses].saberStance = BG_SiegeTranslateGenericTable(parseBuf, StanceTable, qtrue);
00849 }
00850 else
00851 { //It's ok if there isn't one, it's optional.
00852 bgSiegeClasses[bgNumSiegeClasses].saberStance = 0;
00853 }
00854
00855 //Parse forced saber color
00856 if (BG_SiegeGetPairedValue(classInfo, "sabercolor", parseBuf))
00857 {
00858 bgSiegeClasses[bgNumSiegeClasses].forcedSaberColor = atoi(parseBuf);
00859 bgSiegeClasses[bgNumSiegeClasses].hasForcedSaberColor = qtrue;
00860 }
00861 else
00862 { //It's ok if there isn't one, it's optional.
00863 bgSiegeClasses[bgNumSiegeClasses].hasForcedSaberColor = qfalse;
00864 }
00865
00866 //Parse forced saber2 color
00867 if (BG_SiegeGetPairedValue(classInfo, "saber2color", parseBuf))
00868 {
00869 bgSiegeClasses[bgNumSiegeClasses].forcedSaber2Color = atoi(parseBuf);
00870 bgSiegeClasses[bgNumSiegeClasses].hasForcedSaber2Color = qtrue;
00871 }
00872 else
00873 { //It's ok if there isn't one, it's optional.
00874 bgSiegeClasses[bgNumSiegeClasses].hasForcedSaber2Color = qfalse;
00875 }
00876
00877 //Parse weapons
00878 if (BG_SiegeGetPairedValue(classInfo, "weapons", parseBuf))
00879 {
00880 bgSiegeClasses[bgNumSiegeClasses].weapons = BG_SiegeTranslateGenericTable(parseBuf, WPTable, qtrue);
00881 }
00882 else
00883 {
00884 Com_Error(ERR_DROP, "Siege class without weapons entry");
00885 }
00886
00887 if (!(bgSiegeClasses[bgNumSiegeClasses].weapons & (1 << WP_SABER)))
00888 { //make sure it has melee if there's no saber
00889 bgSiegeClasses[bgNumSiegeClasses].weapons |= (1 << WP_MELEE);
00890
00891 //always give them this too if they are not a saber user
00892 //bgSiegeClasses[bgNumSiegeClasses].weapons |= (1 << WP_BRYAR_PISTOL);
00893 }
00894
00895 //Parse forcepowers
00896 if (BG_SiegeGetPairedValue(classInfo, "forcepowers", parseBuf))
00897 {
00898 BG_SiegeTranslateForcePowers(parseBuf, &bgSiegeClasses[bgNumSiegeClasses]);
00899 }
00900 else
00901 { //fine, clear out the powers.
00902 i = 0;
00903 while (i < NUM_FORCE_POWERS)
00904 {
00905 bgSiegeClasses[bgNumSiegeClasses].forcePowerLevels[i] = 0;
00906 i++;
00907 }
00908 }
00909
00910 //Parse classflags
00911 if (BG_SiegeGetPairedValue(classInfo, "classflags", parseBuf))
00912 {
00913 bgSiegeClasses[bgNumSiegeClasses].classflags = BG_SiegeTranslateGenericTable(parseBuf, bgSiegeClassFlagNames, qtrue);
00914 }
00915 else
00916 { //fine, we'll 0 it.
00917 bgSiegeClasses[bgNumSiegeClasses].classflags = 0;
00918 }
00919
00920 //Parse maxhealth
00921 if (BG_SiegeGetPairedValue(classInfo, "maxhealth", parseBuf))
00922 {
00923 bgSiegeClasses[bgNumSiegeClasses].maxhealth = atoi(parseBuf);
00924 }
00925 else
00926 { //It's alright, just default to 100 then.
00927 bgSiegeClasses[bgNumSiegeClasses].maxhealth = 100;
00928 }
00929
00930 //Parse starthealth
00931 if (BG_SiegeGetPairedValue(classInfo, "starthealth", parseBuf))
00932 {
00933 bgSiegeClasses[bgNumSiegeClasses].starthealth = atoi(parseBuf);
00934 }
00935 else
00936 { //It's alright, just default to 100 then.
00937 bgSiegeClasses[bgNumSiegeClasses].starthealth = bgSiegeClasses[bgNumSiegeClasses].maxhealth;
00938 }
00939
00940
00941 //Parse startarmor
00942 if (BG_SiegeGetPairedValue(classInfo, "maxarmor", parseBuf))
00943 {
00944 bgSiegeClasses[bgNumSiegeClasses].maxarmor = atoi(parseBuf);
00945 }
00946 else
00947 { //It's alright, just default to 0 then.
00948 bgSiegeClasses[bgNumSiegeClasses].maxarmor = 0;
00949 }
00950
00951 //Parse startarmor
00952 if (BG_SiegeGetPairedValue(classInfo, "startarmor", parseBuf))
00953 {
00954 bgSiegeClasses[bgNumSiegeClasses].startarmor = atoi(parseBuf);
00955 if (!bgSiegeClasses[bgNumSiegeClasses].maxarmor)
00956 { //if they didn't specify a damn max armor then use this.
00957 bgSiegeClasses[bgNumSiegeClasses].maxarmor = bgSiegeClasses[bgNumSiegeClasses].startarmor;
00958 }
00959 }
00960 else
00961 { //default to maxarmor.
00962 bgSiegeClasses[bgNumSiegeClasses].startarmor = bgSiegeClasses[bgNumSiegeClasses].maxarmor;
00963 }
00964
00965 //Parse speed (this is a multiplier value)
00966 if (BG_SiegeGetPairedValue(classInfo, "speed", parseBuf))
00967 {
00968 bgSiegeClasses[bgNumSiegeClasses].speed = atof(parseBuf);
00969 }
00970 else
00971 { //It's alright, just default to 1 then.
00972 bgSiegeClasses[bgNumSiegeClasses].speed = 1.0f;
00973 }
00974
00975 //Parse shader for ui to use
00976 if (BG_SiegeGetPairedValue(classInfo, "uishader", parseBuf))
00977 {
00978 #ifdef QAGAME
00979 bgSiegeClasses[bgNumSiegeClasses].uiPortraitShader = 0;
00980 memset(bgSiegeClasses[bgNumSiegeClasses].uiPortrait,0,sizeof(bgSiegeClasses[bgNumSiegeClasses].uiPortrait));
00981 #elif defined CGAME
00982 bgSiegeClasses[bgNumSiegeClasses].uiPortraitShader = 0;
00983 memset(bgSiegeClasses[bgNumSiegeClasses].uiPortrait,0,sizeof(bgSiegeClasses[bgNumSiegeClasses].uiPortrait));
00984 #else //ui
00985 bgSiegeClasses[bgNumSiegeClasses].uiPortraitShader = trap_R_RegisterShaderNoMip(parseBuf);
00986 memcpy(bgSiegeClasses[bgNumSiegeClasses].uiPortrait,parseBuf,sizeof(bgSiegeClasses[bgNumSiegeClasses].uiPortrait));
00987 #endif
00988 }
00989 else
00990 { //I guess this is an essential.. we don't want to render bad shaders or anything.
00991 Com_Error(ERR_DROP, "Siege class without uishader entry");
00992 }
00993
00994 //Parse shader for ui to use
00995 if (BG_SiegeGetPairedValue(classInfo, "class_shader", parseBuf))
00996 {
00997 #ifdef QAGAME
00998 bgSiegeClasses[bgNumSiegeClasses].classShader = 0;
00999 #else //cgame, ui
01000 bgSiegeClasses[bgNumSiegeClasses].classShader = trap_R_RegisterShaderNoMip(parseBuf);
01001 assert( bgSiegeClasses[bgNumSiegeClasses].classShader );
01002 if ( !bgSiegeClasses[bgNumSiegeClasses].classShader )
01003 {
01004 //Com_Error( ERR_DROP, "ERROR: could not find class_shader %s for class %s\n", parseBuf, bgSiegeClasses[bgNumSiegeClasses].name );
01005 Com_Printf( "ERROR: could not find class_shader %s for class %s\n", parseBuf, bgSiegeClasses[bgNumSiegeClasses].name );
01006 }
01007 // A very hacky way to determine class . . .
01008 else
01009 #endif
01010 {
01011 // Find the base player class based on the icon name - very bad, I know.
01012 int titleLength,i,arrayTitleLength;
01013 char *holdBuf;
01014
01015 titleLength = strlen(parseBuf);
01016 for (i=0;i<SPC_MAX;i++)
01017 {
01018 // Back up
01019 arrayTitleLength = strlen(classTitles[i]);
01020 if (arrayTitleLength>titleLength) // Too long
01021 {
01022 break;
01023 }
01024
01025 holdBuf = parseBuf + ( titleLength - arrayTitleLength);
01026 if (!strcmp(holdBuf,classTitles[i]))
01027 {
01028 bgSiegeClasses[bgNumSiegeClasses].playerClass = i;
01029 break;
01030 }
01031 }
01032
01033 // In case the icon name doesn't match up
01034 if (i>=SPC_MAX)
01035 {
01036 bgSiegeClasses[bgNumSiegeClasses].playerClass = SPC_INFANTRY;
01037 }
01038 }
01039 }
01040 else
01041 { //No entry! Bad bad bad
01042 //Com_Error( ERR_DROP, "ERROR: no class_shader defined for class %s\n", bgSiegeClasses[bgNumSiegeClasses].name );
01043 Com_Printf( "ERROR: no class_shader defined for class %s\n", bgSiegeClasses[bgNumSiegeClasses].name );
01044 }
01045
01046 //Parse holdable items to use
01047 if (BG_SiegeGetPairedValue(classInfo, "holdables", parseBuf))
01048 {
01049 bgSiegeClasses[bgNumSiegeClasses].invenItems = BG_SiegeTranslateGenericTable(parseBuf, HoldableTable, qtrue);
01050 }
01051 else
01052 { //Just don't start out with any then.
01053 bgSiegeClasses[bgNumSiegeClasses].invenItems = 0;
01054 }
01055
01056 //Parse powerups to use
01057 if (BG_SiegeGetPairedValue(classInfo, "powerups", parseBuf))
01058 {
01059 bgSiegeClasses[bgNumSiegeClasses].powerups = BG_SiegeTranslateGenericTable(parseBuf, PowerupTable, qtrue);
01060 }
01061 else
01062 { //Just don't start out with any then.
01063 bgSiegeClasses[bgNumSiegeClasses].powerups = 0;
01064 }
01065
01066 //A successful read.
01067 bgNumSiegeClasses++;
01068 }
|
|
|
Definition at line 1235 of file bg_saga.c. References BG_SiegeFindClassByName(), BG_SiegeGetPairedValue(), BG_SiegeGetValueGroup(), bgNumSiegeTeams, bgSiegeTeams, Com_Error(), ERR_DROP, fileHandle_t, FS_READ, MAX_SIEGE_CLASSES, name, qboolean, qtrue, strcpy(), trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), trap_R_RegisterShaderNoMip(), and va(). Referenced by BG_SiegeLoadTeams().
01236 {
01237 fileHandle_t f;
01238 int len;
01239 char teamInfo[2048];
01240 char parseBuf[1024];
01241 char lookString[256];
01242 int i = 1;
01243 qboolean success = qtrue;
01244
01245 len = trap_FS_FOpenFile(filename, &f, FS_READ);
01246
01247 if (!f || len >= 2048)
01248 {
01249 return;
01250 }
01251
01252 trap_FS_Read(teamInfo, len, f);
01253
01254 trap_FS_FCloseFile(f);
01255
01256 teamInfo[len] = 0;
01257
01258 if (BG_SiegeGetPairedValue(teamInfo, "name", parseBuf))
01259 {
01260 strcpy(bgSiegeTeams[bgNumSiegeTeams].name, parseBuf);
01261 }
01262 else
01263 {
01264 Com_Error(ERR_DROP, "Siege team with no name definition");
01265 }
01266
01267 //I don't entirely like doing things this way but it's the easiest way.
01268 #ifdef CGAME
01269 if (BG_SiegeGetPairedValue(teamInfo, "FriendlyShader", parseBuf))
01270 {
01271 bgSiegeTeams[bgNumSiegeTeams].friendlyShader = trap_R_RegisterShaderNoMip(parseBuf);
01272 }
01273 #else
01274 bgSiegeTeams[bgNumSiegeTeams].friendlyShader = 0;
01275 #endif
01276
01277 bgSiegeTeams[bgNumSiegeTeams].numClasses = 0;
01278
01279 if (BG_SiegeGetValueGroup(teamInfo, "Classes", teamInfo))
01280 {
01281 while (success && i < MAX_SIEGE_CLASSES)
01282 { //keep checking for group values named class# up to MAX_SIEGE_CLASSES until we can't find one.
01283 strcpy(lookString, va("class%i", i));
01284
01285 success = BG_SiegeGetPairedValue(teamInfo, lookString, parseBuf);
01286
01287 if (!success)
01288 {
01289 break;
01290 }
01291
01292 bgSiegeTeams[bgNumSiegeTeams].classes[bgSiegeTeams[bgNumSiegeTeams].numClasses] = BG_SiegeFindClassByName(parseBuf);
01293
01294 if (!bgSiegeTeams[bgNumSiegeTeams].classes[bgSiegeTeams[bgNumSiegeTeams].numClasses])
01295 {
01296 Com_Error(ERR_DROP, "Invalid class specified: '%s'", parseBuf);
01297 }
01298
01299 bgSiegeTeams[bgNumSiegeTeams].numClasses++;
01300
01301 i++;
01302 }
01303 }
01304
01305 if (!bgSiegeTeams[bgNumSiegeTeams].numClasses)
01306 {
01307 Com_Error(ERR_DROP, "Team defined with no allowable classes\n");
01308 }
01309
01310 //If we get here then it was a success, so increment the team number
01311 bgNumSiegeTeams++;
01312 }
|
|
||||||||||||
|
Definition at line 1473 of file bg_saga.c. References BG_SiegeFindTeamForTheme(), NULL, SIEGETEAM_TEAM1, team1Theme, and team2Theme. Referenced by CG_InitSiegeMode(), InitSiegeMode(), and UI_SetSiegeTeams().
01474 {
01475 siegeTeam_t **teamPtr = NULL;
01476
01477 if (team == SIEGETEAM_TEAM1)
01478 {
01479 teamPtr = &team1Theme;
01480 }
01481 else
01482 {
01483 teamPtr = &team2Theme;
01484 }
01485
01486 (*teamPtr) = BG_SiegeFindTeamForTheme(themeName);
01487 }
|
|
|
Definition at line 168 of file bg_saga.c. References SIEGECHAR_TAB. Referenced by BG_SiegeGetValueGroup().
00169 {
00170 int i = 0;
00171 int i_r = 0;
00172
00173 while (buf[i])
00174 {
00175 if (buf[i] != SIEGECHAR_TAB)
00176 { //not a tab, just stick it in
00177 buf[i_r] = buf[i];
00178 }
00179 else
00180 { //If it's a tab, convert it to a space.
00181 buf[i_r] = ' ';
00182 }
00183
00184 i_r++;
00185 i++;
00186 }
00187
00188 buf[i_r] = '\0';
00189 }
|
|
||||||||||||
|
Definition at line 571 of file bg_saga.c. References atoi(), FORCE_LEVEL_3, FORCE_LEVEL_5, siegeClass_t::forcePowerLevels, FPTable, stringID_table_s::id, name, stringID_table_s::name, NUM_FORCE_POWERS, Q_stricmp(), qboolean, qfalse, qtrue, and strcpy(). Referenced by BG_SiegeParseClassFile().
00572 {
00573 char checkPower[1024];
00574 char checkLevel[256];
00575 int l = 0;
00576 int k = 0;
00577 int j = 0;
00578 int i = 0;
00579 int parsedLevel = 0;
00580 qboolean allPowers = qfalse;
00581 qboolean noPowers = qfalse;
00582
00583 if (!Q_stricmp(buf, "FP_ALL"))
00584 { //this is a special case, just give us all the powers on level 3
00585 allPowers = qtrue;
00586 }
00587
00588 if (buf[0] == '0' && !buf[1])
00589 { //no powers then
00590 noPowers = qtrue;
00591 }
00592
00593 //First clear out the powers, or in the allPowers case, give us all level 3.
00594 while (i < NUM_FORCE_POWERS)
00595 {
00596 if (allPowers)
00597 {
00598 siegeClass->forcePowerLevels[i] = FORCE_LEVEL_3;
00599 }
00600 else
00601 {
00602 siegeClass->forcePowerLevels[i] = 0;
00603 }
00604 i++;
00605 }
00606
00607 if (allPowers || noPowers)
00608 { //we're done now then.
00609 return;
00610 }
00611
00612 i = 0;
00613 while (buf[i])
00614 { //parse through the list which is seperated by |, and add all the weapons into a bitflag
00615 if (buf[i] != ' ' && buf[i] != '|')
00616 {
00617 j = 0;
00618
00619 while (buf[i] && buf[i] != ' ' && buf[i] != '|' && buf[i] != ',')
00620 {
00621 checkPower[j] = buf[i];
00622 j++;
00623 i++;
00624 }
00625 checkPower[j] = 0;
00626
00627 if (buf[i] == ',')
00628 { //parse the power level
00629 i++;
00630 l = 0;
00631 while (buf[i] && buf[i] != ' ' && buf[i] != '|')
00632 {
00633 checkLevel[l] = buf[i];
00634 l++;
00635 i++;
00636 }
00637 checkLevel[l] = 0;
00638 parsedLevel = atoi(checkLevel);
00639
00640 //keep sane limits on the powers
00641 if (parsedLevel < 0)
00642 {
00643 parsedLevel = 0;
00644 }
00645 if (parsedLevel > FORCE_LEVEL_5)
00646 {
00647 parsedLevel = FORCE_LEVEL_5;
00648 }
00649 }
00650 else
00651 { //if it's not there, assume level 3 I guess.
00652 parsedLevel = 3;
00653 }
00654
00655 if (checkPower[0])
00656 { //Got the name, compare it against the weapon table strings.
00657 k = 0;
00658
00659 if (!Q_stricmp(checkPower, "FP_JUMP"))
00660 { //haqery
00661 strcpy(checkPower, "FP_LEVITATION");
00662 }
00663
00664 while (FPTable[k].id != -1 && FPTable[k].name[0])
00665 {
00666 if (!Q_stricmp(checkPower, FPTable[k].name))
00667 { //found it, add the weapon into the weapons value
00668 siegeClass->forcePowerLevels[k] = parsedLevel;
00669 break;
00670 }
00671 k++;
00672 }
00673 }
00674 }
00675
00676 if (!buf[i])
00677 {
00678 break;
00679 }
00680 i++;
00681 }
00682 }
|
|
||||||||||||||||
|
Definition at line 688 of file bg_saga.c. References stringID_table_s::id, name, stringID_table_s::name, Q_stricmp(), and stringID_table_t. Referenced by BG_SiegeParseClassFile().
00689 {
00690 int items = 0;
00691 char checkItem[1024];
00692 int i = 0;
00693 int j = 0;
00694 int k = 0;
00695
00696 if (buf[0] == '0' && !buf[1])
00697 { //special case, no items.
00698 return 0;
00699 }
00700
00701 while (buf[i])
00702 { //Using basically the same parsing method as we do for weapons and forcepowers.
00703 if (buf[i] != ' ' && buf[i] != '|')
00704 {
00705 j = 0;
00706
00707 while (buf[i] && buf[i] != ' ' && buf[i] != '|')
00708 {
00709 checkItem[j] = buf[i];
00710 j++;
00711 i++;
00712 }
00713 checkItem[j] = 0;
00714
00715 if (checkItem[0])
00716 {
00717 k = 0;
00718
00719 while (table[k].name && table[k].name[0])
00720 { //go through the list and check the parsed flag name against the hardcoded names
00721 if (!Q_stricmp(checkItem, table[k].name))
00722 { //Got it, so add the value into our items value.
00723 if (bitflag)
00724 {
00725 items |= (1 << table[k].id);
00726 }
00727 else
00728 { //return the value directly then.
00729 return table[k].id;
00730 }
00731 break;
00732 }
00733 k++;
00734 }
00735 }
00736 }
00737
00738 if (!buf[i])
00739 {
00740 break;
00741 }
00742
00743 i++;
00744 }
00745 return items;
00746 }
|
|
|
Definition at line 95 of file cg_syscalls.c.
00095 {
00096 syscall( CG_FS_FCLOSEFILE, f );
00097 }
|
|
||||||||||||||||
|
Definition at line 83 of file cg_syscalls.c.
00083 {
00084 return syscall( CG_FS_FOPENFILE, qpath, f, mode );
00085 }
|
|
||||||||||||||||||||
|
Definition at line 99 of file cg_syscalls.c.
00099 {
00100 return syscall( CG_FS_GETFILELIST, path, extension, listbuf, bufsize );
00101 }
|
|
||||||||||||||||
|
Definition at line 87 of file cg_syscalls.c.
00087 {
00088 syscall( CG_FS_READ, buffer, len, f );
00089 }
|
|
||||||||||||||||
|
Definition at line 91 of file cg_syscalls.c.
00091 {
00092 syscall( CG_FS_WRITE, buffer, len, f );
00093 }
|
|
|
Definition at line 278 of file cg_syscalls.c.
00278 {
00279 return syscall( CG_R_REGISTERSHADERNOMIP, name );
00280 }
|
|
||||||||||||
|
Definition at line 617 of file bg_saberLoad.c.
00618 {
00619 const char *token;
00620 const char *value;
00621 const char *p;
00622 char useSaber[1024];
00623 float f;
00624 int n;
00625 qboolean triedDefault = qfalse;
00626 int saberMove = LS_INVALID;
00627 int anim = -1;
00628
00629 if ( !saber )
00630 {
00631 return qfalse;
00632 }
00633
00634 //Set defaults so that, if it fails, there's at least something there
00635 WP_SaberSetDefaults( saber );
00636
00637 if ( !SaberName || !SaberName[0] )
00638 {
00639 strcpy(useSaber, DEFAULT_SABER); //default
00640 triedDefault = qtrue;
00641 }
00642 else
00643 {
00644 strcpy(useSaber, SaberName);
00645 }
00646
00647 //try to parse it out
00648 p = SaberParms;
00649 COM_BeginParseSession("saberinfo");
00650
00651 // look for the right saber
00652 while ( p )
00653 {
00654 token = COM_ParseExt( &p, qtrue );
00655 if ( token[0] == 0 )
00656 {
00657 if (!triedDefault)
00658 { //fall back to default and restart, should always be there
00659 p = SaberParms;
00660 COM_BeginParseSession("saberinfo");
00661 strcpy(useSaber, DEFAULT_SABER);
00662 triedDefault = qtrue;
00663 }
00664 else
00665 {
00666 return qfalse;
00667 }
00668 }
00669
00670 if ( !Q_stricmp( token, useSaber ) )
00671 {
00672 break;
00673 }
00674
00675 SkipBracedSection( &p );
00676 }
00677 if ( !p )
00678 { //even the default saber isn't found?
00679 return qfalse;
00680 }
00681
00682 //got the name we're using for sure
00683 strcpy(saber->name, useSaber);
00684
00685 if ( BG_ParseLiteral( &p, "{" ) )
00686 {
00687 return qfalse;
00688 }
00689
00690 // parse the saber info block
00691 while ( 1 )
00692 {
00693 token = COM_ParseExt( &p, qtrue );
00694 if ( !token[0] )
00695 {
00696 Com_Printf( S_COLOR_RED"ERROR: unexpected EOF while parsing '%s'\n", useSaber );
00697 return qfalse;
00698 }
00699
00700 if ( !Q_stricmp( token, "}" ) )
00701 {
00702 break;
00703 }
00704
00705 //saber fullName
00706 if ( !Q_stricmp( token, "name" ) )
00707 {
00708 if ( COM_ParseString( &p, &value ) )
00709 {
00710 continue;
00711 }
00712 strcpy(saber->fullName, value);
00713 continue;
00714 }
00715
00716 //saber type
00717 if ( !Q_stricmp( token, "saberType" ) )
00718 {
00719 int saberType;
00720
00721 if ( COM_ParseString( &p, &value ) )
00722 {
00723 continue;
00724 }
00725 saberType = GetIDForString( SaberTable, value );
00726 if ( saberType >= SABER_SINGLE && saberType <= NUM_SABERS )
00727 {
00728 saber->type = (saberType_t)saberType;
00729 }
00730 continue;
00731 }
00732
00733 //saber hilt
00734 if ( !Q_stricmp( token, "saberModel" ) )
00735 {
00736 if ( COM_ParseString( &p, &value ) )
00737 {
00738 continue;
00739 }
00740 strcpy(saber->model, value);
00741 continue;
00742 }
00743
00744 if ( !Q_stricmp( token, "customSkin" ) )
00745 {
00746 if ( COM_ParseString( &p, &value ) )
00747 {
00748 continue;
00749 }
00750 saber->skin = trap_R_RegisterSkin(value);
00751 continue;
00752 }
00753
00754 //on sound
00755 if ( !Q_stricmp( token, "soundOn" ) )
00756 {
00757 if ( COM_ParseString( &p, &value ) )
00758 {
00759 continue;
00760 }
00761 saber->soundOn = BG_SoundIndex( (char *)value );
00762 continue;
00763 }
00764
00765 //loop sound
00766 if ( !Q_stricmp( token, "soundLoop" ) )
00767 {
00768 if ( COM_ParseString( &p, &value ) )
00769 {
00770 continue;
00771 }
00772 saber->soundLoop = BG_SoundIndex( (char *)value );
00773 continue;
00774 }
00775
00776 //off sound
00777 if ( !Q_stricmp( token, "soundOff" ) )
00778 {
00779 if ( COM_ParseString( &p, &value ) )
00780 {
00781 continue;
00782 }
00783 saber->soundOff = BG_SoundIndex( (char *)value );
00784 continue;
00785 }
00786
00787 if ( !Q_stricmp( token, "numBlades" ) )
00788 {
00789 if ( COM_ParseInt( &p, &n ) )
00790 {
00791 SkipRestOfLine( &p );
00792 continue;
00793 }
00794 if ( n < 1 || n > MAX_BLADES )
00795 {
00796 Com_Error(ERR_DROP, "WP_SaberParseParms: saber %s has illegal number of blades (%d) max: %d", useSaber, n, MAX_BLADES );
00797 continue;
00798 }
00799 saber->numBlades = n;
00800 continue;
00801 }
00802
00803 // saberColor
00804 if ( !Q_stricmpn( token, "saberColor", 10 ) )
00805 {
00806 if (strlen(token)==10)
00807 {
00808 n = -1;
00809 }
00810 else if (strlen(token)==11)
00811 {
00812 n = atoi(&token[10])-1;
00813 if (n > 7 || n < 1 )
00814 {
00815 Com_Printf( S_COLOR_YELLOW"WARNING: bad saberColor '%s' in %s\n", token, useSaber );
00816 continue;
00817 }
00818 }
00819 else
00820 {
00821 Com_Printf( S_COLOR_YELLOW"WARNING: bad saberColor '%s' in %s\n", token, useSaber );
00822 continue;
00823 }
00824
00825 if ( COM_ParseString( &p, &value ) ) //read the color
00826 {
00827 continue;
00828 }
00829
00830 if (n==-1)
00831 {//NOTE: this fills in the rest of the blades with the same color by default
00832 saber_colors_t color = TranslateSaberColor( value );
00833 for ( n = 0; n < MAX_BLADES; n++ )
00834 {
00835 saber->blade[n].color = color;
00836 }
00837 } else
00838 {
00839 saber->blade[n].color = TranslateSaberColor( value );
00840 }
00841 continue;
00842 }
00843
00844 //saber length
00845 if ( !Q_stricmpn( token, "saberLength", 11 ) )
00846 {
00847 if (strlen(token)==11)
00848 {
00849 n = -1;
00850 }
00851 else if (strlen(token)==12)
00852 {
00853 n = atoi(&token[11])-1;
00854 if (n > 7 || n < 1 )
00855 {
00856 Com_Printf( S_COLOR_YELLOW"WARNING: bad saberLength '%s' in %s\n", token, useSaber );
00857 continue;
00858 }
00859 }
00860 else
00861 {
00862 Com_Printf( S_COLOR_YELLOW"WARNING: bad saberLength '%s' in %s\n", token, useSaber );
00863 continue;
00864 }
00865
00866 if ( COM_ParseFloat( &p, &f ) )
00867 {
00868 SkipRestOfLine( &p );
00869 continue;
00870 }
00871 //cap
00872 if ( f < 4.0f )
00873 {
00874 f = 4.0f;
00875 }
00876
00877 if (n==-1)
00878 {//NOTE: this fills in the rest of the blades with the same length by default
00879 for ( n = 0; n < MAX_BLADES; n++ )
00880 {
00881 saber->blade[n].lengthMax = f;
00882 }
00883 }
00884 else
00885 {
00886 saber->blade[n].lengthMax = f;
00887 }
00888 continue;
00889 }
00890
00891 //blade radius
00892 if ( !Q_stricmpn( token, "saberRadius", 11 ) )
00893 {
00894 if (strlen(token)==11)
00895 {
00896 n = -1;
00897 }
00898 else if (strlen(token)==12)
00899 {
00900 n = atoi(&token[11])-1;
00901 if (n > 7 || n < 1 )
00902 {
00903 Com_Printf( S_COLOR_YELLOW"WARNING: bad saberRadius '%s' in %s\n", token, useSaber );
00904 continue;
00905 }
00906 }
00907 else
00908 {
00909 Com_Printf( S_COLOR_YELLOW"WARNING: bad saberRadius '%s' in %s\n", token, useSaber );
00910 continue;
00911 }
00912
00913 if ( COM_ParseFloat( &p, &f ) )
00914 {
00915 SkipRestOfLine( &p );
00916 continue;
00917 }
00918 //cap
00919 if ( f < 0.25f )
00920 {
00921 f = 0.25f;
00922 }
00923 if (n==-1)
00924 {//NOTE: this fills in the rest of the blades with the same length by default
00925 for ( n = 0; n < MAX_BLADES; n++ )
00926 {
00927 saber->blade[n].radius = f;
00928 }
00929 }
00930 else
00931 {
00932 saber->blade[n].radius = f;
00933 }
00934 continue;
00935 }
00936
00937 //locked saber style
00938 if ( !Q_stricmp( token, "saberStyle" ) )
00939 {
00940 int style, styleNum;
00941 if ( COM_ParseString( &p, &value ) )
00942 {
00943 continue;
00944 }
00945 //OLD WAY: only allowed ONE style
00946 style = TranslateSaberStyle( value );
00947 //learn only this style
00948 saber->stylesLearned = (1<<style);
00949 //forbid all other styles
00950 saber->stylesForbidden = 0;
00951 for ( styleNum = SS_NONE+1; styleNum < SS_NUM_SABER_STYLES; styleNum++ )
00952 {
00953 if ( styleNum != style )
00954 {
00955 saber->stylesForbidden |= (1<<styleNum);
00956 }
00957 }
00958 continue;
00959 }
00960
00961 //learned saber style
00962 if ( !Q_stricmp( token, "saberStyleLearned" ) )
00963 {
00964 if ( COM_ParseString( &p, &value ) )
00965 {
00966 continue;
00967 }
00968 saber->stylesLearned |= (1<<TranslateSaberStyle( value ));
00969 continue;
00970 }
00971
00972 //forbidden saber style
00973 if ( !Q_stricmp( token, "saberStyleForbidden" ) )
00974 {
00975 if ( COM_ParseString( &p, &value ) )
00976 {
00977 continue;
00978 }
00979 saber->stylesForbidden |= (1<<TranslateSaberStyle( value ));
00980 continue;
00981 }
00982
00983 //maxChain
00984 if ( !Q_stricmp( token, "maxChain" ) )
00985 {
00986 if ( COM_ParseInt( &p, &n ) )
00987 {
00988 SkipRestOfLine( &p );
00989 continue;
00990 }
00991 saber->maxChain = n;
00992 continue;
00993 }
00994
00995 //lockable
00996 if ( !Q_stricmp( token, "lockable" ) )
00997 {
00998 if ( COM_ParseInt( &p, &n ) )
00999 {
01000 SkipRestOfLine( &p );
01001 continue;
01002 }
01003 if ( n == 0 )
01004 {
01005 saber->saberFlags |= SFL_NOT_LOCKABLE;
01006 }
01007 continue;
01008 }
01009
01010 //throwable
01011 if ( !Q_stricmp( token, "throwable" ) )
01012 {
01013 if ( COM_ParseInt( &p, &n ) )
01014 {
01015 SkipRestOfLine( &p );
01016 continue;
01017 }
01018 if ( n == 0 )
01019 {
01020 saber->saberFlags |= SFL_NOT_THROWABLE;
01021 }
01022 continue;
01023 }
01024
01025 //disarmable
01026 if ( !Q_stricmp( token, "disarmable" ) )
01027 {
01028 if ( COM_ParseInt( &p, &n ) )
01029 {
01030 SkipRestOfLine( &p );
01031 continue;
01032 }
01033 if ( n == 0 )
01034 {
01035 saber->saberFlags |= SFL_NOT_DISARMABLE;
01036 }
01037 continue;
01038 }
01039
01040 //active blocking
01041 if ( !Q_stricmp( token, "blocking" ) )
01042 {
01043 if ( COM_ParseInt( &p, &n ) )
01044 {
01045 SkipRestOfLine( &p );
01046 continue;
01047 }
01048 if ( n == 0 )
01049 {
01050 saber->saberFlags |= SFL_NOT_ACTIVE_BLOCKING;
01051 }
01052 continue;
01053 }
01054
01055 //twoHanded
01056 if ( !Q_stricmp( token, "twoHanded" ) )
01057 {
01058 if ( COM_ParseInt( &p, &n ) )
01059 {
01060 SkipRestOfLine( &p );
01061 continue;
01062 }
01063 if ( n )
01064 {
01065 saber->saberFlags |= SFL_TWO_HANDED;
01066 }
01067 continue;
01068 }
01069
01070 //force power restrictions
01071 if ( !Q_stricmp( token, "forceRestrict" ) )
01072 {
01073 int fp;
01074
01075 if ( COM_ParseString( &p, &value ) )
01076 {
01077 continue;
01078 }
01079 fp = GetIDForString( FPTable, value );
01080 if ( fp >= FP_FIRST && fp < NUM_FORCE_POWERS )
01081 {
01082 saber->forceRestrictions |= (1<<fp);
01083 }
01084 continue;
01085 }
01086
01087 //lockBonus
01088 if ( !Q_stricmp( token, "lockBonus" ) )
01089 {
01090 if ( COM_ParseInt( &p, &n ) )
01091 {
01092 SkipRestOfLine( &p );
01093 continue;
01094 }
01095 saber->lockBonus = n;
01096 continue;
01097 }
01098
01099 //parryBonus
01100 if ( !Q_stricmp( token, "parryBonus" ) )
01101 {
01102 if ( COM_ParseInt( &p, &n ) )
01103 {
01104 SkipRestOfLine( &p );
01105 continue;
01106 }
01107 saber->parryBonus = n;
01108 continue;
01109 }
01110
01111 //breakParryBonus
01112 if ( !Q_stricmp( token, "breakParryBonus" ) )
01113 {
01114 if ( COM_ParseInt( &p, &n ) )
01115 {
01116 SkipRestOfLine( &p );
01117 continue;
01118 }
01119 saber->breakParryBonus = n;
01120 continue;
01121 }
01122
01123 //breakParryBonus2
01124 if ( !Q_stricmp( token, "breakParryBonus2" ) )
01125 {
01126 if ( COM_ParseInt( &p, &n ) )
01127 {
01128 SkipRestOfLine( &p );
01129 continue;
01130 }
01131 saber->breakParryBonus2 = n;
01132 continue;
01133 }
01134
01135 //disarmBonus
01136 if ( !Q_stricmp( token, "disarmBonus" ) )
01137 {
01138 if ( COM_ParseInt( &p, &n ) )
01139 {
01140 SkipRestOfLine( &p );
01141 continue;
01142 }
01143 saber->disarmBonus = n;
01144 continue;
01145 }
01146
01147 //disarmBonus2
01148 if ( !Q_stricmp( token, "disarmBonus2" ) )
01149 {
01150 if ( COM_ParseInt( &p, &n ) )
01151 {
01152 SkipRestOfLine( &p );
01153 continue;
01154 }
01155 saber->disarmBonus2 = n;
01156 continue;
01157 }
01158
01159 //single blade saber style
01160 if ( !Q_stricmp( token, "singleBladeStyle" ) )
01161 {
01162 if ( COM_ParseString( &p, &value ) )
01163 {
01164 continue;
01165 }
01166 saber->singleBladeStyle = TranslateSaberStyle( value );
01167 continue;
01168 }
01169
01170 //single blade throwable
01171 if ( !Q_stricmp( token, "singleBladeThrowable" ) )
01172 {
01173 if ( COM_ParseInt( &p, &n ) )
01174 {
01175 SkipRestOfLine( &p );
01176 continue;
01177 }
01178 if ( n )
01179 {
01180 saber->saberFlags |= SFL_SINGLE_BLADE_THROWABLE;
01181 }
01182 continue;
01183 }
01184
01185 //broken replacement saber1 (right hand)
01186 if ( !Q_stricmp( token, "brokenSaber1" ) )
01187 {
01188 if ( COM_ParseString( &p, &value ) )
01189 {
01190 continue;
01191 }
01192 //saber->brokenSaber1 = G_NewString( value );
01193 continue;
01194 }
01195
01196 //broken replacement saber2 (left hand)
01197 if ( !Q_stricmp( token, "brokenSaber2" ) )
01198 {
01199 if ( COM_ParseString( &p, &value ) )
01200 {
01201 continue;
01202 }
01203 //saber->brokenSaber2 = G_NewString( value );
01204 continue;
01205 }
01206
01207 //spins and does damage on return from saberthrow
01208 if ( !Q_stricmp( token, "returnDamage" ) )
01209 {
01210 if ( COM_ParseInt( &p, &n ) )
01211 {
01212 SkipRestOfLine( &p );
01213 continue;
01214 }
01215 if ( n )
01216 {
01217 saber->saberFlags |= SFL_RETURN_DAMAGE;
01218 }
01219 continue;
01220 }
01221
01222 //spin sound (when thrown)
01223 if ( !Q_stricmp( token, "spinSound" ) )
01224 {
01225 if ( COM_ParseString( &p, &value ) )
01226 {
01227 continue;
01228 }
01229 saber->spinSound = BG_SoundIndex( (char *)value );
01230 continue;
01231 }
01232
01233 //swing sound - NOTE: must provide all 3!!!
01234 if ( !Q_stricmp( token, "swingSound1" ) )
01235 {
01236 if ( COM_ParseString( &p, &value ) )
01237 {
01238 continue;
01239 }
01240 saber->swingSound[0] = BG_SoundIndex( (char *)value );
01241 continue;
01242 }
01243
01244 //swing sound - NOTE: must provide all 3!!!
01245 if ( !Q_stricmp( token, "swingSound2" ) )
01246 {
01247 if ( COM_ParseString( &p, &value ) )
01248 {
01249 continue;
01250 }
01251 saber->swingSound[1] = BG_SoundIndex( (char *)value );
01252 continue;
01253 }
01254
01255 //swing sound - NOTE: must provide all 3!!!
01256 if ( !Q_stricmp( token, "swingSound3" ) )
01257 {
01258 if ( COM_ParseString( &p, &value ) )
01259 {
01260 continue;
01261 }
01262 saber->swingSound[2] = BG_SoundIndex( (char *)value );
01263 continue;
01264 }
01265
01266 //you move faster/slower when using this saber
01267 if ( !Q_stricmp( token, "moveSpeedScale" ) )
01268 {
01269 if ( COM_ParseFloat( &p, &f ) )
01270 {
01271 SkipRestOfLine( &p );
01272 continue;
01273 }
01274 saber->moveSpeedScale = f;
01275 continue;
01276 }
01277
01278 //plays normal attack animations faster/slower
01279 if ( !Q_stricmp( token, "animSpeedScale" ) )
01280 {
01281 if ( COM_ParseFloat( &p, &f ) )
01282 {
01283 SkipRestOfLine( &p );
01284 continue;
01285 }
01286 saber->animSpeedScale = f;
01287 continue;
01288 }
01289
01290 //if non-zero, the saber will bounce back when it hits solid architecture (good for real-sword type mods)
01291 if ( !Q_stricmp( token, "bounceOnWalls" ) )
01292 {
01293 if ( COM_ParseInt( &p, &n ) )
01294 {
01295 SkipRestOfLine( &p );
01296 continue;
01297 }
01298 if ( n )
01299 {
01300 saber->saberFlags |= SFL_BOUNCE_ON_WALLS;
01301 }
01302 continue;
01303 }
01304
01305 //if set, saber model is bolted to wrist, not in hand... useful for things like claws & shields, etc.
01306 if ( !Q_stricmp( token, "boltToWrist" ) )
01307 {
01308 if ( COM_ParseInt( &p, &n ) )
01309 {
01310 SkipRestOfLine( &p );
01311 continue;
01312 }
01313 if ( n )
01314 {
01315 saber->saberFlags |= SFL_BOLT_TO_WRIST;
01316 }
01317 continue;
01318 }
01319
01320 //kata move
01321 if ( !Q_stricmp( token, "kataMove" ) )
01322 {
01323 if ( COM_ParseString( &p, &value ) )
01324 {
01325 continue;
01326 }
01327 saberMove = GetIDForString( SaberMoveTable, value );
01328 if ( saberMove >= LS_INVALID && saberMove < LS_MOVE_MAX )
01329 {
01330 saber->kataMove = saberMove; //LS_INVALID - if set, player will execute this move when they press both attack buttons at the same time
01331 }
01332 continue;
01333 }
01334 //lungeAtkMove move
01335 if ( !Q_stricmp( token, "lungeAtkMove" ) )
01336 {
01337 if ( COM_ParseString( &p, &value ) )
01338 {
01339 continue;
01340 }
01341 saberMove = GetIDForString( SaberMoveTable, value );
01342 if ( saberMove >= LS_INVALID && saberMove < LS_MOVE_MAX )
01343 {
01344 saber->lungeAtkMove = saberMove;
01345 }
01346 continue;
01347 }
01348 //jumpAtkUpMove move
01349 if ( !Q_stricmp( token, "jumpAtkUpMove" ) )
01350 {
01351 if ( COM_ParseString( &p, &value ) )
01352 {
01353 continue;
01354 }
01355 saberMove = GetIDForString( SaberMoveTable, value );
01356 if ( saberMove >= LS_INVALID && saberMove < LS_MOVE_MAX )
01357 {
01358 saber->jumpAtkUpMove = saberMove;
01359 }
01360 continue;
01361 }
01362 //jumpAtkFwdMove move
01363 if ( !Q_stricmp( token, "jumpAtkFwdMove" ) )
01364 {
01365 if ( COM_ParseString( &p, &value ) )
01366 {
01367 continue;
01368 }
01369 saberMove = GetIDForString( SaberMoveTable, value );
01370 if ( saberMove >= LS_INVALID && saberMove < LS_MOVE_MAX )
01371 {
01372 saber->jumpAtkFwdMove = saberMove;
01373 }
01374 continue;
01375 }
01376 //jumpAtkBackMove move
01377 if ( !Q_stricmp( token, "jumpAtkBackMove" ) )
01378 {
01379 if ( COM_ParseString( &p, &value ) )
01380 {
01381 continue;
01382 }
01383 saberMove = GetIDForString( SaberMoveTable, value );
01384 if ( saberMove >= LS_INVALID && saberMove < LS_MOVE_MAX )
01385 {
01386 saber->jumpAtkBackMove = saberMove;
01387 }
01388 continue;
01389 }
01390 //jumpAtkRightMove move
01391 if ( !Q_stricmp( token, "jumpAtkRightMove" ) )
01392 {
01393 if ( COM_ParseString( &p, &value ) )
01394 {
01395 continue;
01396 }
01397 saberMove = GetIDForString( SaberMoveTable, value );
01398 if ( saberMove >= LS_INVALID && saberMove < LS_MOVE_MAX )
01399 {
01400 saber->jumpAtkRightMove = saberMove;
01401 }
01402 continue;
01403 }
01404 //jumpAtkLeftMove move
01405 if ( !Q_stricmp( token, "jumpAtkLeftMove" ) )
01406 {
01407 if ( COM_ParseString( &p, &value ) )
01408 {
01409 continue;
01410 }
01411 saberMove = GetIDForString( SaberMoveTable, value );
01412 if ( saberMove >= LS_INVALID && saberMove < LS_MOVE_MAX )
01413 {
01414 saber->jumpAtkLeftMove = saberMove;
01415 }
01416 continue;
01417 }
01418 //readyAnim
01419 if ( !Q_stricmp( token, "readyAnim" ) )
01420 {
01421 if ( COM_ParseString( &p, &value ) )
01422 {
01423 continue;
01424 }
01425 anim = GetIDForString( animTable, value );
01426 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01427 {
01428 saber->readyAnim = anim;
01429 }
01430 continue;
01431 }
01432 //drawAnim
01433 if ( !Q_stricmp( token, "drawAnim" ) )
01434 {
01435 if ( COM_ParseString( &p, &value ) )
01436 {
01437 continue;
01438 }
01439 anim = GetIDForString( animTable, value );
01440 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01441 {
01442 saber->drawAnim = anim;
01443 }
01444 continue;
01445 }
01446 //putawayAnim
01447 if ( !Q_stricmp( token, "putawayAnim" ) )
01448 {
01449 if ( COM_ParseString( &p, &value ) )
01450 {
01451 continue;
01452 }
01453 anim = GetIDForString( animTable, value );
01454 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01455 {
01456 saber->putawayAnim = anim;
01457 }
01458 continue;
01459 }
01460 //tauntAnim
01461 if ( !Q_stricmp( token, "tauntAnim" ) )
01462 {
01463 if ( COM_ParseString( &p, &value ) )
01464 {
01465 continue;
01466 }
01467 anim = GetIDForString( animTable, value );
01468 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01469 {
01470 saber->tauntAnim = anim;
01471 }
01472 continue;
01473 }
01474 //bowAnim
01475 if ( !Q_stricmp( token, "bowAnim" ) )
01476 {
01477 if ( COM_ParseString( &p, &value ) )
01478 {
01479 continue;
01480 }
01481 anim = GetIDForString( animTable, value );
01482 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01483 {
01484 saber->bowAnim = anim;
01485 }
01486 continue;
01487 }
01488 //meditateAnim
01489 if ( !Q_stricmp( token, "meditateAnim" ) )
01490 {
01491 if ( COM_ParseString( &p, &value ) )
01492 {
01493 continue;
01494 }
01495 anim = GetIDForString( animTable, value );
01496 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01497 {
01498 saber->meditateAnim = anim;
01499 }
01500 continue;
01501 }
01502 //flourishAnim
01503 if ( !Q_stricmp( token, "flourishAnim" ) )
01504 {
01505 if ( COM_ParseString( &p, &value ) )
01506 {
01507 continue;
01508 }
01509 anim = GetIDForString( animTable, value );
01510 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01511 {
01512 saber->flourishAnim = anim;
01513 }
01514 continue;
01515 }
01516 //gloatAnim
01517 if ( !Q_stricmp( token, "gloatAnim" ) )
01518 {
01519 if ( COM_ParseString( &p, &value ) )
01520 {
01521 continue;
01522 }
01523 anim = GetIDForString( animTable, value );
01524 if ( anim >= 0 && anim < MAX_ANIMATIONS )
01525 {
01526 saber->gloatAnim = anim;
01527 }
01528 continue;
01529 }
01530
01531 //if set, cannot do roll-stab move at end of roll
01532 if ( !Q_stricmp( token, "noRollStab" ) )
01533 {
01534 if ( COM_ParseInt( &p, &n ) )
01535 {
01536 SkipRestOfLine( &p );
01537 continue;
01538 }
01539 if ( n )
01540 {
01541 saber->saberFlags |= SFL_NO_ROLL_STAB;
01542 }
01543 continue;
01544 }
01545
01546 //if set, cannot do pull+attack move (move not available in MP anyway)
01547 if ( !Q_stricmp( token, "noPullAttack" ) )
01548 {
01549 if ( COM_ParseInt( &p, &n ) )
01550 {
01551 SkipRestOfLine( &p );
01552 continue;
01553 }
01554 if ( n )
01555 {
01556 saber->saberFlags |= SFL_NO_PULL_ATTACK;
01557 }
01558 continue;
01559 }
01560
01561 //if set, cannot do back-stab moves
01562 if ( !Q_stricmp( token, "noBackAttack" ) )
01563 {
01564 if ( COM_ParseInt( &p, &n ) )
01565 {
01566 SkipRestOfLine( &p );
01567 continue;
01568 }
01569 if ( n )
01570 {
01571 saber->saberFlags |= SFL_NO_BACK_ATTACK;
01572 }
01573 continue;
01574 }
01575
01576 //if set, cannot do stabdown move (when enemy is on ground)
01577 if ( !Q_stricmp( token, "noStabDown" ) )
01578 {
01579 if ( COM_ParseInt( &p, &n ) )
01580 {
01581 SkipRestOfLine( &p );
01582 continue;
01583 }
01584 if ( n )
01585 {
01586 saber->saberFlags |= SFL_NO_STABDOWN;
01587 }
01588 continue;
01589 }
01590
01591 //if set, cannot side-run or forward-run on walls
01592 if ( !Q_stricmp( token, "noWallRuns" ) )
01593 {
01594 if ( COM_ParseInt( &p, &n ) )
01595 {
01596 SkipRestOfLine( &p );
01597 continue;
01598 }
01599 if ( n )
01600 {
01601 saber->saberFlags |= SFL_NO_WALL_RUNS;
01602 }
01603 continue;
01604 }
01605
01606 //if set, cannot do backflip off wall or side-flips off walls
01607 if ( !Q_stricmp( token, "noWallFlips" ) )
01608 {
01609 if ( COM_ParseInt( &p, &n ) )
01610 {
01611 SkipRestOfLine( &p );
01612 continue;
01613 }
01614 if ( n )
01615 {
01616 saber->saberFlags |= SFL_NO_WALL_FLIPS;
01617 }
01618 continue;
01619 }
01620
01621 //if set, cannot grab wall & jump off
01622 if ( !Q_stricmp( token, "noWallGrab" ) )
01623 {
01624 if ( COM_ParseInt( &p, &n ) )
01625 {
01626 SkipRestOfLine( &p );
01627 continue;
01628 }
01629 if ( n )
01630 {
01631 saber->saberFlags |= SFL_NO_WALL_GRAB;
01632 }
01633 continue;
01634 }
01635
01636 //if set, cannot roll
01637 if ( !Q_stricmp( token, "noRolls" ) )
01638 {
01639 if ( COM_ParseInt( &p, &n ) )
01640 {
01641 SkipRestOfLine( &p );
01642 continue;
01643 }
01644 if ( n )
01645 {
01646 saber->saberFlags |= SFL_NO_ROLLS;
01647 }
01648 continue;
01649 }
01650
01651 //if set, cannot do flips
01652 if ( !Q_stricmp( token, "noFlips" ) )
01653 {
01654 if ( COM_ParseInt( &p, &n ) )
01655 {
01656 SkipRestOfLine( &p );
01657 continue;
01658 }
01659 if ( n )
01660 {
01661 saber->saberFlags |= SFL_NO_FLIPS;
01662 }
01663 continue;
01664 }
01665
01666 //if set, cannot do cartwheels
01667 if ( !Q_stricmp( token, "noCartwheels" ) )
01668 {
01669 if ( COM_ParseInt( &p, &n ) )
01670 {
01671 SkipRestOfLine( &p );
01672 continue;
01673 }
01674 if ( n )
01675 {
01676 saber->saberFlags |= SFL_NO_CARTWHEELS;
01677 }
01678 continue;
01679 }
01680
01681 //if set, cannot do kicks (can't do kicks anyway if using a throwable saber/sword)
01682 if ( !Q_stricmp( token, "noKicks" ) )
01683 {
01684 if ( COM_ParseInt( &p, &n ) )
01685 {
01686 SkipRestOfLine( &p );
01687 continue;
01688 }
01689 if ( n )
01690 {
01691 saber->saberFlags |= SFL_NO_KICKS;
01692 }
01693 continue;
01694 }
01695
01696 //if set, cannot do the simultaneous attack left/right moves (only available in Dual Lightsaber Combat Style)
01697 if ( !Q_stricmp( token, "noMirrorAttacks" ) )
01698 {
01699 if ( COM_ParseInt( &p, &n ) )
01700 {
01701 SkipRestOfLine( &p );
01702 continue;
01703 }
01704 if ( n )
01705 {
01706 saber->saberFlags |= SFL_NO_MIRROR_ATTACKS;
01707 }
01708 continue;
01709 }
01710
01711 //stays on in water
01712 if ( !Q_stricmp( token, "onInWater" ) )
01713 {//ignore in MP
01714 SkipRestOfLine( &p );
01715 continue;
01716 }
01717
01718 if ( !Q_stricmp( token, "notInMP" ) )
01719 {//ignore this
01720 SkipRestOfLine( &p );
01721 continue;
01722 }
01723
01724 //===ABOVE THIS, ALL VALUES ARE GLOBAL TO THE SABER========================================================
01725 //bladeStyle2Start - where to start using the second set of blade data
01726 if ( !Q_stricmp( token, "bladeStyle2Start" ) )
01727 {
01728 if ( COM_ParseInt( &p, &n ) )
01729 {
01730 SkipRestOfLine( &p );
01731 continue;
01732 }
01733 saber->bladeStyle2Start = n;
01734 continue;
01735 }
01736 //===BLADE-SPECIFIC FIELDS=================================================================================
01737
01738 //===PRIMARY BLADE====================================
01739 //stops the saber from drawing marks on the world (good for real-sword type mods)
01740 if ( !Q_stricmp( token, "noWallMarks" ) )
01741 {
01742 if ( COM_ParseInt( &p, &n ) )
01743 {
01744 SkipRestOfLine( &p );
01745 continue;
01746 }
01747 if ( n )
01748 {
01749 saber->saberFlags2 |= SFL2_NO_WALL_MARKS;
01750 }
01751 continue;
01752 }
01753
01754 //stops the saber from drawing a dynamic light (good for real-sword type mods)
01755 if ( !Q_stricmp( token, "noDlight" ) )
01756 {
01757 if ( COM_ParseInt( &p, &n ) )
01758 {
01759 SkipRestOfLine( &p );
01760 continue;
01761 }
01762 if ( n )
01763 {
01764 saber->saberFlags2 |= SFL2_NO_DLIGHT;
01765 }
01766 continue;
01767 }
01768
01769 //stops the saber from drawing a blade (good for real-sword type mods)
01770 if ( !Q_stricmp( token, "noBlade" ) )
01771 {
01772 if ( COM_ParseInt( &p, &n ) )
01773 {
01774 SkipRestOfLine( &p );
01775 continue;
01776 }
01777 if ( n )
01778 {
01779 saber->saberFlags2 |= SFL2_NO_BLADE;
01780 }
01781 continue;
01782 }
01783
01784 //default (0) is normal, 1 is a motion blur and 2 is no trail at all (good for real-sword type mods)
01785 if ( !Q_stricmp( token, "trailStyle" ) )
01786 {
01787 if ( COM_ParseInt( &p, &n ) )
01788 {
01789 SkipRestOfLine( &p );
01790 continue;
01791 }
01792 saber->trailStyle = n;
01793 continue;
01794 }
01795
01796 //if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
01797 if ( !Q_stricmp( token, "g2MarksShader" ) )
01798 {
01799 if ( COM_ParseString( &p, &value ) )
01800 {
01801 SkipRestOfLine( &p );
01802 continue;
01803 }
01804 #ifdef QAGAME//cgame-only cares about this
01805 SkipRestOfLine(&p);
01806 #elif defined CGAME
01807 saber->g2MarksShader = trap_R_RegisterShader( value );
01808 #else
01809 SkipRestOfLine(&p);
01810 #endif
01811 continue;
01812 }
01813
01814 //if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
01815 if ( !Q_stricmp( token, "g2WeaponMarkShader" ) )
01816 {
01817 if ( COM_ParseString( &p, &value ) )
01818 {
01819 SkipRestOfLine( &p );
01820 continue;
01821 }
01822 #ifdef QAGAME//cgame-only cares about this
01823 SkipRestOfLine(&p);
01824 #elif defined CGAME
01825 saber->g2WeaponMarkShader = trap_R_RegisterShader( value );
01826 #else
01827 SkipRestOfLine(&p);
01828 #endif
01829 continue;
01830 }
01831
01832 //if non-zero, uses damage done to calculate an appropriate amount of knockback
01833 if ( !Q_stricmp( token, "knockbackScale" ) )
01834 {
01835 if ( COM_ParseFloat( &p, &f ) )
01836 {
01837 SkipRestOfLine( &p );
01838 continue;
01839 }
01840 saber->knockbackScale = f;
01841 continue;
01842 }
01843
01844 //scale up or down the damage done by the saber
01845 if ( !Q_stricmp( token, "damageScale" ) )
01846 {
01847 if ( COM_ParseFloat( &p, &f ) )
01848 {
01849 SkipRestOfLine( &p );
01850 continue;
01851 }
01852 saber->damageScale = f;
01853 continue;
01854 }
01855
01856 //if non-zero, the saber never does dismemberment (good for pointed/blunt melee weapons)
01857 if ( !Q_stricmp( token, "noDismemberment" ) )
01858 {
01859 if ( COM_ParseInt( &p, &n ) )
01860 {
01861 SkipRestOfLine( &p );
01862 continue;
01863 }
01864 if ( n )
01865 {
01866 saber->saberFlags2 |= SFL2_NO_DISMEMBERMENT;
01867 }
01868 continue;
01869 }
01870
01871 //if non-zero, the saber will not do damage or any effects when it is idle (not in an attack anim). (good for real-sword type mods)
01872 if ( !Q_stricmp( token, "noIdleEffect" ) )
01873 {
01874 if ( COM_ParseInt( &p, &n ) )
01875 {
01876 SkipRestOfLine( &p );
01877 continue;
01878 }
01879 if ( n )
01880 {
01881 saber->saberFlags2 |= SFL2_NO_IDLE_EFFECT;
01882 }
01883 continue;
01884 }
01885
01886 //if set, the blades will always be blocking (good for things like shields that should always block)
01887 if ( !Q_stricmp( token, "alwaysBlock" ) )
01888 {
01889 if ( COM_ParseInt( &p, &n ) )
01890 {
01891 SkipRestOfLine( &p );
01892 continue;
01893 }
01894 if ( n )
01895 {
01896 saber->saberFlags2 |= SFL2_ALWAYS_BLOCK;
01897 }
01898 continue;
01899 }
01900
01901 //if set, the blades cannot manually be toggled on and off
01902 if ( !Q_stricmp( token, "noManualDeactivate" ) )
01903 {
01904 if ( COM_ParseInt( &p, &n ) )
01905 {
01906 SkipRestOfLine( &p );
01907 continue;
01908 }
01909 if ( n )
01910 {
01911 saber->saberFlags2 |= SFL2_NO_MANUAL_DEACTIVATE;
01912 }
01913 continue;
01914 }
01915
01916 //if set, the blade does damage in start, transition and return anims (like strong style does)
01917 if ( !Q_stricmp( token, "transitionDamage" ) )
01918 {
01919 if ( COM_ParseInt( &p, &n ) )
01920 {
01921 SkipRestOfLine( &p );
01922 continue;
01923 }
01924 if ( n )
01925 {
01926 saber->saberFlags2 |= SFL2_TRANSITION_DAMAGE;
01927 }
01928 continue;
01929 }
01930
01931 //splashRadius - radius of splashDamage
01932 if ( !Q_stricmp( token, "splashRadius" ) )
01933 {
01934 if ( COM_ParseFloat( &p, &f ) )
01935 {
01936 SkipRestOfLine( &p );
01937 continue;
01938 }
01939 saber->splashRadius = f;
01940 continue;
01941 }
01942
01943 //splashDamage - amount of splashDamage, 100% at a distance of 0, 0% at a distance = splashRadius
01944 if ( !Q_stricmp( token, "splashDamage" ) )
01945 {
01946 if ( COM_ParseInt( &p, &n ) )
01947 {
01948 SkipRestOfLine( &p );
01949 continue;
01950 }
01951 saber->splashDamage = n;
01952 continue;
01953 }
01954
01955 //splashKnockback - amount of splashKnockback, 100% at a distance of 0, 0% at a distance = splashRadius
01956 if ( !Q_stricmp( token, "splashKnockback" ) )
01957 {
01958 if ( COM_ParseFloat( &p, &f ) )
01959 {
01960 SkipRestOfLine( &p );
01961 continue;
01962 }
01963 saber->splashKnockback = f;
01964 continue;
01965 }
01966
01967 //hit sound - NOTE: must provide all 3!!!
01968 if ( !Q_stricmp( token, "hitSound1" ) )
01969 {
01970 if ( COM_ParseString( &p, &value ) )
01971 {
01972 continue;
01973 }
01974 saber->hitSound[0] = BG_SoundIndex( (char *)value );
01975 continue;
01976 }
01977
01978 //hit sound - NOTE: must provide all 3!!!
01979 if ( !Q_stricmp( token, "hitSound2" ) )
01980 {
01981 if ( COM_ParseString( &p, &value ) )
01982 {
01983 continue;
01984 }
01985 saber->hitSound[1] = BG_SoundIndex( (char *)value );
01986 continue;
01987 }
01988
01989 //hit sound - NOTE: must provide all 3!!!
01990 if ( !Q_stricmp( token, "hitSound3" ) )
01991 {
01992 if ( COM_ParseString( &p, &value ) )
01993 {
01994 continue;
01995 }
01996 saber->hitSound[2] = BG_SoundIndex( (char *)value );
01997 continue;
01998 }
01999
02000 //block sound - NOTE: must provide all 3!!!
02001 if ( !Q_stricmp( token, "blockSound1" ) )
02002 {
02003 if ( COM_ParseString( &p, &value ) )
02004 {
02005 continue;
02006 }
02007 saber->blockSound[0] = BG_SoundIndex( (char *)value );
02008 continue;
02009 }
02010
02011 //block sound - NOTE: must provide all 3!!!
02012 if ( !Q_stricmp( token, "blockSound2" ) )
02013 {
02014 if ( COM_ParseString( &p, &value ) )
02015 {
02016 continue;
02017 }
02018 saber->blockSound[1] = BG_SoundIndex( (char *)value );
02019 continue;
02020 }
02021
02022 //block sound - NOTE: must provide all 3!!!
02023 if ( !Q_stricmp( token, "blockSound3" ) )
02024 {
02025 if ( COM_ParseString( &p, &value ) )
02026 {
02027 continue;
02028 }
02029 saber->blockSound[2] = BG_SoundIndex( (char *)value );
02030 continue;
02031 }
02032
02033 //bounce sound - NOTE: must provide all 3!!!
02034 if ( !Q_stricmp( token, "bounceSound1" ) )
02035 {
02036 if ( COM_ParseString( &p, &value ) )
02037 {
02038 continue;
02039 }
02040 saber->bounceSound[0] = BG_SoundIndex( (char *)value );
02041 continue;
02042 }
02043
02044 //bounce sound - NOTE: must provide all 3!!!
02045 if ( !Q_stricmp( token, "bounceSound2" ) )
02046 {
02047 if ( COM_ParseString( &p, &value ) )
02048 {
02049 continue;
02050 }
02051 saber->bounceSound[1] = BG_SoundIndex( (char *)value );
02052 continue;
02053 }
02054
02055 //bounce sound - NOTE: must provide all 3!!!
02056 if ( !Q_stricmp( token, "bounceSound3" ) )
02057 {
02058 if ( COM_ParseString( &p, &value ) )
02059 {
02060 continue;
02061 }
02062 saber->bounceSound[2] = BG_SoundIndex( (char *)value );
02063 continue;
02064 }
02065
02066 //block effect - when saber/sword hits another saber/sword
02067 if ( !Q_stricmp( token, "blockEffect" ) )
02068 {
02069 if ( COM_ParseString( &p, &value ) )
02070 {
02071 continue;
02072 }
02073 #ifdef QAGAME//cgame-only cares about this
02074 SkipRestOfLine(&p);
02075 #elif defined CGAME
02076 saber->blockEffect = trap_FX_RegisterEffect( (char *)value );
02077 #else
02078 SkipRestOfLine(&p);
02079 #endif
02080 continue;
02081 }
02082
02083 //hit person effect - when saber/sword hits a person
02084 if ( !Q_stricmp( token, "hitPersonEffect" ) )
02085 {
02086 if ( COM_ParseString( &p, &value ) )
02087 {
02088 continue;
02089 }
02090 #ifdef QAGAME//cgame-only cares about this
02091 SkipRestOfLine(&p);
02092 #elif defined CGAME
02093 saber->hitPersonEffect = trap_FX_RegisterEffect( (char *)value );
02094 #else
02095 SkipRestOfLine(&p);
02096 #endif
02097 continue;
02098 }
02099
02100 //hit other effect - when saber/sword hits sopmething else damagable
02101 if ( !Q_stricmp( token, "hitOtherEffect" ) )
02102 {
02103 if ( COM_ParseString( &p, &value ) )
02104 {
02105 continue;
02106 }
02107 #ifdef QAGAME//cgame-only cares about this
02108 SkipRestOfLine(&p);
02109 #elif defined CGAME
02110 saber->hitOtherEffect = trap_FX_RegisterEffect( (char *)value );
02111 #else
02112 SkipRestOfLine(&p);
02113 #endif
02114 continue;
02115 }
02116
02117 //blade effect
02118 if ( !Q_stricmp( token, "bladeEffect" ) )
02119 {
02120 if ( COM_ParseString( &p, &value ) )
02121 {
02122 continue;
02123 }
02124 #ifdef QAGAME//cgame-only cares about this
02125 SkipRestOfLine(&p);
02126 #elif defined CGAME
02127 saber->bladeEffect = trap_FX_RegisterEffect( (char *)value );
02128 #else
02129 SkipRestOfLine(&p);
02130 #endif
02131 continue;
02132 }
02133
02134 //if non-zero, the saber will not do the big, white clash flare with other sabers
02135 if ( !Q_stricmp( token, "noClashFlare" ) )
02136 {
02137 if ( COM_ParseInt( &p, &n ) )
02138 {
02139 SkipRestOfLine( &p );
02140 continue;
02141 }
02142 if ( n )
02143 {
02144 saber->saberFlags2 |= SFL2_NO_CLASH_FLARE;
02145 }
02146 continue;
02147 }
02148
02149 //===SECONDARY BLADE====================================
02150 //stops the saber from drawing marks on the world (good for real-sword type mods)
02151 if ( !Q_stricmp( token, "noWallMarks2" ) )
02152 {
02153 if ( COM_ParseInt( &p, &n ) )
02154 {
02155 SkipRestOfLine( &p );
02156 continue;
02157 }
02158 if ( n )
02159 {
02160 saber->saberFlags2 |= SFL2_NO_WALL_MARKS2;
02161 }
02162 continue;
02163 }
02164
02165 //stops the saber from drawing a dynamic light (good for real-sword type mods)
02166 if ( !Q_stricmp( token, "noDlight2" ) )
02167 {
02168 if ( COM_ParseInt( &p, &n ) )
02169 {
02170 SkipRestOfLine( &p );
02171 continue;
02172 }
02173 if ( n )
02174 {
02175 saber->saberFlags2 |= SFL2_NO_DLIGHT2;
02176 }
02177 continue;
02178 }
02179
02180 //stops the saber from drawing a blade (good for real-sword type mods)
02181 if ( !Q_stricmp( token, "noBlade2" ) )
02182 {
02183 if ( COM_ParseInt( &p, &n ) )
02184 {
02185 SkipRestOfLine( &p );
02186 continue;
02187 }
02188 if ( n )
02189 {
02190 saber->saberFlags2 |= SFL2_NO_BLADE2;
02191 }
02192 continue;
02193 }
02194
02195 //default (0) is normal, 1 is a motion blur and 2 is no trail at all (good for real-sword type mods)
02196 if ( !Q_stricmp( token, "trailStyle2" ) )
02197 {
02198 if ( COM_ParseInt( &p, &n ) )
02199 {
02200 SkipRestOfLine( &p );
02201 continue;
02202 }
02203 saber->trailStyle2 = n;
02204 continue;
02205 }
02206
02207 //if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
02208 if ( !Q_stricmp( token, "g2MarksShader2" ) )
02209 {
02210 if ( COM_ParseString( &p, &value ) )
02211 {
02212 SkipRestOfLine( &p );
02213 continue;
02214 }
02215 #ifdef QAGAME//cgame-only cares about this
02216 SkipRestOfLine(&p);
02217 #elif defined CGAME
02218 saber->g2MarksShader2 = trap_R_RegisterShader( value );
02219 #else
02220 SkipRestOfLine(&p);
02221 #endif
02222 continue;
02223 }
02224
02225 //if set, the game will use this shader for marks on enemies instead of the default "gfx/damage/saberglowmark"
02226 if ( !Q_stricmp( token, "g2WeaponMarkShader2" ) )
02227 {
02228 if ( COM_ParseString( &p, &value ) )
02229 {
02230 SkipRestOfLine( &p );
02231 continue;
02232 }
02233 #ifdef QAGAME//cgame-only cares about this
02234 SkipRestOfLine(&p);
02235 #elif defined CGAME
02236 saber->g2WeaponMarkShader2 = trap_R_RegisterShader( value );
02237 #else
02238 SkipRestOfLine(&p);
02239 #endif
02240 continue;
02241 }
02242
02243 //if non-zero, uses damage done to calculate an appropriate amount of knockback
02244 if ( !Q_stricmp( token, "knockbackScale2" ) )
02245 {
02246 if ( COM_ParseFloat( &p, &f ) )
02247 {
02248 SkipRestOfLine( &p );
02249 continue;
02250 }
02251 saber->knockbackScale2 = f;
02252 continue;
02253 }
02254
02255 //scale up or down the damage done by the saber
02256 if ( !Q_stricmp( token, "damageScale2" ) )
02257 {
02258 if ( COM_ParseFloat( &p, &f ) )
02259 {
02260 SkipRestOfLine( &p );
02261 continue;
02262 }
02263 saber->damageScale2 = f;
02264 continue;
02265 }
02266
02267 //if non-zero, the saber never does dismemberment (good for pointed/blunt melee weapons)
02268 if ( !Q_stricmp( token, "noDismemberment2" ) )
02269 {
02270 if ( COM_ParseInt( &p, &n ) )
02271 {
02272 SkipRestOfLine( &p );
02273 continue;
02274 }
02275 if ( n )
02276 {
02277 saber->saberFlags2 |= SFL2_NO_DISMEMBERMENT2;
02278 }
02279 continue;
02280 }
02281
02282 //if non-zero, the saber will not do damage or any effects when it is idle (not in an attack anim). (good for real-sword type mods)
02283 if ( !Q_stricmp( token, "noIdleEffect2" ) )
02284 {
02285 if ( COM_ParseInt( &p, &n ) )
02286 {
02287 SkipRestOfLine( &p );
02288 continue;
02289 }
02290 if ( n )
02291 {
02292 saber->saberFlags2 |= SFL2_NO_IDLE_EFFECT2;
02293 }
02294 continue;
02295 }
02296
02297 //if set, the blades will always be blocking (good for things like shields that should always block)
02298 if ( !Q_stricmp( token, "alwaysBlock2" ) )
02299 {
02300 if ( COM_ParseInt( &p, &n ) )
02301 {
02302 SkipRestOfLine( &p );
02303 continue;
02304 }
02305 if ( n )
02306 {
02307 saber->saberFlags2 |= SFL2_ALWAYS_BLOCK2;
02308 }
02309 continue;
02310 }
02311
02312 //if set, the blades cannot manually be toggled on and off
02313 if ( !Q_stricmp( token, "noManualDeactivate2" ) )
02314 {
02315 if ( COM_ParseInt( &p, &n ) )
02316 {
02317 SkipRestOfLine( &p );
02318 continue;
02319 }
02320 if ( n )
02321 {
02322 saber->saberFlags2 |= SFL2_NO_MANUAL_DEACTIVATE2;
02323 }
02324 continue;
02325 }
02326
02327 //if set, the blade does damage in start, transition and return anims (like strong style does)
02328 if ( !Q_stricmp( token, "transitionDamage2" ) )
02329 {
02330 if ( COM_ParseInt( &p, &n ) )
02331 {
02332 SkipRestOfLine( &p );
02333 continue;
02334 }
02335 if ( n )
02336 {
02337 saber->saberFlags2 |= SFL2_TRANSITION_DAMAGE2;
02338 }
02339 continue;
02340 }
02341
02342 //splashRadius - radius of splashDamage
02343 if ( !Q_stricmp( token, "splashRadius2" ) )
02344 {
02345 if ( COM_ParseFloat( &p, &f ) )
02346 {
02347 SkipRestOfLine( &p );
02348 continue;
02349 }
02350 saber->splashRadius2 = f;
02351 continue;
02352 }
02353
02354 //splashDamage - amount of splashDamage, 100% at a distance of 0, 0% at a distance = splashRadius
02355 if ( !Q_stricmp( token, "splashDamage2" ) )
02356 {
02357 if ( COM_ParseInt( &p, &n ) )
02358 {
02359 SkipRestOfLine( &p );
02360 continue;
02361 }
02362 saber->splashDamage2 = n;
02363 continue;
02364 }
02365
02366 //splashKnockback - amount of splashKnockback, 100% at a distance of 0, 0% at a distance = splashRadius
02367 if ( !Q_stricmp( token, "splashKnockback2" ) )
02368 {
02369 if ( COM_ParseFloat( &p, &f ) )
02370 {
02371 SkipRestOfLine( &p );
02372 continue;
02373 }
02374 saber->splashKnockback2 = f;
02375 continue;
02376 }
02377
02378 //hit sound - NOTE: must provide all 3!!!
02379 if ( !Q_stricmp( token, "hit2Sound1" ) )
02380 {
02381 if ( COM_ParseString( &p, &value ) )
02382 {
02383 continue;
02384 }
02385 saber->hit2Sound[0] = BG_SoundIndex( (char *)value );
02386 continue;
02387 }
02388
02389 //hit sound - NOTE: must provide all 3!!!
02390 if ( !Q_stricmp( token, "hit2Sound2" ) )
02391 {
02392 if ( COM_ParseString( &p, &value ) )
02393 {
02394 continue;
02395 }
02396 saber->hit2Sound[1] = BG_SoundIndex( (char *)value );
02397 continue;
02398 }
02399
02400 //hit sound - NOTE: must provide all 3!!!
02401 if ( !Q_stricmp( token, "hit2Sound3" ) )
02402 {
02403 if ( COM_ParseString( &p, &value ) )
02404 {
02405 continue;
02406 }
02407 saber->hit2Sound[2] = BG_SoundIndex( (char *)value );
02408 continue;
02409 }
02410
02411 //block sound - NOTE: must provide all 3!!!
02412 if ( !Q_stricmp( token, "block2Sound1" ) )
02413 {
02414 if ( COM_ParseString( &p, &value ) )
02415 {
02416 continue;
02417 }
02418 saber->block2Sound[0] = BG_SoundIndex( (char *)value );
02419 continue;
02420 }
02421
02422 //block sound - NOTE: must provide all 3!!!
02423 if ( !Q_stricmp( token, "block2Sound2" ) )
02424 {
02425 if ( COM_ParseString( &p, &value ) )
02426 {
02427 continue;
02428 }
02429 saber->block2Sound[1] = BG_SoundIndex( (char *)value );
02430 continue;
02431 }
02432
02433 //block sound - NOTE: must provide all 3!!!
02434 if ( !Q_stricmp( token, "block2Sound3" ) )
02435 {
02436 if ( COM_ParseString( &p, &value ) )
02437 {
02438 continue;
02439 }
02440 saber->block2Sound[2] = BG_SoundIndex( (char *)value );
02441 continue;
02442 }
02443
02444 //bounce sound - NOTE: must provide all 3!!!
02445 if ( !Q_stricmp( token, "bounce2Sound1" ) )
02446 {
02447 if ( COM_ParseString( &p, &value ) )
02448 {
02449 continue;
02450 }
02451 saber->bounce2Sound[0] = BG_SoundIndex( (char *)value );
02452 continue;
02453 }
02454
02455 //bounce sound - NOTE: must provide all 3!!!
02456 if ( !Q_stricmp( token, "bounce2Sound2" ) )
02457 {
02458 if ( COM_ParseString( &p, &value ) )
02459 {
02460 continue;
02461 }
02462 saber->bounce2Sound[1] = BG_SoundIndex( (char *)value );
02463 continue;
02464 }
02465
02466 //bounce sound - NOTE: must provide all 3!!!
02467 if ( !Q_stricmp( token, "bounce2Sound3" ) )
02468 {
02469 if ( COM_ParseString( &p, &value ) )
02470 {
02471 continue;
02472 }
02473 saber->bounce2Sound[2] = BG_SoundIndex( (char *)value );
02474 continue;
02475 }
02476
02477 //block effect - when saber/sword hits another saber/sword
02478 if ( !Q_stricmp( token, "blockEffect2" ) )
02479 {
02480 if ( COM_ParseString( &p, &value ) )
02481 {
02482 continue;
02483 }
02484 #ifdef QAGAME//cgame-only cares about this
02485 SkipRestOfLine(&p);
02486 #elif defined CGAME
02487 saber->blockEffect2 = trap_FX_RegisterEffect( (char *)value );
02488 #else
02489 SkipRestOfLine(&p);
02490 #endif
02491 continue;
02492 }
02493
02494 //hit person effect - when saber/sword hits a person
02495 if ( !Q_stricmp( token, "hitPersonEffect2" ) )
02496 {
02497 if ( COM_ParseString( &p, &value ) )
02498 {
02499 continue;
02500 }
02501 #ifdef QAGAME//cgame-only cares about this
02502 SkipRestOfLine(&p);
02503 #elif defined CGAME
02504 saber->hitPersonEffect2 = trap_FX_RegisterEffect( (char *)value );
02505 #else
02506 SkipRestOfLine(&p);
02507 #endif
02508 continue;
02509 }
02510
02511 //hit other effect - when saber/sword hits sopmething else damagable
02512 if ( !Q_stricmp( token, "hitOtherEffect2" ) )
02513 {
02514 if ( COM_ParseString( &p, &value ) )
02515 {
02516 continue;
02517 }
02518 #ifdef QAGAME//cgame-only cares about this
02519 SkipRestOfLine(&p);
02520 #elif defined CGAME
02521 saber->hitOtherEffect2 = trap_FX_RegisterEffect( (char *)value );
02522 #else
02523 SkipRestOfLine(&p);
02524 #endif
02525 continue;
02526 }
02527
02528 //blade effect
02529 if ( !Q_stricmp( token, "bladeEffect2" ) )
02530 {
02531 if ( COM_ParseString( &p, &value ) )
02532 {
02533 continue;
02534 }
02535 #ifdef QAGAME//cgame-only cares about this
02536 SkipRestOfLine(&p);
02537 #elif defined CGAME
02538 saber->bladeEffect2 = trap_FX_RegisterEffect( (char *)value );
02539 #else
02540 SkipRestOfLine(&p);
02541 #endif
02542 continue;
02543 }
02544
02545 //if non-zero, the saber will not do the big, white clash flare with other sabers
02546 if ( !Q_stricmp( token, "noClashFlare2" ) )
02547 {
02548 if ( COM_ParseInt( &p, &n ) )
02549 {
02550 SkipRestOfLine( &p );
02551 continue;
02552 }
02553 if ( n )
02554 {
02555 saber->saberFlags2 |= SFL2_NO_CLASH_FLARE2;
02556 }
02557 continue;
02558 }
02559 //===END BLADE-SPECIFIC FIELDS=============================================================================
02560
02561 //FIXME: saber sounds (on, off, loop)
02562
02563 #ifdef _DEBUG
02564 Com_Printf( "WARNING: unknown keyword '%s' while parsing '%s'\n", token, useSaber );
02565 #endif
02566 SkipRestOfLine( &p );
02567 }
02568
02569 //FIXME: precache the saberModel(s)?
02570
02571 return qtrue;
02572 }
|
|
|
Definition at line 39 of file bg_saga.c. Referenced by BG_SiegeFindClassByName(), BG_SiegeFindClassIndexByName(), BG_SiegeLoadClasses(), BG_SiegeParseClassFile(), CG_InitSiegeMode(), InitSiegeMode(), UI_SiegeClassNum(), and UI_SiegeInit(). |
|
|
Definition at line 42 of file bg_saga.c. Referenced by BG_SiegeFindTeamForTheme(), BG_SiegeLoadTeams(), BG_SiegeParseTeamFile(), CG_InitSiegeMode(), InitSiegeMode(), and UI_SiegeInit(). |
|
|
|
Initial value:
{
ENUM2STRING(CFL_MORESABERDMG),
ENUM2STRING(CFL_STRONGAGAINSTPHYSICAL),
ENUM2STRING(CFL_FASTFORCEREGEN),
ENUM2STRING(CFL_STATVIEWER),
ENUM2STRING(CFL_HEAVYMELEE),
ENUM2STRING(CFL_SINGLE_ROCKET),
ENUM2STRING(CFL_CUSTOMSKEL),
ENUM2STRING(CFL_EXTRA_AMMO),
"", -1
}
Definition at line 45 of file bg_saga.c. Referenced by BG_SiegeParseClassFile(). |
|
|
Definition at line 41 of file bg_saga.c. Referenced by BG_SiegeFindTeamForTheme(), and BG_SiegeParseTeamFile(). |
|
|
Initial value:
{
"infantry",
"vanguard",
"support",
"jedi_general",
"demolitionist",
"heavy_weapons",
}
Definition at line 748 of file bg_saga.c. Referenced by BG_SiegeParseClassFile(). |
|
|
Initial value:
{
ENUM2STRING(FP_HEAL),
ENUM2STRING(FP_LEVITATION),
ENUM2STRING(FP_SPEED),
ENUM2STRING(FP_PUSH),
ENUM2STRING(FP_PULL),
ENUM2STRING(FP_TELEPATHY),
ENUM2STRING(FP_GRIP),
ENUM2STRING(FP_LIGHTNING),
ENUM2STRING(FP_RAGE),
ENUM2STRING(FP_PROTECT),
ENUM2STRING(FP_ABSORB),
ENUM2STRING(FP_TEAM_HEAL),
ENUM2STRING(FP_TEAM_FORCE),
ENUM2STRING(FP_DRAIN),
ENUM2STRING(FP_SEE),
ENUM2STRING(FP_SABER_OFFENSE),
ENUM2STRING(FP_SABER_DEFENSE),
ENUM2STRING(FP_SABERTHROW),
"", -1
}
|
|
|
Initial value:
{
ENUM2STRING(HI_NONE),
ENUM2STRING(HI_SEEKER),
ENUM2STRING(HI_SHIELD),
ENUM2STRING(HI_MEDPAC),
ENUM2STRING(HI_MEDPAC_BIG),
ENUM2STRING(HI_BINOCULARS),
ENUM2STRING(HI_SENTRY_GUN),
ENUM2STRING(HI_JETPACK),
ENUM2STRING(HI_HEALTHDISP),
ENUM2STRING(HI_AMMODISP),
ENUM2STRING(HI_EWEB),
ENUM2STRING(HI_CLOAK),
"", -1
}
Definition at line 123 of file bg_saga.c. Referenced by BG_SiegeParseClassFile(). |
|
|
Initial value:
{
ENUM2STRING(PW_NONE),
ENUM2STRING(PW_QUAD),
ENUM2STRING(PW_BATTLESUIT),
ENUM2STRING(PW_PULL),
ENUM2STRING(PW_REDFLAG),
ENUM2STRING(PW_BLUEFLAG),
ENUM2STRING(PW_NEUTRALFLAG),
ENUM2STRING(PW_SHIELDHIT),
ENUM2STRING(PW_SPEEDBURST),
ENUM2STRING(PW_DISINT_4),
ENUM2STRING(PW_SPEED),
ENUM2STRING(PW_CLOAKED),
ENUM2STRING(PW_FORCE_ENLIGHTENED_LIGHT),
ENUM2STRING(PW_FORCE_ENLIGHTENED_DARK),
ENUM2STRING(PW_FORCE_BOON),
ENUM2STRING(PW_YSALAMIRI),
"", -1
}
Definition at line 142 of file bg_saga.c. Referenced by BG_SiegeParseClassFile(). |
|
|
|
|
Initial value:
{
ENUM2STRING(SS_NONE),
ENUM2STRING(SS_FAST),
ENUM2STRING(SS_MEDIUM),
ENUM2STRING(SS_STRONG),
ENUM2STRING(SS_DESANN),
ENUM2STRING(SS_TAVION),
ENUM2STRING(SS_DUAL),
ENUM2STRING(SS_STAFF),
"", 0
}
Definition at line 59 of file bg_saga.c. Referenced by BG_SiegeParseClassFile(). |
|
|
Definition at line 35 of file bg_saga.c. Referenced by BG_SiegeCheckClassLegality(), BG_SiegeFindThemeForTeam(), and BG_SiegeSetTeamTheme(). |
|
|
Definition at line 36 of file bg_saga.c. Referenced by BG_SiegeCheckClassLegality(), BG_SiegeFindThemeForTeam(), and BG_SiegeSetTeamTheme(). |
|
|
Initial value:
{
"NULL",WP_NONE,
ENUM2STRING(WP_NONE),
ENUM2STRING(WP_STUN_BATON),
ENUM2STRING(WP_MELEE),
ENUM2STRING(WP_SABER),
ENUM2STRING(WP_BRYAR_PISTOL),
"WP_BLASTER_PISTOL", WP_BRYAR_PISTOL,
ENUM2STRING(WP_BLASTER),
ENUM2STRING(WP_DISRUPTOR),
ENUM2STRING(WP_BOWCASTER),
ENUM2STRING(WP_REPEATER),
ENUM2STRING(WP_DEMP2),
ENUM2STRING(WP_FLECHETTE),
ENUM2STRING(WP_ROCKET_LAUNCHER),
ENUM2STRING(WP_THERMAL),
ENUM2STRING(WP_TRIP_MINE),
ENUM2STRING(WP_DET_PACK),
ENUM2STRING(WP_CONCUSSION),
ENUM2STRING(WP_BRYAR_OLD),
ENUM2STRING(WP_EMPLACED_GUN),
ENUM2STRING(WP_TURRET),
"", 0
}
Definition at line 73 of file bg_saga.c. Referenced by BG_SiegeParseClassFile(), NPC_ParseParms(), NPC_Precache(), and SP_misc_weapon_shooter(). |