From bd0bbcf4464a5cb9570c4cd3a3c1f347fa3cff66 Mon Sep 17 00:00:00 2001 From: Teetime Date: Fri, 14 Oct 2011 15:51:14 +0200 Subject: new mode: ninja --- src/game/server/entities/character.cpp | 19 ++++++++++++------- src/game/server/gamemodes/zcatch.cpp | 3 +++ src/game/variables.h | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 5ab5a5f5..06c1c913 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -137,16 +137,21 @@ void CCharacter::HandleNinja() if(m_ActiveWeapon != WEAPON_NINJA) return; - if ((Server()->Tick() - m_Ninja.m_ActivationTick) > (g_pData->m_Weapons.m_Ninja.m_Duration * Server()->TickSpeed() / 1000)) + /* zCatch */ + if(GameServer()->m_pController->IsZCatch() == false || (GameServer()->m_pController->IsZCatch() && g_Config.m_SvMode == 0)) { - // time's up, return - m_aWeapons[WEAPON_NINJA].m_Got = false; - m_ActiveWeapon = m_LastWeapon; + if ((Server()->Tick() - m_Ninja.m_ActivationTick) > (g_pData->m_Weapons.m_Ninja.m_Duration * Server()->TickSpeed() / 1000)) + { + // time's up, return + m_aWeapons[WEAPON_NINJA].m_Got = false; + m_ActiveWeapon = m_LastWeapon; - SetWeapon(m_ActiveWeapon); - return; + SetWeapon(m_ActiveWeapon); + return; + } } - + /* zCatch end*/ + // force ninja Weapon SetWeapon(WEAPON_NINJA); diff --git a/src/game/server/gamemodes/zcatch.cpp b/src/game/server/gamemodes/zcatch.cpp index 451bab58..2c9370e4 100644 --- a/src/game/server/gamemodes/zcatch.cpp +++ b/src/game/server/gamemodes/zcatch.cpp @@ -176,6 +176,9 @@ void CGameController_zCatch::OnCharacterSpawn(class CCharacter *pChr) case 4: pChr->GiveWeapon(WEAPON_GRENADE, -1); break; + case 5: + pChr->GiveNinja(); + break; } //Update color of spawning tees OnPlayerInfoChange(pChr->GetPlayer()); diff --git a/src/game/variables.h b/src/game/variables.h index 69a266ac..c3063a33 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -91,7 +91,7 @@ MACRO_CONFIG_INT(DbgTuning, dbg_tuning, 0, 0, 1, CFGFLAG_CLIENT, "") #endif //zCatch: -MACRO_CONFIG_INT(SvMode, sv_mode, 1, 0, 4, CFGFLAG_SERVER, "0 - Normal; 1 - Instagib; 2 - Rocket area; 3 - Hammerparty; 4 - Grenade") +MACRO_CONFIG_INT(SvMode, sv_mode, 1, 0, 5, CFGFLAG_SERVER, "0 - Normal; 1 - Instagib; 2 - Rocket area; 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 catched players") -- cgit 1.4.1