This commit is contained in:
btd 2010-09-11 13:42:35 +04:00
commit 7ed685ee11
20 changed files with 326 additions and 134 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 KiB

After

Width:  |  Height:  |  Size: 303 KiB

View file

@ -63,6 +63,17 @@ MACRO_CONFIG_STR(SvSqlIp, sv_sql_ip, 32, "127.0.0.1", CFGFLAG_SERVER, "SQL Datab
MACRO_CONFIG_INT(SvSqlPort, sv_sql_port, 3306, 0, 65535, CFGFLAG_SERVER, "SQL Database port",3)
MACRO_CONFIG_STR(SvSqlDatabase, sv_sql_database, 16, "teeworlds", CFGFLAG_SERVER, "SQL Database name",3)
MACRO_CONFIG_STR(SvSqlPrefix, sv_sql_prefix, 16, "record", CFGFLAG_SERVER, "SQL Database table prefix",3)
MACRO_CONFIG_INT(SvDDRaceRules, sv_ddrace_rules, 1, 0, 1, CFGFLAG_SERVER, "Weather the default mod rules are displayed or not",4)
MACRO_CONFIG_STR(SvRulesLine1, sv_rules_line1, 40, "", CFGFLAG_SERVER, "Rules line 1",4)
MACRO_CONFIG_STR(SvRulesLine2, sv_rules_line2, 40, "", CFGFLAG_SERVER, "Rules line 2",4)
MACRO_CONFIG_STR(SvRulesLine3, sv_rules_line3, 40, "", CFGFLAG_SERVER, "Rules line 3",4)
MACRO_CONFIG_STR(SvRulesLine4, sv_rules_line4, 40, "", CFGFLAG_SERVER, "Rules line 4",4)
MACRO_CONFIG_STR(SvRulesLine5, sv_rules_line5, 40, "", CFGFLAG_SERVER, "Rules line 5",4)
MACRO_CONFIG_STR(SvRulesLine6, sv_rules_line6, 40, "", CFGFLAG_SERVER, "Rules line 6",4)
MACRO_CONFIG_STR(SvRulesLine7, sv_rules_line7, 40, "", CFGFLAG_SERVER, "Rules line 7",4)
MACRO_CONFIG_STR(SvRulesLine8, sv_rules_line8, 40, "", CFGFLAG_SERVER, "Rules line 8",4)
MACRO_CONFIG_STR(SvRulesLine9, sv_rules_line9, 40, "", CFGFLAG_SERVER, "Rules line 9",4)
MACRO_CONFIG_STR(SvRulesLine10, sv_rules_line10, 40, "", CFGFLAG_SERVER, "Rules line 10",4)//of course there are better ways but i am lazy bite me!!
//===============================
MACRO_CONFIG_INT(SvShowOthers, sv_show_others, 1, 0, 1, CFGFLAG_SERVER, "Shows the other players", 3)
MACRO_CONFIG_STR(PlayerName, player_name, 24, "nameless tee", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Name of the player",0)

View file

@ -136,7 +136,7 @@ int CCollision::GetMapIndex(vec2 PrevPos, vec2 Pos)
((m_pTiles[ny*m_Width+nx].m_Index >TILE_BOOST)&&(m_pTiles[ny*m_Width+nx].m_Index <= TILE_NPH) ) ||
(m_pFront && (m_pFront[ny*m_Width+nx].m_Index >= TILE_THROUGH && m_pFront[ny*m_Width+nx].m_Index < TILE_TELEIN)) ||
(m_pFront && ((m_pFront[ny*m_Width+nx].m_Index >TILE_BOOST)&&(m_pFront[ny*m_Width+nx].m_Index <= TILE_NPH))) ||
(m_pTele && (m_pTele[ny*m_Width+nx].m_Type == TILE_TELEIN || m_pTele[ny*m_Width+nx].m_Type == TILE_TELEOUT)) ||
(m_pTele && (m_pTele[ny*m_Width+nx].m_Type == TILE_TELEIN || m_pTele[ny*m_Width+nx].m_Type == TILE_TELEINEVIL || m_pTele[ny*m_Width+nx].m_Type == TILE_TELEOUT)) ||
(m_pSpeedup && m_pSpeedup[ny*m_Width+nx].m_Force > 0))
{
return ny*m_Width+nx;
@ -507,7 +507,6 @@ int CCollision::IsFNoLaser(int x, int y)
return (CCollision::GetFTile(x,y) & COLFLAG_NOLASER);
}
//DDRace
int CCollision::IsTeleport(int x, int y)
{
if(!m_pTele)
@ -528,7 +527,29 @@ int CCollision::IsTeleport(int x, int y)
return Tele;
}
bool CCollision::IsSpeedup(int x, int y)
int CCollision::IsEvilTeleport(int x, int y)
{
if(!m_pTele)
return 0;
int nx = clamp(x/32, 0, m_pLayers->TeleLayer()->m_Width-1);
int ny = clamp(y/32, 0, m_pLayers->TeleLayer()->m_Height-1);
/*int z = m_pTiles[ny*m_Width+nx].m_Index-1;
if(z > 34 && z <= 34 + 50 && z&1)
return z;
return 0;*/
int Tele = 0;
if(m_pTele[ny*m_pLayers->TeleLayer()->m_Width+nx].m_Type == TILE_TELEINEVIL)
{
Tele = m_pTele[ny*m_pLayers->TeleLayer()->m_Width+nx].m_Number;
dbg_msg("IsEvilTele","%d",Tele);
}
return Tele;
}
int CCollision::IsSpeedup(int x, int y)
{
if(!m_pSpeedup)
return false;
@ -538,9 +559,12 @@ bool CCollision::IsSpeedup(int x, int y)
int ny = clamp(y/32, 0, m_pLayers->SpeedupLayer()->m_Height-1);
if(m_pSpeedup[ny*m_pLayers->SpeedupLayer()->m_Width+nx].m_Force > 0)
return true;
//{
//dbg_msg("IsSpeedup","Index = %d",m_pSpeedup[ny*m_pLayers->SpeedupLayer()->m_Width+nx].m_Type);
return m_pSpeedup[ny*m_pLayers->SpeedupLayer()->m_Width+nx].m_Type;
//}
return false;
return 0;
}
void CCollision::GetSpeedup(int x, int y, vec2 *Dir, int *Force)

View file

@ -48,8 +48,9 @@ public:
int GetCollisionDDRace(int Index);
int GetFCollisionDDRace(int Index);
int IsTeleport(int x, int y);
int IsEvilTeleport(int x, int y);
//int IsCheckpoint(int Index);
bool IsSpeedup(int x, int y);
int IsSpeedup(int x, int y);
void GetSpeedup(int x, int y, vec2 *Dir, int *Force);
int IsSolid(int x, int y);

View file

@ -587,6 +587,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName)
{
if(((CLayerTele*)pTiles)->m_pTeleTile[i].m_Type == TILE_TELEIN)
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_TELEIN;
else if(((CLayerTele*)pTiles)->m_pTeleTile[i].m_Type == TILE_TELEINEVIL)
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_TELEINEVIL;
else if(((CLayerTele*)pTiles)->m_pTeleTile[i].m_Type == TILE_TELEOUT)
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_TELEOUT;
else
@ -601,8 +603,8 @@ int CEditorMap::Load(class IStorage *pStorage, const char *pFileName)
for(int i = 0; i < pTiles->m_Width*pTiles->m_Height; i++)
{
if(((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Force > 0)
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = TILE_BOOST;
if(((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Force > 0 && (((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Type == TILE_BOOST || ((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Type == TILE_BOOSTS))
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = ((CLayerSpeedup*)pTiles)->m_pSpeedupTile[i].m_Type;
else
((CLayerTiles*)pTiles)->m_pTiles[i].m_Index = 0;
}

View file

@ -277,7 +277,7 @@ void CLayerTiles::BrushDraw(CLayer *pBrush, float wx, float wy)
continue;
// dont allow tele in and out tiles... same with speedup tile in game layer
if(m_pEditor->GetSelectedLayer(0) == m_pEditor->m_Map.m_pGameLayer && (l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOST || l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_TRIGGER + ENTITY_OFFSET)|| l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_DOOR + ENTITY_OFFSET)))
if(m_pEditor->GetSelectedLayer(0) == m_pEditor->m_Map.m_pGameLayer && (l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINEVIL || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOST || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOSTS || l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_TRIGGER + ENTITY_OFFSET)|| l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_DOOR + ENTITY_OFFSET)))
continue;
m_pTiles[fy*m_Width+fx] = l->m_pTiles[y*l->m_Width+x];
@ -525,7 +525,7 @@ void CLayerTele::BrushDraw(CLayer *pBrush, float wx, float wy)
if(fx<0 || fx >= m_Width || fy < 0 || fy >= m_Height)
continue;
if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT)
if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINEVIL || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT)
{
if(l->m_pTeleTile[y*l->m_Width+x].m_Number)
m_pTeleTile[fy*m_Width+fx].m_Number = l->m_pTeleTile[y*l->m_Width+x].m_Number;
@ -644,18 +644,20 @@ void CLayerSpeedup::BrushDraw(CLayer *pBrush, float wx, float wy)
if(fx<0 || fx >= m_Width || fy < 0 || fy >= m_Height)
continue;
if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOST)
if(l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOST || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOSTS)
{
if(l->m_pSpeedupTile[y*l->m_Width+x].m_Force || l->m_pSpeedupTile[y*l->m_Width+x].m_Angle)
{
m_pSpeedupTile[fy*m_Width+fx].m_Force = l->m_pSpeedupTile[y*l->m_Width+x].m_Force;
m_pSpeedupTile[fy*m_Width+fx].m_Angle = l->m_pSpeedupTile[y*l->m_Width+x].m_Angle;
m_pSpeedupTile[fy*m_Width+fx].m_Type = l->m_pTiles[y*l->m_Width+x].m_Index;
m_pTiles[fy*m_Width+fx].m_Index = l->m_pTiles[y*l->m_Width+x].m_Index;
}
else if(m_pEditor->m_SpeedupForce)
{
m_pSpeedupTile[fy*m_Width+fx].m_Force = m_pEditor->m_SpeedupForce;
m_pSpeedupTile[fy*m_Width+fx].m_Angle = m_pEditor->m_SpeedupAngle;
m_pSpeedupTile[fy*m_Width+fx].m_Type = l->m_pTiles[y*l->m_Width+x].m_Index;
m_pTiles[fy*m_Width+fx].m_Index = l->m_pTiles[y*l->m_Width+x].m_Index;
}
else
@ -756,7 +758,7 @@ void CLayerFront::BrushDraw(CLayer *pBrush, float wx, float wy)
continue;
// dont allow tele in and out tiles... same with speedup tile and alot more in front
if(m_pEditor->GetSelectedLayer(0) == m_pEditor->m_Map.m_pFrontLayer && (l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOST || l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_TRIGGER + ENTITY_OFFSET) || l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_DOOR + ENTITY_OFFSET)) || l->m_pTiles[y*l->m_Width+x].m_Index == (TILE_SOLID) || l->m_pTiles[y*l->m_Width+x].m_Index == (TILE_NOHOOK) || (l->m_pTiles[y*l->m_Width+x].m_Index >=TILE_CP_D && l->m_pTiles[y*l->m_Width+x].m_Index <=TILE_CP_L_F))
if(m_pEditor->GetSelectedLayer(0) == m_pEditor->m_Map.m_pFrontLayer && (l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEIN || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEINEVIL || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_TELEOUT || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOST || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOSTS || l->m_pTiles[y*l->m_Width+x].m_Index == TILE_BOOSTS || l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_TRIGGER + ENTITY_OFFSET) || l->m_pTiles[y*l->m_Width+x].m_Index == (ENTITY_DOOR + ENTITY_OFFSET)) || l->m_pTiles[y*l->m_Width+x].m_Index == (TILE_SOLID) || l->m_pTiles[y*l->m_Width+x].m_Index == (TILE_NOHOOK) || (l->m_pTiles[y*l->m_Width+x].m_Index >=TILE_CP_D && l->m_pTiles[y*l->m_Width+x].m_Index <=TILE_CP_L_F))
continue;
m_pTiles[fy*m_Width+fx] = l->m_pTiles[y*l->m_Width+x];
}

