2815: Renamed tile names. r=def- a=gerdoe-jr

I didn't get why some tiles' names end with `END/START` and another with `DISABLE/ENABLE`, so, I just replaced all `END/START` with `DISABLE/ENABLE`.
Also, I renamed `TILE_BONUS` and `TILE_PENALTY`, because you need to check the variables' declarations/references for understanding their purposes.

Co-authored-by: Vlad <gerdoexx@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2020-09-14 14:02:05 +00:00 committed by GitHub
commit 3df140740c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 208 additions and 219 deletions

View file

@ -718,44 +718,44 @@ void CCharacter::HandleTiles(int Index)
}
// endless hook
if(((m_TileIndex == TILE_EHOOK_START) || (m_TileFIndex == TILE_EHOOK_START)) && !m_EndlessHook)
if(((m_TileIndex == TILE_EHOOK_ENABLE) || (m_TileFIndex == TILE_EHOOK_ENABLE)) && !m_EndlessHook)
{
m_EndlessHook = true;
m_Core.m_EndlessHook = true;
}
else if(((m_TileIndex == TILE_EHOOK_END) || (m_TileFIndex == TILE_EHOOK_END)) && m_EndlessHook)
else if(((m_TileIndex == TILE_EHOOK_DISABLE) || (m_TileFIndex == TILE_EHOOK_DISABLE)) && m_EndlessHook)
{
m_EndlessHook = false;
m_Core.m_EndlessHook = false;
}
// collide with others
if(((m_TileIndex == TILE_NPC_END) || (m_TileFIndex == TILE_NPC_END)) && m_Core.m_Collision)
if(((m_TileIndex == TILE_NPC_DISABLE) || (m_TileFIndex == TILE_NPC_DISABLE)) && m_Core.m_Collision)
{
m_Core.m_Collision = false;
}
else if(((m_TileIndex == TILE_NPC_START) || (m_TileFIndex == TILE_NPC_START)) && !m_Core.m_Collision)
else if(((m_TileIndex == TILE_NPC_ENABLE) || (m_TileFIndex == TILE_NPC_ENABLE)) && !m_Core.m_Collision)
{
m_Core.m_Collision = true;
}
// hook others
if(((m_TileIndex == TILE_NPH_END) || (m_TileFIndex == TILE_NPH_END)) && m_Core.m_Hook)
if(((m_TileIndex == TILE_NPH_DISABLE) || (m_TileFIndex == TILE_NPH_DISABLE)) && m_Core.m_Hook)
{
m_Core.m_Hook = false;
}
else if(((m_TileIndex == TILE_NPH_START) || (m_TileFIndex == TILE_NPH_START)) && !m_Core.m_Hook)
else if(((m_TileIndex == TILE_NPH_ENABLE) || (m_TileFIndex == TILE_NPH_ENABLE)) && !m_Core.m_Hook)
{
m_Core.m_Hook = true;
}
// unlimited air jumps
if(((m_TileIndex == TILE_SUPER_START) || (m_TileFIndex == TILE_SUPER_START)) && !m_SuperJump)
if(((m_TileIndex == TILE_UNLIMITED_JUMPS_ENABLE) || (m_TileFIndex == TILE_UNLIMITED_JUMPS_ENABLE)) && !m_SuperJump)
{
m_SuperJump = true;
m_Core.m_EndlessJump = true;
}
else if(((m_TileIndex == TILE_SUPER_END) || (m_TileFIndex == TILE_SUPER_END)) && m_SuperJump)
else if(((m_TileIndex == TILE_UNLIMITED_JUMPS_DISABLE) || (m_TileFIndex == TILE_UNLIMITED_JUMPS_DISABLE)) && m_SuperJump)
{
m_SuperJump = false;
m_Core.m_EndlessJump = false;
@ -773,23 +773,23 @@ void CCharacter::HandleTiles(int Index)
}
// jetpack gun
if(((m_TileIndex == TILE_JETPACK_START) || (m_TileFIndex == TILE_JETPACK_START)) && !m_Jetpack)
if(((m_TileIndex == TILE_JETPACK_ENABLE) || (m_TileFIndex == TILE_JETPACK_ENABLE)) && !m_Jetpack)
{
m_Jetpack = true;
m_Core.m_Jetpack = true;
}
else if(((m_TileIndex == TILE_JETPACK_END) || (m_TileFIndex == TILE_JETPACK_END)) && m_Jetpack)
else if(((m_TileIndex == TILE_JETPACK_DISABLE) || (m_TileFIndex == TILE_JETPACK_DISABLE)) && m_Jetpack)
{
m_Jetpack = false;
m_Core.m_Jetpack = false;
}
// solo part
if(((m_TileIndex == TILE_SOLO_START) || (m_TileFIndex == TILE_SOLO_START)) && !TeamsCore()->GetSolo(GetCID()))
if(((m_TileIndex == TILE_SOLO_ENABLE) || (m_TileFIndex == TILE_SOLO_ENABLE)) && !TeamsCore()->GetSolo(GetCID()))
{
SetSolo(true);
}
else if(((m_TileIndex == TILE_SOLO_END) || (m_TileFIndex == TILE_SOLO_END)) && TeamsCore()->GetSolo(GetCID()))
else if(((m_TileIndex == TILE_SOLO_DISABLE) || (m_TileFIndex == TILE_SOLO_DISABLE)) && TeamsCore()->GetSolo(GetCID()))
{
SetSolo(false);
}

