add all character flags to ddnetnetwork character

This commit is contained in:
Ryozuki 2019-04-19 11:17:28 +02:00
parent bbf485a9ac
commit f37f8a8268
No known key found for this signature in database
GPG key ID: 848FCC08E5B89681
7 changed files with 144 additions and 3 deletions

View file

@ -4,7 +4,10 @@ Emotes = ["NORMAL", "PAIN", "HAPPY", "SURPRISE", "ANGRY", "BLINK"]
PlayerFlags = ["PLAYING", "IN_MENU", "CHATTING", "SCOREBOARD", "AIM"]
GameFlags = ["TEAMS", "FLAGS"]
GameStateFlags = ["GAMEOVER", "SUDDENDEATH", "PAUSED", "RACETIME"]
CharacterFlags = ["SOLO"]
CharacterFlags = ["SOLO", "JETPACK", "NO_COLLISION", "ENDLESS_HOOK", "ENDLESS_JUMP", "SUPER",
"DISABLE_HIT_HAMMER", "DISABLE_HIT_SHOTGUN", "DISABLE_HIT_GRENADE", "DISABLE_HIT_RIFLE", "DISABLE_HOOK",
"TELEGUN_GUN", "TELEGUN_GRENADE", "TELEGUN_LASER",
"FROZEN", "DEEP_FROZEN", "IS_SPECTATING"]
Emoticons = ["OOP", "EXCLAMATION", "HEARTS", "DROP", "DOTDOT", "MUSIC", "SORRY", "GHOST", "SUSHI", "SPLATTEE", "DEVILTEE", "ZOMG", "ZZZ", "WTF", "EYES", "QUESTION"]

View file

@ -1118,8 +1118,48 @@ void CGameClient::OnNewSnapshot()
}
else if(Item.m_Type == NETOBJTYPE_DDNETCHARACTER)
{
const CNetObj_DDNetCharacter *pCharacterData = (const CNetObj_DDNetCharacter *)pData;
// Collision
m_aClients[Item.m_ID].m_Solo = m_aClients[Item.m_ID].m_Predicted.m_Solo =
((const CNetObj_DDNetCharacter *)pData)->m_Flags & CHARACTERFLAG_SOLO;
pCharacterData->m_Flags & CHARACTERFLAG_SOLO;
m_aClients[Item.m_ID].m_NoCollision = m_aClients[Item.m_ID].m_Predicted.m_NoCollision =
pCharacterData->m_Flags & CHARACTERFLAG_NO_COLLISION;
m_aClients[Item.m_ID].m_NoHammerHit = m_aClients[Item.m_ID].m_Predicted.m_NoHammerHit =
pCharacterData->m_Flags & CHARACTERFLAG_DISABLE_HIT_HAMMER;
m_aClients[Item.m_ID].m_NoGrenadeHit = m_aClients[Item.m_ID].m_Predicted.m_NoGrenadeHit =
pCharacterData->m_Flags & CHARACTERFLAG_DISABLE_HIT_GRENADE;
m_aClients[Item.m_ID].m_NoRifleHit = m_aClients[Item.m_ID].m_Predicted.m_NoRifleHit =
pCharacterData->m_Flags & CHARACTERFLAG_DISABLE_HIT_RIFLE;
m_aClients[Item.m_ID].m_NoShotgunHit = m_aClients[Item.m_ID].m_Predicted.m_NoShotgunHit =
pCharacterData->m_Flags & CHARACTERFLAG_DISABLE_HIT_SHOTGUN;
m_aClients[Item.m_ID].m_NoHookHit = m_aClients[Item.m_ID].m_Predicted.m_NoHookHit =
pCharacterData->m_Flags & CHARACTERFLAG_DISABLE_HOOK;
m_aClients[Item.m_ID].m_Super = m_aClients[Item.m_ID].m_Predicted.m_Super =
pCharacterData->m_Flags & CHARACTERFLAG_SUPER;
// Endless
m_aClients[Item.m_ID].m_EndlessHook = m_aClients[Item.m_ID].m_Predicted.m_EndlessHook =
pCharacterData->m_Flags & CHARACTERFLAG_ENDLESS_HOOK;
m_aClients[Item.m_ID].m_EndlessJump = m_aClients[Item.m_ID].m_Predicted.m_EndlessJump =
pCharacterData->m_Flags & CHARACTERFLAG_ENDLESS_JUMP;
// Freeze
m_aClients[Item.m_ID].m_Frozen = m_aClients[Item.m_ID].m_Predicted.m_Frozen =
pCharacterData->m_Flags & CHARACTERFLAG_FROZEN;
m_aClients[Item.m_ID].m_DeepFrozen = m_aClients[Item.m_ID].m_Predicted.m_DeepFrozen =
pCharacterData->m_Flags & CHARACTERFLAG_DEEP_FROZEN;
// Telegun
m_aClients[Item.m_ID].m_HasTelegunGrenade = m_aClients[Item.m_ID].m_Predicted.m_HasTelegunGrenade =
pCharacterData->m_Flags & CHARACTERFLAG_TELEGUN_GRENADE;
m_aClients[Item.m_ID].m_HasTelegunGun = m_aClients[Item.m_ID].m_Predicted.m_HasTelegunGun =
pCharacterData->m_Flags & CHARACTERFLAG_TELEGUN_GUN;
m_aClients[Item.m_ID].m_HasTelegunLaser = m_aClients[Item.m_ID].m_Predicted.m_HasTelegunLaser =
pCharacterData->m_Flags & CHARACTERFLAG_TELEGUN_LASER;
// Other
m_aClients[Item.m_ID].m_Spectating = pCharacterData->m_Flags & CHARACTERFLAG_IS_SPECTATING;
}
else if(Item.m_Type == NETOBJTYPE_SPECTATORINFO)
{
@ -1854,7 +1894,26 @@ void CGameClient::CClientData::Reset()
m_SkinInfo.m_Texture = g_GameClient.m_pSkins->Get(0)->m_ColorTexture;
m_SkinInfo.m_ColorBody = vec4(1,1,1,1);
m_SkinInfo.m_ColorFeet = vec4(1,1,1,1);
// DDNet Character
m_Solo = false;
m_Jetpack = false;
m_NoCollision = false;
m_EndlessHook = false;
m_EndlessJump = false;
m_NoHammerHit = false;
m_NoGrenadeHit = false;
m_NoRifleHit = false;
m_NoShotgunHit = false;
m_NoHookHit = false;
m_Super = false;
m_HasTelegunGun = false;
m_HasTelegunGrenade = false;
m_HasTelegunLaser = false;
m_Frozen = false;
m_DeepFrozen = false;
m_Spectating = false;
UpdateRenderInfo();
}

