Skip to content

Commit

Permalink
Fix CIcLaser class name
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Dec 23, 2024
1 parent 505200c commit 931fa81
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 39 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -911,14 +911,14 @@ set_glob(GAME_SERVER GLOB_RECURSE src/game/server
infclass/entities/ic_door.h
infclass/entities/ic_entity.cpp
infclass/entities/ic_entity.h
infclass/entities/ic_laser.cpp
infclass/entities/ic_laser.h
infclass/entities/ic_pickup.cpp
infclass/entities/ic_pickup.h
infclass/entities/ic_placed_object.cpp
infclass/entities/ic_placed_object.h
infclass/entities/ic_projectile.cpp
infclass/entities/ic_projectile.h
infclass/entities/infc-laser.cpp
infclass/entities/infc-laser.h
infclass/entities/laser-teleport.cpp
infclass/entities/laser-teleport.h
infclass/entities/looper-wall.cpp
Expand Down
6 changes: 3 additions & 3 deletions src/game/server/infclass/classes/humans/human.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,15 +1031,15 @@ void CInfClassHuman::OnLaserFired(WeaponFireContext *pFireContext)
case EInfclassWeapon::LOOPER_LASER:
StartEnergy *= 0.7f;
Damage = 5;
CInfClassLaser::MakeLaser(GameServer(), GetPos(), Direction, StartEnergy, GetCid(), Damage, pFireContext->InfClassWeapon);
CIcLaser::MakeLaser(GameServer(), GetPos(), Direction, StartEnergy, GetCid(), Damage, pFireContext->InfClassWeapon);
break;
case EInfclassWeapon::SNIPER_RIFLE:
Damage = m_pCharacter->PositionIsLocked() ? 30 : random_int(10, 13);
CInfClassLaser::MakeLaser(GameServer(), GetPos(), Direction, StartEnergy, GetCid(), Damage, pFireContext->InfClassWeapon);
CIcLaser::MakeLaser(GameServer(), GetPos(), Direction, StartEnergy, GetCid(), Damage, pFireContext->InfClassWeapon);
break;
case EInfclassWeapon::ENGINEER_LASER:
case EInfclassWeapon::HERO_LASER:
CInfClassLaser::MakeLaser(GameServer(), GetPos(), Direction, StartEnergy, GetCid(), Damage, pFireContext->InfClassWeapon);
CIcLaser::MakeLaser(GameServer(), GetPos(), Direction, StartEnergy, GetCid(), Damage, pFireContext->InfClassWeapon);
break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/biologist-laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <game/server/infclass/entities/ic_character.h>

CBiologistLaser::CBiologistLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, int Owner, int Dmg) :
CInfClassLaser(pGameContext, Pos, Direction, 400.0f, Owner, Dmg, EInfclassWeapon::BIOLOGIST_MINE_LASER)
CIcLaser(pGameContext, Pos, Direction, 400.0f, Owner, Dmg, EInfclassWeapon::BIOLOGIST_MINE_LASER)
{
m_MaxBounces = 4;
m_BounceCost = -100;
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/biologist-laser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#ifndef GAME_SERVER_ENTITIES_BIOLOGIST_LASER_H
#define GAME_SERVER_ENTITIES_BIOLOGIST_LASER_H

#include "infc-laser.h"
#include "ic_laser.h"

class CBiologistLaser final : public CInfClassLaser
class CBiologistLaser final : public CIcLaser
{
public:
CBiologistLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, int Owner, int Dmg);
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/blinding-laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void CBlindingLaser::OnFired(CIcCharacter *pCharacter, WeaponFireContext *pFireC
}

CBlindingLaser::CBlindingLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, int Owner)
: CInfClassLaser(pGameContext, Pos, Direction, 600, Owner, 0, EInfclassWeapon::BLINDING_LASER)
: CIcLaser(pGameContext, Pos, Direction, 600, Owner, 0, EInfclassWeapon::BLINDING_LASER)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/blinding-laser.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef GAME_SERVER_ENTITIES_BLINDING_LASER_H
#define GAME_SERVER_ENTITIES_BLINDING_LASER_H

