Added Bats and Witches.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1021 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
4b998cfedc
commit
77064aa486
@ -726,6 +726,14 @@
|
||||
RelativePath="..\source\Mobs\AggressiveMonster.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Mobs\Bat.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Mobs\Bat.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Mobs\Blaze.cpp"
|
||||
>
|
||||
@ -894,6 +902,14 @@
|
||||
RelativePath="..\source\Mobs\Villager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Mobs\Witch.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Mobs\Witch.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Mobs\Wolf.cpp"
|
||||
>
|
||||
|
45
source/Mobs/Bat.cpp
Normal file
45
source/Mobs/Bat.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
||||
|
||||
#include "Bat.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cBat::cBat()
|
||||
{
|
||||
m_MobType = 65;
|
||||
GetMonsterConfig("Bat");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cBat::~cBat()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool cBat::IsA( const char* a_EntityType )
|
||||
{
|
||||
if( strcmp( a_EntityType, "cBat" ) == 0 ) return true;
|
||||
return cMonster::IsA( a_EntityType );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cBat::KilledBy( cEntity* a_Killer )
|
||||
{
|
||||
cMonster::KilledBy( a_Killer );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
14
source/Mobs/Bat.h
Normal file
14
source/Mobs/Bat.h
Normal file
@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "PassiveMonster.h"
|
||||
|
||||
class cBat : public cPassiveMonster
|
||||
{
|
||||
public:
|
||||
cBat();
|
||||
~cBat();
|
||||
|
||||
virtual bool IsA( const char* a_EntityType );
|
||||
|
||||
virtual void KilledBy( cEntity* a_Killer );
|
||||
};
|
55
source/Mobs/Witch.cpp
Normal file
55
source/Mobs/Witch.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
||||
|
||||
#include "Witch.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cWitch::cWitch()
|
||||
{
|
||||
m_MobType = 66;
|
||||
GetMonsterConfig("Witch");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cWitch::~cWitch()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool cWitch::IsA( const char* a_EntityType )
|
||||
{
|
||||
if( strcmp( a_EntityType, "cWitch" ) == 0 ) return true;
|
||||
return cMonster::IsA( a_EntityType );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cWitch::KilledBy( cEntity* a_Killer )
|
||||
{
|
||||
cItems Drops;
|
||||
AddRandomDropItem(Drops, 0, 6, E_ITEM_GLASS_BOTTLE);
|
||||
AddRandomDropItem(Drops, 0, 6, E_ITEM_GLOWSTONE_DUST);
|
||||
AddRandomDropItem(Drops, 0, 6, E_ITEM_GUNPOWDER);
|
||||
AddRandomDropItem(Drops, 0, 6, E_ITEM_REDSTONE_DUST);
|
||||
AddRandomDropItem(Drops, 0, 6, E_ITEM_SPIDER_EYE);
|
||||
AddRandomDropItem(Drops, 0, 6, E_ITEM_STICK);
|
||||
AddRandomDropItem(Drops, 0, 6, E_ITEM_SUGAR);
|
||||
m_World->SpawnItemPickups(Drops, m_Pos.x, m_Pos.y, m_Pos.z);
|
||||
|
||||
cMonster::KilledBy( a_Killer );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
14
source/Mobs/Witch.h
Normal file
14
source/Mobs/Witch.h
Normal file
@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "AggressiveMonster.h"
|
||||
|
||||
class cWitch : public cAggressiveMonster
|
||||
{
|
||||
public:
|
||||
cWitch();
|
||||
~cWitch();
|
||||
|
||||
virtual bool IsA( const char* a_EntityType );
|
||||
|
||||
virtual void KilledBy( cEntity* a_Killer );
|
||||
};
|
@ -23,6 +23,7 @@
|
||||
#include "Simulator/RedstoneSimulator.h"
|
||||
|
||||
// Mobs:
|
||||
#include "Mobs/Bat.h"
|
||||
#include "Mobs/Blaze.h"
|
||||
#include "Mobs/Cavespider.h"
|
||||
#include "Mobs/Chicken.h"
|
||||
@ -41,6 +42,7 @@
|
||||
#include "Mobs/Spider.h"
|
||||
#include "Mobs/Squid.h"
|
||||
#include "Mobs/Villager.h"
|
||||
#include "Mobs/Witch.h"
|
||||
#include "Mobs/Wolf.h"
|
||||
#include "Mobs/Zombie.h"
|
||||
#include "Mobs/Zombiepigman.h"
|
||||
@ -2196,6 +2198,7 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, int a_EntityTy
|
||||
|
||||
switch (a_EntityType)
|
||||
{
|
||||
case E_ENTITY_TYPE_BAT: Monster = new cBat(); break;
|
||||
case E_ENTITY_TYPE_BLAZE: Monster = new cBlaze(); break;
|
||||
case E_ENTITY_TYPE_CAVE_SPIDER: Monster = new cCavespider(); break;
|
||||
case E_ENTITY_TYPE_CHICKEN: Monster = new cChicken(); break;
|
||||
@ -2214,6 +2217,7 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, int a_EntityTy
|
||||
case E_ENTITY_TYPE_SPIDER: Monster = new cSpider(); break;
|
||||
case E_ENTITY_TYPE_SQUID: Monster = new cSquid(); break;
|
||||
case E_ENTITY_TYPE_VILLAGER: Monster = new cVillager(); break;
|
||||
case E_ENTITY_TYPE_WITCH: Monster = new cWitch(); break;
|
||||
case E_ENTITY_TYPE_WOLF: Monster = new cWolf(); break;
|
||||
case E_ENTITY_TYPE_ZOMBIE: Monster = new cZombie(); break;
|
||||
case E_ENTITY_TYPE_ZOMBIE_PIGMAN: Monster = new cZombiepigman(); break;
|
||||
|
Loading…
Reference in New Issue
Block a user