Add jetpack

This commit is contained in:
def 2013-11-13 13:25:26 +01:00
parent 51321c6011
commit 0b305471d2
5 changed files with 15 additions and 2 deletions

View file

@ -281,7 +281,8 @@ void CCharacter::FireWeapon()
bool FullAuto = false;
if(m_ActiveWeapon == WEAPON_GRENADE || m_ActiveWeapon == WEAPON_SHOTGUN || m_ActiveWeapon == WEAPON_RIFLE)
FullAuto = true;
if (m_pGameWorld->m_Core.m_Tuning.m_PlayerJetpack != 0.0f && m_ActiveWeapon == WEAPON_GUN)
FullAuto = true;
// check if we gonna fire
bool WillFire = false;
@ -398,6 +399,9 @@ void CCharacter::FireWeapon()
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()));
} break;

View file

@ -62,8 +62,8 @@ class CEntity
CEntity *m_pPrevTypeEntity;
CEntity *m_pNextTypeEntity;
class CGameWorld *m_pGameWorld;
protected:
class CGameWorld *m_pGameWorld;
bool m_MarkedForDestroy;
int m_ID;
int m_ObjType;

View file

@ -2194,6 +2194,13 @@ bool CGameContext::PlayerHooking()
return Temp != 0.0;
}
float CGameContext::PlayerJetpack()
{
float Temp;
m_Tuning.Get("player_jetpack", &Temp);
return Temp;
}
void CGameContext::OnSetAuthed(int ClientID, int Level)
{
CServer* pServ = (CServer*)Server();

View file

@ -295,6 +295,7 @@ public:
virtual void OnSetAuthed(int ClientID,int Level);
virtual bool PlayerCollision();
virtual bool PlayerHooking();
virtual float PlayerJetpack();
void ResetTuning();

View file

@ -45,4 +45,5 @@ MACRO_TUNING_PARAM(LaserDamage, laser_damage, 5)
MACRO_TUNING_PARAM(PlayerCollision, player_collision, 1)
MACRO_TUNING_PARAM(PlayerHooking, player_hooking, 1)
MACRO_TUNING_PARAM(PlayerJetpack, player_jetpack, 0.0f)
#endif