diff options
Diffstat (limited to 'src/game/bg_misc.c')
-rw-r--r-- | src/game/bg_misc.c | 150 |
1 files changed, 123 insertions, 27 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 63eed9c8..f1ede9bb 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -891,8 +891,31 @@ int bg_numItems = sizeof(bg_itemlist) / sizeof(bg_itemlist[0]) - 1; classAttributes_t bg_classList[ ] = { + { + PCL_D_B_BASE, + "Builder", + "lucy", + "default", + { -15, -15, -20 }, + { 15, 15, 20 }, + { 15, 15, 20 }, + { -15, -15, -4 }, + { 15, 15, 4 }, + 12, 12, + 50, + 50, + SCA_TAKESFALLDAMAGE|SCA_FOVWARPS, + 80, + 0.015f, + 350, + 0.5f, + 1.0f, + { PCL_D_D_BASE, PCL_D_O_BASE, PCL_NONE }, + 2000 + }, { PCL_D_O_BASE, + "Offensive", "klesk", "default", { -15, -15, -15 }, @@ -903,15 +926,18 @@ classAttributes_t bg_classList[ ] = 4, 4, 25, 0, - SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT, + SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, 140, 0.0f, 25, 2.0f, - 5.0f + 5.0f, + { PCL_D_D_BASE, PCL_D_B_BASE, PCL_NONE }, + 3000 }, { PCL_D_D_BASE, + "Defensive", "orbb", "default", { -15, -15, -15 }, @@ -922,34 +948,18 @@ classAttributes_t bg_classList[ ] = 4, 4, 50, 0, - SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT, - 160, + SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, + 90, 0.0f, 25, 1.5f, - 3.0f - }, - { - PCL_D_B_BASE, - "lucy", - "default", - { -15, -15, -20 }, - { 15, 15, 20 }, - { 15, 15, 20 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 12, 12, - 50, - 50, - SCA_TAKESFALLDAMAGE, - 80, - 0.015f, - 350, - 0.5f, - 1.0f + 3.0f, + { PCL_D_O_BASE, PCL_D_B_BASE, PCL_NONE }, + 1000 }, { PCL_H_BASE, + "Human", "sarge", "default", { -15, -15, -24 }, @@ -965,7 +975,9 @@ classAttributes_t bg_classList[ ] = 0.002f, 200, 1.0f, - 1.0f + 1.0f, + { PCL_NONE, PCL_NONE, PCL_NONE }, + 0 } }; @@ -973,6 +985,44 @@ int bg_numPclasses = sizeof( bg_classList ) / sizeof( bg_classList[ 0 ] ); /* ============== +BG_FindClassNumForName +============== +*/ +int BG_FindClassNumForName( char *name ) +{ + int i; + + for( i = 0; i < bg_numPclasses; i++ ) + { + if( !Q_stricmp( bg_classList[ i ].className, name ) ) + return bg_classList[ i ].classNum; + } + + //wimp out + return PCL_NONE; +} + +/* +============== +BG_FindNameForClassNum +============== +*/ +char *BG_FindNameForClassNum( int pclass ) +{ + int i; + + for( i = 0; i < bg_numPclasses; i++ ) + { + if( bg_classList[ i ].classNum == pclass ) + return bg_classList[ i ].className; + } + + //wimp out + return ""; +} + +/* +============== BG_FindModelNameForClass ============== */ @@ -986,7 +1036,7 @@ char *BG_FindModelNameForClass( int pclass ) return bg_classList[ i ].modelName; } - //wimp out + //note: must return a valid modelName! return bg_classList[ 0 ].modelName; } @@ -1208,7 +1258,6 @@ int BG_FindSteptimeForClass( int pclass ) return 200; } - /* ============== BG_ClassHasAbility @@ -1233,6 +1282,52 @@ qboolean BG_ClassHasAbility( int pclass, int ability ) return qfalse; } +/* +============== +BG_ClassCanEvolveFromTo +============== +*/ +qboolean BG_ClassCanEvolveFromTo( int fclass, int tclass ) +{ + int i, j; + + if( tclass == PCL_NONE ) + return qfalse; + + for( i = 0; i < bg_numPclasses; i++ ) + { + if( bg_classList[ i ].classNum == fclass ) + { + for( j = 0; j <= 3; j++ ) + if( bg_classList[ i ].children[ j ] == tclass ) return qtrue; + + return qfalse; //may as well return by this point + } + } + + return qfalse; +} + +/* +============== +BG_FindEvolveTimeForClass +============== +*/ +int BG_FindEvolveTimeForClass( int pclass ) +{ + int i; + + for( i = 0; i < bg_numPclasses; i++ ) + { + if( bg_classList[ i ].classNum == pclass ) + { + return bg_classList[ i ].timeToEvolve; + } + } + + return 5000; +} + /* ============== @@ -1605,6 +1700,7 @@ char *eventnames[] = { "EV_USE_ITEM15", "EV_ITEM_RESPAWN", + "EV_PLAYER_RESPAWN", "EV_ITEM_POP", "EV_PLAYER_TELEPORT_IN", "EV_PLAYER_TELEPORT_OUT", |