From 77064aa486822be1ba593e171725c811e6987981 Mon Sep 17 00:00:00 2001 From: "luksor111@gmail.com" Date: Thu, 1 Nov 2012 10:56:47 +0000 Subject: Added Bats and Witches. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1021 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Mobs/Bat.cpp | 45 +++++++++++++++++++++++++++++++++++++++++ source/Mobs/Bat.h | 14 +++++++++++++ source/Mobs/Witch.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ source/Mobs/Witch.h | 14 +++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 source/Mobs/Bat.cpp create mode 100644 source/Mobs/Bat.h create mode 100644 source/Mobs/Witch.cpp create mode 100644 source/Mobs/Witch.h (limited to 'source/Mobs') diff --git a/source/Mobs/Bat.cpp b/source/Mobs/Bat.cpp new file mode 100644 index 000000000..4cc74ec2b --- /dev/null +++ b/source/Mobs/Bat.cpp @@ -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 ); +} + + + + diff --git a/source/Mobs/Bat.h b/source/Mobs/Bat.h new file mode 100644 index 000000000..94ae595d0 --- /dev/null +++ b/source/Mobs/Bat.h @@ -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 ); +}; diff --git a/source/Mobs/Witch.cpp b/source/Mobs/Witch.cpp new file mode 100644 index 000000000..02d1de4fe --- /dev/null +++ b/source/Mobs/Witch.cpp @@ -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 ); +} + + + + diff --git a/source/Mobs/Witch.h b/source/Mobs/Witch.h new file mode 100644 index 000000000..303aa7595 --- /dev/null +++ b/source/Mobs/Witch.h @@ -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 ); +}; -- cgit v1.2.3