#include "infc-laser.h"
#include "ic_laser.h"

class CBlindingLaser : public CInfClassLaser
class CBlindingLaser : public CIcLaser
{
public:
static void OnFired(CIcCharacter *pCharacter, WeaponFireContext *pFireContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#include "infc-laser.h"
#include "ic_laser.h"

#include <engine/shared/config.h>

Expand All @@ -12,7 +12,7 @@
#include <game/server/infclass/entities/ic_character.h>
#include <game/server/infclass/ic_gamecontroller.h>

CInfClassLaser::CInfClassLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon) :
CIcLaser::CIcLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon) :
CIcEntity(pGameContext, CGameWorld::ENTTYPE_LASER, Pos, Owner), m_Weapon(InfClassWeapon)
{
m_Dmg = Dmg;
Expand All @@ -23,7 +23,7 @@ CInfClassLaser::CInfClassLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direct
GameWorld()->InsertEntity(this);
}

bool CInfClassLaser::HitCharacter(vec2 From, vec2 To)
bool CIcLaser::HitCharacter(vec2 From, vec2 To)
{
vec2 At;
CIcCharacter *pOwnerChar = GameController()->GetCharacter(GetOwner());
Expand All @@ -46,7 +46,7 @@ bool CInfClassLaser::HitCharacter(vec2 From, vec2 To)
return OnCharacterHit(pHit);
}

bool CInfClassLaser::OnCharacterHit(CIcCharacter *pHit)
bool CIcLaser::OnCharacterHit(CIcCharacter *pHit)
{
pHit->TakeDamage(vec2(0.f, 0.f), m_Dmg, GetOwner(), GetDamageType());

Expand All @@ -60,7 +60,7 @@ bool CInfClassLaser::OnCharacterHit(CIcCharacter *pHit)
return true;
}

void CInfClassLaser::DoBounce()
void CIcLaser::DoBounce()
{
m_EvalTick = Server()->Tick();

Expand Down Expand Up @@ -107,25 +107,25 @@ void CInfClassLaser::DoBounce()
}
}

CInfClassLaser *CInfClassLaser::MakeLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon)
CIcLaser *CIcLaser::MakeLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon)
{
CInfClassLaser *pLaser = new CInfClassLaser(pGameContext, Pos, Direction, StartEnergy, Owner, Dmg, InfClassWeapon);
CIcLaser *pLaser = new CIcLaser(pGameContext, Pos, Direction, StartEnergy, Owner, Dmg, InfClassWeapon);
pLaser->DoBounce();
return pLaser;
}

void CInfClassLaser::Tick()
void CIcLaser::Tick()
{
if(Server()->Tick() > m_EvalTick+(Server()->TickSpeed()*GameServer()->Tuning()->m_LaserBounceDelay)/1000.0f)
DoBounce();
}

void CInfClassLaser::TickPaused()
void CIcLaser::TickPaused()
{
++m_EvalTick;
}

void CInfClassLaser::Snap(int SnappingClient)
void CIcLaser::Snap(int SnappingClient)
{
if(NetworkClipped(SnappingClient) && NetworkClipped(SnappingClient, m_From))
return;
Expand All @@ -135,17 +135,17 @@ void CInfClassLaser::Snap(int SnappingClient)
GameServer()->SnapLaserObject(Context, GetId(), m_Pos, m_From, m_EvalTick, GetOwner(), m_SnapLaserType);
}

void CInfClassLaser::SetExplosive(bool Explosive)
void CIcLaser::SetExplosive(bool Explosive)
{
m_Explosive = Explosive;
}

void CInfClassLaser::SetSnapType(int LaserType)
void CIcLaser::SetSnapType(int LaserType)
{
m_SnapLaserType = LaserType;
}

EDamageType CInfClassLaser::GetDamageType() const
EDamageType CIcLaser::GetDamageType() const
{
switch(m_Weapon)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ struct WeaponFireContext;
enum class EDamageType;
enum class EInfclassWeapon;

class CInfClassLaser : public CIcEntity
class CIcLaser : public CIcEntity
{
public:
CInfClassLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon);
CIcLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon);

static CInfClassLaser *MakeLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon);
static CIcLaser *MakeLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon);

void Tick() override;
void TickPaused() override;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/medic-laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void CMedicLaser::OnFired(CIcCharacter *pCharacter, WeaponFireContext *pFireCont
}

CMedicLaser::CMedicLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, EInfclassWeapon Weapon)
: CInfClassLaser(pGameContext, Pos, Direction, StartEnergy, Owner, 0, Weapon)
: CIcLaser(pGameContext, Pos, Direction, StartEnergy, Owner, 0, Weapon)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/medic-laser.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef GAME_SERVER_ENTITIES_MEDIC_LASER_H
#define GAME_SERVER_ENTITIES_MEDIC_LASER_H

#include "infc-laser.h"
#include "ic_laser.h"

class CMedicLaser : public CInfClassLaser
class CMedicLaser : public CIcLaser
{
public:
static void OnFired(CIcCharacter *pCharacter, WeaponFireContext *pFireContext, float StartEnergy);
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/merc-laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
static const int MercLaserDamage = 0;

CMercenaryLaser::CMercenaryLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, float UpgradePoints)
: CInfClassLaser(pGameContext, Pos, Direction, StartEnergy, Owner, MercLaserDamage, EInfclassWeapon::MERCENARY_UPGRADE_LASER)
: CIcLaser(pGameContext, Pos, Direction, StartEnergy, Owner, MercLaserDamage, EInfclassWeapon::MERCENARY_UPGRADE_LASER)
, m_UpgradePoints(UpgradePoints)
{
CInfClassLaser::DoBounce();
CIcLaser::DoBounce();
}

bool CMercenaryLaser::HitCharacter(vec2 From, vec2 To)
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/merc-laser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#ifndef GAME_SERVER_INFCLASS_ENTITIES_MERC_LASER_H
#define GAME_SERVER_INFCLASS_ENTITIES_MERC_LASER_H

#include "infc-laser.h"
#include "ic_laser.h"

class CMercenaryLaser final : public CInfClassLaser
class CMercenaryLaser final : public CIcLaser
{
public:
CMercenaryLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, float UpgradePoints);
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/scientist-laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "white-hole.h"

CScientistLaser::CScientistLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg)
: CInfClassLaser(pGameContext, Pos, Direction, StartEnergy, Owner, Dmg, EInfclassWeapon::EXPLOSIVE_LASER)
: CIcLaser(pGameContext, Pos, Direction, StartEnergy, Owner, Dmg, EInfclassWeapon::EXPLOSIVE_LASER)
{
DoBounce();
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/scientist-laser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#ifndef GAME_SERVER_ENTITIES_SCILASER_H
#define GAME_SERVER_ENTITIES_SCILASER_H

#include "infc-laser.h"
#include "ic_laser.h"

class CScientistLaser final : public CInfClassLaser
class CScientistLaser final : public CIcLaser
{
public:
CScientistLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg);
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/turret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <game/server/infclass/ic_gamecontroller.h>
#include <game/server/infclass/ic_player.h>

#include "infc-laser.h"
#include "ic_laser.h"
#include "ic_character.h"
#include "plasma.h"

Expand Down Expand Up @@ -163,7 +163,7 @@ void CTurret::AttackTargets()
{
case LASER:
{
CInfClassLaser *pLaser = CInfClassLaser::MakeLaser(GameServer(), m_Pos, Direction, GameServer()->Tuning()->m_LaserReach, GetOwner(), GetDamage(), EInfclassWeapon::LASER_TURRET);
CIcLaser *pLaser = CIcLaser::MakeLaser(GameServer(), m_Pos, Direction, GameServer()->Tuning()->m_LaserReach, GetOwner(), GetDamage(), EInfclassWeapon::LASER_TURRET);
pLaser->SetSnapType(m_SnapLaserType);
m_ammunition--;
break;
Expand Down

0 comments on commit 931fa81

Please sign in to comment.