summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Levin <risujin@fastmail.fm>2009-10-03 11:18:41 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:52 +0000
commit9dd501f6338a95183ad4a245c2b813699b3a6513 (patch)
tree04c90a6abb944f960f809613160f481bc99d5a3d /src
parentd1747093e36873d29801ff6c6ecf5d24db94be62 (diff)
* Oops, Repeater now gives Repeater reward credits
* Reloading a weapon and switching to blaster will not cause it to be "reloaded" * Removed "team change free" flag, all clients keep credits when changing teams * Human and Alien credits properly converted when switching teams (based on max) * Cannot open both say prompts at the same time anymore
Diffstat (limited to 'src')
-rw-r--r--src/game/bg_misc.c2
-rw-r--r--src/game/g_admin.h2
-rw-r--r--src/game/g_cmds.c34
-rw-r--r--src/game/g_weapon.c56
-rw-r--r--src/game/tremulous.h1
-rw-r--r--src/ui/ui_atoms.c4
6 files changed, 49 insertions, 50 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 671aa9bf..45f6281f 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -674,7 +674,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean dccTest;
qfalse, //qboolean transparentTest;
qfalse, //qboolean reactorTest;
- REACTOR_VALUE, //int value;
+ REPEATER_VALUE, //int value;
}
};
diff --git a/src/game/g_admin.h b/src/game/g_admin.h
index 4e24681d..5760f521 100644
--- a/src/game/g_admin.h
+++ b/src/game/g_admin.h
@@ -44,7 +44,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
/*
* 1 - cannot be vote kicked, vote muted
* 2 - cannot be censored or flood protected TODO
- * 3 - never loses credits for changing teams
* 4 - can see team chat as a spectator
* 5 - can switch teams any time, regardless of balance
* 6 - does not need to specify a reason for a kick/ban
@@ -59,7 +58,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define ADMF_IMMUNITY '1'
#define ADMF_NOCENSORFLOOD '2' /* TODO */
-#define ADMF_TEAMCHANGEFREE '3'
#define ADMF_SPEC_ALLCHAT '4'
#define ADMF_FORCETEAMCHANGE '5'
#define ADMF_UNACCOUNTABLE '6'
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 6b2e94c2..11dd7973 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -355,7 +355,7 @@ void Cmd_Give_f( gentity_t *ent )
if( give_all || Q_stricmpn( name, "funds", 5 ) == 0 )
{
- int credits = give_all ? HUMAN_MAX_CREDITS : atoi( name + 6 );
+ int credits = give_all ? ALIEN_MAX_CREDITS : atoi( name + 6 );
G_AddCreditToClient( ent->client, credits, qtrue );
}
@@ -565,38 +565,26 @@ G_ChangeTeam
void G_ChangeTeam( gentity_t *ent, pTeam_t newTeam )
{
pTeam_t oldTeam = ent->client->pers.teamSelection;
-
+
if( oldTeam == newTeam )
return;
G_LeaveTeam( ent );
ent->client->pers.teamSelection = newTeam;
-
- // under certain circumstances, clients can keep their kills and credits
- // when switching teams
- if( G_admin_permission( ent, ADMF_TEAMCHANGEFREE ) ||
- ( ( oldTeam == PTE_HUMANS || oldTeam == PTE_ALIENS )
- && ( level.time - ent->client->pers.teamChangeTime ) > 60000 ) )
- {
- if( oldTeam == PTE_ALIENS )
- ent->client->pers.credit *= (float)FREEKILL_HUMAN / FREEKILL_ALIEN;
- else if( newTeam == PTE_ALIENS )
- ent->client->pers.credit *= (float)FREEKILL_ALIEN / FREEKILL_HUMAN;
- }
- else
- {
- ent->client->pers.credit = 0;
- ent->client->pers.score = 0;
- }
-
ent->client->pers.classSelection = PCL_NONE;
ClientSpawn( ent, NULL, NULL, NULL );
-
ent->client->pers.joinedATeam = qtrue;
ent->client->pers.teamChangeTime = level.time;
-
- //update ClientInfo
ClientUserinfoChanged( ent->client->ps.clientNum );
+
+ // Convert between Alien and Human credits, specs use Alien credits
+ if( oldTeam == PTE_HUMANS )
+ ent->client->pers.credit = (int)( ent->client->pers.credit *
+ ALIEN_MAX_CREDITS / HUMAN_MAX_CREDITS + 0.5f );
+ if( newTeam == PTE_HUMANS )
+ ent->client->pers.credit = (int)( ent->client->ps.persistant[ PERS_CREDIT ] *
+ HUMAN_MAX_CREDITS / ALIEN_MAX_CREDITS + 0.5f );
+ ent->client->ps.persistant[ PERS_CREDIT ] = ent->client->pers.credit;
}
/*
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 1aba326c..43d221c2 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -38,38 +38,46 @@ void G_ForceWeaponChange( gentity_t *ent, weapon_t weapon )
{
int i;
- if( ent )
+ if( !ent )
+ return;
+
+ // stop a reload in progress
+ if( ent->client->ps.weaponstate == WEAPON_RELOADING )
{
- ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH;
+ PM_StartTorsoAnim( TORSO_RAISE );
+ ent->client->ps.weaponTime = 250;
+ ent->client->ps.weaponstate = WEAPON_READY;
+ }
+
+ ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH;
- if( weapon == WP_NONE ||
- !BG_InventoryContainsWeapon( weapon, ent->client->ps.stats ) )
+ if( weapon == WP_NONE ||
+ !BG_InventoryContainsWeapon( weapon, ent->client->ps.stats ) )
+ {
+ // switch to the first non blaster weapon
+ for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ )
{
- //switch to the first non blaster weapon
- for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ )
- {
- if( i == WP_BLASTER )
- continue;
+ if( i == WP_BLASTER )
+ continue;
- if( BG_InventoryContainsWeapon( i, ent->client->ps.stats ) )
- {
- ent->client->ps.persistant[ PERS_NEWWEAPON ] = i;
- break;
- }
+ if( BG_InventoryContainsWeapon( i, ent->client->ps.stats ) )
+ {
+ ent->client->ps.persistant[ PERS_NEWWEAPON ] = i;
+ break;
}
-
- //only got the blaster to switch to
- if( i == WP_NUM_WEAPONS )
- ent->client->ps.persistant[ PERS_NEWWEAPON ] = WP_BLASTER;
}
- else
- ent->client->ps.persistant[ PERS_NEWWEAPON ] = weapon;
- // force this here to prevent flamer effect from continuing
- ent->client->ps.generic1 = WPM_NOTFIRING;
-
- ent->client->ps.weapon = ent->client->ps.persistant[ PERS_NEWWEAPON ];
+ // only got the blaster to switch to
+ if( i == WP_NUM_WEAPONS )
+ ent->client->ps.persistant[ PERS_NEWWEAPON ] = WP_BLASTER;
}
+ else
+ ent->client->ps.persistant[ PERS_NEWWEAPON ] = weapon;
+
+ // force this here to prevent flamer effect from continuing
+ ent->client->ps.generic1 = WPM_NOTFIRING;
+
+ ent->client->ps.weapon = ent->client->ps.persistant[ PERS_NEWWEAPON ];
}
/*
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 733770cd..582e0a70 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -353,6 +353,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define ALIEN_REGEN_NOCREEP_TIME 3000 //msec between regen off creep
#define ALIEN_MAX_FRAGS 9
+#define ALIEN_MAX_CREDITS (ALIEN_MAX_FRAGS*ALIEN_CREDITS_PER_FRAG)
#define ALIEN_CREDITS_PER_FRAG 400
#define ALIEN_TK_SUICIDE_PENALTY 350
diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c
index bb12a972..65cfd0b1 100644
--- a/src/ui/ui_atoms.c
+++ b/src/ui/ui_atoms.c
@@ -166,6 +166,8 @@ qboolean UI_ConsoleCommand( int realTime )
uiInfo.chatTeam = qfalse;
trap_Key_SetCatcher( KEYCATCH_UI );
+ Menus_CloseByName( "say" );
+ Menus_CloseByName( "say_team" );
Menus_ActivateByName( "say" );
return qtrue;
}
@@ -177,6 +179,8 @@ qboolean UI_ConsoleCommand( int realTime )
uiInfo.chatTeam = qtrue;
trap_Key_SetCatcher( KEYCATCH_UI );
+ Menus_CloseByName( "say" );
+ Menus_CloseByName( "say_team" );
Menus_ActivateByName( "say_team" );
return qtrue;
}