diff options
Diffstat (limited to '')
-rw-r--r-- | VC2008/MCServer.vcproj | 40 | ||||
-rw-r--r-- | source/Items/ItemSpawnEgg.h | 119 | ||||
-rw-r--r-- | source/Mobs/Blaze.cpp | 49 | ||||
-rw-r--r-- | source/Mobs/Blaze.h | 14 | ||||
-rw-r--r-- | source/Mobs/Magmacube.cpp | 49 | ||||
-rw-r--r-- | source/Mobs/Magmacube.h | 14 | ||||
-rw-r--r-- | source/Mobs/Mooshroom.cpp | 56 | ||||
-rw-r--r-- | source/Mobs/Mooshroom.h | 14 | ||||
-rw-r--r-- | source/Mobs/Ocelot.cpp | 45 | ||||
-rw-r--r-- | source/Mobs/Ocelot.h | 14 | ||||
-rw-r--r-- | source/Mobs/Villager.cpp | 45 | ||||
-rw-r--r-- | source/Mobs/Villager.h | 14 |
12 files changed, 471 insertions, 2 deletions
diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj index 88fa40b65..83596b82c 100644 --- a/VC2008/MCServer.vcproj +++ b/VC2008/MCServer.vcproj @@ -727,6 +727,14 @@ >
</File>
<File
+ RelativePath="..\source\Mobs\Blaze.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\source\Mobs\Blaze.h"
+ >
+ </File>
+ <File
RelativePath="..\source\Mobs\Cavespider.cpp"
>
</File>
@@ -775,6 +783,14 @@ >
</File>
<File
+ RelativePath="..\source\Mobs\Magmacube.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\source\Mobs\Magmacube.h"
+ >
+ </File>
+ <File
RelativePath="..\source\Mobs\Monster.cpp"
>
</File>
@@ -783,6 +799,22 @@ >
</File>
<File
+ RelativePath="..\source\Mobs\Mooshroom.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\source\Mobs\Mooshroom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\source\Mobs\Ocelot.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\source\Mobs\Ocelot.h"
+ >
+ </File>
+ <File
RelativePath="..\source\Mobs\PassiveAggressiveMonster.cpp"
>
</File>
@@ -855,6 +887,14 @@ >
</File>
<File
+ RelativePath="..\source\Mobs\Villager.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\source\Mobs\Villager.h"
+ >
+ </File>
+ <File
RelativePath="..\source\Mobs\Wolf.cpp"
>
</File>
diff --git a/source/Items/ItemSpawnEgg.h b/source/Items/ItemSpawnEgg.h index fb040c6ea..974129d6f 100644 --- a/source/Items/ItemSpawnEgg.h +++ b/source/Items/ItemSpawnEgg.h @@ -22,6 +22,11 @@ #include "../Mobs/Cavespider.h"
#include "../Mobs/Ghast.h"
#include "../Mobs/Zombiepigman.h"
+#include "../Mobs/Villager.h"
+#include "../Mobs/Ocelot.h"
+#include "../Mobs/Mooshroom.h"
+#include "../Mobs/Magmacube.h"
+#include "../Mobs/Blaze.h"
@@ -53,8 +58,118 @@ public: cMonster * Monster = NULL;
- Monster = new cZombie();
-
+ switch (a_Item->m_ItemDamage)
+ {
+ case E_META_SPAWN_EGG_BLAZE:
+ {
+ Monster = new cBlaze();
+ break;
+ }
+ case E_META_SPAWN_EGG_CAVE_SPIDER:
+ {
+ Monster = new cCavespider();
+ break;
+ }
+ case E_META_SPAWN_EGG_CHICKEN:
+ {
+ Monster = new cChicken();
+ break;
+ }
+ case E_META_SPAWN_EGG_COW:
+ {
+ Monster = new cCow();
+ break;
+ }
+ case E_META_SPAWN_EGG_CREEPER:
+ {
+ Monster = new cCreeper();
+ break;
+ }
+ case E_META_SPAWN_EGG_ENDERMAN:
+ {
+ Monster = new cEnderman();
+ break;
+ }
+ case E_META_SPAWN_EGG_GHAST:
+ {
+ Monster = new cGhast();
+ break;
+ }
+ case E_META_SPAWN_EGG_MAGMA_CUBE:
+ {
+ Monster = new cMagmacube();
+ break;
+ }
+ case E_META_SPAWN_EGG_MOOSHROOM:
+ {
+ Monster = new cMooshroom();
+ break;
+ }
+ case E_META_SPAWN_EGG_OCELOT:
+ {
+ Monster = new cOcelot();
+ break;
+ }
+ case E_META_SPAWN_EGG_PIG:
+ {
+ Monster = new cPig();
+ break;
+ }
+ case E_META_SPAWN_EGG_SHEEP:
+ {
+ Monster = new cSheep();
+ break;
+ }
+ case E_META_SPAWN_EGG_SILVERFISH:
+ {
+ Monster = new cSilverfish();
+ break;
+ }
+ case E_META_SPAWN_EGG_SKELETON:
+ {
+ Monster = new cSkeleton();
+ break;
+ }
+ case E_META_SPAWN_EGG_SLIME:
+ {
+ Monster = new cSlime();
+ break;
+ }
+ case E_META_SPAWN_EGG_SPIDER:
+ {
+ Monster = new cSpider();
+ break;
+ }
+ case E_META_SPAWN_EGG_SQUID:
+ {
+ Monster = new cSquid();
+ break;
+ }
+ case E_META_SPAWN_EGG_VILLAGER:
+ {
+ Monster = new cVillager();
+ break;
+ }
+ case E_META_SPAWN_EGG_WOLF:
+ {
+ Monster = new cWolf();
+ break;
+ }
+ case E_META_SPAWN_EGG_ZOMBIE:
+ {
+ Monster = new cZombie();
+ break;
+ }
+ case E_META_SPAWN_EGG_ZOMBIE_PIGMAN:
+ {
+ Monster = new cZombiepigman();
+ break;
+ }
+ default:
+ {
+ return false;
+ }
+ }
Monster->Initialize(a_World);
Monster->TeleportTo(a_BlockX + 0.5, a_BlockY, a_BlockZ + 0.5);
a_World->BroadcastSpawn(*Monster);
diff --git a/source/Mobs/Blaze.cpp b/source/Mobs/Blaze.cpp new file mode 100644 index 000000000..c3e68518f --- /dev/null +++ b/source/Mobs/Blaze.cpp @@ -0,0 +1,49 @@ +
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "Blaze.h"
+
+
+
+
+
+cBlaze::cBlaze()
+{
+ m_MobType = 61;
+ GetMonsterConfig("Blaze");
+}
+
+
+
+
+
+cBlaze::~cBlaze()
+{
+}
+
+
+
+
+
+bool cBlaze::IsA( const char* a_EntityType )
+{
+ if( strcmp( a_EntityType, "cBlaze" ) == 0 ) return true;
+ return cMonster::IsA( a_EntityType );
+}
+
+
+
+
+
+void cBlaze::KilledBy( cEntity* a_Killer )
+{
+ cItems Drops;
+ AddRandomDropItem(Drops, 0, 1, E_ITEM_BLAZE_ROD);
+ m_World->SpawnItemPickups(Drops, m_Pos.x, m_Pos.y, m_Pos.z);
+
+ cMonster::KilledBy( a_Killer );
+}
+
+
+
+
diff --git a/source/Mobs/Blaze.h b/source/Mobs/Blaze.h new file mode 100644 index 000000000..bd722d529 --- /dev/null +++ b/source/Mobs/Blaze.h @@ -0,0 +1,14 @@ +#pragma once
+
+#include "AggressiveMonster.h"
+
+class cBlaze : public cAggressiveMonster
+{
+public:
+ cBlaze();
+ ~cBlaze();
+
+ virtual bool IsA( const char* a_EntityType );
+
+ virtual void KilledBy( cEntity* a_Killer );
+};
diff --git a/source/Mobs/Magmacube.cpp b/source/Mobs/Magmacube.cpp new file mode 100644 index 000000000..d73041baf --- /dev/null +++ b/source/Mobs/Magmacube.cpp @@ -0,0 +1,49 @@ +
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "Magmacube.h"
+
+
+
+
+
+cMagmacube::cMagmacube()
+{
+ m_MobType = 62;
+ GetMonsterConfig("Magmacube");
+}
+
+
+
+
+
+cMagmacube::~cMagmacube()
+{
+}
+
+
+
+
+
+bool cMagmacube::IsA( const char* a_EntityType )
+{
+ if( strcmp( a_EntityType, "cMagmacube" ) == 0 ) return true;
+ return cMonster::IsA( a_EntityType );
+}
+
+
+
+
+
+void cMagmacube::KilledBy( cEntity* a_Killer )
+{
+ cItems Drops;
+ AddRandomDropItem(Drops, 0, 1, E_ITEM_MAGMA_CREAM);
+ m_World->SpawnItemPickups(Drops, m_Pos.x, m_Pos.y, m_Pos.z);
+
+ cMonster::KilledBy( a_Killer );
+}
+
+
+
+
diff --git a/source/Mobs/Magmacube.h b/source/Mobs/Magmacube.h new file mode 100644 index 000000000..1a36ef2c1 --- /dev/null +++ b/source/Mobs/Magmacube.h @@ -0,0 +1,14 @@ +#pragma once
+
+#include "AggressiveMonster.h"
+
+class cMagmacube : public cAggressiveMonster
+{
+public:
+ cMagmacube();
+ ~cMagmacube();
+
+ virtual bool IsA( const char* a_EntityType );
+
+ virtual void KilledBy( cEntity* a_Killer );
+};
diff --git a/source/Mobs/Mooshroom.cpp b/source/Mobs/Mooshroom.cpp new file mode 100644 index 000000000..f70349e97 --- /dev/null +++ b/source/Mobs/Mooshroom.cpp @@ -0,0 +1,56 @@ +
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "Mooshroom.h"
+
+
+
+
+
+// TODO: Milk Cow
+
+
+
+
+
+cMooshroom::cMooshroom()
+{
+ m_MobType = 96;
+ GetMonsterConfig("Mooshroom");
+}
+
+
+
+
+
+cMooshroom::~cMooshroom()
+{
+}
+
+
+
+
+
+bool cMooshroom::IsA( const char* a_EntityType )
+{
+ if( strcmp( a_EntityType, "cMooshroom" ) == 0 ) return true;
+ return cMonster::IsA( a_EntityType );
+}
+
+
+
+
+
+void cMooshroom::KilledBy( cEntity* a_Killer )
+{
+ cItems Drops;
+ AddRandomDropItem(Drops, 0, 2, E_ITEM_LEATHER);
+ AddRandomDropItem(Drops, 1, 3, (GetMetaData() == BURNING) ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
+ m_World->SpawnItemPickups(Drops, m_Pos.x, m_Pos.y, m_Pos.z);
+
+ cMonster::KilledBy( a_Killer );
+}
+
+
+
+
diff --git a/source/Mobs/Mooshroom.h b/source/Mobs/Mooshroom.h new file mode 100644 index 000000000..ea8ed5b08 --- /dev/null +++ b/source/Mobs/Mooshroom.h @@ -0,0 +1,14 @@ +#pragma once
+
+#include "PassiveMonster.h"
+
+class cMooshroom : public cPassiveMonster
+{
+public:
+ cMooshroom();
+ ~cMooshroom();
+
+ virtual bool IsA( const char* a_EntityType );
+
+ virtual void KilledBy( cEntity* a_Killer );
+};
diff --git a/source/Mobs/Ocelot.cpp b/source/Mobs/Ocelot.cpp new file mode 100644 index 000000000..ec50a9656 --- /dev/null +++ b/source/Mobs/Ocelot.cpp @@ -0,0 +1,45 @@ +
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "Ocelot.h"
+
+
+
+
+
+cOcelot::cOcelot()
+{
+ m_MobType = 98;
+ GetMonsterConfig("Ocelot");
+}
+
+
+
+
+
+cOcelot::~cOcelot()
+{
+}
+
+
+
+
+
+bool cOcelot::IsA( const char* a_EntityType )
+{
+ if( strcmp( a_EntityType, "cOcelot" ) == 0 ) return true;
+ return cMonster::IsA( a_EntityType );
+}
+
+
+
+
+
+void cOcelot::KilledBy( cEntity* a_Killer )
+{
+ cMonster::KilledBy( a_Killer );
+}
+
+
+
+
diff --git a/source/Mobs/Ocelot.h b/source/Mobs/Ocelot.h new file mode 100644 index 000000000..87571022f --- /dev/null +++ b/source/Mobs/Ocelot.h @@ -0,0 +1,14 @@ +#pragma once
+
+#include "PassiveMonster.h"
+
+class cOcelot : public cPassiveMonster
+{
+public:
+ cOcelot();
+ ~cOcelot();
+
+ virtual bool IsA( const char* a_EntityType );
+
+ virtual void KilledBy( cEntity* a_Killer );
+};
diff --git a/source/Mobs/Villager.cpp b/source/Mobs/Villager.cpp new file mode 100644 index 000000000..65b2ac5b5 --- /dev/null +++ b/source/Mobs/Villager.cpp @@ -0,0 +1,45 @@ +
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
+#include "Villager.h"
+
+
+
+
+
+cVillager::cVillager()
+{
+ m_MobType = 120;
+ GetMonsterConfig("Villager");
+}
+
+
+
+
+
+cVillager::~cVillager()
+{
+}
+
+
+
+
+
+bool cVillager::IsA( const char* a_EntityType )
+{
+ if( strcmp( a_EntityType, "cVillager" ) == 0 ) return true;
+ return cMonster::IsA( a_EntityType );
+}
+
+
+
+
+
+void cVillager::KilledBy( cEntity* a_Killer )
+{
+ cMonster::KilledBy( a_Killer );
+}
+
+
+
+
diff --git a/source/Mobs/Villager.h b/source/Mobs/Villager.h new file mode 100644 index 000000000..02272378b --- /dev/null +++ b/source/Mobs/Villager.h @@ -0,0 +1,14 @@ +#pragma once
+
+#include "PassiveMonster.h"
+
+class cVillager : public cPassiveMonster
+{
+public:
+ cVillager();
+ ~cVillager();
+
+ virtual bool IsA( const char* a_EntityType );
+
+ virtual void KilledBy( cEntity* a_Killer );
+};
|