View file

@ -60,8 +60,9 @@ enum
ENTITY_PLASMAE=29,
ENTITY_PLASMAF,
ENTITY_PLASMA,
ENTITY_PLASMAU,
//DDRace - Shotgun
ENTITY_CRAZY_SHOTGUN_U_EX=33,
ENTITY_CRAZY_SHOTGUN_U_EX,
ENTITY_CRAZY_SHOTGUN_R_EX,
ENTITY_CRAZY_SHOTGUN_D_EX,
ENTITY_CRAZY_SHOTGUN_L_EX,
@ -99,7 +100,9 @@ enum
TILE_NOLASER,
TILE_THROUGH=6,
TILE_FREEZE=9,
TILE_UNFREEZE=11,
TILE_TELEINEVIL,
TILE_UNFREEZE,
TILE_BOOSTS,
TILE_BOOST_L=18,
TILE_BOOST_R,
TILE_BOOST_D,
@ -131,7 +134,7 @@ enum
TILE_NPC,
TILE_EHOOK,
TILE_NOHIT,
TILE_NPH,//Remeber to change this in collision.cpp if you add anymore tiles
TILE_NPH,//Remember to change this in collision.cpp if you add anymore tiles
//End of higher tiles
//Untouchable Elements
TILEFLAG_VFLIP=1,
@ -197,6 +200,7 @@ class CSpeedupTile
{
public:
unsigned char m_Force;
unsigned char m_Type;
short m_Angle;
};

