summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Chicken.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/Chicken.cpp')
-rw-r--r--src/Mobs/Chicken.cpp50
1 files changed, 7 insertions, 43 deletions
diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp
index 1068295e6..a7b27fc11 100644
--- a/src/Mobs/Chicken.cpp
+++ b/src/Mobs/Chicken.cpp
@@ -5,53 +5,17 @@
-
-
-
-
cChicken::cChicken(void) :
- super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.3, 0.4),
- m_EggDropTimer(0)
+ super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.3, 0.4)
{
SetGravity(-2.0f);
SetAirDrag(0.0f);
-}
-
-
-
-
-void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
-{
- super::Tick(a_Dt, a_Chunk);
- if (!IsTicking())
- {
- // The base class tick destroyed us
- return;
- }
-
- if (IsBaby())
- {
- return; // Babies don't lay eggs
- }
-
- if ((m_EggDropTimer == 6000) && GetRandomProvider().RandBool())
- {
- cItems Drops;
- m_EggDropTimer = 0;
- Drops.push_back(cItem(E_ITEM_EGG, 1));
- m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
- }
- else if (m_EggDropTimer == 12000)
- {
- cItems Drops;
- m_EggDropTimer = 0;
- Drops.push_back(cItem(E_ITEM_EGG, 1));
- m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10);
- }
- else
- {
- m_EggDropTimer++;
- }
+ m_EMPersonality = PASSIVE;
+ m_BehaviorBreeder.AttachToMonster(*this);
+ m_BehaviorCoward.AttachToMonster(*this);
+ m_BehaviorItemFollower.AttachToMonster(*this);
+ m_BehaviorWanderer.AttachToMonster(*this);
+ m_BehaviorItemDropper.AttachToMonster(*this);
}