Added mp_winlimit and fixed a bug with selecting the C4 Bomb as well as changed the way input works during freezetime.
This commit is contained in:
parent
c94019bfea
commit
f78ece6005
16 changed files with 59 additions and 18 deletions
5
Source/Client/.kdev4/Client.kdev4
Executable file
5
Source/Client/.kdev4/Client.kdev4
Executable file
|
@ -0,0 +1,5 @@
|
|||
[Buildset]
|
||||
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x0c\x00C\x00l\x00i\x00e\x00n\x00t)
|
||||
|
||||
[Project]
|
||||
VersionControlSupport=kdevgit
|
4
Source/Client/Client.kdev4
Executable file
4
Source/Client/Client.kdev4
Executable file
|
@ -0,0 +1,4 @@
|
|||
[Project]
|
||||
CreatedFrom=Makefile
|
||||
Manager=KDevCustomMakeManager
|
||||
Name=Client
|
|
@ -267,7 +267,7 @@ void CSQC_UpdateView( float fWinWidth, float fWinHeight, float fGameFocus ) {
|
|||
CSQC_DrawChat();
|
||||
|
||||
// Don't even try to draw centerprints and VGUI menus when scores are shown
|
||||
if ( pSeat->iShowScores == TRUE ) {
|
||||
if ( pSeat->iShowScores == TRUE || getstatf( STAT_GAMESTATE ) == GAME_OVER ) {
|
||||
VGUI_Scores_Show();
|
||||
} else {
|
||||
CSQC_DrawCenterprint();
|
||||
|
|
0
Source/FreeCS-CE.prj
Normal file → Executable file
0
Source/FreeCS-CE.prj
Normal file → Executable file
|
@ -86,7 +86,8 @@ enum {
|
|||
GAME_COMMENCING,
|
||||
GAME_FREEZE,
|
||||
GAME_ACTIVE,
|
||||
GAME_END
|
||||
GAME_END,
|
||||
GAME_OVER
|
||||
};
|
||||
|
||||
#define CS_WEAPON_COUNT 28
|
||||
|
|
5
Source/Menu/.kdev4/Menu.kdev4
Executable file
5
Source/Menu/.kdev4/Menu.kdev4
Executable file
|
@ -0,0 +1,5 @@
|
|||
[Buildset]
|
||||
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x08\x00M\x00e\x00n\x00u)
|
||||
|
||||
[Project]
|
||||
VersionControlSupport=kdevgit
|
4
Source/Menu/Menu.kdev4
Executable file
4
Source/Menu/Menu.kdev4
Executable file
|
@ -0,0 +1,4 @@
|
|||
[Project]
|
||||
CreatedFrom=Makefile
|
||||
Manager=KDevCustomMakeManager
|
||||
Name=Menu
|
|
@ -1,2 +1,5 @@
|
|||
[Buildset]
|
||||
BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x0c\x00S\x00e\x00r\x00v\x00e\x00r)
|
||||
|
||||
[Project]
|
||||
VersionControlSupport=kdevgit
|
||||
|
|
|
@ -141,7 +141,7 @@ void SV_RunClientCommand( void ) {
|
|||
|
||||
if ( fGameState == GAME_FREEZE && self.health > 0 ) {
|
||||
input_movevalues = '0 0 0';
|
||||
input_buttons = 0;
|
||||
//input_buttons = 0;
|
||||
input_impulse = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define VEC_PLAYER_CVIEWPOS '0 0 12'
|
||||
|
||||
// Server cvars
|
||||
var float autocvar_mp_startmoney = 800;
|
||||
var int autocvar_mp_winlimit = 0;
|
||||
var int autocvar_mp_halftime = 0;
|
||||
var int autocvar_mp_startmoney = 800;
|
||||
var float autocvar_mp_buytime = 90;
|
||||
var float autocvar_mp_freezetime = 6;
|
||||
var float autocvar_mp_c4timer = 45;
|
||||
|
|
|
@ -38,10 +38,6 @@ void Input_Handle( void ) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( fGameState == GAME_FREEZE ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Make this fast switch only
|
||||
if ( self.impulse == 3 ) {
|
||||
Weapon_Switch( SLOT_MELEE );
|
||||
|
@ -66,7 +62,9 @@ void Input_Handle( void ) {
|
|||
}
|
||||
|
||||
if ( self.button0 ) {
|
||||
Weapon_PrimaryAttack( self.weapon );
|
||||
if ( fGameState != GAME_FREEZE ) {
|
||||
Weapon_PrimaryAttack( self.weapon );
|
||||
}
|
||||
} else if ( self.button4 ) {
|
||||
Weapon_Reload( self.weapon );
|
||||
} else if ( self.button5 ) {
|
||||
|
|
|
@ -34,6 +34,8 @@ void Timer_Begin( float fTime, float fMode) {
|
|||
fGameState = GAME_END;
|
||||
} else if ( fMode == GAME_COMMENCING ) {
|
||||
fGameState = GAME_COMMENCING;
|
||||
} else if ( fMode == GAME_OVER ) {
|
||||
fGameState = GAME_OVER;
|
||||
}
|
||||
|
||||
fGameTime = fTime;
|
||||
|
@ -66,19 +68,32 @@ void Timer_Update( void ) {
|
|||
}
|
||||
|
||||
if ( time >= ( cvar( "mp_timelimit" ) * 60 ) ) {
|
||||
for ( int i = 0; i < iMapCycleCount; i++ ) {
|
||||
if ( sMapCycle[ i ] == mapname ) {
|
||||
if ( ( i + 1 ) < iMapCycleCount ) {
|
||||
localcmd( sprintf( "changelevel %s\n", sMapCycle[ i + 1 ] ) );
|
||||
return;
|
||||
} else {
|
||||
localcmd( sprintf( "changelevel %s\n", sMapCycle[ 0 ] ) );
|
||||
}
|
||||
Timer_Begin( 5, GAME_OVER );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( fGameState == GAME_OVER ) && ( fGameTime < 0 ) ) {
|
||||
for ( int i = 0; i < iMapCycleCount; i++ ) {
|
||||
if ( sMapCycle[ i ] == mapname ) {
|
||||
if ( ( i + 1 ) < iMapCycleCount ) {
|
||||
localcmd( sprintf( "changelevel %s\n", sMapCycle[ i + 1 ] ) );
|
||||
return;
|
||||
} else {
|
||||
localcmd( sprintf( "changelevel %s\n", sMapCycle[ 0 ] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Okay, this means that timelimit is not the only deciding factor
|
||||
if ( autocvar_mp_winlimit > 0 && fGameState != GAME_OVER ) {
|
||||
if ( iWon_CT == autocvar_mp_winlimit ) {
|
||||
Timer_Begin( 5, GAME_OVER );
|
||||
} else if ( iWon_T == autocvar_mp_winlimit ) {
|
||||
Timer_Begin( 5, GAME_OVER );
|
||||
}
|
||||
}
|
||||
|
||||
if ( fGameState == GAME_INACTIVE ) {
|
||||
return;
|
||||
}
|
||||
|
@ -96,7 +111,7 @@ void Timer_Update( void ) {
|
|||
if ( fGameTime <= 0 ) {
|
||||
if ( fGameState == GAME_ACTIVE ) {
|
||||
Rules_TimeOver();
|
||||
Timer_Begin( 5, GAME_END); // Round is over, 5 seconds til a new round starts
|
||||
Timer_Begin( 5, GAME_END ); // Round is over, 5 seconds til a new round starts
|
||||
} else {
|
||||
Timer_Begin( autocvar_mp_roundtime * 60, GAME_ACTIVE ); // Unfreeze
|
||||
Radio_StartMessage();
|
||||
|
|
|
@ -275,6 +275,10 @@ float Weapon_AlreadyExists( float fWeapon ) {
|
|||
if ( self.fSlotSecondary == fWeapon ) {
|
||||
return TRUE;
|
||||
}
|
||||
} else if ( wptTable[ fWeapon ].iSlot == SLOT_GRENADE ) {
|
||||
if ( self.fSlotGrenade == fWeapon ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
BIN
freecs/menu.dat
BIN
freecs/menu.dat
Binary file not shown.
BIN
freecs/progs.dat
BIN
freecs/progs.dat
Binary file not shown.
Loading…
Reference in a new issue