about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTeetime <TeetimeTW@yahoo.de>2013-02-04 23:30:35 +0100
committerTeetime <TeetimeTW@yahoo.de>2013-02-04 23:30:35 +0100
commitec0f6d1f179036580fb19d6a85818cf9aa726a22 (patch)
tree2b7980776be2bf50798428b203698df178b93afa
parent32b2d5e8521e31a25ef713bca8bd75d5f210ee39 (diff)
downloadzcatch-ec0f6d1f179036580fb19d6a85818cf9aa726a22.tar.gz
zcatch-ec0f6d1f179036580fb19d6a85818cf9aa726a22.zip
Changed weapons a bit.
Now you are able to set endless grenade ammo and customize the ammo
for mode 2
-rw-r--r--src/game/server/entities/character.cpp2
-rw-r--r--src/game/server/gamemodes/zcatch.cpp10
-rw-r--r--src/game/variables.h9
3 files changed, 12 insertions, 9 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index a874debd..dc70641a 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -489,7 +489,7 @@ void CCharacter::HandleWeapons()
 			if ((Server()->Tick() - m_aWeapons[m_ActiveWeapon].m_AmmoRegenStart) >= AmmoRegenTime * Server()->TickSpeed() / 1000)
 			{
 				// Add some ammo
-				m_aWeapons[m_ActiveWeapon].m_Ammo = min(m_aWeapons[m_ActiveWeapon].m_Ammo + 1, g_Config.m_SvGrenadeBullets);
+				m_aWeapons[m_ActiveWeapon].m_Ammo = min(m_aWeapons[m_ActiveWeapon].m_Ammo + 1, g_Config.m_SvWeaponsAmmo);
 				m_aWeapons[m_ActiveWeapon].m_AmmoRegenStart = -1;
 			}
 		}
diff --git a/src/game/server/gamemodes/zcatch.cpp b/src/game/server/gamemodes/zcatch.cpp
index 42c241f9..4a810e04 100644
--- a/src/game/server/gamemodes/zcatch.cpp
+++ b/src/game/server/gamemodes/zcatch.cpp
@@ -174,16 +174,16 @@ void CGameController_zCatch::OnCharacterSpawn(class CCharacter *pChr)
 		break;
 	case 2: /* All Weapons */
 		pChr->GiveWeapon(WEAPON_HAMMER, -1);
-		pChr->GiveWeapon(WEAPON_GUN, 6);
-		pChr->GiveWeapon(WEAPON_GRENADE, 6);
-		pChr->GiveWeapon(WEAPON_SHOTGUN, 6);
-		pChr->GiveWeapon(WEAPON_RIFLE, 6);
+		pChr->GiveWeapon(WEAPON_GUN, g_Config.m_SvWeaponsAmmo);
+		pChr->GiveWeapon(WEAPON_GRENADE, g_Config.m_SvWeaponsAmmo);
+		pChr->GiveWeapon(WEAPON_SHOTGUN, g_Config.m_SvWeaponsAmmo);
+		pChr->GiveWeapon(WEAPON_RIFLE, g_Config.m_SvWeaponsAmmo);
 		break;
 	case 3: /* Hammer */
 		pChr->GiveWeapon(WEAPON_HAMMER, -1);
 		break;
 	case 4: /* Grenade */
-		pChr->GiveWeapon(WEAPON_GRENADE, g_Config.m_SvGrenadeBullets);
+		pChr->GiveWeapon(WEAPON_GRENADE, g_Config.m_SvGrenadeEndlessAmmo ? -1 : g_Config.m_SvWeaponsAmmo);
 		break;
 	case 5: /* Ninja */
 		pChr->GiveNinja();
diff --git a/src/game/variables.h b/src/game/variables.h
index 182af208..3a1fb419 100644
--- a/src/game/variables.h
+++ b/src/game/variables.h
@@ -92,7 +92,7 @@ MACRO_CONFIG_INT(DbgFocus, dbg_focus, 0, 0, 1, CFGFLAG_CLIENT, "")
 MACRO_CONFIG_INT(DbgTuning, dbg_tuning, 0, 0, 1, CFGFLAG_CLIENT, "")
 
 //zCatch:
