added 'mobs_attack_creatura' setting for monsters to attack Creatura mob mobs
This commit is contained in:
parent
267ee57837
commit
194c9f7847
21
api.lua
21
api.lua
@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20230524",
|
version = "20230526",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -128,6 +128,9 @@ end
|
|||||||
-- calculate aoc range for mob count
|
-- calculate aoc range for mob count
|
||||||
local aoc_range = tonumber(settings:get("active_block_range")) * 16
|
local aoc_range = tonumber(settings:get("active_block_range")) * 16
|
||||||
|
|
||||||
|
-- can we attack Creatura mobs ?
|
||||||
|
local creatura = settings:get_bool("mobs_attack_creatura") == true
|
||||||
|
|
||||||
-- default nodes
|
-- default nodes
|
||||||
local node_ice = "default:ice"
|
local node_ice = "default:ice"
|
||||||
local node_snowblock = "default:snowblock"
|
local node_snowblock = "default:snowblock"
|
||||||
@ -175,7 +178,7 @@ mobs.mob_class = {
|
|||||||
floats = 1, -- floats in water by default
|
floats = 1, -- floats in water by default
|
||||||
replace_offset = 0,
|
replace_offset = 0,
|
||||||
timer = 0,
|
timer = 0,
|
||||||
env_damage_timer = 0, -- only used when state = "attack"
|
env_damage_timer = 0,
|
||||||
tamed = false,
|
tamed = false,
|
||||||
pause_timer = 0,
|
pause_timer = 0,
|
||||||
horny = false,
|
horny = false,
|
||||||
@ -1951,7 +1954,19 @@ function mob_class:general_attack()
|
|||||||
--print("- pla", n)
|
--print("- pla", n)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- or are we a mob?
|
-- are we a creatura mob?
|
||||||
|
elseif creatura and ent and ent._cmi_is_mob ~= true
|
||||||
|
and ent.hitbox and ent.stand_node then
|
||||||
|
|
||||||
|
if self.name == ent.name
|
||||||
|
or self.type ~= "monster"
|
||||||
|
or (self.specific_attack
|
||||||
|
and not check_for(ent.name, self.specific_attack)) then
|
||||||
|
objs[n] = nil
|
||||||
|
-- print("- creatura", n, self.name, ent.name)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- or are we a mob? -- ent.hitbox is a creatura mob identifier
|
||||||
elseif ent and ent._cmi_is_mob then
|
elseif ent and ent._cmi_is_mob then
|
||||||
|
|
||||||
-- remove mobs not to attack
|
-- remove mobs not to attack
|
||||||
|
1
api.txt
1
api.txt
@ -751,6 +751,7 @@ External Settings for "minetest.conf"
|
|||||||
'enable_damage' if true monsters will attack players (default is true)
|
'enable_damage' if true monsters will attack players (default is true)
|
||||||
'only_peaceful_mobs' if true only animals will spawn in game (default is
|
'only_peaceful_mobs' if true only animals will spawn in game (default is
|
||||||
false)
|
false)
|
||||||
|
'mobs_attack_creatura' When True mobs redo mobs will attack Creatura mod mobs.
|
||||||
'mobs_disable_blood' if false blood effects appear when mob is hit (default
|
'mobs_disable_blood' if false blood effects appear when mob is hit (default
|
||||||
is false)
|
is false)
|
||||||
'mob_hit_effect' False by default, when True and mobs are hit then
|
'mob_hit_effect' False by default, when True and mobs are hit then
|
||||||
|
@ -32,6 +32,7 @@ https://forum.minetest.net/viewtopic.php?f=11&t=9917
|
|||||||
* Added ability for mobs to die only in natural daylight
|
* Added ability for mobs to die only in natural daylight
|
||||||
* Refactored do_jump and added get_nodes function
|
* Refactored do_jump and added get_nodes function
|
||||||
* Many bug fixes and tweaks to improve performance
|
* Many bug fixes and tweaks to improve performance
|
||||||
|
* Added 'mobs_attack_creatura' setting so that monsters can attack Creatura mobs
|
||||||
|
|
||||||
### Version 1.56
|
### Version 1.56
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# Enable setting so that Mobs Redo mobs can attack Creatura mobs
|
||||||
|
mobs_attack_creatura (Attack Creatura Mobs) bool false
|
||||||
|
|
||||||
# How often mobs get nodes around them (default is 0.25, 1/4 second)
|
# How often mobs get nodes around them (default is 0.25, 1/4 second)
|
||||||
mob_node_timer_interval (Mob Node Timer Interval) float 0.25
|
mob_node_timer_interval (Mob Node Timer Interval) float 0.25
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user