update the core server-side

This commit is contained in:
Ryozuki 2019-04-21 15:16:28 +02:00
parent 6bfdad9771
commit 7d4fdb3322
No known key found for this signature in database
GPG key ID: 848FCC08E5B89681

View file

@ -106,7 +106,7 @@ void CCharacter::SetWeapon(int W)
void CCharacter::SetSolo(bool Solo)
{
m_Solo = Solo;
GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCID()]->m_Solo = Solo;
m_Core.m_Solo = Solo;
Teams()->m_Core.SetSolo(m_pPlayer->GetCID(), Solo);
if(Solo)
@ -1530,11 +1530,13 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Endless hook has been activated");
m_EndlessHook = true;
m_Core.m_EndlessHook = true;
}
else if(((m_TileIndex == TILE_EHOOK_END) || (m_TileFIndex == TILE_EHOOK_END)) && m_EndlessHook)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Endless hook has been deactivated");
m_EndlessHook = false;
m_Core.m_EndlessHook = false;
}
// hit others
@ -1542,6 +1544,10 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hit others");
m_Hit = DISABLE_HIT_GRENADE|DISABLE_HIT_HAMMER|DISABLE_HIT_RIFLE|DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = true;
m_Core.m_NoGrenadeHit = true;
m_Core.m_NoHammerHit = true;
m_Core.m_NoRifleHit = true;
m_NeededFaketuning |= FAKETUNE_NOHAMMER;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
@ -1549,6 +1555,10 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hit others");
m_Hit = HIT_ALL;
m_Core.m_NoShotgunHit = false;
m_Core.m_NoGrenadeHit = false;
m_Core.m_NoHammerHit = false;
m_Core.m_NoRifleHit = false;
m_NeededFaketuning &= ~FAKETUNE_NOHAMMER;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
@ -1558,6 +1568,7 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't collide with others");
m_Core.m_Collision = false;
m_Core.m_NoCollision = true;
m_NeededFaketuning |= FAKETUNE_NOCOLL;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
@ -1565,6 +1576,7 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can collide with others");
m_Core.m_Collision = true;
m_Core.m_NoCollision = false;
m_NeededFaketuning &= ~FAKETUNE_NOCOLL;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
@ -1574,6 +1586,7 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hook others");
m_Core.m_Hook = false;
m_Core.m_NoHookHit = true;
m_NeededFaketuning |= FAKETUNE_NOHOOK;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
@ -1581,6 +1594,7 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can hook others");
m_Core.m_Hook = true;
m_Core.m_NoHookHit = false;
m_NeededFaketuning &= ~FAKETUNE_NOHOOK;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
@ -1590,6 +1604,7 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You have unlimited air jumps");
m_SuperJump = true;
m_Core.m_EndlessJump = true;
if (m_Core.m_Jumps == 0)
{
m_NeededFaketuning &= ~FAKETUNE_NOJUMP;
@ -1600,6 +1615,7 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You don't have unlimited air jumps");
m_SuperJump = false;
m_Core.m_EndlessJump = false;
if (m_Core.m_Jumps == 0)
{
m_NeededFaketuning |= FAKETUNE_NOJUMP;
@ -1623,11 +1639,13 @@ void CCharacter::HandleTiles(int Index)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You have a jetpack gun");
m_Jetpack = true;
m_Core.m_Jetpack = true;
}
else if(((m_TileIndex == TILE_JETPACK_END) || (m_TileFIndex == TILE_JETPACK_END)) && m_Jetpack)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You lost your jetpack gun");
m_Jetpack = false;
m_Core.m_Jetpack = false;
}
// unlock team
@ -1668,33 +1686,39 @@ void CCharacter::HandleTiles(int Index)
if (((m_TileIndex == TILE_TELE_GUN_ENABLE) || (m_TileFIndex == TILE_TELE_GUN_ENABLE)) && !m_HasTeleGun)
{
m_HasTeleGun = true;
m_Core.m_HasTelegunGun = true;
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport gun enabled");
}
else if (((m_TileIndex == TILE_TELE_GUN_DISABLE) || (m_TileFIndex == TILE_TELE_GUN_DISABLE)) && m_HasTeleGun)
{
m_HasTeleGun = false;
m_Core.m_HasTelegunGun = false;
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport gun disabled");
}
if (((m_TileIndex == TILE_TELE_GRENADE_ENABLE) || (m_TileFIndex == TILE_TELE_GRENADE_ENABLE)) && !m_HasTeleGrenade)
{
m_HasTeleGrenade = true;
m_Core.m_HasTelegunGrenade = true;
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport grenade enabled");
}
else if (((m_TileIndex == TILE_TELE_GRENADE_DISABLE) || (m_TileFIndex == TILE_TELE_GRENADE_DISABLE)) && m_HasTeleGrenade)
{
m_HasTeleGrenade = false;
m_Core.m_HasTelegunGrenade = false;
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport grenade disabled");
}
if (((m_TileIndex == TILE_TELE_LASER_ENABLE) || (m_TileFIndex == TILE_TELE_LASER_ENABLE)) && !m_HasTeleLaser)
{
m_HasTeleLaser = true;
m_Core.m_HasTelegunLaser = true;
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport laser enabled");
}
else if (((m_TileIndex == TILE_TELE_LASER_DISABLE) || (m_TileFIndex == TILE_TELE_LASER_DISABLE)) && m_HasTeleLaser)
{
m_HasTeleLaser = false;
m_Core.m_HasTelegunLaser = false;
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Teleport laser disabled");
}
@ -1775,6 +1799,7 @@ void CCharacter::HandleTiles(int Index)
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can hammer hit others");
m_Hit &= ~DISABLE_HIT_HAMMER;
m_NeededFaketuning &= ~FAKETUNE_NOHAMMER;
m_Core.m_NoHammerHit = false;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_END && !(m_Hit&DISABLE_HIT_HAMMER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
@ -1782,37 +1807,44 @@ void CCharacter::HandleTiles(int Index)
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't hammer hit others");
m_Hit |= DISABLE_HIT_HAMMER;
m_NeededFaketuning |= FAKETUNE_NOHAMMER;
m_Core.m_NoHammerHit = true;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_START && m_Hit&DISABLE_HIT_SHOTGUN && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can shoot others with shotgun");
m_Hit &= ~DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = false;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_END && !(m_Hit&DISABLE_HIT_SHOTGUN) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_SHOTGUN)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't shoot others with shotgun");
m_Hit |= DISABLE_HIT_SHOTGUN;
m_Core.m_NoShotgunHit = true;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_START && m_Hit&DISABLE_HIT_GRENADE && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can shoot others with grenade");
m_Hit &= ~DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = false;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_END && !(m_Hit&DISABLE_HIT_GRENADE) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_GRENADE)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't shoot others with grenade");
m_Hit |= DISABLE_HIT_GRENADE;
m_Core.m_NoGrenadeHit = true;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_START && m_Hit&DISABLE_HIT_RIFLE && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_RIFLE)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can shoot others with rifle");
m_Hit &= ~DISABLE_HIT_RIFLE;
m_Core.m_NoRifleHit = false;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_END && !(m_Hit&DISABLE_HIT_RIFLE) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_RIFLE)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't shoot others with rifle");
m_Hit |= DISABLE_HIT_RIFLE;
m_Core.m_NoRifleHit = true;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_JUMP)
{