mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Add jetpack
This commit is contained in:
parent
51321c6011
commit
0b305471d2
|
@ -281,7 +281,8 @@ void CCharacter::FireWeapon()
|
||||||
bool FullAuto = false;
|
bool FullAuto = false;
|
||||||
if(m_ActiveWeapon == WEAPON_GRENADE || m_ActiveWeapon == WEAPON_SHOTGUN || m_ActiveWeapon == WEAPON_RIFLE)
|
if(m_ActiveWeapon == WEAPON_GRENADE || m_ActiveWeapon == WEAPON_SHOTGUN || m_ActiveWeapon == WEAPON_RIFLE)
|
||||||
FullAuto = true;
|
FullAuto = true;
|
||||||
|
if (m_pGameWorld->m_Core.m_Tuning.m_PlayerJetpack != 0.0f && m_ActiveWeapon == WEAPON_GUN)
|
||||||
|
FullAuto = true;
|
||||||
|
|
||||||
// check if we gonna fire
|
// check if we gonna fire
|
||||||
bool WillFire = false;
|
bool WillFire = false;
|
||||||
|
@ -398,6 +399,9 @@ void CCharacter::FireWeapon()
|
||||||
|
|
||||||
Server()->SendMsg(&Msg, 0, m_pPlayer->GetCID());
|
Server()->SendMsg(&Msg, 0, m_pPlayer->GetCID());
|
||||||
|
|
||||||
|
if (m_pGameWorld->m_Core.m_Tuning.m_PlayerJetpack != 0.0f)
|
||||||
|
TakeDamage(Direction * -1.0f * m_pGameWorld->m_Core.m_Tuning.m_PlayerJetpack, g_pData->m_Weapons.m_Hammer.m_pBase->m_Damage, m_pPlayer->GetCID(), m_ActiveWeapon);
|
||||||
|
|
||||||
GameServer()->CreateSound(m_Pos, SOUND_GUN_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
GameServer()->CreateSound(m_Pos, SOUND_GUN_FIRE, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
|
@ -62,8 +62,8 @@ class CEntity
|
||||||
CEntity *m_pPrevTypeEntity;
|
CEntity *m_pPrevTypeEntity;
|
||||||
CEntity *m_pNextTypeEntity;
|
CEntity *m_pNextTypeEntity;
|
||||||
|
|
||||||
class CGameWorld *m_pGameWorld;
|
|
||||||
protected:
|
protected:
|
||||||
|
class CGameWorld *m_pGameWorld;
|
||||||
bool m_MarkedForDestroy;
|
bool m_MarkedForDestroy;
|
||||||
int m_ID;
|
int m_ID;
|
||||||
int m_ObjType;
|
int m_ObjType;
|
||||||
|
|
|
@ -2194,6 +2194,13 @@ bool CGameContext::PlayerHooking()
|
||||||
return Temp != 0.0;
|
return Temp != 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CGameContext::PlayerJetpack()
|
||||||
|
{
|
||||||
|
float Temp;
|
||||||
|
m_Tuning.Get("player_jetpack", &Temp);
|
||||||
|
return Temp;
|
||||||
|
}
|
||||||
|
|
||||||
void CGameContext::OnSetAuthed(int ClientID, int Level)
|
void CGameContext::OnSetAuthed(int ClientID, int Level)
|
||||||
{
|
{
|
||||||
CServer* pServ = (CServer*)Server();
|
CServer* pServ = (CServer*)Server();
|
||||||
|
|
|
@ -295,6 +295,7 @@ public:
|
||||||
virtual void OnSetAuthed(int ClientID,int Level);
|
virtual void OnSetAuthed(int ClientID,int Level);
|
||||||
virtual bool PlayerCollision();
|
virtual bool PlayerCollision();
|
||||||
virtual bool PlayerHooking();
|
virtual bool PlayerHooking();
|
||||||
|
virtual float PlayerJetpack();
|
||||||
|
|
||||||
void ResetTuning();
|
void ResetTuning();
|
||||||
|
|
||||||
|
|
|
@ -45,4 +45,5 @@ MACRO_TUNING_PARAM(LaserDamage, laser_damage, 5)
|
||||||
|
|
||||||
MACRO_TUNING_PARAM(PlayerCollision, player_collision, 1)
|
MACRO_TUNING_PARAM(PlayerCollision, player_collision, 1)
|
||||||
MACRO_TUNING_PARAM(PlayerHooking, player_hooking, 1)
|
MACRO_TUNING_PARAM(PlayerHooking, player_hooking, 1)
|
||||||
|
MACRO_TUNING_PARAM(PlayerJetpack, player_jetpack, 0.0f)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue