Switchable ninjajetpack

This commit is contained in:
def 2014-01-11 13:59:20 +01:00
parent f4b961ecad
commit 2af9d9f423
7 changed files with 22 additions and 2 deletions

View file

@ -880,6 +880,21 @@ void CGameContext::ConEyeEmote(IConsole::IResult *pResult, void *pUserData)
} }
} }
void CGameContext::ConNinjaJetpack(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;
if (!CheckClientID(pResult->m_ClientID))
return;
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
if (!pPlayer)
return;
if (pResult->NumArguments())
pPlayer->m_NinjaJetpack = pResult->GetInteger(0);
else
pPlayer->m_NinjaJetpack = !pPlayer->m_NinjaJetpack;
}
void CGameContext::ConShowOthers(IConsole::IResult *pResult, void *pUserData) void CGameContext::ConShowOthers(IConsole::IResult *pResult, void *pUserData)
{ {
CGameContext *pSelf = (CGameContext *) pUserData; CGameContext *pSelf = (CGameContext *) pUserData;

View file

@ -29,6 +29,7 @@ CHAT_COMMAND("lock", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConLockTeam, this, "Lock
CHAT_COMMAND("top5team", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTeamTop5, this, "Shows five team ranks of the ladder beginning with rank i (1 by default)") CHAT_COMMAND("top5team", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTeamTop5, this, "Shows five team ranks of the ladder beginning with rank i (1 by default)")
CHAT_COMMAND("top5", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTop5, this, "Shows five ranks of the ladder beginning with rank i (1 by default)") CHAT_COMMAND("top5", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTop5, this, "Shows five ranks of the ladder beginning with rank i (1 by default)")
CHAT_COMMAND("showothers", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConShowOthers, this, "Whether to showplayers from other teams or not (off by default), optional i = 0 for off else for on") CHAT_COMMAND("showothers", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConShowOthers, this, "Whether to showplayers from other teams or not (off by default), optional i = 0 for off else for on")
CHAT_COMMAND("ninjajetpack", "?i", CFGFLAG_CHAT|CFGFLAG_SERVER, ConNinjaJetpack, this, "Whether to showplayers from other teams or not (off by default), optional i = 0 for off else for on")
CHAT_COMMAND("saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race") CHAT_COMMAND("saytime", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTime, this, "Privately messages you your current time in this current running race")
CHAT_COMMAND("saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race") CHAT_COMMAND("saytimeall", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConSayTimeAll, this, "Publicly messages everyone your current time in this current running race")
CHAT_COMMAND("time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message") CHAT_COMMAND("time", "", CFGFLAG_CHAT|CFGFLAG_SERVER, ConTime, this, "Privately shows you your current time in this current running race in the broadcast message")

View file

@ -387,7 +387,7 @@ void CCharacter::FireWeapon()
{ {
TakeDamage(Direction * -1.0f * (g_Config.m_SvJetpack / 100.0f), g_pData->m_Weapons.m_Hammer.m_pBase->m_Damage, m_pPlayer->GetCID(), m_ActiveWeapon); TakeDamage(Direction * -1.0f * (g_Config.m_SvJetpack / 100.0f), g_pData->m_Weapons.m_Hammer.m_pBase->m_Damage, m_pPlayer->GetCID(), m_ActiveWeapon);
} }
else if (!m_Jetpack || !m_pPlayer->m_NinjaJetpack)
{ {
CProjectile *pProj = new CProjectile CProjectile *pProj = new CProjectile
( (
@ -1015,7 +1015,7 @@ void CCharacter::Snap(int SnappingClient)
pCharacter->m_Weapon = WEAPON_NINJA; pCharacter->m_Weapon = WEAPON_NINJA;
pCharacter->m_AmmoCount = 0; pCharacter->m_AmmoCount = 0;
} }
else if (m_Jetpack && m_ActiveWeapon == WEAPON_GUN) else if (m_pPlayer->m_NinjaJetpack && m_Jetpack && m_ActiveWeapon == WEAPON_GUN)
{ {
pCharacter->m_Emote = EMOTE_HAPPY, pCharacter->m_Emote = EMOTE_HAPPY,
pCharacter->m_Weapon = WEAPON_NINJA; pCharacter->m_Weapon = WEAPON_NINJA;

View file

@ -162,6 +162,7 @@ public:
bool m_Super; bool m_Super;
bool m_SuperJump; bool m_SuperJump;
bool m_Jetpack; bool m_Jetpack;
bool m_NinjaJetpack;
int m_TeamBeforeSuper; int m_TeamBeforeSuper;
int m_FreezeTime; int m_FreezeTime;
int m_FreezeTick; int m_FreezeTick;

View file

@ -261,6 +261,7 @@ private:
static void ConToggleBroadcast(IConsole::IResult *pResult, void *pUserData); static void ConToggleBroadcast(IConsole::IResult *pResult, void *pUserData);
static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData); static void ConEyeEmote(IConsole::IResult *pResult, void *pUserData);
static void ConShowOthers(IConsole::IResult *pResult, void *pUserData); static void ConShowOthers(IConsole::IResult *pResult, void *pUserData);
static void ConNinjaJetpack(IConsole::IResult *pResult, void *pUserData);
static void ConSayTime(IConsole::IResult *pResult, void *pUserData); static void ConSayTime(IConsole::IResult *pResult, void *pUserData);
static void ConSayTimeAll(IConsole::IResult *pResult, void *pUserData); static void ConSayTimeAll(IConsole::IResult *pResult, void *pUserData);
static void ConTime(IConsole::IResult *pResult, void *pUserData); static void ConTime(IConsole::IResult *pResult, void *pUserData);

View file

@ -75,6 +75,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
m_IsUsingDDRaceClient = false; m_IsUsingDDRaceClient = false;
m_ShowOthers = g_Config.m_SvShowOthersDefault; m_ShowOthers = g_Config.m_SvShowOthersDefault;
m_NinjaJetpack = false;
m_Paused = PAUSED_NONE; m_Paused = PAUSED_NONE;
m_DND = false; m_DND = false;

View file

@ -139,6 +139,7 @@ public:
int m_Authed; int m_Authed;
bool m_IsUsingDDRaceClient; bool m_IsUsingDDRaceClient;
bool m_ShowOthers; bool m_ShowOthers;
bool m_NinjaJetpack;
bool m_Afk; bool m_Afk;
int m_ChatScore; int m_ChatScore;