mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Added Flicker effect to NON-Active Entities
This commit is contained in:
parent
bf0b4183cc
commit
3c1c045722
|
@ -65,6 +65,8 @@ void CDoor::Snap(int SnappingClient)
|
||||||
pObj->m_Y = (int)m_Pos.y;
|
pObj->m_Y = (int)m_Pos.y;
|
||||||
|
|
||||||
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
||||||
|
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||||
|
if (Char && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (!Tick)) return;
|
||||||
if(Char == 0) return;
|
if(Char == 0) return;
|
||||||
|
|
||||||
if(Char->Team() == TEAM_SUPER)
|
if(Char->Team() == TEAM_SUPER)
|
||||||
|
|
|
@ -26,7 +26,7 @@ CDragger::CDragger(CGameWorld *pGameWorld, vec2 Pos, float Strength, bool NW, in
|
||||||
|
|
||||||
void CDragger::Move()
|
void CDragger::Move()
|
||||||
{
|
{
|
||||||
if(m_Target && m_Target->m_Super)
|
if(m_Target && m_Target->m_Alive && (m_Target->m_Super || m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[m_Target->Team()]))
|
||||||
m_Target = 0;
|
m_Target = 0;
|
||||||
if(m_Target)
|
if(m_Target)
|
||||||
return;
|
return;
|
||||||
|
@ -123,6 +123,8 @@ void CDragger::Snap(int SnappingClient)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
||||||
|
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||||
|
if (Char && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (!Tick)) return;
|
||||||
if(Char && m_Target && Char->Team() != m_Target->Team()) return;
|
if(Char && m_Target && Char->Team() != m_Target->Team()) return;
|
||||||
|
|
||||||
CNetObj_Laser *obj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
CNetObj_Laser *obj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||||
|
|
|
@ -88,11 +88,14 @@ void CGun::Tick()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGun::Snap(int snapping_client)
|
void CGun::Snap(int SnappingClient)
|
||||||
{
|
{
|
||||||
if(NetworkClipped(snapping_client))
|
if(NetworkClipped(SnappingClient))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||||
|
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||||
|
if (SnapChar && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||||
pObj->m_X = (int)m_Pos.x;
|
pObj->m_X = (int)m_Pos.x;
|
||||||
pObj->m_Y = (int)m_Pos.y;
|
pObj->m_Y = (int)m_Pos.y;
|
||||||
|
|
|
@ -112,6 +112,8 @@ void CLight::Snap(int SnappingClient)
|
||||||
pObj->m_Y = (int)m_Pos.y;
|
pObj->m_Y = (int)m_Pos.y;
|
||||||
|
|
||||||
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
||||||
|
int Tick = (Server()->Tick()%Server()->TickSpeed())%6;
|
||||||
|
if (Char && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (Tick)) return;
|
||||||
if(Char == 0) return;
|
if(Char == 0) return;
|
||||||
|
|
||||||
if(Char->Team() == TEAM_SUPER)
|
if(Char->Team() == TEAM_SUPER)
|
||||||
|
|
|
@ -153,6 +153,9 @@ void CPickup::Snap(int SnappingClient)
|
||||||
if(m_SpawnTick != -1 || NetworkClipped(SnappingClient))
|
if(m_SpawnTick != -1 || NetworkClipped(SnappingClient))
|
||||||
return;
|
return;
|
||||||
*/
|
*/
|
||||||
|
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||||
|
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||||
|
if (SnapChar && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||||
CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, m_Id, sizeof(CNetObj_Pickup)));
|
CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, m_Id, sizeof(CNetObj_Pickup)));
|
||||||
pP->m_X = (int)m_Pos.x;
|
pP->m_X = (int)m_Pos.x;
|
||||||
pP->m_Y = (int)m_Pos.y;
|
pP->m_Y = (int)m_Pos.y;
|
||||||
|
|
|
@ -79,7 +79,9 @@ void CPlasma::Snap(int SnappingClient)
|
||||||
if(NetworkClipped(SnappingClient))
|
if(NetworkClipped(SnappingClient))
|
||||||
return;
|
return;
|
||||||
CCharacter* SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
CCharacter* SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||||
|
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||||
if(!SnapChar) return;
|
if(!SnapChar) return;
|
||||||
|
if (!GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||||
if((SnapChar->Team() != m_ResponsibleTeam) && !SnapChar->GetPlayer()->m_IsUsingDDRaceClient) return;
|
if((SnapChar->Team() != m_ResponsibleTeam) && !SnapChar->GetPlayer()->m_IsUsingDDRaceClient) return;
|
||||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||||
pObj->m_X = (int)m_Pos.x;
|
pObj->m_X = (int)m_Pos.x;
|
||||||
|
|
|
@ -171,7 +171,8 @@ void CProjectile::Snap(int SnappingClient)
|
||||||
if(NetworkClipped(SnappingClient, GetPos(Ct)))
|
if(NetworkClipped(SnappingClient, GetPos(Ct)))
|
||||||
return;
|
return;
|
||||||
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||||
if (!GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()]) return;
|
int Tick = (Server()->Tick()%Server()->TickSpeed())%6;
|
||||||
|
if (SnapChar && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (Tick)) return;
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in a new issue