From b9ca7bd1203f704d4f9d6215d72728d40a187b7c Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Mon, 2 Jun 2014 14:16:36 +0200 Subject: Small tweak for mobs Mobs move a bit smoother and aren't able to move allot when in air. --- src/Mobs/Monster.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index a9ca7a2fa..5843ca5a6 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -301,7 +301,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) if (DoesPosYRequireJump((int)floor(m_Destination.y))) { m_bOnGround = false; - AddPosY(1.5); // Jump!! + AddSpeedY(5.2); // Jump!! } } @@ -310,9 +310,19 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) { Distance.y = 0; Distance.Normalize(); - Distance *= 5; - SetSpeedX(Distance.x); - SetSpeedZ(Distance.z); + + if (m_bOnGround) + { + Distance *= 2.5; + } + else + { + // Don't let the mob move too much if he's falling. + Distance *= 0.25; + } + + AddSpeedX(Distance.x); + AddSpeedZ(Distance.z); if (m_EMState == ESCAPING) { //Runs Faster when escaping :D otherwise they just walk away -- cgit v1.2.3 From 9ef4b9d52d0b3b19eed90daf528bab5b9c01d8dc Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 4 Jun 2014 09:27:50 +0100 Subject: Exploded creepers drop nothing, part of #1058 --- src/Mobs/Creeper.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Creeper.cpp b/src/Mobs/Creeper.cpp index 9cf539427..a7b97f604 100644 --- a/src/Mobs/Creeper.cpp +++ b/src/Mobs/Creeper.cpp @@ -43,7 +43,7 @@ void cCreeper::Tick(float a_Dt, cChunk & a_Chunk) if (m_ExplodingTimer == 30) { m_World->DoExplosionAt((m_bIsCharged ? 5 : 3), GetPosX(), GetPosY(), GetPosZ(), false, esMonster, this); - Destroy(); + Destroy(); // Just in case we aren't killed by the explosion } } } @@ -54,6 +54,12 @@ void cCreeper::Tick(float a_Dt, cChunk & a_Chunk) void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer) { + if (m_ExplodingTimer == 30) + { + // Exploded creepers drop naught but charred flesh, which Minecraft doesn't have + return; + } + int LootingLevel = 0; if (a_Killer != NULL) { @@ -65,7 +71,7 @@ void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer) { if (((cMonster *)((cProjectileEntity *)a_Killer)->GetCreator())->GetMobType() == mtSkeleton) { - // 12 music discs. TickRand starts from 0, so range = 11. Disk IDs start at 2256, so add that. There. + // 12 music discs. TickRand starts from 0 to 11. Disk IDs start at 2256, so add that. There. AddRandomDropItem(a_Drops, 1, 1, (short)m_World->GetTickRandomNumber(11) + 2256); } } -- cgit v1.2.3