From a0f34023462e7aaa599283101c45e3d7cdf8705c Mon Sep 17 00:00:00 2001
From: Wuzzy <almikes@aol.com>
Date: Thu, 23 Feb 2017 19:52:07 +0100
Subject: [PATCH] Tweak water and lava damage for all mobs

---
 mods/ENTITIES/mobs_mc/blaze.lua     |  3 ++-
 mods/ENTITIES/mobs_mc/chicken.lua   |  3 +--
 mods/ENTITIES/mobs_mc/cow.lua       |  3 +--
 mods/ENTITIES/mobs_mc/creeper.lua   |  3 +--
 mods/ENTITIES/mobs_mc/enderman.lua  |  2 +-
 mods/ENTITIES/mobs_mc/ghast.lua     |  3 +--
 mods/ENTITIES/mobs_mc/horse.lua     |  9 +++------
 mods/ENTITIES/mobs_mc/pig.lua       |  3 +--
 mods/ENTITIES/mobs_mc/rabbit.lua    |  5 ++---
 mods/ENTITIES/mobs_mc/sheep.lua     |  3 +--
 mods/ENTITIES/mobs_mc/skeleton.lua  |  4 ++--
 mods/ENTITIES/mobs_mc/slimes.lua    | 10 +++++-----
 mods/ENTITIES/mobs_mc/spider.lua    |  2 +-
 mods/ENTITIES/mobs_mc/squid.lua     |  2 +-
 mods/ENTITIES/mobs_mc/villager.lua  |  3 +--
 mods/ENTITIES/mobs_mc/wolf.lua      |  4 ++--
 mods/ENTITIES/mobs_mc/zombie.lua    |  4 ++--
 mods/ENTITIES/mobs_mc/zombiepig.lua |  3 +--
 18 files changed, 29 insertions(+), 40 deletions(-)

diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua
index b449b2159..8d7609e4e 100644
--- a/mods/ENTITIES/mobs_mc/blaze.lua
+++ b/mods/ENTITIES/mobs_mc/blaze.lua
@@ -49,7 +49,8 @@ mobs:register_mob("mobs_mc:blaze", {
         shoot_end = 40,
 	},
 	drawtype = "front",
-    water_damage = 10,
+	-- MC Wiki: 1 damage every half second
+	water_damage = 2,
 	lava_damage = 0,
 	fall_damage = 0,
 	light_damage = 0,
diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua
index 7b19511c5..c082f58a8 100644
--- a/mods/ENTITIES/mobs_mc/chicken.lua
+++ b/mods/ENTITIES/mobs_mc/chicken.lua
@@ -34,8 +34,7 @@ mobs:register_mob("mobs_mc:chicken", {
 		max = 2,},
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fall_damage = false,
 	fear_height = 4,
diff --git a/mods/ENTITIES/mobs_mc/cow.lua b/mods/ENTITIES/mobs_mc/cow.lua
index 451ac9008..aabf80e53 100644
--- a/mods/ENTITIES/mobs_mc/cow.lua
+++ b/mods/ENTITIES/mobs_mc/cow.lua
@@ -28,8 +28,7 @@ mobs:register_mob("mobs_mc:cow", {
 		max = 2,},
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fear_height = 3,
 	sounds = {
diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua
index ce0cba4f3..2dbde9ab1 100644
--- a/mods/ENTITIES/mobs_mc/creeper.lua
+++ b/mods/ENTITIES/mobs_mc/creeper.lua
@@ -67,8 +67,7 @@ mobs:register_mob("mobs_mc:creeper", {
 		look_end = 108,
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	view_range = 16,
 	attack_type = "explode",
diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua
index e4cfb2d8b..d90cc3f5d 100644
--- a/mods/ENTITIES/mobs_mc/enderman.lua
+++ b/mods/ENTITIES/mobs_mc/enderman.lua
@@ -49,7 +49,7 @@ mobs:register_mob("mobs_mc:enderman", {
 	},
 	drawtype = "front",
 	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	view_range = 16,
 	attack_type = "dogfight",
diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua
index cacc674d6..c9a0d01a5 100644
--- a/mods/ENTITIES/mobs_mc/ghast.lua
+++ b/mods/ENTITIES/mobs_mc/ghast.lua
@@ -57,11 +57,10 @@ mobs:register_mob("mobs_mc:ghast", {
 		death_end = 118,
 	},
 	drawtype = "front",
-	water_damage = 10,
 	lava_damage = 0,
 	light_damage = 0,
 	fall_damage = 0,
-	view_range = 16,
+	view_range = 100,
 	--attack_type = "dogshoot",
 	attack_type = "dogshoot",
 	arrow = "mobs_mc:ghast_fireball",
diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua
index e5aeea3e7..8a579ae9c 100644
--- a/mods/ENTITIES/mobs_mc/horse.lua
+++ b/mods/ENTITIES/mobs_mc/horse.lua
@@ -209,8 +209,7 @@ mobs:register_mob("mobs_mc:horse", {
 		max = 2,},
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fear_height = 6,
 	animation = {
@@ -252,8 +251,7 @@ mobs:register_mob("mobs_mc:horse2", {
 		max = 2,},
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fear_height = 6,
 	animation = {
@@ -295,8 +293,7 @@ mobs:register_mob("mobs_mc:horse3", {
 		max = 2,},
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fear_height = 6,
 	animation = {
diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua
index 62426d650..d8455a227 100644
--- a/mods/ENTITIES/mobs_mc/pig.lua
+++ b/mods/ENTITIES/mobs_mc/pig.lua
@@ -27,8 +27,7 @@ mobs:register_mob("mobs_mc:pig", {
 		max = 3,},
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fear_height = 4,
 	jump_height = 4.5,
diff --git a/mods/ENTITIES/mobs_mc/rabbit.lua b/mods/ENTITIES/mobs_mc/rabbit.lua
index c804e3a5b..199077625 100644
--- a/mods/ENTITIES/mobs_mc/rabbit.lua
+++ b/mods/ENTITIES/mobs_mc/rabbit.lua
@@ -33,10 +33,9 @@ mobs:register_mob("mobs_mc:rabbit", {
 		{name = "mcl_mobitems:rabbit_hide", chance = 1, min = 0, max = 1},
 		{name = "mcl_mobitems:rabbit_foot", chance = 10, min = 1, max = 1},
 	},
-	water_damage = 1,
-	lava_damage = 4,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
-	fear_height = 2,
+	fear_height = 3,
 	animation = {
 		speed_normal = 15,
 		stand_start = 1,
diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua
index abd4d4a66..a5335c455 100644
--- a/mods/ENTITIES/mobs_mc/sheep.lua
+++ b/mods/ENTITIES/mobs_mc/sheep.lua
@@ -58,8 +58,7 @@ mobs:register_mob("mobs_mc:sheep", {
 		max = 1,},
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fear_height = 4,
 	jump_height = 4.5,
diff --git a/mods/ENTITIES/mobs_mc/skeleton.lua b/mods/ENTITIES/mobs_mc/skeleton.lua
index 8b396fb92..929c41183 100644
--- a/mods/ENTITIES/mobs_mc/skeleton.lua
+++ b/mods/ENTITIES/mobs_mc/skeleton.lua
@@ -55,8 +55,8 @@ mobs:register_mob("mobs_mc:skeleton", {
 		shoot_end = 82,
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
+	-- TODO: Mob should burn only in direct sunlight
 	light_damage = 1,
 	view_range = 16,
 	attack_type = "dogshoot",
diff --git a/mods/ENTITIES/mobs_mc/slimes.lua b/mods/ENTITIES/mobs_mc/slimes.lua
index 46bd1012d..1f0b06a7e 100644
--- a/mods/ENTITIES/mobs_mc/slimes.lua
+++ b/mods/ENTITIES/mobs_mc/slimes.lua
@@ -53,7 +53,7 @@ mobs:register_mob("mobs_mc:greensmall", {
 	},
 	drawtype = "front",
 	water_damage = 0,
-	lava_damage = 10,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fall_damage = 0,
 	view_range = 16,
@@ -107,7 +107,7 @@ mobs:register_mob("mobs_mc:greenmedium", {
 	},
 	drawtype = "front",
 	water_damage = 0,
-	lava_damage = 10,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fall_damage = 0,
 	view_range = 16,
@@ -171,7 +171,7 @@ mobs:register_mob("mobs_mc:greenbig", {
 	},
 	drawtype = "front",
 	water_damage = 0,
-	lava_damage = 10,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fall_damage = 0,
 	view_range = 16,
@@ -240,7 +240,7 @@ mobs:register_mob("mobs_mc:lavasmall", {
 		death_end = 118,
 	},
 	drawtype = "front",
-	water_damage = 10,
+	water_damage = 0,
 	lava_damage = 0,
 	light_damage = 0,
 	fall_damage = 0,
@@ -299,7 +299,7 @@ mobs:register_mob("mobs_mc:lavabig", {
 		death_end = 118,
 	},
 	drawtype = "front",
-	water_damage = 10,
+	water_damage = 0,
 	lava_damage = 0,
 	light_damage = 0,
 	fall_damage = 0,
diff --git a/mods/ENTITIES/mobs_mc/spider.lua b/mods/ENTITIES/mobs_mc/spider.lua
index 1d94a466b..4a3710e9e 100644
--- a/mods/ENTITIES/mobs_mc/spider.lua
+++ b/mods/ENTITIES/mobs_mc/spider.lua
@@ -47,7 +47,7 @@ mobs:register_mob("mobs_mc:spider", {
 		{name = "mcl_mobitems:spider_eye",
 		chance = 3, min = 1, max = 1,},
 	},
-	lava_damage = 8,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	fear_height = 14,
 	animation = {
diff --git a/mods/ENTITIES/mobs_mc/squid.lua b/mods/ENTITIES/mobs_mc/squid.lua
index 687cd8d23..01b68ad50 100644
--- a/mods/ENTITIES/mobs_mc/squid.lua
+++ b/mods/ENTITIES/mobs_mc/squid.lua
@@ -48,7 +48,7 @@ mobs:register_mob("mobs_mc:squid", {
     view_range = 8,
     fall_damage = 1,
     water_damage = 0,
-    lava_damage = 5,
+    lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
     light_damage = 0,
     
 })
diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua
index b5ea62dc6..643babb60 100644
--- a/mods/ENTITIES/mobs_mc/villager.lua
+++ b/mods/ENTITIES/mobs_mc/villager.lua
@@ -47,8 +47,7 @@ mobs:register_mob("mobs_mc:villager", {
 		shoot_end = 82,
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	view_range = 16,
 	fear_height = 5,
diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua
index fbc7c97da..0ab9f92fa 100644
--- a/mods/ENTITIES/mobs_mc/wolf.lua
+++ b/mods/ENTITIES/mobs_mc/wolf.lua
@@ -39,7 +39,7 @@ mobs:register_mob("mobs_mc:dog", {
 	drops = {},
 	drawtype = "front",
 	water_damage = 0,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	on_rightclick = function(self, clicker)
 		local item = clicker:get_wielded_item()
@@ -139,7 +139,7 @@ mobs:register_mob("mobs_mc:wolf", {
 	drops = {},
 	drawtype = "front",
 	water_damage = 0,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 0,
 	on_rightclick = function(self, clicker)
 		local tool = clicker:get_wielded_item()
diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua
index 64de9d456..df547f825 100644
--- a/mods/ENTITIES/mobs_mc/zombie.lua
+++ b/mods/ENTITIES/mobs_mc/zombie.lua
@@ -82,8 +82,8 @@ mobs:register_mob("mobs_mc:zombie", {
 		death_end = 118,
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
+	-- TODO: Burn mob only when in direct sunlight
 	light_damage = 1,
 	view_range = 16,
 	attack_type = "dogfight",
diff --git a/mods/ENTITIES/mobs_mc/zombiepig.lua b/mods/ENTITIES/mobs_mc/zombiepig.lua
index e3cedcc4e..d5d212c36 100644
--- a/mods/ENTITIES/mobs_mc/zombiepig.lua
+++ b/mods/ENTITIES/mobs_mc/zombiepig.lua
@@ -75,8 +75,7 @@ mobs:register_mob("mobs_mc:pigman", {
 		punch_start = 200,		punch_end = 219,
 	},
 	drawtype = "front",
-	water_damage = 1,
-	lava_damage = 5,
+	lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
 	light_damage = 1,
 	fear_height = 3,
 	view_range = 16,