View file

@ -828,71 +828,81 @@ void CCharacter::Tick()
{
if(m_PrevPos.x-m_Pos.x<0)
m_Core.m_Vel.x += m_Core.m_Vel.x *-0.5;
else if(m_LastBooster != TileIndex || m_LastFBooster != TileFIndex)
else if(m_LastBooster != MapIndex)
m_Core.m_Vel.x += m_Core.m_Vel.x*0.5;
}
if (TileIndex == TILE_BOOST_R || TileFIndex == TILE_BOOST_R)
{
if(m_PrevPos.x-m_Pos.x>0)
m_Core.m_Vel.x += m_Core.m_Vel.x *-0.5;
else if(m_LastBooster != TileIndex || m_LastFBooster != TileFIndex)
else if(m_LastBooster != MapIndex)
m_Core.m_Vel.x += m_Core.m_Vel.x*0.5;
}
if (TileIndex == TILE_BOOST_D || TileFIndex == TILE_BOOST_D)
{
if(m_PrevPos.y-m_Pos.y>0)
m_Core.m_Vel.y += m_Core.m_Vel.y *-0.5;
else if(m_LastBooster != TileIndex || m_LastFBooster != TileFIndex)
else if(m_LastBooster != MapIndex)
m_Core.m_Vel.y += m_Core.m_Vel.y*0.5;
}
if (TileIndex == TILE_BOOST_U || TileFIndex == TILE_BOOST_U)
{
if(m_PrevPos.y-m_Pos.y<0)
m_Core.m_Vel.y += m_Core.m_Vel.y *-0.5;
else if(m_LastBooster != TileIndex || m_LastFBooster != TileFIndex)
else if(m_LastBooster != TileIndex)
m_Core.m_Vel.y += m_Core.m_Vel.y*0.5;
}
if ((TileIndex == TILE_BOOST_L2 || TileFIndex == TILE_BOOST_L2) && (m_LastBooster != TileIndex || m_LastFBooster != TileFIndex))
if ((TileIndex == TILE_BOOST_L2 || TileFIndex == TILE_BOOST_L2) && (m_LastBooster != MapIndex))
{
if(m_PrevPos.x-m_Pos.x<0)
m_Core.m_Vel.x = m_Core.m_Vel.x *-1.1;
else
m_Core.m_Vel.x += m_Core.m_Vel.x*1.1;
}
if ((TileIndex == TILE_BOOST_R2|| TileFIndex == TILE_BOOST_R2) && (m_LastBooster != TileIndex || m_LastFBooster != TileFIndex))
if ((TileIndex == TILE_BOOST_R2|| TileFIndex == TILE_BOOST_R2) && (m_LastBooster != MapIndex))
{
if(m_Core.m_Vel.x < 0)
m_Core.m_Vel.x = m_Core.m_Vel.x *-1.1;
else
m_Core.m_Vel.x += m_Core.m_Vel.x*1.1;
}
if ((TileIndex == TILE_BOOST_D2 || TileFIndex == TILE_BOOST_D2) && (m_LastBooster != TileIndex || m_LastFBooster != TileFIndex))
if ((TileIndex == TILE_BOOST_D2 || TileFIndex == TILE_BOOST_D2) && (m_LastBooster != MapIndex))
{
if(m_PrevPos.y-m_Pos.y>0)
m_Core.m_Vel.y = m_Core.m_Vel.y *-1.1;
else
m_Core.m_Vel.y += m_Core.m_Vel.y*1.1;
}
if ((TileIndex == TILE_BOOST_U2 || TileFIndex == TILE_BOOST_U2) && (m_LastBooster != TileIndex || m_LastFBooster != TileFIndex))
if ((TileIndex == TILE_BOOST_U2 || TileFIndex == TILE_BOOST_U2) && (m_LastBooster != MapIndex))
{
if(m_PrevPos.y-m_Pos.y<0)
m_Core.m_Vel.y = m_Core.m_Vel.y *-1.1;
else
m_Core.m_Vel.y += m_Core.m_Vel.y*1.1;
}
m_LastBooster = TileIndex;
m_LastFBooster = TileFIndex;
// handle speedup tiles
if(GameServer()->Collision()->IsSpeedup((int)m_Core.m_Pos.x, (int)m_Core.m_Pos.y))
if(GameServer()->Collision()->IsSpeedup((int)m_Core.m_Pos.x, (int)m_Core.m_Pos.y) == TILE_BOOST)
{
vec2 Direction;
int Force;
GameServer()->Collision()->GetSpeedup((int)m_Core.m_Pos.x, (int)m_Core.m_Pos.y, &Direction, &Force);
m_Core.m_Vel += Direction*Force;
dbg_msg("Direction","%f %f %f %f %f %f",Direction.x,Direction.y,(Direction*Force).x,(Direction*Force).y,m_Core.m_Vel.x,m_Core.m_Vel.y);
}
else if(GameServer()->Collision()->IsSpeedup((int)m_Core.m_Pos.x, (int)m_Core.m_Pos.y) == TILE_BOOSTS)
{
vec2 Direction;
int Force;
GameServer()->Collision()->GetSpeedup((int)m_Core.m_Pos.x, (int)m_Core.m_Pos.y, &Direction, &Force);
Force/=5;
m_Core.m_Vel = Direction*Force;
m_Core.m_Vel+=Direction;
dbg_msg("Direction","%f %f %f %f %f %f",Direction.x,Direction.y,(Direction*Force).x,(Direction*Force).y,m_Core.m_Vel.x,m_Core.m_Vel.y);
}
m_LastBooster = MapIndex;
int z = GameServer()->Collision()->IsTeleport(m_Pos.x, m_Pos.y);
if(z)
{
m_Core.m_HookedPlayer = -1;
@ -902,7 +912,18 @@ void CCharacter::Tick()
m_Core.m_Pos = ((CGameControllerDDRace*)GameServer()->m_pController)->m_pTeleporter[z-1];
m_Core.m_HookPos = m_Core.m_Pos;
}
int evilz = GameServer()->Collision()->IsEvilTeleport(m_Pos.x, m_Pos.y);
if(evilz && !m_Super)
{
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
m_Core.m_HookState = HOOK_RETRACTED;
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
m_Core.m_Pos = ((CGameControllerDDRace*)GameServer()->m_pController)->m_pTeleporter[evilz-1];
m_Core.m_HookPos = m_Core.m_Pos;
m_Core.m_Vel = vec2(0,0);
}
// handle death-tiles
if((GameServer()->Collision()->GetCollisionAt(m_Pos.x+m_ProximityRadius/3.f, m_Pos.y-m_ProximityRadius/3.f)&CCollision::COLFLAG_DEATH ||
GameServer()->Collision()->GetCollisionAt(m_Pos.x+m_ProximityRadius/3.f, m_Pos.y+m_ProximityRadius/3.f)&CCollision::COLFLAG_DEATH ||
@ -1303,7 +1324,7 @@ void CCharacter::Snap(int SnappingClient)
if (m_FreezeTime > 0 || m_FreezeTime == -1)
{
Character->m_Emote = EMOTE_PAIN;
Character->m_Emote = EMOTE_BLINK;
Character->m_Weapon = WEAPON_NINJA;
Character->m_AmmoCount = 0;
}

View file

@ -168,7 +168,6 @@ public:
int m_RefreshTime;
int m_LastBooster;
int m_LastFBooster;
vec2 m_PrevPos;
// checkpoints

View file

@ -12,7 +12,7 @@ const int RANGE=700;
//////////////////////////////////////////////////
// CGun
//////////////////////////////////////////////////
CGun::CGun(CGameWorld *pGameWorld, vec2 Pos, bool Freeze, bool Explosive)
CGun::CGun(CGameWorld *pGameWorld, vec2 Pos, int Freeze, bool Explosive)
: CEntity(pGameWorld, NETOBJTYPE_LASER)
{
m_Delay = Server()->TickSpeed()*0.3f;

View file

@ -13,14 +13,14 @@ class CGun : public CEntity
int m_EvalTick;
vec2 m_Core;
bool m_Freeze;
int m_Freeze;
bool m_Explosive;
void Fire();
int m_Delay;
public:
CGun(CGameWorld *pGameWorld, vec2 Pos, bool Freeze, bool Explosive);
CGun(CGameWorld *pGameWorld, vec2 Pos, int Freeze, bool Explosive);
virtual void Reset();
virtual void Tick();

View file

@ -12,6 +12,7 @@ const float ACCEL=1.1f;
//////////////////////////////////////////////////
// turret
//////////////////////////////////////////////////
CPlasma::CPlasma(CGameWorld *pGameWorld, vec2 Pos, vec2 Dir, bool Freeze, bool Explosive, int ResponsibleTeam)
: CEntity(pGameWorld, NETOBJTYPE_LASER)
{
@ -31,8 +32,11 @@ bool CPlasma::HitCharacter()
CCharacter *Hit = GameServer()->m_World.IntersectCharacter(m_Pos, m_Pos+m_Core, 0.0f,To2);
if(!Hit)
return false;
if(Hit->Team() != m_ResponsibleTeam) return false;
if(m_Freeze)
if(m_Freeze== -1)
Hit->UnFreeze();
else if (m_Freeze)
Hit->Freeze(Server()->TickSpeed()*3);
if(!m_Freeze || (m_Freeze && m_Explosive))
GameServer()->CreateExplosion(m_Pos, -1, WEAPON_GRENADE, true, Hit->Teams()->TeamMask(m_ResponsibleTeam));

View file

@ -12,14 +12,18 @@ class CPlasma : public CEntity
vec2 m_Core;
int m_EvalTick;
int m_LifeTime;
int m_ResponsibleTeam;
bool m_Freeze;
bool m_Explosive;
bool HitCharacter();
void Move();
public:
CPlasma(CGameWorld *pGameWorld, vec2 Pos, vec2 Dir, bool Freeze, bool Explosive, int ResponsibleTeam);
virtual void Reset();
virtual void Tick();
virtual void Snap(int SnappingClient);

View file

@ -115,7 +115,7 @@ void CProjectile::Tick()
if(Collide && m_Bouncing != 0)
{
m_StartTick = Server()->Tick();
m_Pos = NewPos+(-m_Direction);
m_Pos = NewPos+(-(m_Direction*2));
if (m_Bouncing == 1)
m_Direction.x = -m_Direction.x;
else if(m_Bouncing == 2)
@ -159,4 +159,4 @@ void CProjectile::Snap(int SnappingClient)
Char->Team() != GameServer()->GetPlayerChar(m_Owner)->Team()) return;
CNetObj_Projectile *pProj = static_cast<CNetObj_Projectile *>(Server()->SnapNewItem(NETOBJTYPE_PROJECTILE, m_Id, sizeof(CNetObj_Projectile)));
FillInfo(pProj);
}
}

View file

@ -649,51 +649,18 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
*pMessage = ' ';
pMessage++;
}
if(pMsg->m_pMessage[0]=='/') {
if(pMsg->m_pMessage[0]=='/')
{
if(!str_comp_nocase(pMsg->m_pMessage, "/Credits"))
{
SendChatTarget(ClientId, "This mod was originally Created by 3DA");
SendChatTarget(ClientId, "But now maintained by GreYFoX@GTi among others:");
SendChatTarget(ClientId, "[blacktee] den, LemonFace, noother & Fluxid");
SendChatTarget(ClientId, "please check the changelog on DDRace.info");
SendChatTarget(ClientId, "also the commit log on github.com/GreYFoXGTi/DDRace");
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/pause"))
{
if(g_Config.m_SvPauseable)
{
CCharacter* chr = p->GetCharacter();
if(!p->GetTeam() && (!chr->m_aWeapons[WEAPON_NINJA].m_Got || chr->m_FreezeTime) && chr->IsGrounded() && chr->m_Pos==chr->m_PrevPos)
{
p->SaveCharacter();
p->SetTeam(-1);
}
else if (p->GetTeam()==-1)
{
p->m_PauseInfo.m_Respawn = true;
p->SetTeam(0);
//p->LoadCharacter();//TODO:Check if this system Works
}
else
SendChatTarget(ClientId, (chr->m_aWeapons[WEAPON_NINJA].m_Got)?"You can't use /pause while you are a ninja":(!chr->IsGrounded())?"You can't use /pause while you are a in air":"You can't use /pause while you are moving");
SendChatTarget(ClientId, "This mod was originally created by 3DA");
SendChatTarget(ClientId, "Now it is maintained by GreYFoX@GTi and [BlackTee]den among others:");
SendChatTarget(ClientId, "Code: LemonFace, noother & Fluxid");
SendChatTarget(ClientId, "Documentation: Zeta-Hoernchen");
SendChatTarget(ClientId, "Please check the changelog on DDRace.info.");
SendChatTarget(ClientId, "Also the commit log on github.com/GreYFoXGTi/DDRace.");
//if(chr->m_RaceState==RACE_STARTED)
// chr->m_RaceState = RACE_PAUSE;
//else if(chr->m_RaceState==RACE_PAUSE)
// chr->m_RaceState = RACE_STARTED;*/
}
else
SendChatTarget(ClientId, "The admin didn't activate /pause");
}
else if(!str_comp_nocase(pMsg->m_pMessage, "kill"))
{
SendChatTarget(ClientId, "/kill not kill to kill your self" DDRACE_VERSION);
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/kill"))
{
p->KillCharacter(-1);
SendChatTarget(ClientId, "You are dead.");
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/info"))
{
@ -702,6 +669,51 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
SendChatTarget(ClientId, "For more Info /CMDList");
SendChatTarget(ClientId, "Or visit DDRace.info");
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/CMDList"))
{
char buf[64];
str_format(buf, sizeof(buf), "/help /Info /Credits %s",g_Config.m_SvPauseable?"/pause":"");
SendChatTarget(ClientId, buf);
SendChatTarget(ClientId, "/rank /emote /top5 /top5 i /team i /broadcast /time /flags /kill");
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help"))
{
SendChatTarget(ClientId, "/CMDlist will show a list of all chat commands");
SendChatTarget(ClientId, "/help + any command will show you the help for this command");
SendChatTarget(ClientId, "Example /help flags will display the help about ");
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help Credits"))
SendChatTarget(ClientId, "Displays the credits of DDRace.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help info"))
SendChatTarget(ClientId, "Displays information about the mod.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help CMDlist"))
SendChatTarget(ClientId, "Displays all chat commands.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help Help"))
SendChatTarget(ClientId, "This is what you are just using.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help Help %s"))
SendChatTarget(ClientId, "Well... i think i won't give you any help with this, you funny guy.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help flags"))
SendChatTarget(ClientId, "Displays information about server options");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help rules"))
SendChatTarget(ClientId, "Displays the server rules.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help kill"))
SendChatTarget(ClientId, "Kills your tee so you can quickly restart the race.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help pause"))
SendChatTarget(ClientId, "Pauses your tee. You will join the spectators while your tee is paused. Use the command again to continue.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help top5"))
SendChatTarget(ClientId, "Displays the top five ranks of this race on this server. /top5 i will show 5 ranks beginningt with rank i.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help top5 i"))
SendChatTarget(ClientId, "You're a funny stacker... See /top5 for this.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help rank"))
SendChatTarget(ClientId, "Shows your rank on the server. /rank <name> will show you the rank of the player with the specified name.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help rank name"))
SendChatTarget(ClientId, "You're a funny stacker... See /rank for this.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help eyeemote"))
SendChatTarget(ClientId, "Ask Greyfox, what this means.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help broadcast"))
SendChatTarget(ClientId, "Enables/disables the broadcast");
else if(!str_comp_nocase(pMsg->m_pMessage, "/Help emote"))
SendChatTarget(ClientId, "Shows information about the emote commands. Emote commands change the eyes of your tee.");
else if(!str_comp_nocase(pMsg->m_pMessage, "/flags"))
{
char buf[64];
@ -709,29 +721,116 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
float temp2;
m_Tuning.Get("player_collision",&temp1);
m_Tuning.Get("player_hooking",&temp2);
str_format(buf, sizeof(buf), "Flags: Cheats[%s]%s%s Player Collision[%s] PLayer Hook[%s]",
g_Config.m_SvCheats?"Y":"N",
str_format(buf, sizeof(buf), "Flags: cheats[%s]%s%s collision[%s] hooking[%s]",
g_Config.m_SvCheats?"yes":"no",
(g_Config.m_SvCheats)?" w/Time":"",
(g_Config.m_SvCheats)?(g_Config.m_SvCheatTime)?"[Y]":"[N]":"",
temp1?"Y":"N",
temp2?"Y":"N"
);
(g_Config.m_SvCheats)?(g_Config.m_SvCheatTime)?"[yes]":"[no]":"",
temp1?"yes":"no",
temp2?"yes":"no");
SendChatTarget(ClientId, buf);
str_format(buf, sizeof(buf), "Endless Hook[%s] Weapons Effect Others[%s]",g_Config.m_SvEndlessDrag?"Y":"N",g_Config.m_SvHit?"Y":"N");
str_format(buf, sizeof(buf), "endless hook[%s] weapons effect others[%s]",g_Config.m_SvEndlessDrag?"yes":"no",g_Config.m_SvHit?"yes":"no");
SendChatTarget(ClientId, buf);
if(g_Config.m_SvPauseable)
{
str_format(buf, sizeof(buf), "Server Allows /pause with%s",g_Config.m_SvPauseTime?" time pause.":"out time pause.");
SendChatTarget(ClientId, buf);
}
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/CMDList"))
else if(!str_comp_nocase(pMsg->m_pMessage, "/rules"))
{
char buf[64];
str_format(buf, sizeof(buf), "/Info /Credits %s",g_Config.m_SvPauseable?"/pause":"");
SendChatTarget(ClientId, buf);
SendChatTarget(ClientId, "/rank /emote /top5 /top5 i /team i /broadcast /time /flags /kill");
bool printed=false;
if(g_Config.m_SvDDRaceRules)
{
SendChatTarget(ClientId, "No blocking.");
SendChatTarget(ClientId, "No insulting / spamming.");
SendChatTarget(ClientId, "No fun voting / vote spamming.");
SendChatTarget(ClientId, "Breaking any of these rules will result in a penalty, decided by server admins.");
printed=true;
}
if(g_Config.m_SvRulesLine1[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine1);
printed=true;
}
if(g_Config.m_SvRulesLine2[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine2);
printed=true;
}
if(g_Config.m_SvRulesLine3[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine3);
printed=true;
}
if(g_Config.m_SvRulesLine4[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine4);
printed=true;
}
if(g_Config.m_SvRulesLine5[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine5);
printed=true;
}
if(g_Config.m_SvRulesLine6[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine6);
printed=true;
}
if(g_Config.m_SvRulesLine7[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine7);
printed=true;
}
if(g_Config.m_SvRulesLine8[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine8);
printed=true;
}
if(g_Config.m_SvRulesLine9[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine9);
printed=true;
}
if(g_Config.m_SvRulesLine10[0])
{
SendChatTarget(ClientId, g_Config.m_SvRulesLine10);
printed=true;
}
if(!printed)
SendChatTarget(ClientId, "No Rules Defined, Kill em all!!");
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/kill"))
{
p->KillCharacter(-1);//TODO:GFX Make This have Suicide Penalty ( Tees can't spawn unless they wait 3 seconds )
}
else if(!str_comp_nocase(pMsg->m_pMessage, "/pause"))
{
if(g_Config.m_SvPauseable)
{
CCharacter* chr = p->GetCharacter();
if(!p->GetTeam() && (!chr->m_aWeapons[WEAPON_NINJA].m_Got || chr->m_FreezeTime) && chr->IsGrounded() && chr->m_Pos==chr->m_PrevPos)
{
p->SaveCharacter();
p->SetTeam(-1);
}
else if (p->GetTeam()==-1)
{
p->m_PauseInfo.m_Respawn = true;
p->SetTeam(0);
//p->LoadCharacter();//TODO:Check if this system Works
}
else
SendChatTarget(ClientId, (chr->m_aWeapons[WEAPON_NINJA].m_Got)?"You can't use /pause while you are a ninja":(!chr->IsGrounded())?"You can't use /pause while you are a in air":"You can't use /pause while you are moving");
}
else
SendChatTarget(ClientId, "The admin didn't activate /pause");
}
else if(!str_comp_num(pMsg->m_pMessage, "/top5", 5))
{
if(g_Config.m_SvHideScore)
{
SendChatTarget(ClientId, "Showing the Top5 is not allowed on this server.");
SendChatTarget(ClientId, "Showing the top 5 is not allowed on this server.");
return;
}
@ -762,7 +861,8 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
else
p->m_ShowOthers = !p->m_ShowOthers;
}
else if (!str_comp_nocase(pMsg->m_pMessage, "/time")&&g_Config.m_SvEmotionalTees)
else if (!str_comp_nocase(pMsg->m_pMessage, "/time") && g_Config.m_SvEmotionalTees)
{
CCharacter* pChr = p->GetCharacter();
if (pChr)
@ -773,6 +873,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
pChr->m_BroadTime=true;
}
}
else if(!str_comp_num(pMsg->m_pMessage, "/team", 5))
{
int Num;
@ -792,14 +893,16 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
}
}
else if (!str_comp_nocase(pMsg->m_pMessage, "/eyeemote")&&g_Config.m_SvEmotionalTees)
else if (!str_comp_nocase(pMsg->m_pMessage, "/eyeemote") && g_Config.m_SvEmotionalTees)
{
CCharacter* pChr = p->GetCharacter();
if (pChr)
pChr->m_EyeEmote=!pChr->m_EyeEmote;
SendChatTarget(ClientId, (pChr->m_EyeEmote)?"You can now use the preset Eye Emotes.":"You don't have any Eye Emotes, remember to bind some.(until you die)");
SendChatTarget(ClientId, (pChr->m_EyeEmote)?"You can now use the preset eye emotes.":"You don't have any eye emotes, remember to bind some.(until you die)");
}
else if (!str_comp_nocase(pMsg->m_pMessage, "/broadcast")&&g_Config.m_SvEmotionalTees)
else if (!str_comp_nocase(pMsg->m_pMessage, "/broadcast") && g_Config.m_SvEmotionalTees)
{
CCharacter* pChr = p->GetCharacter();
if (pChr)
@ -810,64 +913,64 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
pChr->m_BroadCast=true;
}
}
else if (!str_comp_nocase(pMsg->m_pMessage, "/emote")&&g_Config.m_SvEmotionalTees)
else if (!str_comp_nocase(pMsg->m_pMessage, "/emote") && g_Config.m_SvEmotionalTees)
{
SendChatTarget(ClientId, "Emote Commands Are: /emotesurprise /emoteblink /emoteclose /emoteangry /emotehappy /emotepain");
SendChatTarget(ClientId, "Example: /emotesurprise 10 for 10 seconds or /emotesurprise (default 1 second)");
SendChatTarget(ClientId, "Emote commands are: /emote surprise /emote blink /emote close /emote angry /emote happy /emote pain");
SendChatTarget(ClientId, "Example: /emote surprise 10 for 10 seconds or /emote surprise (default 1 second)");
}
else if(!str_comp_num(pMsg->m_pMessage, "/emotepain", 10))
else if(!str_comp_num(pMsg->m_pMessage, "/emote pain", 11) && g_Config.m_SvEmotionalTees)
{
int Num = -1;
CCharacter* pChr = p->GetCharacter();
if (pChr)
{
pChr->m_EmoteType = EMOTE_PAIN;
if(sscanf(pMsg->m_pMessage, "/emotepain %d", &Num) > 0)
if(sscanf(pMsg->m_pMessage, "/emote pain %d", &Num) > 0)
pChr->m_EmoteStop = Server()->Tick() + Num * Server()->TickSpeed();
else
pChr->m_EmoteStop = Server()->Tick() + 1 * Server()->TickSpeed();
}
}
else if(!str_comp_num(pMsg->m_pMessage, "/emotehappy", 11))
else if(!str_comp_num(pMsg->m_pMessage, "/emote happy", 12) && g_Config.m_SvEmotionalTees)
{
int Num = -1;
CCharacter* pChr = p->GetCharacter();
if (pChr)
{
pChr->m_EmoteType = EMOTE_HAPPY;
if(sscanf(pMsg->m_pMessage, "/emotehappy %d", &Num) > 0)
if(sscanf(pMsg->m_pMessage, "/emote happy %d", &Num) > 0)
pChr->m_EmoteStop = Server()->Tick() + Num * Server()->TickSpeed();
else
pChr->m_EmoteStop = Server()->Tick() + 1 * Server()->TickSpeed();
}
}
else if(!str_comp_num(pMsg->m_pMessage, "/emoteangry", 11))
else if(!str_comp_num(pMsg->m_pMessage, "/emote angry", 12) && g_Config.m_SvEmotionalTees)
{
int Num = -1;
CCharacter* pChr = p->GetCharacter();
if (pChr)
{
pChr->m_EmoteType = EMOTE_ANGRY;
if(sscanf(pMsg->m_pMessage, "/emoteangry %d", &Num) > 0)
if(sscanf(pMsg->m_pMessage, "/emote angry %d", &Num) > 0)
pChr->m_EmoteStop = Server()->Tick() + Num * Server()->TickSpeed();
else
pChr->m_EmoteStop = Server()->Tick() + 1 * Server()->TickSpeed();
}
}
else if(!str_comp_num(pMsg->m_pMessage, "/emoteclose", 11))
else if(!str_comp_num(pMsg->m_pMessage, "/emote close", 12) && g_Config.m_SvEmotionalTees)
{
int Num = -1;
CCharacter* pChr = p->GetCharacter();
if (pChr)
{
pChr->m_EmoteType = EMOTE_BLINK;
if(sscanf(pMsg->m_pMessage, "/emoteclose %d", &Num) > 0)
if(sscanf(pMsg->m_pMessage, "/emote close %d", &Num) > 0)
pChr->m_EmoteStop = Server()->Tick() + Num * Server()->TickSpeed();
else
pChr->m_EmoteStop = Server()->Tick() + 1 * Server()->TickSpeed();
}
}
else if (!str_comp_nocase(pMsg->m_pMessage, "/emoteblink")&&g_Config.m_SvEmotionalTees)
else if(!str_comp_nocase(pMsg->m_pMessage, "/emote blink") && g_Config.m_SvEmotionalTees)
{
CCharacter* pChr = p->GetCharacter();
if (pChr)
@ -876,23 +979,26 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
pChr->m_EmoteStop = Server()->Tick() + 0.5 * Server()->TickSpeed();
}
}
else if(!str_comp_num(pMsg->m_pMessage, "/emotesurprise", 14))
else if(!str_comp_num(pMsg->m_pMessage, "/emote surprise", 15) && g_Config.m_SvEmotionalTees)
{
int Num = -1;
CCharacter* pChr = p->GetCharacter();
if (pChr)
{
pChr->m_EmoteType = EMOTE_SURPRISE;
if(sscanf(pMsg->m_pMessage, "/emotesurprise %d", &Num) > 0)
if(sscanf(pMsg->m_pMessage, "/emote surprise %d", &Num) > 0)
pChr->m_EmoteStop = Server()->Tick() + Num * Server()->TickSpeed();
else
pChr->m_EmoteStop = Server()->Tick() + 1 * Server()->TickSpeed();
}
}
else
SendChatTarget(ClientId, "No such command!");
SendChatTarget(ClientId, "No such command!");
} else {
}
else if(!str_comp_nocase(pMsg->m_pMessage, "kill"))
SendChatTarget(ClientId, "/kill not kill to kill your self" DDRACE_VERSION); //this will never happen
else {
if (m_apPlayers[ClientId]->m_Muted == 0)
SendChat(ClientId, Team, pMsg->m_pMessage);
else
@ -1339,11 +1445,13 @@ void CGameContext::ConAddVote(IConsole::IResult *pResult, void *pUserData, int C
void CGameContext::ConVote(IConsole::IResult *pResult, void *pUserData, int ClientID)
{
CGameContext *pSelf = (CGameContext *)pUserData;
char aBuf[64];
if(str_comp_nocase(pResult->GetString(0), "yes") == 0)
pSelf->m_VoteEnforce = CGameContext::VOTE_ENFORCE_YES;
else if(str_comp_nocase(pResult->GetString(0), "no") == 0)
pSelf->m_VoteEnforce = CGameContext::VOTE_ENFORCE_NO;
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "vote forced to %s by %s", pResult->GetString(0),pSelf->Server()->ClientName(ClientID));
pSelf->SendChat(-1, CGameContext::CHAT_ALL, aBuf);
str_format(aBuf, sizeof(aBuf), "forcing vote %s", pResult->GetString(0));
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
}
@ -1378,7 +1486,7 @@ void CGameContext::ConGoLeft(IConsole::IResult *pResult, void *pUserData, int ci
CCharacter* chr = pSelf->GetPlayerChar(cid);
if(chr)
{
chr->m_Core.m_Pos.x -= 16;
chr->m_Core.m_Pos.x -= 32;
if(!g_Config.m_SvCheatTime)
chr->m_RaceState = RACE_CHEAT;
}
@ -1390,7 +1498,7 @@ void CGameContext::ConGoRight(IConsole::IResult *pResult, void *pUserData, int
CCharacter* chr = pSelf->GetPlayerChar(cid);
if(chr)
{
chr->m_Core.m_Pos.x += 16;
chr->m_Core.m_Pos.x += 32;
if(!g_Config.m_SvCheatTime)
chr->m_RaceState = RACE_CHEAT;
}
@ -1402,7 +1510,7 @@ void CGameContext::ConGoUp(IConsole::IResult *pResult, void *pUserData, int cid
CCharacter* chr = pSelf->GetPlayerChar(cid);
if(chr)
{
chr->m_Core.m_Pos.y -= 16;
chr->m_Core.m_Pos.y -= 32;
if(!g_Config.m_SvCheatTime)
chr->m_RaceState = RACE_CHEAT;
}
@ -1414,7 +1522,7 @@ void CGameContext::ConGoDown(IConsole::IResult *pResult, void *pUserData, int c
CCharacter* chr = pSelf->GetPlayerChar(cid);
if(chr)
{
chr->m_Core.m_Pos.y += 16;
chr->m_Core.m_Pos.y += 32;
if(!g_Config.m_SvCheatTime)
chr->m_RaceState = RACE_CHEAT;
}

View file

@ -297,15 +297,19 @@ bool IGameController::OnEntity(int Index, vec2 Pos, bool Front)
}
else if(Index==ENTITY_PLASMAE)
{
new CGun(&GameServer()->m_World, Pos, false, true);
new CGun(&GameServer()->m_World, Pos, 0, true);
}
else if(Index==ENTITY_PLASMAF)
{
new CGun(&GameServer()->m_World, Pos, true, false);
new CGun(&GameServer()->m_World, Pos, 1, false);
}
else if(Index==ENTITY_PLASMA)
{
new CGun(&GameServer()->m_World, Pos, true, true);
new CGun(&GameServer()->m_World, Pos, 1, true);
}
else if(Index==ENTITY_PLASMAU)
{
new CGun(&GameServer()->m_World, Pos, -1, false);
}
if(Type != -1)
{

View file

@ -1,5 +1,10 @@
// copyright (c) 2007 magnus auvinen, see licence.txt for more info/*
/*#include <game/mapitems.h>
=======
// copyright (c) 2007 magnus auvinen, see licence.txt for more info
/*
#include <game/mapitems.h>
>>>>>>> 72e05efc53009137a398e1ec19d9e61a94bb6262
#include <game/server/entities/character.h>
#include <game/server/entities/flag.h>
#include <game/server/player.h>

View file

@ -252,3 +252,17 @@ std::list<class CCharacter *> CGameWorld::IntersectedCharacters(vec2 Pos0, vec2
return listOfChars;
}
void CGameWorld::ReleaseHooked(int ClientId)
{
CCharacter *p = (CCharacter *)CGameWorld::FindFirst(NETOBJTYPE_CHARACTER);
for(; p; p = (CCharacter *)p->TypeNext())
if(p->m_Core.m_HookedPlayer == ClientId && !p->m_Super)
{
p->m_Core.m_HookedPlayer = -1;
p->m_Core.m_HookState = HOOK_RETRACTED;
p->m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
p->m_Core.m_HookState = HOOK_RETRACTED;
}
}

View file

@ -137,22 +137,11 @@ public:
*/
void Tick();
/*
Function: interserct_CCharacter
Finds all CCharacters that intersect the line.
Arguments:
pos0 - Start position
pos2 - End position
radius - How for from the line the CCharacter is allowed to be.
new_pos - Intersection position
notthis - Entity to ignore intersecting with
Returns:
Returns list with all Characters on line.
*/
std::list<class CCharacter *> IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, class CEntity *pNotThis = 0);
std::list<class CCharacter *> IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, vec2 &NewPos, class CEntity *pNotThis);
void ReleaseHooked(int ClientId);
};
#endif