mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Endless Hook Tile for ingameplay by Floff aka LemonFace
This commit is contained in:
parent
8860202172
commit
9c66a2d54c
Binary file not shown.
Before Width: | Height: | Size: 223 KiB After Width: | Height: | Size: 238 KiB |
Binary file not shown.
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 230 KiB |
Binary file not shown.
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 267 KiB |
|
@ -119,7 +119,7 @@ void CCollision::Init(class CLayers *pLayers)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DDRace tiles
|
// DDRace tiles
|
||||||
if(Index == TILE_THROUGH || (Index >= TILE_FREEZE && Index <= TILE_UNFREEZE) || (Index >= TILE_SWITCHOPEN && Index<=TILE_BOOST) || (Index >= TILE_BEGIN && Index <= TILE_STOPA) || Index == TILE_CP || Index == TILE_CP_F || (Index >= TILE_OLDLASER && Index <= TILE_NPH))
|
if(Index == TILE_THROUGH || (Index >= TILE_FREEZE && Index <= TILE_UNFREEZE) || (Index >= TILE_SWITCHOPEN && Index<=TILE_BOOST) || (Index >= TILE_BEGIN && Index <= TILE_STOPA) || Index == TILE_CP || Index == TILE_CP_F || (Index >= TILE_OLDLASER && Index <= TILE_NPH) || (Index >= TILE_EHOOK_START && Index <= TILE_EHOOK_END))
|
||||||
m_pFront[i].m_Index = Index;
|
m_pFront[i].m_Index = Index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ void CCollision::Init(class CLayers *pLayers)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DDRace tiles
|
// DDRace tiles
|
||||||
if(Index == TILE_THROUGH || (Index >= TILE_FREEZE && Index <= TILE_UNFREEZE) || (Index >= TILE_SWITCHOPEN && Index<=TILE_BOOST) || (Index >= TILE_BEGIN && Index <= TILE_STOPA) || Index == TILE_CP || Index == TILE_CP_F || (Index >= TILE_OLDLASER && Index <= TILE_NPH))
|
if(Index == TILE_THROUGH || (Index >= TILE_FREEZE && Index <= TILE_UNFREEZE) || (Index >= TILE_SWITCHOPEN && Index<=TILE_BOOST) || (Index >= TILE_BEGIN && Index <= TILE_STOPA) || Index == TILE_CP || Index == TILE_CP_F || (Index >= TILE_OLDLASER && Index <= TILE_NPH) || (Index >= TILE_EHOOK_START && Index <= TILE_EHOOK_END))
|
||||||
m_pTiles[i].m_Index = Index;
|
m_pTiles[i].m_Index = Index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,8 @@ enum
|
||||||
TILE_FREEZE = 9,
|
TILE_FREEZE = 9,
|
||||||
TILE_TELEINEVIL,
|
TILE_TELEINEVIL,
|
||||||
TILE_UNFREEZE,
|
TILE_UNFREEZE,
|
||||||
|
TILE_EHOOK_START = 17,
|
||||||
|
TILE_EHOOK_END,
|
||||||
//Switches
|
//Switches
|
||||||
TILE_SWITCHTIMEDOPEN = 22,
|
TILE_SWITCHTIMEDOPEN = 22,
|
||||||
TILE_SWITCHTIMEDCLOSE,
|
TILE_SWITCHTIMEDCLOSE,
|
||||||
|
|
|
@ -776,7 +776,7 @@ void CCharacter::Tick()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_DoSplash = false;
|
m_DoSplash = false;
|
||||||
if (g_Config.m_SvEndlessDrag)
|
if (g_Config.m_SvEndlessDrag || m_EndlessHook)
|
||||||
m_Core.m_HookTick = 0;
|
m_Core.m_HookTick = 0;
|
||||||
if (m_Super && m_Core.m_Jumped > 1)
|
if (m_Super && m_Core.m_Jumped > 1)
|
||||||
m_Core.m_Jumped = 1;
|
m_Core.m_Jumped = 1;
|
||||||
|
@ -1005,6 +1005,16 @@ void CCharacter::HandleTiles(int Index)
|
||||||
{
|
{
|
||||||
UnFreeze();
|
UnFreeze();
|
||||||
}
|
}
|
||||||
|
else if(((m_TileIndex == TILE_EHOOK_START) || (m_TileFIndex == TILE_EHOOK_START)) && !m_EndlessHook)
|
||||||
|
{
|
||||||
|
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"Endless hook has been activated");
|
||||||
|
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;
|
||||||
|
}
|
||||||
if(((m_TileIndex == TILE_STOP && m_TileFlags == ROTATION_270) || (m_TileIndexL == TILE_STOP && m_TileFlagsL == ROTATION_270) || (m_TileIndexL == TILE_STOPS && (m_TileFlagsL == ROTATION_90 || m_TileFlagsL ==ROTATION_270)) || (m_TileIndexL == TILE_STOPA) || (m_TileFIndex == TILE_STOP && m_TileFFlags == ROTATION_270) || (m_TileFIndexL == TILE_STOP && m_TileFFlagsL == ROTATION_270) || (m_TileFIndexL == TILE_STOPS && (m_TileFFlagsL == ROTATION_90 || m_TileFFlagsL == ROTATION_270)) || (m_TileFIndexL == TILE_STOPA) || (m_TileSIndex == TILE_STOP && m_TileSFlags == ROTATION_270) || (m_TileSIndexL == TILE_STOP && m_TileSFlagsL == ROTATION_270) || (m_TileSIndexL == TILE_STOPS && (m_TileSFlagsL == ROTATION_90 || m_TileSFlagsL == ROTATION_270)) || (m_TileSIndexL == TILE_STOPA)) && m_Core.m_Vel.x > 0)
|
if(((m_TileIndex == TILE_STOP && m_TileFlags == ROTATION_270) || (m_TileIndexL == TILE_STOP && m_TileFlagsL == ROTATION_270) || (m_TileIndexL == TILE_STOPS && (m_TileFlagsL == ROTATION_90 || m_TileFlagsL ==ROTATION_270)) || (m_TileIndexL == TILE_STOPA) || (m_TileFIndex == TILE_STOP && m_TileFFlags == ROTATION_270) || (m_TileFIndexL == TILE_STOP && m_TileFFlagsL == ROTATION_270) || (m_TileFIndexL == TILE_STOPS && (m_TileFFlagsL == ROTATION_90 || m_TileFFlagsL == ROTATION_270)) || (m_TileFIndexL == TILE_STOPA) || (m_TileSIndex == TILE_STOP && m_TileSFlags == ROTATION_270) || (m_TileSIndexL == TILE_STOP && m_TileSFlagsL == ROTATION_270) || (m_TileSIndexL == TILE_STOPS && (m_TileSFlagsL == ROTATION_90 || m_TileSFlagsL == ROTATION_270)) || (m_TileSIndexL == TILE_STOPA)) && m_Core.m_Vel.x > 0)
|
||||||
{
|
{
|
||||||
if((int)GameServer()->Collision()->GetPos(MapIndexL).x)
|
if((int)GameServer()->Collision()->GetPos(MapIndexL).x)
|
||||||
|
|
|
@ -122,6 +122,8 @@ public:
|
||||||
//DDRace
|
//DDRace
|
||||||
int m_FreezeTime;
|
int m_FreezeTime;
|
||||||
int m_FreezeTick;
|
int m_FreezeTick;
|
||||||
|
|
||||||
|
bool m_EndlessHook;
|
||||||
|
|
||||||
int m_Doored;
|
int m_Doored;
|
||||||
|
|
||||||
|
|
|
@ -285,6 +285,7 @@ void CPlayer::LoadCharacter()
|
||||||
Character->m_LastWeapon = m_PauseInfo.m_LastWeapon;
|
Character->m_LastWeapon = m_PauseInfo.m_LastWeapon;
|
||||||
Character->m_HammerType = m_PauseInfo.m_HammerType;
|
Character->m_HammerType = m_PauseInfo.m_HammerType;
|
||||||
Character->m_Super = m_PauseInfo.m_Super;
|
Character->m_Super = m_PauseInfo.m_Super;
|
||||||
|
Character->m_EndlessHook = m_PauseInfo.m_EndlessHook;
|
||||||
CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController;
|
CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController;
|
||||||
Controller->m_Teams.m_Core.Team(GetCID(), m_PauseInfo.m_Team);
|
Controller->m_Teams.m_Core.Team(GetCID(), m_PauseInfo.m_Team);
|
||||||
m_PauseInfo.m_Respawn = false;
|
m_PauseInfo.m_Respawn = false;
|
||||||
|
@ -315,6 +316,7 @@ void CPlayer::SaveCharacter()
|
||||||
m_PauseInfo.m_LastWeapon = Character->m_LastWeapon;
|
m_PauseInfo.m_LastWeapon = Character->m_LastWeapon;
|
||||||
m_PauseInfo.m_HammerType = Character->m_HammerType;
|
m_PauseInfo.m_HammerType = Character->m_HammerType;
|
||||||
m_PauseInfo.m_Super = Character->m_Super;
|
m_PauseInfo.m_Super = Character->m_Super;
|
||||||
|
m_PauseInfo.m_EndlessHook = Character->m_EndlessHook;
|
||||||
CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController;
|
CGameControllerDDRace* Controller = (CGameControllerDDRace*)GameServer()->m_pController;
|
||||||
m_PauseInfo.m_Team = Controller->m_Teams.m_Core.Team(GetCID());
|
m_PauseInfo.m_Team = Controller->m_Teams.m_Core.Team(GetCID());
|
||||||
m_PauseInfo.m_PauseTime = Server()->Tick();
|
m_PauseInfo.m_PauseTime = Server()->Tick();
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
bool m_aHasWeapon[NUM_WEAPONS];
|
bool m_aHasWeapon[NUM_WEAPONS];
|
||||||
int m_HammerType;
|
int m_HammerType;
|
||||||
bool m_Super;
|
bool m_Super;
|
||||||
|
bool m_EndlessHook;
|
||||||
int m_PauseTime;
|
int m_PauseTime;
|
||||||
int m_Team;
|
int m_Team;
|
||||||
} m_PauseInfo;
|
} m_PauseInfo;
|
||||||
|
|
Loading…
Reference in a new issue