View file

@ -82,16 +82,16 @@ bool CRaceHelper::IsStart(CGameClient *pClient, vec2 Prev, vec2 Pos)
if(!Indices.empty())
for(std::list < int >::iterator i = Indices.begin(); i != Indices.end(); i++)
{
if(pCollision->GetTileIndex(*i) == TILE_BEGIN)
if(pCollision->GetTileIndex(*i) == TILE_START)
return true;
if(pCollision->GetFTileIndex(*i) == TILE_BEGIN)
if(pCollision->GetFTileIndex(*i) == TILE_START)
return true;
}
else
{
if(pCollision->GetTileIndex(pCollision->GetPureMapIndex(Pos)) == TILE_BEGIN)
if(pCollision->GetTileIndex(pCollision->GetPureMapIndex(Pos)) == TILE_START)
return true;
if(pCollision->GetFTileIndex(pCollision->GetPureMapIndex(Pos)) == TILE_BEGIN)
if(pCollision->GetFTileIndex(pCollision->GetPureMapIndex(Pos)) == TILE_START)
return true;
}
}

View file

@ -125,11 +125,9 @@ void CCollision::Init(class CLayers *pLayers)
Index = m_pSwitch[i].m_Type;
if(Index <= TILE_NPH_START)
if(Index <= TILE_NPH_ENABLE)
{
if((Index >= TILE_JUMP && Index <= TILE_BONUS)
|| Index == TILE_ALLOW_TELE_GUN
|| Index == TILE_ALLOW_BLUE_TELE_GUN)
if((Index >= TILE_JUMP && Index <= TILE_SUBSTRACT_TIME) || Index == TILE_ALLOW_TELE_GUN || Index == TILE_ALLOW_BLUE_TELE_GUN)
m_pSwitch[i].m_Type = Index;
else
m_pSwitch[i].m_Type = 0;

View file

@ -235,7 +235,7 @@ public:
}
case LAYERTYPE_TUNE:
{
if (Index == TILE_TUNE1)
if (Index == TILE_TUNE)
return true;
else
return false;

View file

@ -77,31 +77,31 @@ const char *CEditor::Explain(int Tile, int Layer)
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "WALLJUMP: Placed next to a wall. Enables climbing up the wall.";
break;
case TILE_EHOOK_START:
case TILE_EHOOK_ENABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "ENDLESS HOOK: Activates endless hook.";
break;
case TILE_EHOOK_END:
case TILE_EHOOK_DISABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "ENDLESS HOOK OFF: Deactivates endless hook.";
break;
case TILE_HIT_START:
case TILE_HIT_ENABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "HIT OTHERS: You can hit others.";
if(Layer == LAYER_SWITCH)
return "HIT OTHERS: You can activate hitting others for single weapons, using delay number to select which.";
break;
case TILE_HIT_END:
case TILE_HIT_DISABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "HIT OTHERS: You can't hit others.";
if(Layer == LAYER_SWITCH)
return "HIT OTHERS: You can deactivate hitting others for single weapons, using delay number to select which.";
break;
case TILE_SOLO_START:
case TILE_SOLO_ENABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "SOLO: You are now in a solo part.";
break;
case TILE_SOLO_END: // also TILE_SWITCHTIMEDOPEN
case TILE_SOLO_DISABLE: // also TILE_SWITCHTIMEDOPEN
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "SOLO: You are now out of the solo part.";
if(Layer == LAYER_SWITCH)
@ -147,11 +147,11 @@ const char *CEditor::Explain(int Tile, int Layer)
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "REFILL JUMPS: Restores all jumps.";
break;
case TILE_BEGIN:
case TILE_START:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "START: Starts counting your race time.";
break;
case TILE_END:
case TILE_FINISH:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "FINISH: End of race.";
break;
@ -179,7 +179,7 @@ const char *CEditor::Explain(int Tile, int Layer)
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "SPEEDER: Causes weapons, SHIELD, HEART and SPINNING LASER to move quickly.";
break;
case TILE_TUNE1:
case TILE_TUNE:
if(Layer == LAYER_TUNE)
return "TUNE ZONE: Area where defined tunes work.";
break;
@ -207,43 +207,43 @@ const char *CEditor::Explain(int Tile, int Layer)
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "UNLOCK TEAM: Forces team to be unlocked so that team doesn't get killed when one dies.";
break;
case TILE_PENALTY:
case TILE_ADD_TIME:
if(Layer == LAYER_SWITCH)
return "PENALTY: Adds time to your current race time. Opposite of BONUS.";
break;
case TILE_NPC_END:
case TILE_NPC_DISABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "COLLISION OFF: You can't collide with others.";
break;
case TILE_SUPER_END:
case TILE_UNLIMITED_JUMPS_DISABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "SUPER JUMP OFF: You don't have unlimited air jumps.";
break;
case TILE_JETPACK_END:
case TILE_JETPACK_DISABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "JETPACK OFF: You lose your jetpack gun.";
break;
case TILE_NPH_END:
case TILE_NPH_DISABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "HOOK OTHERS OFF: You can't hook others.";
break;
case TILE_BONUS:
case TILE_SUBSTRACT_TIME:
if(Layer == LAYER_SWITCH)
return "BONUS: Subtracts time from your current race time. Opposite of PENALTY.";
break;
case TILE_NPC_START:
case TILE_NPC_ENABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "COLLISION: You can collide with others.";
break;
case TILE_SUPER_START:
case TILE_UNLIMITED_JUMPS_ENABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "SUPER JUMP: You have unlimited air jumps.";
break;
case TILE_JETPACK_START:
case TILE_JETPACK_ENABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "JETPACK: You have a jetpack gun.";
break;
case TILE_NPH_START:
case TILE_NPH_ENABLE:
if(Layer == LAYER_GAME || Layer == LAYER_FRONT)
return "HOOK OTHERS: You can hook others.";
break;

View file

@ -951,14 +951,13 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
TILE_FREEZE,
TILE_DFREEZE,
TILE_DUNFREEZE,
TILE_HIT_START,
TILE_HIT_END,
TILE_HIT_ENABLE,
TILE_HIT_DISABLE,
TILE_JUMP,
TILE_PENALTY,
TILE_BONUS,
TILE_ADD_TIME,
TILE_SUBSTRACT_TIME,
TILE_ALLOW_TELE_GUN,
TILE_ALLOW_BLUE_TELE_GUN
};
TILE_ALLOW_BLUE_TELE_GUN};
CSwitchTile *pLayerSwitchTiles = ((CLayerSwitch *)pTiles)->m_pSwitchTile;
mem_copy(((CLayerSwitch *)pTiles)->m_pSwitchTile, pSwitchData, pTiles->m_Width*pTiles->m_Height*sizeof(CSwitchTile));
@ -996,8 +995,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName, int Storag
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
{
if(pLayerTuneTiles[i].m_Type == TILE_TUNE1)
pTiles->m_pTiles[i].m_Index = TILE_TUNE1;
if(pLayerTuneTiles[i].m_Type == TILE_TUNE)
pTiles->m_pTiles[i].m_Index = TILE_TUNE;
else
pTiles->m_pTiles[i].m_Index = 0;
}

