diff --git a/api.lua b/api.lua index 3c8b2f1..ba2cdbd 100644 --- a/api.lua +++ b/api.lua @@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20230524", + version = "20230526", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -128,6 +128,9 @@ end -- calculate aoc range for mob count 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 local node_ice = "default:ice" local node_snowblock = "default:snowblock" @@ -175,7 +178,7 @@ mobs.mob_class = { floats = 1, -- floats in water by default replace_offset = 0, timer = 0, - env_damage_timer = 0, -- only used when state = "attack" + env_damage_timer = 0, tamed = false, pause_timer = 0, horny = false, @@ -1951,7 +1954,19 @@ function mob_class:general_attack() --print("- pla", n) 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 -- remove mobs not to attack diff --git a/api.txt b/api.txt index 45d8cde..cc6514a 100644 --- a/api.txt +++ b/api.txt @@ -751,6 +751,7 @@ External Settings for "minetest.conf" 'enable_damage' if true monsters will attack players (default is true) 'only_peaceful_mobs' if true only animals will spawn in game (default is 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 is false) 'mob_hit_effect' False by default, when True and mobs are hit then diff --git a/readme.MD b/readme.MD index 000d0a6..aba1f0b 100644 --- a/readme.MD +++ b/readme.MD @@ -32,6 +32,7 @@ https://forum.minetest.net/viewtopic.php?f=11&t=9917 * Added ability for mobs to die only in natural daylight * Refactored do_jump and added get_nodes function * Many bug fixes and tweaks to improve performance +* Added 'mobs_attack_creatura' setting so that monsters can attack Creatura mobs ### Version 1.56 diff --git a/settingtypes.txt b/settingtypes.txt index f351c16..18db2bf 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -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) mob_node_timer_interval (Mob Node Timer Interval) float 0.25