Skip to content

Commit

Permalink
Improved mercenary bombs
Browse files Browse the repository at this point in the history
  • Loading branch information
necropotame committed Nov 14, 2016
1 parent f94bfc0 commit 08551de
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
16 changes: 15 additions & 1 deletion src/game/server/entities/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
m_IsFrozen = false;
m_FrozenTime = -1;
m_LoveTick = -1;
m_SlipperyTick = -1;
m_PositionLockTick = -Server()->TickSpeed()*10;
m_PositionLocked = false;
m_Poison = 0;
Expand Down Expand Up @@ -460,6 +461,10 @@ void CCharacter::UpdateTuningParam()
pTuningParams->m_AirControlAccel = 1.5f;
pTuningParams->m_AirJumpImpulse = 0.0f;
}
if(m_SlipperyTick > 0)
{
pTuningParams->m_GroundFriction = 1.0f;
}

if(NoActions)
{
Expand Down Expand Up @@ -1299,6 +1304,9 @@ void CCharacter::Tick()
if(m_LoveTick > 0)
--m_LoveTick;

if(m_SlipperyTick > 0)
--m_SlipperyTick;

if(m_Poison > 0)
{
if(m_PoisonTick == 0)
Expand Down Expand Up @@ -2880,12 +2888,18 @@ bool CCharacter::IsInfected() const
return m_pPlayer->IsInfected();
}

void CCharacter::Love()
void CCharacter::LoveEffect()
{
if(m_LoveTick <= 0)
m_LoveTick = Server()->TickSpeed()*5;
}

void CCharacter::SlipperyEffect()
{
if(m_SlipperyTick <= 0)
m_SlipperyTick = Server()->TickSpeed()/2;
}

void CCharacter::Freeze(float Time, int Player, int Reason)
{
if(m_IsFrozen)
Expand Down
4 changes: 3 additions & 1 deletion src/game/server/entities/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class CCharacter : public CEntity
int m_PositionLockTick;
bool m_PositionLocked;
int m_LoveTick;
int m_SlipperyTick;
int m_PoisonTick;
int m_Poison;
int m_PoisonFrom;
Expand All @@ -202,7 +203,8 @@ class CCharacter : public CEntity
bool IsFrozen() const;
void Unfreeze();
void Poison(int Count, int From);
void Love();
void LoveEffect();
void SlipperyEffect();
bool IsTeleportable();
int GetInfWeaponID(int WID);
void UpdateTuningParam();
Expand Down
5 changes: 3 additions & 2 deletions src/game/server/entities/engineer-wall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ void CEngineerWall::Snap(int SnappingClient)
if(!pObj)
return;


pObj->m_X = (int)m_Pos.x;
pObj->m_Y = (int)m_Pos.y;
pObj->m_FromX = (int)m_Pos2.x;
pObj->m_FromY = (int)m_Pos2.y;
pObj->m_StartTick = Server()->Tick();
pObj->m_StartTick = Server()->Tick()+Server()->TickSpeed() + Server()->TickSpeed();
}
{
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_EndPointID, sizeof(CNetObj_Laser)));
Expand All @@ -125,6 +126,6 @@ void CEngineerWall::Snap(int SnappingClient)
pObj->m_Y = (int)Pos.y;
pObj->m_FromX = (int)Pos.x;
pObj->m_FromY = (int)Pos.y;
pObj->m_StartTick = Server()->Tick();
pObj->m_StartTick = Server()->Tick()+Server()->TickSpeed() + Server()->TickSpeed();
}
}
3 changes: 2 additions & 1 deletion src/game/server/entities/growingexplosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,14 @@ void CGrowingExplosion::Tick()
break;
case GROWINGEXPLOSIONEFFECT_SHOCKWAVE_INFECTED:
{
p->SlipperyEffect();
vec2 Force = -m_pGrowingMapVec[tileY*m_GrowingMap_Length+tileX] * 20.0f;
p->m_Core.m_Vel += Force;
break;
}
case GROWINGEXPLOSIONEFFECT_LOVE_INFECTED:
{
p->Love();
p->LoveEffect();
GameServer()->SendEmoticon(p->GetPlayer()->GetCID(), EMOTICON_HEARTS);
m_Hit[p->GetPlayer()->GetCID()] = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/entities/merc-bomb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void CMercenaryBomb::Explode()
new CGrowingExplosion(GameWorld(), m_Pos, vec2(0.0, -1.0), m_Owner, 14.0f * Factor, GROWINGEXPLOSIONEFFECT_EXPLOSION_INFECTED);
break;
case EFFECT_LOVE:
new CGrowingExplosion(GameWorld(), m_Pos, vec2(0.0, -1.0), m_Owner, 14.0f * Factor, GROWINGEXPLOSIONEFFECT_LOVE_INFECTED);
new CGrowingExplosion(GameWorld(), m_Pos, vec2(0.0, -1.0), m_Owner, 16.0f * Factor, GROWINGEXPLOSIONEFFECT_LOVE_INFECTED);
break;
case EFFECT_SHOCKWAVE:
new CGrowingExplosion(GameWorld(), m_Pos, vec2(0.0, -1.0), m_Owner, 14.0f * Factor, GROWINGEXPLOSIONEFFECT_SHOCKWAVE_INFECTED);
Expand Down

0 comments on commit 08551de

Please sign in to comment.