View file

@ -309,22 +309,22 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
for(int y = 0; y < r.h; y++)
for(int x = 0; x < r.w; x++)
{
pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x] = ((CLayerSwitch*)this)->m_pSwitchTile[(r.y+y)*m_Width+(r.x+x)];
if(pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_DOOR + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_HIT_START
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_HIT_END
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHOPEN
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHCLOSE
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHTIMEDOPEN
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_SWITCHTIMEDCLOSE
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_LASER_LONG + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_LASER_MEDIUM + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == ENTITY_LASER_SHORT + ENTITY_OFFSET
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_JUMP
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_PENALTY
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_BONUS
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_ALLOW_TELE_GUN
|| pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Type == TILE_ALLOW_BLUE_TELE_GUN)
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x] = ((CLayerSwitch *)this)->m_pSwitchTile[(r.y + y) * m_Width + (r.x + x)];
if(pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_DOOR + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_HIT_ENABLE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_HIT_DISABLE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHOPEN ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHCLOSE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHTIMEDOPEN ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SWITCHTIMEDCLOSE ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_LASER_LONG + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_LASER_MEDIUM + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == ENTITY_LASER_SHORT + ENTITY_OFFSET ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_JUMP ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_ADD_TIME ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_SUBSTRACT_TIME ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_ALLOW_TELE_GUN ||
pGrabbed->m_pSwitchTile[y * pGrabbed->m_Width + x].m_Type == TILE_ALLOW_BLUE_TELE_GUN)
{
m_pEditor->m_SwitchNum = pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Number;
m_pEditor->m_SwitchDelay = pGrabbed->m_pSwitchTile[y*pGrabbed->m_Width+x].m_Delay;
@ -360,8 +360,8 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
for(int y = 0; y < r.h; y++)
for(int x = 0; x < r.w; x++)
{
pGrabbed->m_pTuneTile[y*pGrabbed->m_Width+x] = ((CLayerTune*)this)->m_pTuneTile[(r.y+y)*m_Width+(r.x+x)];
if(pGrabbed->m_pTuneTile[y*pGrabbed->m_Width+x].m_Type == TILE_TUNE1)
pGrabbed->m_pTuneTile[y * pGrabbed->m_Width + x] = ((CLayerTune *)this)->m_pTuneTile[(r.y + y) * m_Width + (r.x + x)];
if(pGrabbed->m_pTuneTile[y * pGrabbed->m_Width + x].m_Type == TILE_TUNE)
{
m_pEditor->m_TuningNum = pGrabbed->m_pTuneTile[y*pGrabbed->m_Width+x].m_Number;
}

View file

@ -3,59 +3,56 @@
bool IsValidGameTile(int Index)
{
return (
Index == TILE_AIR
|| (Index >= TILE_SOLID && Index <= TILE_THROUGH)
|| Index == TILE_FREEZE
|| (Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE)
|| (Index >= TILE_WALLJUMP && Index <= TILE_SOLO_END)
|| (Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA)
|| (Index >= TILE_CP && Index <= TILE_THROUGH_DIR)
|| (Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM)
|| (Index >= TILE_NPC_END && Index <= TILE_NPH_END)
|| (Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_TELE_GUN_DISABLE)
|| (Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE)
|| (Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE)
|| (Index >= TILE_NPC_START && Index <= TILE_NPH_START)
|| (Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2)
|| IsValidEntity(Index)
);
Index == TILE_AIR ||
(Index >= TILE_SOLID && Index <= TILE_THROUGH) ||
Index == TILE_FREEZE ||
(Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE) ||
(Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE) ||
(Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA) ||
(Index >= TILE_CP && Index <= TILE_THROUGH_DIR) ||
(Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM) ||
(Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE) ||
(Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_TELE_GUN_DISABLE) ||
(Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE) ||
(Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE) ||
(Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE) ||
(Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2) ||
IsValidEntity(Index));
}
bool IsValidFrontTile(int Index)
{
return (
Index == TILE_AIR
|| Index == TILE_DEATH
|| (Index >= TILE_NOLASER && Index <= TILE_THROUGH)
|| Index == TILE_FREEZE
|| (Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE)
|| (Index >= TILE_WALLJUMP && Index <= TILE_SOLO_END)
|| (Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA)
|| (Index >= TILE_CP && Index <= TILE_THROUGH_DIR)
|| (Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM)
|| (Index >= TILE_NPC_END && Index <= TILE_NPH_END)
|| (Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_ALLOW_BLUE_TELE_GUN)
|| (Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE)
|| (Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE)
|| (Index >= TILE_NPC_START && Index <= TILE_NPH_START)
|| (Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2)
|| IsValidEntity(Index)
);
Index == TILE_AIR ||
Index == TILE_DEATH ||
(Index >= TILE_NOLASER && Index <= TILE_THROUGH) ||
Index == TILE_FREEZE ||
(Index >= TILE_UNFREEZE && Index <= TILE_DUNFREEZE) ||
(Index >= TILE_WALLJUMP && Index <= TILE_SOLO_DISABLE) ||
(Index >= TILE_REFILL_JUMPS && Index <= TILE_STOPA) ||
(Index >= TILE_CP && Index <= TILE_THROUGH_DIR) ||
(Index >= TILE_OLDLASER && Index <= TILE_UNLOCK_TEAM) ||
(Index >= TILE_NPC_DISABLE && Index <= TILE_NPH_DISABLE) ||
(Index >= TILE_TELE_GUN_ENABLE && Index <= TILE_ALLOW_BLUE_TELE_GUN) ||
(Index >= TILE_TELE_GRENADE_ENABLE && Index <= TILE_TELE_GRENADE_DISABLE) ||
(Index >= TILE_TELE_LASER_ENABLE && Index <= TILE_TELE_LASER_DISABLE) ||
(Index >= TILE_NPC_ENABLE && Index <= TILE_NPH_ENABLE) ||
(Index >= TILE_ENTITIES_OFF_1 && Index <= TILE_ENTITIES_OFF_2) ||
IsValidEntity(Index));
}
bool IsValidTeleTile(int Index)
{
return (
Index == TILE_TELEINEVIL
|| Index == TILE_TELEINWEAPON
|| Index == TILE_TELEINHOOK
|| Index == TILE_TELEIN
|| Index == TILE_TELEOUT
|| Index == TILE_TELECHECK
|| Index == TILE_TELECHECKOUT
|| Index == TILE_TELECHECKIN
|| Index == TILE_TELECHECKINEVIL
);
Index == TILE_TELEINEVIL ||
Index == TILE_TELEINWEAPON ||
Index == TILE_TELEINHOOK ||
Index == TILE_TELEIN ||
Index == TILE_TELEOUT ||
Index == TILE_TELECHECK ||
Index == TILE_TELECHECKOUT ||
Index == TILE_TELECHECKIN ||
Index == TILE_TELECHECKINEVIL);
}
bool IsValidSpeedupTile(int Index)
@ -66,62 +63,58 @@ bool IsValidSpeedupTile(int Index)
bool IsValidSwitchTile(int Index)
{
return (
Index == TILE_JUMP
|| Index == TILE_FREEZE
|| Index == TILE_DFREEZE
|| Index == TILE_DUNFREEZE
|| Index == TILE_HIT_START
|| Index == TILE_HIT_END
|| (Index >= TILE_SWITCHTIMEDOPEN && Index <= TILE_SWITCHCLOSE)
|| Index == TILE_PENALTY
|| Index == TILE_BONUS
|| Index == TILE_ALLOW_TELE_GUN
|| Index == TILE_ALLOW_BLUE_TELE_GUN
|| IsValidEntity(Index)
);
Index == TILE_JUMP ||
Index == TILE_FREEZE ||
Index == TILE_DFREEZE ||
Index == TILE_DUNFREEZE ||
Index == TILE_HIT_ENABLE ||
Index == TILE_HIT_DISABLE ||
(Index >= TILE_SWITCHTIMEDOPEN && Index <= TILE_SWITCHCLOSE) ||
Index == TILE_ADD_TIME ||
Index == TILE_SUBSTRACT_TIME ||
Index == TILE_ALLOW_TELE_GUN ||
Index == TILE_ALLOW_BLUE_TELE_GUN ||
IsValidEntity(Index));
}
bool IsValidTuneTile(int Index)
{
return Index == TILE_TUNE1;
return Index == TILE_TUNE;
}
bool IsValidEntity(int Index)
{
Index -= ENTITY_OFFSET;
return (
(Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST)
|| (Index >= ENTITY_PLASMAE && Index <= ENTITY_CRAZY_SHOTGUN)
|| (Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW)
|| Index == ENTITY_DOOR
);
(Index >= ENTITY_SPAWN && Index <= ENTITY_LASER_O_FAST) ||
(Index >= ENTITY_PLASMAE && Index <= ENTITY_CRAZY_SHOTGUN) ||
(Index >= ENTITY_DRAGGER_WEAK && Index <= ENTITY_DRAGGER_STRONG_NW) ||
Index == ENTITY_DOOR);
}
bool IsRotatableTile(int Index)
{
return (
Index == TILE_STOP
|| Index == TILE_STOPS
|| Index == TILE_CP
|| Index == TILE_CP_F
|| Index == TILE_THROUGH_DIR
|| Index == TILE_ENTITIES_OFF_1
|| Index == TILE_ENTITIES_OFF_2
|| Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN_EX
|| Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN
);
Index == TILE_STOP ||
Index == TILE_STOPS ||
Index == TILE_CP ||
Index == TILE_CP_F ||
Index == TILE_THROUGH_DIR ||
Index == TILE_ENTITIES_OFF_1 ||
Index == TILE_ENTITIES_OFF_2 ||
Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN_EX ||
Index - ENTITY_OFFSET == ENTITY_CRAZY_SHOTGUN);
}
bool IsCreditsTile(int TileIndex)
{
return (
(TILE_CREDITS_1 == TileIndex)
|| (TILE_CREDITS_2 == TileIndex)
|| (TILE_CREDITS_3 == TileIndex)
|| (TILE_CREDITS_4 == TileIndex)
|| (TILE_CREDITS_5 == TileIndex)
|| (TILE_CREDITS_6 == TileIndex)
|| (TILE_CREDITS_7 == TileIndex)
|| (TILE_CREDITS_8 == TileIndex)
);
(TILE_CREDITS_1 == TileIndex) ||
(TILE_CREDITS_2 == TileIndex) ||
(TILE_CREDITS_3 == TileIndex) ||
(TILE_CREDITS_4 == TileIndex) ||
(TILE_CREDITS_5 == TileIndex) ||
(TILE_CREDITS_6 == TileIndex) ||
(TILE_CREDITS_7 == TileIndex) ||
(TILE_CREDITS_8 == TileIndex));
}