-MACRO_CONFIG_INT(SvMode, sv_mode, 1, 1, 5, CFGFLAG_SERVER, "1 - Instagib; 2 - Rocket area; 3 - Hammerparty; 4 - Grenade; 5 - Ninja")
+MACRO_CONFIG_INT(SvMode, sv_mode, 1, 1, 5, CFGFLAG_SERVER, "1 - Instagib; 2 - Everything; 3 - Hammerparty; 4 - Grenade; 5 - Ninja")
 MACRO_CONFIG_INT(SvAllowJoin, sv_allow_join, 2, 1, 2, CFGFLAG_SERVER, "Allow new Players to join without waiting for the next round")
 //1 = Allowed to join; 2 = Will join when person with the most kills die
 MACRO_CONFIG_INT(SvColorIndicator, sv_color_indicator, 1, 0, 1, CFGFLAG_SERVER, "Color tees apropriate to the number of currently caught players")
@@ -102,14 +102,17 @@ MACRO_CONFIG_INT(SvLaserjumps, sv_laserjumps, 0, 0, 1, CFGFLAG_SERVER, "Use lase
 MACRO_CONFIG_INT(SvChatValue, sv_chat_value, 250, 100, 1000, CFGFLAG_SERVER, "A value which is added on each message and decreased on each tick")
 MACRO_CONFIG_INT(SvChatThreshold, sv_chat_threshold, 1000, 250, 10000, CFGFLAG_SERVER, "If this threshold will exceed by too many messages the player will be muted")
 MACRO_CONFIG_INT(SvMuteDuration, sv_mute_duration, 60, 0, 3600, CFGFLAG_SERVER, "How long the player will be muted (in seconds)")
+
 MACRO_CONFIG_INT(SvAnticamper, sv_anticamper, 2, 0, 2, CFGFLAG_SERVER, "0 disables, 1 enables anticamper in all modes and 2 only in Instagib")
 MACRO_CONFIG_INT(SvAnticamperFreeze, sv_anticamper_freeze, 7, 0, 15, CFGFLAG_SERVER, "If a player should freeze on camping (and how long) or die")
 MACRO_CONFIG_INT(SvAnticamperTime, sv_anticamper_time, 10, 5, 120, CFGFLAG_SERVER, "How long to wait till the player dies/freezes")
 MACRO_CONFIG_INT(SvAnticamperRange, sv_anticamper_range, 200, 0, 1000, CFGFLAG_SERVER, "Distance how far away the player must move to escape anticamper")
 
-MACRO_CONFIG_INT(SvVoteForceReason, sv_vote_forcereason, 1, 0, 1, CFGFLAG_SERVER, "Allow only votes with a reason (except settings)")
 MACRO_CONFIG_INT(SvGrenadeMinDamage, sv_grenade_min_damage, 4, 1, 6, CFGFLAG_SERVER, "How much damage the grenade must do to kill the player (depends how far away it explodes)")
-MACRO_CONFIG_INT(SvGrenadeBullets, sv_grenade_bullets, -1, -1, 10, CFGFLAG_SERVER, "Default amount of bullets for the grenade (-1 = endless ammo), otherwise it reloads after some time")
+MACRO_CONFIG_INT(SvGrenadeEndlessAmmo, sv_grenade_endless_ammo, 1, 0, 1, CFGFLAG_SERVER, "Endless ammo for grenade (only mode 4). If not zero, set sv_grenade_bullets for the number of bullets")
+MACRO_CONFIG_INT(SvWeaponsAmmo, sv_weapons_ammo, 7, 5, 10, CFGFLAG_SERVER, "Default amount of ammo for all weapons in mode 2 or grenade in mode 4. Your ammo will regenerate after some while")
+
+MACRO_CONFIG_INT(SvVoteForceReason, sv_vote_forcereason, 1, 0, 1, CFGFLAG_SERVER, "Allow only votes with a reason (except settings)")
 MACRO_CONFIG_INT(SvSuicideTime, sv_suicide_time, 15, 0, 60, CFGFLAG_SERVER, "Minimum time between suicides. 0 to forbid suicides completely")
 MACRO_CONFIG_INT(SvKillPenalty, sv_kill_penalty, 5, 0, 50, CFGFLAG_SERVER, "The amount of points which the score will be decreased on each suicide")
 #endif