summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-09-28 19:27:43 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-09-28 19:27:43 +0100
commita455395a96de65bbbedf3d4bb8ab4530b80cfad3 (patch)
tree21638feebfe0695c76a4aeecfc41f9368d17cb28
parent5df8e9054e19b318ae17efca07555d8de4dbaf73 (diff)
added mob_difficulty config setting
-rw-r--r--api.lua12
-rw-r--r--api.txt3
-rw-r--r--readme.MD2
3 files changed, 10 insertions, 7 deletions
diff --git a/api.lua b/api.lua
index 58b950e..3bafcb0 100644
--- a/api.lua
+++ b/api.lua
@@ -1,5 +1,5 @@
--- Mobs Api (26th September 2016)
+-- Mobs Api (28th September 2016)
mobs = {}
mobs.mod = "redo"
@@ -39,6 +39,7 @@ local disable_blood = minetest.setting_getbool("mobs_disable_blood")
local creative = minetest.setting_getbool("creative_mode")
local spawn_protected = tonumber(minetest.setting_get("mobs_spawn_protected")) or 1
local remove_far = minetest.setting_getbool("remove_far_mobs")
+local difficulty = tonumber(minetest.setting_get("mob_difficulty")) or 1.0
-- pathfinding settings
local enable_pathfinding = true
@@ -361,7 +362,8 @@ function check_for_death(self)
if self.on_die then
self.on_die(self, pos)
-self.object:remove()
+ self.object:remove()
+
return true
end
@@ -2281,8 +2283,8 @@ minetest.register_entity(name, {
drawtype = def.drawtype, -- DEPRECATED, use rotate instead
rotate = math.rad(def.rotate or 0), -- 0=front, 90=side, 180=back, 270=side2
lifetimer = def.lifetimer or 180, -- 3 minutes
- hp_min = def.hp_min or 5,
- hp_max = def.hp_max or 10,
+ hp_min = (def.hp_min or 5) * difficulty,
+ hp_max = (def.hp_max or 10) * difficulty,
physical = true,
collisionbox = def.collisionbox,
visual = def.visual,
@@ -2292,7 +2294,7 @@ minetest.register_entity(name, {
view_range = def.view_range or 5,
walk_velocity = def.walk_velocity or 1,
run_velocity = def.run_velocity or 2,
- damage = def.damage or 0,
+ damage = (def.damage or 0) * difficulty,
light_damage = def.light_damage or 0,
water_damage = def.water_damage or 0,
lava_damage = def.lava_damage or 0,
diff --git a/api.txt b/api.txt
index 6af7eb5..9b5461c 100644
--- a/api.txt
+++ b/api.txt
@@ -1,5 +1,5 @@
-MOB API (26th September 2016)
+MOB API (28th September 2016)
The mob api is a function that can be called on by other mods to add new animals or monsters into minetest.
@@ -11,6 +11,7 @@ The mob api is a function that can be called on by other mods to add new animals
'mobs_spawn_protected' if set to 1 then mobs will not spawn in protected areas (default is 0)
'remove_far_mobs' if true then mobs that are outside players visual range will be removed (default is false)
'mobname_chance' can change specific mob chance rates or set to 0 to disable e.g. mobs_animal:cow_chance = 1000
+ 'mob_difficulty' sets difficulty level (health and hit damage multiplied by this number), defaults to 1.0.
mobs:register_mob(name, definition)
diff --git a/readme.MD b/readme.MD
index eeafb26..5dd20cf 100644
--- a/readme.MD
+++ b/readme.MD
@@ -20,7 +20,7 @@ Crafts:
Changelog:
-- 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks.
+- 1.31- Added 'attack_animals' and 'specific_attack' flags for custom monster attacks, also 'mob_difficulty' .conf setting to make mobs harder.
- 1.30- Added support for invisibility mod (mobs cant attack what they cant see), tweaked and tidied code
- 1.29- Split original Mobs Redo into a modpack to make it easier to disable mob sets (animal, monster, npc) or simply use the Api itself for your own mod
- 1.28- New damage system added with ability for mob to be immune to weapons or healed by them :)