View file

@ -9,7 +9,7 @@
enum
{
// TODO(Shereef Marzouk): fix this for vanilla, make use of LAYERTYPE_GAME instead of using m_game variable in the editor.
LAYERTYPE_INVALID=0,
LAYERTYPE_INVALID = 0,
LAYERTYPE_GAME,
LAYERTYPE_TILES,
LAYERTYPE_QUADS,
@ -21,7 +21,7 @@ enum
LAYERTYPE_SOUNDS_DEPRECATED, // deprecated! do not use this, this is just for compatibility reasons
LAYERTYPE_SOUNDS,
MAPITEMTYPE_VERSION=0,
MAPITEMTYPE_VERSION = 0,
MAPITEMTYPE_INFO,
MAPITEMTYPE_IMAGE,
MAPITEMTYPE_ENVELOPE,
@ -33,8 +33,7 @@ enum
// format with UUIDs. See src/engine/shared/datafile.cpp for some of
// the implementation.
CURVETYPE_STEP=0,
CURVETYPE_STEP = 0,
CURVETYPE_LINEAR,
CURVETYPE_SLOW,
CURVETYPE_FAST,
@ -43,7 +42,7 @@ enum
// game layer tiles
// TODO define which Layer uses which tiles (needed for mapeditor)
ENTITY_NULL=0,
ENTITY_NULL = 0,
ENTITY_SPAWN,
ENTITY_SPAWN_RED,
ENTITY_SPAWN_BLUE,
@ -74,7 +73,7 @@ enum
ENTITY_LASER_O_NORMAL,
ENTITY_LASER_O_FAST,
//DDRace - Plasma
ENTITY_PLASMAE=29,
ENTITY_PLASMAE = 29,
ENTITY_PLASMAF,
ENTITY_PLASMA,
ENTITY_PLASMAU,
@ -82,7 +81,7 @@ enum
ENTITY_CRAZY_SHOTGUN_EX,
ENTITY_CRAZY_SHOTGUN,
//DDRace - Draggers
ENTITY_DRAGGER_WEAK=42,
ENTITY_DRAGGER_WEAK = 42,
ENTITY_DRAGGER_NORMAL,
ENTITY_DRAGGER_STRONG,
//Draggers Behind Walls
@ -90,12 +89,12 @@ enum
ENTITY_DRAGGER_NORMAL_NW,
ENTITY_DRAGGER_STRONG_NW,
//Doors
ENTITY_DOOR=49,
ENTITY_DOOR = 49,
//End Of Lower Tiles
NUM_ENTITIES,
//Start From Top Left
//Tile Controllers
TILE_AIR=0,
TILE_AIR = 0,
TILE_SOLID,
TILE_DEATH,
TILE_NOHOOK,
@ -111,12 +110,12 @@ enum
TILE_TELEINWEAPON,
TILE_TELEINHOOK,
TILE_WALLJUMP = 16,
TILE_EHOOK_START,
TILE_EHOOK_END,
TILE_HIT_START,
TILE_HIT_END,
TILE_SOLO_START,
TILE_SOLO_END,
TILE_EHOOK_ENABLE,
TILE_EHOOK_DISABLE,
TILE_HIT_ENABLE,
TILE_HIT_DISABLE,
TILE_SOLO_ENABLE,
TILE_SOLO_DISABLE,
//Switches
TILE_SWITCHTIMEDOPEN = 22,
TILE_SWITCHTIMEDCLOSE,
@ -129,8 +128,8 @@ enum
TILE_TELECHECKOUT,
TILE_TELECHECKIN,
TILE_REFILL_JUMPS = 32,
TILE_BEGIN,
TILE_END,
TILE_START,
TILE_FINISH,
TILE_CHECKPOINT_FIRST = 35,
TILE_CHECKPOINT_LAST = 59,
TILE_STOP = 60,
@ -141,27 +140,27 @@ enum
TILE_CP_F,
TILE_THROUGH_ALL,
TILE_THROUGH_DIR,
TILE_TUNE1,
TILE_TUNE,
TILE_OLDLASER = 71,
TILE_NPC,
TILE_EHOOK,
TILE_NOHIT,
TILE_NPH,
TILE_UNLOCK_TEAM,
TILE_PENALTY = 79,
TILE_NPC_END = 88,
TILE_SUPER_END,
TILE_JETPACK_END,
TILE_NPH_END,
TILE_BONUS = 95,
TILE_ADD_TIME = 79,
TILE_NPC_DISABLE = 88,
TILE_UNLIMITED_JUMPS_DISABLE,
TILE_JETPACK_DISABLE,
TILE_NPH_DISABLE,
TILE_SUBSTRACT_TIME = 95,
TILE_TELE_GUN_ENABLE = 96,
TILE_TELE_GUN_DISABLE = 97,
TILE_ALLOW_TELE_GUN = 98,
TILE_ALLOW_BLUE_TELE_GUN = 99,
TILE_NPC_START = 104,
TILE_SUPER_START,
TILE_JETPACK_START,
TILE_NPH_START,
TILE_NPC_ENABLE = 104,
TILE_UNLIMITED_JUMPS_ENABLE,
TILE_JETPACK_ENABLE,
TILE_NPH_ENABLE,
TILE_TELE_GRENADE_ENABLE = 112,
TILE_TELE_GRENADE_DISABLE = 113,
TILE_TELE_LASER_ENABLE = 128,
@ -178,7 +177,7 @@ enum
TILE_ENTITIES_OFF_2,
//End of higher tiles
//Layers
LAYER_GAME=0,
LAYER_GAME = 0,
LAYER_FRONT,
LAYER_TELE,
LAYER_SPEEDUP,
@ -186,25 +185,25 @@ enum
LAYER_TUNE,
NUM_LAYERS,
//Flags
TILEFLAG_VFLIP=1,
TILEFLAG_HFLIP=2,
TILEFLAG_OPAQUE=4,
TILEFLAG_ROTATE=8,
TILEFLAG_VFLIP = 1,
TILEFLAG_HFLIP = 2,
TILEFLAG_OPAQUE = 4,
TILEFLAG_ROTATE = 8,
//Rotation
ROTATION_0 = 0,
ROTATION_90 = TILEFLAG_ROTATE,
ROTATION_180 = (TILEFLAG_VFLIP|TILEFLAG_HFLIP),
ROTATION_270 = (TILEFLAG_VFLIP|TILEFLAG_HFLIP|TILEFLAG_ROTATE),
ROTATION_180 = (TILEFLAG_VFLIP | TILEFLAG_HFLIP),
ROTATION_270 = (TILEFLAG_VFLIP | TILEFLAG_HFLIP | TILEFLAG_ROTATE),
LAYERFLAG_DETAIL=1,
TILESLAYERFLAG_GAME=1,
TILESLAYERFLAG_TELE=2,
TILESLAYERFLAG_SPEEDUP=4,
TILESLAYERFLAG_FRONT=8,
TILESLAYERFLAG_SWITCH=16,
TILESLAYERFLAG_TUNE=32,
LAYERFLAG_DETAIL = 1,
TILESLAYERFLAG_GAME = 1,
TILESLAYERFLAG_TELE = 2,
TILESLAYERFLAG_SPEEDUP = 4,
TILESLAYERFLAG_FRONT = 8,
TILESLAYERFLAG_SWITCH = 16,
TILESLAYERFLAG_TUNE = 32,
ENTITY_OFFSET=255-16*4,
ENTITY_OFFSET = 255 - 16 * 4,
};
struct CPoint

