1
0
Fork 0

Merge pull request #1956 from Tri125/master

Fixed Magma cube sound and spawn size
This commit is contained in:
Mattes D 2015-05-09 12:44:57 +02:00
commit 92b8cd2f2a
5 changed files with 20 additions and 6 deletions

View File

@ -7,7 +7,7 @@
cMagmaCube::cMagmaCube(int a_Size) :
super("MagmaCube", mtMagmaCube, "mob.MagmaCube.big", "mob.MagmaCube.big", 0.6 * a_Size, 0.6 * a_Size),
super("MagmaCube", mtMagmaCube, Printf("mob.magmacube.%s", GetSizeName(a_Size).c_str()), Printf("mob.magmacube.%s", GetSizeName(a_Size).c_str()), 0.6 * a_Size, 0.6 * a_Size),
m_Size(a_Size)
{
}
@ -27,4 +27,14 @@ void cMagmaCube::GetDrops(cItems & a_Drops, cEntity * a_Killer)
AString cMagmaCube::GetSizeName(int a_Size)
{
if (a_Size > 1)
{
return "big";
}
else
{
return "small";
}
}

View File

@ -19,10 +19,14 @@ public:
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr) override;
int GetSize(void) const { return m_Size; }
/** Returns the text describing the slime's size, as used by the client's resource subsystem for sounds.
Returns either "big" or "small". */
static AString GetSizeName(int a_Size);
protected:
/// Size of the MagmaCube, 1 .. 3, with 1 being the smallest
/// Size of the MagmaCube, 1, 2 and 4, with 1 being the smallest
int m_Size;
} ;

View File

@ -960,7 +960,7 @@ cMonster * cMonster::NewMonsterFromType(eMonsterType a_MobType)
{
case mtMagmaCube:
{
toReturn = new cMagmaCube(Random.NextInt(2) + 1);
toReturn = new cMagmaCube(1 << Random.NextInt(3)); // Size 1, 2 or 4
break;
}
case mtSlime:

View File

@ -89,7 +89,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI)
const AString cSlime::GetSizeName(int a_Size) const
AString cSlime::GetSizeName(int a_Size)
{
if (a_Size > 1)
{

View File

@ -27,7 +27,7 @@ public:
/** Returns the text describing the slime's size, as used by the client's resource subsystem for sounds.
Returns either "big" or "small". */
const AString GetSizeName(int a_Size) const;
static AString GetSizeName(int a_Size);
protected: