mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Switchable ninjajetpack
This commit is contained in:
parent
f4b961ecad
commit
2af9d9f423
|
@ -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;
|
||||||
|
|
|
@ -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")
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue