Using Super.
This commit is contained in:
committed by
Alexander Harkness
parent
f931590bf0
commit
9ee47e5999
@@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
cAggressiveMonster::cAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height) :
|
||||
super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_SoundAmbient, a_Width, a_Height)
|
||||
Super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_SoundAmbient, a_Width, a_Height)
|
||||
{
|
||||
m_EMPersonality = AGGRESSIVE;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ cAggressiveMonster::cAggressiveMonster(const AString & a_ConfigName, eMonsterTyp
|
||||
// What to do if in Chasing State
|
||||
void cAggressiveMonster::InStateChasing(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::InStateChasing(a_Dt, a_Chunk);
|
||||
Super::InStateChasing(a_Dt, a_Chunk);
|
||||
|
||||
if (GetTarget() != nullptr)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ void cAggressiveMonster::EventSeePlayer(cPlayer * a_Player, cChunk & a_Chunk)
|
||||
return;
|
||||
}
|
||||
|
||||
super::EventSeePlayer(a_Player, a_Chunk);
|
||||
Super::EventSeePlayer(a_Player, a_Chunk);
|
||||
m_EMState = CHASING;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ void cAggressiveMonster::EventSeePlayer(cPlayer * a_Player, cChunk & a_Chunk)
|
||||
|
||||
void cAggressiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -7,14 +7,22 @@
|
||||
|
||||
|
||||
|
||||
class cAggressiveMonster :
|
||||
class cAggressiveMonster:
|
||||
public cMonster
|
||||
{
|
||||
typedef cMonster super;
|
||||
using Super = cMonster;
|
||||
|
||||
public:
|
||||
|
||||
cAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height);
|
||||
cAggressiveMonster(
|
||||
const AString & a_ConfigName,
|
||||
eMonsterType a_MobType,
|
||||
const AString & a_SoundHurt,
|
||||
const AString & a_SoundDeath,
|
||||
const AString & a_SoundAmbient,
|
||||
double a_Width,
|
||||
double a_Height
|
||||
);
|
||||
|
||||
virtual void Tick (std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
||||
virtual void InStateChasing(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
cBat::cBat(void) :
|
||||
super("Bat", mtBat, "entity.bat.hurt", "entity.bat.death", "entity.bat.ambient", 0.5, 0.9)
|
||||
Super("Bat", mtBat, "entity.bat.hurt", "entity.bat.death", "entity.bat.ambient", 0.5, 0.9)
|
||||
{
|
||||
SetGravity(-2.0f);
|
||||
SetAirDrag(0.05f);
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cBat :
|
||||
class cBat:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
cBat(void);
|
||||
|
||||
cBat();
|
||||
|
||||
CLASS_PROTODEF(cBat)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cBlaze::cBlaze(void) :
|
||||
super("Blaze", mtBlaze, "entity.blaze.hurt", "entity.blaze.death", "entity.blaze.ambient", 0.6, 1.8),
|
||||
Super("Blaze", mtBlaze, "entity.blaze.hurt", "entity.blaze.death", "entity.blaze.ambient", 0.6, 1.8),
|
||||
m_IsCharging(false),
|
||||
m_ChargeTimer(0)
|
||||
{
|
||||
@@ -50,7 +50,7 @@ bool cBlaze::Attack(std::chrono::milliseconds a_Dt)
|
||||
|
||||
void cBlaze::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cBlaze :
|
||||
class cBlaze:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cBlaze(void);
|
||||
|
||||
cBlaze();
|
||||
|
||||
CLASS_PROTODEF(cBlaze)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cCaveSpider::cCaveSpider(void) :
|
||||
super("CaveSpider", mtCaveSpider, "entity.spider.hurt", "entity.spider.death", "entity.spider.ambient", 0.7, 0.5)
|
||||
Super("CaveSpider", mtCaveSpider, "entity.spider.hurt", "entity.spider.death", "entity.spider.ambient", 0.7, 0.5)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ cCaveSpider::cCaveSpider(void) :
|
||||
|
||||
void cCaveSpider::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -34,7 +34,7 @@ void cCaveSpider::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
bool cCaveSpider::Attack(std::chrono::milliseconds a_Dt)
|
||||
{
|
||||
if (!super::Attack(a_Dt))
|
||||
if (!Super::Attack(a_Dt))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
|
||||
|
||||
|
||||
class cCaveSpider :
|
||||
class cCaveSpider:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cCaveSpider(void);
|
||||
|
||||
cCaveSpider();
|
||||
|
||||
CLASS_PROTODEF(cCaveSpider)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cChicken::cChicken(void) :
|
||||
super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", "entity.chicken.ambient", 0.4, 0.7),
|
||||
Super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", "entity.chicken.ambient", 0.4, 0.7),
|
||||
m_EggDropTimer(0)
|
||||
{
|
||||
SetGravity(-2.0f);
|
||||
@@ -21,7 +21,7 @@ cChicken::cChicken(void) :
|
||||
|
||||
void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -80,5 +80,5 @@ bool cChicken::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
return false;
|
||||
}
|
||||
|
||||
return super::DoTakeDamage(a_TDI);
|
||||
return Super::DoTakeDamage(a_TDI);
|
||||
}
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
|
||||
|
||||
|
||||
class cChicken :
|
||||
class cChicken:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
cChicken(void);
|
||||
|
||||
cChicken();
|
||||
|
||||
CLASS_PROTODEF(cChicken)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cCow::cCow(void) :
|
||||
super("Cow", mtCow, "entity.cow.hurt", "entity.cow.death", "entity.cow.ambient", 0.9, 1.3)
|
||||
Super("Cow", mtCow, "entity.cow.hurt", "entity.cow.death", "entity.cow.ambient", 0.9, 1.3)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cCow::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
short HeldItem = a_Player.GetEquippedItem().m_ItemType;
|
||||
if (HeldItem == E_ITEM_BUCKET)
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
|
||||
class cCow :
|
||||
class cCow:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cCow();
|
||||
|
||||
CLASS_PROTODEF(cCow)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cCreeper::cCreeper(void) :
|
||||
super("Creeper", mtCreeper, "entity.creeper.hurt", "entity.creeper.death", "entity.creeper.ambient", 0.6, 1.8),
|
||||
Super("Creeper", mtCreeper, "entity.creeper.hurt", "entity.creeper.death", "entity.creeper.ambient", 0.6, 1.8),
|
||||
m_bIsBlowing(false),
|
||||
m_bIsCharged(false),
|
||||
m_BurnedWithFlintAndSteel(false),
|
||||
@@ -25,7 +25,7 @@ cCreeper::cCreeper(void) :
|
||||
|
||||
void cCreeper::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -103,7 +103,7 @@ void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
bool cCreeper::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ bool cCreeper::Attack(std::chrono::milliseconds a_Dt)
|
||||
|
||||
void cCreeper::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_FLINT_AND_STEEL))
|
||||
{
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cCreeper :
|
||||
class cCreeper:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cCreeper(void);
|
||||
|
||||
cCreeper();
|
||||
|
||||
CLASS_PROTODEF(cCreeper)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
cEnderDragon::cEnderDragon(void) :
|
||||
// TODO: Vanilla source says this, but is it right? Dragons fly, they don't stand
|
||||
super("EnderDragon", mtEnderDragon, "entity.enderdragon.hurt", "entity.enderdragon.death", "entity.enderdragon.ambient", 16.0, 8.0)
|
||||
Super("EnderDragon", mtEnderDragon, "entity.enderdragon.hurt", "entity.enderdragon.death", "entity.enderdragon.ambient", 16.0, 8.0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cEnderDragon :
|
||||
class cEnderDragon:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cEnderDragon(void);
|
||||
|
||||
cEnderDragon();
|
||||
|
||||
CLASS_PROTODEF(cEnderDragon)
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ protected:
|
||||
|
||||
|
||||
cEnderman::cEnderman(void) :
|
||||
super("Enderman", mtEnderman, "entity.endermen.hurt", "entity.endermen.death", "entity.endermen.ambient", 0.5, 2.9),
|
||||
Super("Enderman", mtEnderman, "entity.endermen.hurt", "entity.endermen.death", "entity.endermen.ambient", 0.5, 2.9),
|
||||
m_bIsScreaming(false),
|
||||
m_CarriedBlock(E_BLOCK_AIR),
|
||||
m_CarriedMeta(0)
|
||||
@@ -131,7 +131,7 @@ void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk)
|
||||
|
||||
void cEnderman::CheckEventLostPlayer(void)
|
||||
{
|
||||
super::CheckEventLostPlayer();
|
||||
Super::CheckEventLostPlayer();
|
||||
EventLosePlayer();
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ void cEnderman::CheckEventLostPlayer(void)
|
||||
|
||||
void cEnderman::EventLosePlayer()
|
||||
{
|
||||
super::EventLosePlayer();
|
||||
Super::EventLosePlayer();
|
||||
m_bIsScreaming = false;
|
||||
GetWorld()->BroadcastEntityMetadata(*this);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ void cEnderman::EventLosePlayer()
|
||||
|
||||
void cEnderman::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cEnderman :
|
||||
class cEnderman:
|
||||
public cPassiveAggressiveMonster
|
||||
{
|
||||
typedef cPassiveAggressiveMonster super;
|
||||
using Super = cPassiveAggressiveMonster;
|
||||
|
||||
public:
|
||||
cEnderman(void);
|
||||
|
||||
cEnderman();
|
||||
|
||||
CLASS_PROTODEF(cEnderman)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cGhast::cGhast(void) :
|
||||
super("Ghast", mtGhast, "entity.ghast.hurt", "entity.ghast.death", "entity.ghast.ambient", 4, 4),
|
||||
Super("Ghast", mtGhast, "entity.ghast.hurt", "entity.ghast.death", "entity.ghast.ambient", 4, 4),
|
||||
m_IsCharging(false),
|
||||
m_FlightCooldown(5),
|
||||
m_TicksUntilShot(10)
|
||||
@@ -64,7 +64,7 @@ bool cGhast::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
return false;
|
||||
}
|
||||
|
||||
return super::DoTakeDamage(a_TDI);
|
||||
return Super::DoTakeDamage(a_TDI);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ bool cGhast::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
|
||||
void cGhast::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cGhast :
|
||||
class cGhast:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cGhast(void);
|
||||
|
||||
cGhast();
|
||||
|
||||
CLASS_PROTODEF(cGhast)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cGiant::cGiant(void) :
|
||||
super("Giant", mtGiant, "entity.zombie.hurt", "entity.zombie.death", "entity.zombie.ambient", 3.6, 10.8)
|
||||
Super("Giant", mtGiant, "entity.zombie.hurt", "entity.zombie.death", "entity.zombie.ambient", 3.6, 10.8)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
|
||||
class cGiant :
|
||||
class cGiant:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cGiant(void);
|
||||
|
||||
CLASS_PROTODEF(cGiant)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cGuardian::cGuardian(void) :
|
||||
super("Guardian", mtGuardian, "entity.guardian.hurt", "entity.guardian.death", "entity.guardian.ambient", 0.875, 0.8)
|
||||
Super("Guardian", mtGuardian, "entity.guardian.hurt", "entity.guardian.death", "entity.guardian.ambient", 0.875, 0.8)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void cGuardian::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
return;
|
||||
}
|
||||
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
|
||||
class cGuardian :
|
||||
class cGuardian:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cGuardian();
|
||||
|
||||
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cHorse::cHorse(int Type, int Color, int Style, int TameTimes) :
|
||||
super("Horse", mtHorse, "entity.horse.hurt", "entity.horse.death", "entity.horse.ambient", 1.4, 1.6),
|
||||
Super("Horse", mtHorse, "entity.horse.hurt", "entity.horse.death", "entity.horse.ambient", 1.4, 1.6),
|
||||
cEntityWindowOwner(this),
|
||||
m_bHasChest(false),
|
||||
m_bIsEating(false),
|
||||
@@ -47,7 +47,7 @@ cHorse::~cHorse()
|
||||
|
||||
void cHorse::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -116,7 +116,7 @@ void cHorse::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
void cHorse::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
if (m_bIsTame)
|
||||
{
|
||||
@@ -272,7 +272,7 @@ void cHorse::InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
// If horse is tame and someone is sitting on it, don't walk around
|
||||
if ((!m_bIsTame) || (m_Attachee == nullptr))
|
||||
{
|
||||
super::InStateIdle(a_Dt, a_Chunk);
|
||||
Super::InStateIdle(a_Dt, a_Chunk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ void cHorse::HandleSpeedFromAttachee(float a_Forward, float a_Sideways)
|
||||
{
|
||||
if ((m_bIsTame) && IsSaddled())
|
||||
{
|
||||
super::HandleSpeedFromAttachee(a_Forward * m_MaxSpeed, a_Sideways * m_MaxSpeed);
|
||||
Super::HandleSpeedFromAttachee(a_Forward * m_MaxSpeed, a_Sideways * m_MaxSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
|
||||
|
||||
|
||||
class cHorse :
|
||||
class cHorse:
|
||||
public cPassiveMonster,
|
||||
public cEntityWindowOwner
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cHorse(int Type, int Color, int Style, int TameTimes);
|
||||
virtual ~cHorse() override;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cIronGolem::cIronGolem(void) :
|
||||
super("IronGolem", mtIronGolem, "entity.irongolem.hurt", "entity.irongolem.death", "entity.irongolem.ambient", 1.4, 2.9)
|
||||
Super("IronGolem", mtIronGolem, "entity.irongolem.hurt", "entity.irongolem.death", "entity.irongolem.ambient", 1.4, 2.9)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cIronGolem :
|
||||
class cIronGolem:
|
||||
public cPassiveAggressiveMonster
|
||||
{
|
||||
typedef cPassiveAggressiveMonster super;
|
||||
using Super = cPassiveAggressiveMonster;
|
||||
|
||||
public:
|
||||
cIronGolem(void);
|
||||
|
||||
cIronGolem();
|
||||
|
||||
CLASS_PROTODEF(cIronGolem)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
cMagmaCube::cMagmaCube(int a_Size) :
|
||||
super("MagmaCube", mtMagmaCube, Printf("entity.%smagmacube.hurt", GetSizeName(a_Size).c_str()), Printf("entity.%smagmacube.death", GetSizeName(a_Size).c_str()), "", 0.6 * a_Size, 0.6 * a_Size),
|
||||
Super("MagmaCube", mtMagmaCube, Printf("entity.%smagmacube.hurt", GetSizeName(a_Size).c_str()), Printf("entity.%smagmacube.death", GetSizeName(a_Size).c_str()), "", 0.6 * a_Size, 0.6 * a_Size),
|
||||
m_Size(a_Size)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
|
||||
|
||||
|
||||
class cMagmaCube :
|
||||
class cMagmaCube:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
/** Creates a MagmaCube of the specified size; with 1 being the smallest */
|
||||
cMagmaCube(int a_Size);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ static const struct
|
||||
// cMonster:
|
||||
|
||||
cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height)
|
||||
: super(etMonster, a_Width, a_Height)
|
||||
: Super(etMonster, a_Width, a_Height)
|
||||
, m_EMState(IDLE)
|
||||
, m_EMPersonality(AGGRESSIVE)
|
||||
, m_PathFinder(a_Width, a_Height)
|
||||
@@ -153,7 +153,7 @@ void cMonster::OnRemoveFromWorld(cWorld & a_World)
|
||||
}
|
||||
}
|
||||
|
||||
super::OnRemoveFromWorld(a_World);
|
||||
Super::OnRemoveFromWorld(a_World);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ void cMonster::OnRemoveFromWorld(cWorld & a_World)
|
||||
void cMonster::Destroyed()
|
||||
{
|
||||
SetTarget(nullptr); // Tell them we're no longer targeting them.
|
||||
super::Destroyed();
|
||||
Super::Destroyed();
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ void cMonster::StopMovingToPosition()
|
||||
|
||||
void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -544,7 +544,7 @@ void cMonster::SetPitchAndYawFromDestination(bool a_IsFollowingPath)
|
||||
void cMonster::HandleFalling()
|
||||
{
|
||||
m_bTouchGround = IsOnGround();
|
||||
super::HandleFalling();
|
||||
Super::HandleFalling();
|
||||
}
|
||||
|
||||
|
||||
@@ -582,7 +582,7 @@ int cMonster::FindFirstNonAirBlockPosition(double a_PosX, double a_PosZ)
|
||||
|
||||
bool cMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -617,7 +617,7 @@ void cMonster::DoMoveToWorld(const cEntity::sWorldChangeInfo & a_WorldChangeInfo
|
||||
SetTarget(nullptr);
|
||||
StopEveryoneFromTargetingMe();
|
||||
|
||||
super::DoMoveToWorld(a_WorldChangeInfo);
|
||||
Super::DoMoveToWorld(a_WorldChangeInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -626,7 +626,7 @@ void cMonster::DoMoveToWorld(const cEntity::sWorldChangeInfo & a_WorldChangeInfo
|
||||
|
||||
void cMonster::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
if (m_SoundHurt != "")
|
||||
{
|
||||
m_World->BroadcastSoundEffect(m_SoundDeath, GetPosition(), 1.0f, 0.8f);
|
||||
@@ -707,7 +707,7 @@ void cMonster::KilledBy(TakeDamageInfo & a_TDI)
|
||||
|
||||
void cMonster::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
const cItem & EquippedItem = a_Player.GetEquippedItem();
|
||||
if ((EquippedItem.m_ItemType == E_ITEM_NAME_TAG) && !EquippedItem.m_CustomName.empty())
|
||||
|
||||
@@ -12,10 +12,16 @@ class cClientHandle;
|
||||
|
||||
|
||||
// tolua_begin
|
||||
class cMonster :
|
||||
class cMonster:
|
||||
public cPawn
|
||||
{
|
||||
typedef cPawn super;
|
||||
|
||||
// tolua_end
|
||||
|
||||
using Super = cPawn;
|
||||
|
||||
// tolua_begin
|
||||
|
||||
public:
|
||||
|
||||
enum eFamily
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cMooshroom::cMooshroom(void) :
|
||||
super("Mooshroom", mtMooshroom, "entity.cow.hurt", "entity.cow.death", "entity.cow.ambient", 0.9, 1.3)
|
||||
Super("Mooshroom", mtMooshroom, "entity.cow.hurt", "entity.cow.death", "entity.cow.ambient", 0.9, 1.3)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cMooshroom :
|
||||
class cMooshroom:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
cMooshroom(void);
|
||||
|
||||
cMooshroom();
|
||||
|
||||
CLASS_PROTODEF(cMooshroom)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
cOcelot::cOcelot(void) :
|
||||
super("Ocelot", mtOcelot, "entity.cat.hurt", "entity.cat.death", "entity.cat.ambient", 0.6, 0.8),
|
||||
Super("Ocelot", mtOcelot, "entity.cat.hurt", "entity.cat.death", "entity.cat.ambient", 0.6, 0.8),
|
||||
m_IsSitting(false),
|
||||
m_IsTame(false),
|
||||
m_IsBegging(false),
|
||||
@@ -36,7 +36,7 @@ cOcelot::cOcelot(void) :
|
||||
|
||||
void cOcelot::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -179,12 +179,12 @@ void cOcelot::OnRightClicked(cPlayer & a_Player)
|
||||
}
|
||||
else
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
}
|
||||
}
|
||||
else if (a_Player.GetUUID() == m_OwnerUUID)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
SetIsSitting(!IsSitting());
|
||||
}
|
||||
m_World->BroadcastEntityMetadata(*this);
|
||||
@@ -220,5 +220,5 @@ bool cOcelot::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
return false;
|
||||
}
|
||||
|
||||
return super::DoTakeDamage(a_TDI);
|
||||
return Super::DoTakeDamage(a_TDI);
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
|
||||
|
||||
class cOcelot :
|
||||
class cOcelot:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cPassiveAggressiveMonster::cPassiveAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height) :
|
||||
super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_SoundAmbient, a_Width, a_Height)
|
||||
Super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_SoundAmbient, a_Width, a_Height)
|
||||
{
|
||||
m_EMPersonality = PASSIVE;
|
||||
}
|
||||
@@ -21,7 +21,7 @@ cPassiveAggressiveMonster::cPassiveAggressiveMonster(const AString & a_ConfigNam
|
||||
|
||||
bool cPassiveAggressiveMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7,13 +7,22 @@
|
||||
|
||||
|
||||
|
||||
class cPassiveAggressiveMonster :
|
||||
class cPassiveAggressiveMonster:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cPassiveAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height);
|
||||
|
||||
cPassiveAggressiveMonster(
|
||||
const AString & a_ConfigName,
|
||||
eMonsterType a_MobType,
|
||||
const AString & a_SoundHurt,
|
||||
const AString & a_SoundDeath,
|
||||
const AString & a_SoundAmbient,
|
||||
double a_Width,
|
||||
double a_Height
|
||||
);
|
||||
|
||||
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
|
||||
virtual void EventSeePlayer(cPlayer *, cChunk & a_Chunk) override;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cPassiveMonster::cPassiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height) :
|
||||
super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_SoundAmbient, a_Width, a_Height),
|
||||
Super(a_ConfigName, a_MobType, a_SoundHurt, a_SoundDeath, a_SoundAmbient, a_Width, a_Height),
|
||||
m_LovePartner(nullptr),
|
||||
m_LoveTimer(0),
|
||||
m_LoveCooldown(0),
|
||||
@@ -26,7 +26,7 @@ cPassiveMonster::cPassiveMonster(const AString & a_ConfigName, eMonsterType a_Mo
|
||||
|
||||
bool cPassiveMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ void cPassiveMonster::Destroyed()
|
||||
{
|
||||
m_LovePartner->ResetLoveMode();
|
||||
}
|
||||
super::Destroyed();
|
||||
Super::Destroyed();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ void cPassiveMonster::Destroyed()
|
||||
|
||||
void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -206,7 +206,7 @@ void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
void cPassiveMonster::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
const cItem & EquippedItem = a_Player.GetEquippedItem();
|
||||
|
||||
|
||||
@@ -7,13 +7,22 @@
|
||||
|
||||
|
||||
|
||||
class cPassiveMonster :
|
||||
class cPassiveMonster:
|
||||
public cMonster
|
||||
{
|
||||
typedef cMonster super;
|
||||
using Super = cMonster;
|
||||
|
||||
public:
|
||||
cPassiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, const AString & a_SoundAmbient, double a_Width, double a_Height);
|
||||
|
||||
cPassiveMonster(
|
||||
const AString & a_ConfigName,
|
||||
eMonsterType a_MobType,
|
||||
const AString & a_SoundHurt,
|
||||
const AString & a_SoundDeath,
|
||||
const AString & a_SoundAmbient,
|
||||
double a_Width,
|
||||
double a_Height
|
||||
);
|
||||
|
||||
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
||||
virtual void OnRightClicked(cPlayer & a_Player) override;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cPig::cPig(void) :
|
||||
super("Pig", mtPig, "entity.pig.hurt", "entity.pig.death", "entity.pig.ambient", 0.9, 0.9),
|
||||
Super("Pig", mtPig, "entity.pig.hurt", "entity.pig.death", "entity.pig.ambient", 0.9, 0.9),
|
||||
m_bIsSaddled(false)
|
||||
{
|
||||
}
|
||||
@@ -44,7 +44,7 @@ void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cPig::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
if (m_bIsSaddled)
|
||||
{
|
||||
@@ -89,7 +89,7 @@ void cPig::OnRightClicked(cPlayer & a_Player)
|
||||
|
||||
void cPig::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -112,7 +112,7 @@ void cPig::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
bool cPig::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cPig :
|
||||
class cPig:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
cPig(void);
|
||||
|
||||
cPig();
|
||||
|
||||
CLASS_PROTODEF(cPig)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ cRabbit::cRabbit(void) :
|
||||
|
||||
|
||||
cRabbit::cRabbit(eRabbitType Type, int MoreCarrotTicks) :
|
||||
super("Rabbit", mtRabbit, "entity.rabbit.hurt", "entity.rabbit.death", "entity.rabbit.ambient", 0.82, 0.68),
|
||||
Super("Rabbit", mtRabbit, "entity.rabbit.hurt", "entity.rabbit.death", "entity.rabbit.ambient", 0.82, 0.68),
|
||||
m_Type(Type),
|
||||
m_MoreCarrotTicks(MoreCarrotTicks)
|
||||
{
|
||||
|
||||
@@ -22,12 +22,13 @@ enum class eRabbitType : UInt8
|
||||
|
||||
|
||||
|
||||
class cRabbit :
|
||||
class cRabbit:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cRabbit();
|
||||
cRabbit(eRabbitType Type, int MoreCarrotTicks = 0);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
cSheep::cSheep(int a_Color) :
|
||||
super("Sheep", mtSheep, "entity.sheep.hurt", "entity.sheep.death", "entity.sheep.ambient", 0.6, 1.3),
|
||||
Super("Sheep", mtSheep, "entity.sheep.hurt", "entity.sheep.death", "entity.sheep.ambient", 0.6, 1.3),
|
||||
m_IsSheared(false),
|
||||
m_WoolColor(a_Color),
|
||||
m_TimeToStopEating(-1)
|
||||
@@ -59,7 +59,7 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cSheep::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
const cItem & EquippedItem = a_Player.GetEquippedItem();
|
||||
if ((EquippedItem.m_ItemType == E_ITEM_SHEARS) && !IsSheared() && !IsBaby())
|
||||
@@ -91,7 +91,7 @@ void cSheep::OnRightClicked(cPlayer & a_Player)
|
||||
|
||||
void cSheep::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
|
||||
|
||||
class cSheep :
|
||||
class cSheep:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
|
||||
|
||||
|
||||
class cSilverfish :
|
||||
class cSilverfish:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cSilverfish(void) :
|
||||
super("Silverfish", mtSilverfish, "entity.silverfish.hurt", "entity.silverfish.death", "entity.silverfish.ambient", 0.3, 0.4)
|
||||
|
||||
cSilverfish():
|
||||
Super("Silverfish", mtSilverfish, "entity.silverfish.hurt", "entity.silverfish.death", "entity.silverfish.ambient", 0.3, 0.4)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cSkeleton::cSkeleton(void) :
|
||||
super("Skeleton", mtSkeleton, "entity.skeleton.hurt", "entity.skeleton.death", "entity.skeleton.ambient", 0.6, 1.8)
|
||||
Super("Skeleton", mtSkeleton, "entity.skeleton.hurt", "entity.skeleton.death", "entity.skeleton.ambient", 0.6, 1.8)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ bool cSkeleton::Attack(std::chrono::milliseconds a_Dt)
|
||||
|
||||
void cSkeleton::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
super::SpawnOn(a_ClientHandle);
|
||||
Super::SpawnOn(a_ClientHandle);
|
||||
a_ClientHandle.SendEntityEquipment(*this, 0, cItem(E_ITEM_BOW));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cSkeleton :
|
||||
class cSkeleton:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cSkeleton(void);
|
||||
|
||||
cSkeleton();
|
||||
|
||||
CLASS_PROTODEF(cSkeleton)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cSlime::cSlime(int a_Size) :
|
||||
super("Slime",
|
||||
Super("Slime",
|
||||
mtSlime,
|
||||
Printf("entity.%sslime.hurt", GetSizeName(a_Size).c_str()),
|
||||
Printf("entity.%sslime.death", GetSizeName(a_Size).c_str()),
|
||||
@@ -52,7 +52,7 @@ bool cSlime::Attack(std::chrono::milliseconds a_Dt)
|
||||
if (m_Size > 1)
|
||||
{
|
||||
// Only slimes larger than size 1 attack a player.
|
||||
return super::Attack(a_Dt);
|
||||
return Super::Attack(a_Dt);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -85,7 +85,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI)
|
||||
m_World->SpawnMobFinalize(std::move(NewSlime));
|
||||
}
|
||||
}
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
|
||||
class cSlime :
|
||||
class cSlime:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
/** Creates a slime of the specified size; size can be 1, 2 or 4, with 1 is the smallest and 4 is the tallest. */
|
||||
cSlime(int a_Size);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cSnowGolem::cSnowGolem(void) :
|
||||
super("SnowGolem", mtSnowGolem, "entity.snowman.hurt", "entity.snowman.death", "entity.snowman.ambient", 0.4, 1.8)
|
||||
Super("SnowGolem", mtSnowGolem, "entity.snowman.hurt", "entity.snowman.death", "entity.snowman.ambient", 0.4, 1.8)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ void cSnowGolem::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cSnowGolem::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cSnowGolem :
|
||||
class cSnowGolem:
|
||||
public cPassiveAggressiveMonster
|
||||
{
|
||||
typedef cPassiveAggressiveMonster super;
|
||||
using Super = cPassiveAggressiveMonster;
|
||||
|
||||
public:
|
||||
cSnowGolem(void);
|
||||
|
||||
cSnowGolem();
|
||||
|
||||
CLASS_PROTODEF(cSnowGolem)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cSpider::cSpider(void) :
|
||||
super("Spider", mtSpider, "entity.spider.hurt", "entity.spider.death", "entity.spider.ambient", 1.4, 0.9)
|
||||
Super("Spider", mtSpider, "entity.spider.hurt", "entity.spider.death", "entity.spider.ambient", 1.4, 0.9)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ void cSpider::EventSeePlayer(cPlayer * a_Player, cChunk & a_Chunk)
|
||||
!((Chunk->GetSkyLightAltered(Rel.x, Rel.y, Rel.z) > 11) || (Chunk->GetBlockLight(Rel.x, Rel.y, Rel.z) > 11))
|
||||
)
|
||||
{
|
||||
super::EventSeePlayer(a_Player, a_Chunk);
|
||||
Super::EventSeePlayer(a_Player, a_Chunk);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void cSpider::EventSeePlayer(cPlayer * a_Player, cChunk & a_Chunk)
|
||||
|
||||
bool cSpider::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cSpider :
|
||||
class cSpider:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cSpider(void);
|
||||
|
||||
cSpider();
|
||||
|
||||
CLASS_PROTODEF(cSpider)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cSquid::cSquid(void) :
|
||||
super("Squid", mtSquid, "entity.squid.hurt", "entity.squid.death", "entity.squid.ambient", 0.95, 0.95)
|
||||
Super("Squid", mtSquid, "entity.squid.hurt", "entity.squid.death", "entity.squid.ambient", 0.95, 0.95)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -77,5 +77,5 @@ void cSquid::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
m_AirTickTimer = DROWNING_TICKS;
|
||||
}
|
||||
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
}
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
|
||||
class cSquid :
|
||||
class cSquid:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cSquid();
|
||||
|
||||
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
cVillager::cVillager(eVillagerType VillagerType) :
|
||||
super("Villager", mtVillager, "entity.villager.hurt", "entity.villager.death", "entity.villager.ambient", 0.6, 1.8),
|
||||
Super("Villager", mtVillager, "entity.villager.hurt", "entity.villager.death", "entity.villager.ambient", 0.6, 1.8),
|
||||
m_ActionCountDown(-1),
|
||||
m_Type(VillagerType),
|
||||
m_VillagerAction(false)
|
||||
@@ -25,7 +25,7 @@ cVillager::cVillager(eVillagerType VillagerType) :
|
||||
|
||||
bool cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ bool cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
|
||||
void cVillager::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -110,7 +110,7 @@ void cVillager::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
void cVillager::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
|
||||
// TODO: 0% chance on Easy, 50% chance on Normal and 100% chance on Hard
|
||||
if (GetRandomProvider().RandBool(0.5) && (a_TDI.Attacker != nullptr) && (a_TDI.Attacker->IsMob()))
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
|
||||
|
||||
class cVillager :
|
||||
class cVillager:
|
||||
public cPassiveMonster
|
||||
{
|
||||
typedef cPassiveMonster super;
|
||||
using Super = cPassiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cWitch::cWitch(void) :
|
||||
super("Witch", mtWitch, "entity.witch.hurt", "entity.witch.death", "entity.witch.ambient", 0.6, 1.8)
|
||||
Super("Witch", mtWitch, "entity.witch.hurt", "entity.witch.death", "entity.witch.ambient", 0.6, 1.8)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
|
||||
class cWitch :
|
||||
class cWitch:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cWitch();
|
||||
|
||||
CLASS_PROTODEF(cWitch)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cWither::cWither(void) :
|
||||
super("Wither", mtWither, "entity.wither.hurt", "entity.wither.death", "entity.wither.ambient", 0.9, 4.0),
|
||||
Super("Wither", mtWither, "entity.wither.hurt", "entity.wither.death", "entity.wither.ambient", 0.9, 4.0),
|
||||
m_WitherInvulnerableTicks(220)
|
||||
{
|
||||
SetMaxHealth(300);
|
||||
@@ -48,7 +48,7 @@ bool cWither::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
return false;
|
||||
}
|
||||
|
||||
return super::DoTakeDamage(a_TDI);
|
||||
return Super::DoTakeDamage(a_TDI);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ bool cWither::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
|
||||
void cWither::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -99,7 +99,7 @@ void cWither::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cWither::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
|
||||
Vector3d Pos = GetPosition();
|
||||
m_World->ForEachPlayer([=](cPlayer & a_Player)
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cWither :
|
||||
class cWither:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cWither(void);
|
||||
|
||||
cWither();
|
||||
|
||||
CLASS_PROTODEF(cWither)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cWitherSkeleton::cWitherSkeleton(void) :
|
||||
super("WitherSkeleton", mtWitherSkeleton, "entity.wither_skeleton.hurt", "entity.wither_skeleton.death", "entity.wither_skeleton.ambient", 0.7, 2.4)
|
||||
Super("WitherSkeleton", mtWitherSkeleton, "entity.wither_skeleton.hurt", "entity.wither_skeleton.death", "entity.wither_skeleton.ambient", 0.7, 2.4)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ bool cWitherSkeleton::Attack(std::chrono::milliseconds a_Dt)
|
||||
}
|
||||
|
||||
GetTarget()->AddEntityEffect(cEntityEffect::effWither, 200, 0);
|
||||
return super::Attack(a_Dt);
|
||||
return Super::Attack(a_Dt);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,6 @@ void cWitherSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cWitherSkeleton::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
super::SpawnOn(a_ClientHandle);
|
||||
Super::SpawnOn(a_ClientHandle);
|
||||
a_ClientHandle.SendEntityEquipment(*this, 0, cItem(E_ITEM_STONE_SWORD));
|
||||
}
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
|
||||
|
||||
|
||||
class cWitherSkeleton :
|
||||
class cWitherSkeleton:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
cWitherSkeleton(void);
|
||||
|
||||
cWitherSkeleton();
|
||||
|
||||
CLASS_PROTODEF(cWitherSkeleton)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cWolf::cWolf(void) :
|
||||
super("Wolf", mtWolf, "entity.wolf.hurt", "entity.wolf.death", "entity.wolf.ambient", 0.6, 0.8),
|
||||
Super("Wolf", mtWolf, "entity.wolf.hurt", "entity.wolf.death", "entity.wolf.ambient", 0.6, 0.8),
|
||||
m_IsSitting(false),
|
||||
m_IsTame(false),
|
||||
m_IsBegging(false),
|
||||
@@ -30,7 +30,7 @@ cWolf::cWolf(void) :
|
||||
bool cWolf::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
cPawn * PreviousTarget = GetTarget();
|
||||
if (!super::DoTakeDamage(a_TDI))
|
||||
if (!Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ bool cWolf::Attack(std::chrono::milliseconds a_Dt)
|
||||
}
|
||||
|
||||
NotifyAlliesOfFight(static_cast<cPawn*>(GetTarget()));
|
||||
return super::Attack(a_Dt);
|
||||
return Super::Attack(a_Dt);
|
||||
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ void cWolf::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
}
|
||||
else
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
}
|
||||
|
||||
if (!IsTicking())
|
||||
|
||||
@@ -9,13 +9,14 @@ class cEntity;
|
||||
|
||||
|
||||
|
||||
class cWolf :
|
||||
class cWolf:
|
||||
public cPassiveAggressiveMonster
|
||||
{
|
||||
typedef cPassiveAggressiveMonster super;
|
||||
using Super = cPassiveAggressiveMonster;
|
||||
|
||||
public:
|
||||
cWolf(void);
|
||||
|
||||
cWolf();
|
||||
|
||||
CLASS_PROTODEF(cWolf)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cZombie::cZombie() :
|
||||
super("Zombie", mtZombie, "entity.zombie.hurt", "entity.zombie.death", "entity.zombie.ambient", 0.6, 1.8)
|
||||
Super("Zombie", mtZombie, "entity.zombie.hurt", "entity.zombie.death", "entity.zombie.ambient", 0.6, 1.8)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
|
||||
|
||||
|
||||
class cZombie :
|
||||
class cZombie:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cZombie();
|
||||
|
||||
CLASS_PROTODEF(cZombie)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cZombiePigman::cZombiePigman(void) :
|
||||
super("ZombiePigman", mtZombiePigman, "entity.zombie_pig.hurt", "entity.zombie_pig.death", "entity.zombie_pig.ambient", 0.6, 1.8)
|
||||
Super("ZombiePigman", mtZombiePigman, "entity.zombie_pig.hurt", "entity.zombie_pig.death", "entity.zombie_pig.ambient", 0.6, 1.8)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void cZombiePigman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cZombiePigman::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
super::SpawnOn(a_ClientHandle);
|
||||
Super::SpawnOn(a_ClientHandle);
|
||||
a_ClientHandle.SendEntityEquipment(*this, 0, cItem(E_ITEM_GOLD_SWORD));
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void cZombiePigman::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
|
||||
void cZombiePigman::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
|
||||
if ((a_TDI.Attacker != nullptr) && (a_TDI.Attacker->IsPlayer()))
|
||||
{
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
|
||||
|
||||
|
||||
class cZombiePigman :
|
||||
class cZombiePigman:
|
||||
public cPassiveAggressiveMonster
|
||||
{
|
||||
typedef cPassiveAggressiveMonster super;
|
||||
using Super = cPassiveAggressiveMonster;
|
||||
|
||||
public:
|
||||
cZombiePigman(void);
|
||||
|
||||
cZombiePigman();
|
||||
|
||||
CLASS_PROTODEF(cZombiePigman)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cZombieVillager::cZombieVillager(cVillager::eVillagerType a_Profession) :
|
||||
super("ZombieVillager", mtZombieVillager, "entity.zombie_villager.hurt", "entity.zombie_villager.death", "entity.ambient", 0.6, 1.8),
|
||||
Super("ZombieVillager", mtZombieVillager, "entity.zombie_villager.hurt", "entity.zombie_villager.death", "entity.ambient", 0.6, 1.8),
|
||||
m_ConversionTime(-1),
|
||||
m_Profession(a_Profession)
|
||||
{
|
||||
@@ -45,7 +45,7 @@ void cZombieVillager::GetDrops(cItems & a_Drops, cEntity * a_Killer)
|
||||
|
||||
void cZombieVillager::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -72,7 +72,7 @@ void cZombieVillager::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
void cZombieVillager::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
const cItem & EquippedItem = a_Player.GetEquippedItem();
|
||||
if ((EquippedItem.m_ItemType == E_ITEM_GOLDEN_APPLE) && GetEntityEffect(cEntityEffect::effWeakness) != nullptr)
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
|
||||
|
||||
class cZombieVillager :
|
||||
class cZombieVillager:
|
||||
public cAggressiveMonster
|
||||
{
|
||||
typedef cAggressiveMonster super;
|
||||
using Super = cAggressiveMonster;
|
||||
|
||||
public:
|
||||
|
||||
cZombieVillager(cVillager::eVillagerType a_Profession);
|
||||
|
||||
CLASS_PROTODEF(cZombieVillager)
|
||||
|
||||
Reference in New Issue
Block a user