Added Hit as a tile

Entities are in the previous commit
This commit is contained in:
GreYFoX 2011-07-19 23:33:12 +02:00
parent 7ea942441b
commit 1dfd2882d2
4 changed files with 15 additions and 2 deletions

View file

@ -108,7 +108,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_TELECHECKIN) || (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) || (Index >= TILE_DFREEZE && Index <= TILE_DUNFREEZE)) if(Index == TILE_THROUGH || (Index >= TILE_FREEZE && Index <= TILE_UNFREEZE) || (Index >= TILE_SWITCHOPEN && Index <= TILE_TELECHECKIN) || (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_HIT_END) || (Index >= TILE_DFREEZE && Index <= TILE_DUNFREEZE))
m_pFront[i].m_Index = Index; m_pFront[i].m_Index = Index;
} }
} }
@ -134,7 +134,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_TELECHECKIN) || (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) || (Index >= TILE_DFREEZE && Index <= TILE_DUNFREEZE)) if(Index == TILE_THROUGH || (Index >= TILE_FREEZE && Index <= TILE_UNFREEZE) || (Index >= TILE_SWITCHOPEN && Index <= TILE_TELECHECKIN) || (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_HIT_END) || (Index >= TILE_DFREEZE && Index <= TILE_DUNFREEZE))
m_pTiles[i].m_Index = Index; m_pTiles[i].m_Index = Index;
} }
} }

View file

@ -95,6 +95,8 @@ enum
TILE_DUNFREEZE, TILE_DUNFREEZE,
TILE_EHOOK_START = 17, TILE_EHOOK_START = 17,
TILE_EHOOK_END, TILE_EHOOK_END,
TILE_HIT_START,
TILE_HIT_END,
//Switches //Switches
TILE_SWITCHTIMEDOPEN = 22, TILE_SWITCHTIMEDOPEN = 22,
TILE_SWITCHTIMEDCLOSE, TILE_SWITCHTIMEDCLOSE,

View file

@ -1234,6 +1234,16 @@ void CCharacter::HandleTiles(int Index)
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"Endless hook has been deactivated"); GameServer()->SendChatTarget(GetPlayer()->GetCID(),"Endless hook has been deactivated");
m_EndlessHook = false; m_EndlessHook = false;
} }
if(((m_TileIndex == TILE_HIT_START) || (m_TileFIndex == TILE_HIT_START)) && !m_EndlessHook)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can hit others");
m_Hit = true;
}
else if(((m_TileIndex == TILE_HIT_END) || (m_TileFIndex == TILE_HIT_END)) && m_EndlessHook)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't hit others");
m_Hit = 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)

View file

@ -157,6 +157,7 @@ public:
int m_FreezeTick; int m_FreezeTick;
bool m_DeepFreeze; bool m_DeepFreeze;
bool m_EndlessHook; bool m_EndlessHook;
bool m_Hit;
int m_PainSoundTimer; int m_PainSoundTimer;
int m_DefEmote; int m_DefEmote;
int m_DefEmoteReset; int m_DefEmoteReset;