View file

@ -243,6 +243,24 @@ public:
int m_Emoticon;
int m_EmoticonStart;
bool m_Solo;
bool m_Jetpack;
bool m_NoCollision;
bool m_EndlessHook;
bool m_EndlessJump;
bool m_NoHammerHit;
bool m_NoGrenadeHit;
bool m_NoRifleHit;
bool m_NoShotgunHit;
bool m_NoHookHit;
bool m_Super;
bool m_HasTelegunGun;
bool m_HasTelegunGrenade;
bool m_HasTelegunLaser;
bool m_Frozen;
bool m_DeepFrozen;
bool m_Spectating;
CCharacterCore m_Predicted;
CCharacterCore m_PrevPredicted;

View file

@ -101,7 +101,24 @@ void CCharacterCore::Reset()
m_TriggeredEvents = 0;
m_Hook = true;
m_Collision = true;
// DDNet Character
m_Solo = false;
m_Jetpack = false;
m_NoCollision = false;
m_EndlessHook = false;
m_EndlessJump = false;
m_NoHammerHit = false;
m_NoGrenadeHit = false;
m_NoRifleHit = false;
m_NoShotgunHit = false;
m_NoHookHit = false;
m_Super = false;
m_HasTelegunGun = false;
m_HasTelegunGrenade = false;
m_HasTelegunLaser = false;
m_Frozen = false;
m_DeepFrozen = false;
}
void CCharacterCore::Tick(bool UseInput, bool IsClient)

View file

@ -230,7 +230,24 @@ public:
vec2 m_LastVel;
int m_Colliding;
bool m_LeftWall;
// DDnet Character
bool m_Solo;
bool m_Jetpack;
bool m_NoCollision;
bool m_EndlessHook;
bool m_EndlessJump;
bool m_NoHammerHit;
bool m_NoGrenadeHit;
bool m_NoRifleHit;
bool m_NoShotgunHit;
bool m_NoHookHit;
bool m_Super;
bool m_HasTelegunGun;
bool m_HasTelegunGrenade;
bool m_HasTelegunLaser;
bool m_Frozen;
bool m_DeepFrozen;
void LimitForce(vec2 *Force);
void ApplyForce(vec2 Force);

View file

@ -1174,6 +1174,34 @@ void CCharacter::Snap(int SnappingClient)
pDDNetCharacter->m_Flags = 0;
if(m_Solo)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_SOLO;
if(m_Super)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_SUPER;
if(m_EndlessHook)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_ENDLESS_HOOK;
if(m_SuperJump)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_ENDLESS_JUMP;
if(m_Jetpack || m_NinjaJetpack)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_JETPACK;
if(m_FreezeTime > 0)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_FROZEN;
if(m_DeepFreeze)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_DEEP_FROZEN;
if(m_Hit&DISABLE_HIT_GRENADE)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_DISABLE_HIT_GRENADE;
if(m_Hit&DISABLE_HIT_HAMMER)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_DISABLE_HIT_HAMMER;
if(m_Hit&DISABLE_HIT_RIFLE)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_DISABLE_HIT_RIFLE;
if(m_Hit&DISABLE_HIT_SHOTGUN)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_DISABLE_HIT_SHOTGUN;
if(IsPaused())
pDDNetCharacter->m_Flags |= CHARACTERFLAG_IS_SPECTATING;
if(m_HasTeleGun)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_GUN;
if(m_HasTeleGrenade)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_GRENADE;
if(m_HasTeleLaser)
pDDNetCharacter->m_Flags |= CHARACTERFLAG_TELEGUN_LASER;
}
int CCharacter::NetworkClipped(int SnappingClient)

View file

@ -186,7 +186,6 @@ public:
int Team();
bool CanCollide(int ClientID);
bool SameTeam(int ClientID);
bool IsSolo() { return m_Solo; };
bool m_Super;
bool m_SuperJump;
bool m_Jetpack;