View file

@ -1547,7 +1547,7 @@ void CCharacter::HandleTiles(int Index)
m_TeleCheckpoint = tcp;
// start
if(((m_TileIndex == TILE_BEGIN) || (m_TileFIndex == TILE_BEGIN) || FTile1 == TILE_BEGIN || FTile2 == TILE_BEGIN || FTile3 == TILE_BEGIN || FTile4 == TILE_BEGIN || Tile1 == TILE_BEGIN || Tile2 == TILE_BEGIN || Tile3 == TILE_BEGIN || Tile4 == TILE_BEGIN) && (m_DDRaceState == DDRACE_NONE || m_DDRaceState == DDRACE_FINISHED || (m_DDRaceState == DDRACE_STARTED && !Team() && g_Config.m_SvTeam != 3)))
if(((m_TileIndex == TILE_START) || (m_TileFIndex == TILE_START) || FTile1 == TILE_START || FTile2 == TILE_START || FTile3 == TILE_START || FTile4 == TILE_START || Tile1 == TILE_START || Tile2 == TILE_START || Tile3 == TILE_START || Tile4 == TILE_START) && (m_DDRaceState == DDRACE_NONE || m_DDRaceState == DDRACE_FINISHED || (m_DDRaceState == DDRACE_STARTED && !Team() && g_Config.m_SvTeam != 3)))
{
if(Teams()->GetSaving(Team()))
{
@ -1584,7 +1584,7 @@ void CCharacter::HandleTiles(int Index)
}
// finish
if(((m_TileIndex == TILE_END) || (m_TileFIndex == TILE_END) || FTile1 == TILE_END || FTile2 == TILE_END || FTile3 == TILE_END || FTile4 == TILE_END || Tile1 == TILE_END || Tile2 == TILE_END || Tile3 == TILE_END || Tile4 == TILE_END) && m_DDRaceState == DDRACE_STARTED)
if(((m_TileIndex == TILE_FINISH) || (m_TileFIndex == TILE_FINISH) || FTile1 == TILE_FINISH || FTile2 == TILE_FINISH || FTile3 == TILE_FINISH || FTile4 == TILE_FINISH || Tile1 == TILE_FINISH || Tile2 == TILE_FINISH || Tile3 == TILE_FINISH || Tile4 == TILE_FINISH) && m_DDRaceState == DDRACE_STARTED)
Controller->m_Teams.OnCharacterFinish(m_pPlayer->GetCID());
// freeze
@ -1600,13 +1600,13 @@ void CCharacter::HandleTiles(int Index)
m_DeepFreeze = false;
// endless hook
if(((m_TileIndex == TILE_EHOOK_START) || (m_TileFIndex == TILE_EHOOK_START)) && !m_EndlessHook)
if(((m_TileIndex == TILE_EHOOK_ENABLE) || (m_TileFIndex == TILE_EHOOK_ENABLE)) && !m_EndlessHook)
{
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)
else if(((m_TileIndex == TILE_EHOOK_DISABLE) || (m_TileFIndex == TILE_EHOOK_DISABLE)) && m_EndlessHook)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "Endless hook has been deactivated");
m_EndlessHook = false;
@ -1614,7 +1614,7 @@ void CCharacter::HandleTiles(int Index)
}
// hit others
if(((m_TileIndex == TILE_HIT_END) || (m_TileFIndex == TILE_HIT_END)) && m_Hit != (DISABLE_HIT_GRENADE|DISABLE_HIT_HAMMER|DISABLE_HIT_LASER|DISABLE_HIT_SHOTGUN))
if(((m_TileIndex == TILE_HIT_DISABLE) || (m_TileFIndex == TILE_HIT_DISABLE)) && m_Hit != (DISABLE_HIT_GRENADE | DISABLE_HIT_HAMMER | DISABLE_HIT_LASER | DISABLE_HIT_SHOTGUN))
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hit others");
m_Hit = DISABLE_HIT_GRENADE|DISABLE_HIT_HAMMER|DISABLE_HIT_LASER|DISABLE_HIT_SHOTGUN;
@ -1625,7 +1625,7 @@ void CCharacter::HandleTiles(int Index)
m_NeededFaketuning |= FAKETUNE_NOHAMMER;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
else if(((m_TileIndex == TILE_HIT_START) || (m_TileFIndex == TILE_HIT_START)) && m_Hit != HIT_ALL)
else if(((m_TileIndex == TILE_HIT_ENABLE) || (m_TileFIndex == TILE_HIT_ENABLE)) && m_Hit != HIT_ALL)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can hit others");
m_Hit = HIT_ALL;
@ -1638,7 +1638,7 @@ void CCharacter::HandleTiles(int Index)
}
// collide with others
if(((m_TileIndex == TILE_NPC_END) || (m_TileFIndex == TILE_NPC_END)) && m_Core.m_Collision)
if(((m_TileIndex == TILE_NPC_DISABLE) || (m_TileFIndex == TILE_NPC_DISABLE)) && m_Core.m_Collision)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't collide with others");
m_Core.m_Collision = false;
@ -1646,7 +1646,7 @@ void CCharacter::HandleTiles(int Index)
m_NeededFaketuning |= FAKETUNE_NOCOLL;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
else if(((m_TileIndex == TILE_NPC_START) || (m_TileFIndex == TILE_NPC_START)) && !m_Core.m_Collision)
else if(((m_TileIndex == TILE_NPC_ENABLE) || (m_TileFIndex == TILE_NPC_ENABLE)) && !m_Core.m_Collision)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can collide with others");
m_Core.m_Collision = true;
@ -1656,7 +1656,7 @@ void CCharacter::HandleTiles(int Index)
}
// hook others
if(((m_TileIndex == TILE_NPH_END) || (m_TileFIndex == TILE_NPH_END)) && m_Core.m_Hook)
if(((m_TileIndex == TILE_NPH_DISABLE) || (m_TileFIndex == TILE_NPH_DISABLE)) && m_Core.m_Hook)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You can't hook others");
m_Core.m_Hook = false;
@ -1664,7 +1664,7 @@ void CCharacter::HandleTiles(int Index)
m_NeededFaketuning |= FAKETUNE_NOHOOK;
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
else if(((m_TileIndex == TILE_NPH_START) || (m_TileFIndex == TILE_NPH_START)) && !m_Core.m_Hook)
else if(((m_TileIndex == TILE_NPH_ENABLE) || (m_TileFIndex == TILE_NPH_ENABLE)) && !m_Core.m_Hook)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can hook others");
m_Core.m_Hook = true;
@ -1674,7 +1674,7 @@ void CCharacter::HandleTiles(int Index)
}
// unlimited air jumps
if(((m_TileIndex == TILE_SUPER_START) || (m_TileFIndex == TILE_SUPER_START)) && !m_SuperJump)
if(((m_TileIndex == TILE_UNLIMITED_JUMPS_ENABLE) || (m_TileFIndex == TILE_UNLIMITED_JUMPS_ENABLE)) && !m_SuperJump)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You have unlimited air jumps");
m_SuperJump = true;
@ -1685,7 +1685,7 @@ void CCharacter::HandleTiles(int Index)
GameServer()->SendTuningParams(m_pPlayer->GetCID(), m_TuneZone); // update tunings
}
}
else if(((m_TileIndex == TILE_SUPER_END) || (m_TileFIndex == TILE_SUPER_END)) && m_SuperJump)
else if(((m_TileIndex == TILE_UNLIMITED_JUMPS_DISABLE) || (m_TileFIndex == TILE_UNLIMITED_JUMPS_DISABLE)) && m_SuperJump)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You don't have unlimited air jumps");
m_SuperJump = false;
@ -1709,13 +1709,13 @@ void CCharacter::HandleTiles(int Index)
}
// jetpack gun
if(((m_TileIndex == TILE_JETPACK_START) || (m_TileFIndex == TILE_JETPACK_START)) && !m_Jetpack)
if(((m_TileIndex == TILE_JETPACK_ENABLE) || (m_TileFIndex == TILE_JETPACK_ENABLE)) && !m_Jetpack)
{
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)
else if(((m_TileIndex == TILE_JETPACK_DISABLE) || (m_TileFIndex == TILE_JETPACK_DISABLE)) && m_Jetpack)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You lost your jetpack gun");
m_Jetpack = false;
@ -1733,12 +1733,12 @@ void CCharacter::HandleTiles(int Index)
}
// solo part
if(((m_TileIndex == TILE_SOLO_START) || (m_TileFIndex == TILE_SOLO_START)) && !Teams()->m_Core.GetSolo(m_pPlayer->GetCID()))
if(((m_TileIndex == TILE_SOLO_ENABLE) || (m_TileFIndex == TILE_SOLO_ENABLE)) && !Teams()->m_Core.GetSolo(m_pPlayer->GetCID()))
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You are now in a solo part");
SetSolo(true);
}
else if(((m_TileIndex == TILE_SOLO_END) || (m_TileFIndex == TILE_SOLO_END)) && Teams()->m_Core.GetSolo(m_pPlayer->GetCID()))
else if(((m_TileIndex == TILE_SOLO_DISABLE) || (m_TileFIndex == TILE_SOLO_DISABLE)) && Teams()->m_Core.GetSolo(m_pPlayer->GetCID()))
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(), "You are now out of the solo part");
SetSolo(false);
@ -1838,7 +1838,7 @@ void CCharacter::HandleTiles(int Index)
if(GameServer()->Collision()->GetSwitchNumber(MapIndex) == 0 || GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
m_DeepFreeze = false;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_START && m_Hit&DISABLE_HIT_HAMMER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_HAMMER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can hammer hit others");
m_Hit &= ~DISABLE_HIT_HAMMER;
@ -1846,7 +1846,7 @@ void CCharacter::HandleTiles(int Index)
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)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_HAMMER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_HAMMER)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't hammer hit others");
m_Hit |= DISABLE_HIT_HAMMER;
@ -1854,37 +1854,37 @@ void CCharacter::HandleTiles(int Index)
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)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && 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)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(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)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && 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)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(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_LASER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_ENABLE && m_Hit & DISABLE_HIT_LASER && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can shoot others with laser");
m_Hit &= ~DISABLE_HIT_LASER;
m_Core.m_NoLaserHit = false;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_END && !(m_Hit&DISABLE_HIT_LASER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_HIT_DISABLE && !(m_Hit & DISABLE_HIT_LASER) && GameServer()->Collision()->GetSwitchDelay(MapIndex) == WEAPON_LASER)
{
GameServer()->SendChatTarget(GetPlayer()->GetCID(),"You can't shoot others with laser");
m_Hit |= DISABLE_HIT_LASER;
@ -1917,7 +1917,7 @@ void CCharacter::HandleTiles(int Index)
m_Core.m_Jumps = newJumps;
}
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_PENALTY && !m_LastPenalty)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ADD_TIME && !m_LastPenalty)
{
int min = GameServer()->Collision()->GetSwitchDelay(MapIndex);
int sec = GameServer()->Collision()->GetSwitchNumber(MapIndex);
@ -1941,7 +1941,7 @@ void CCharacter::HandleTiles(int Index)
m_LastPenalty = true;
}
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_BONUS && !m_LastBonus)
else if(GameServer()->Collision()->IsSwitch(MapIndex) == TILE_SUBSTRACT_TIME && !m_LastBonus)
{
int min = GameServer()->Collision()->GetSwitchDelay(MapIndex);
int sec = GameServer()->Collision()->GetSwitchNumber(MapIndex);
@ -1968,12 +1968,12 @@ void CCharacter::HandleTiles(int Index)
m_LastBonus = true;
}
if(GameServer()->Collision()->IsSwitch(MapIndex) != TILE_PENALTY)
if(GameServer()->Collision()->IsSwitch(MapIndex) != TILE_ADD_TIME)
{
m_LastPenalty = false;
}
if(GameServer()->Collision()->IsSwitch(MapIndex) != TILE_BONUS)
if(GameServer()->Collision()->IsSwitch(MapIndex) != TILE_SUBSTRACT_TIME)
{
m_LastBonus = false;
}