mobs_crocs updated to newer code
This commit is contained in:
parent
d41bf23dd2
commit
5d234f5bed
@ -1,21 +0,0 @@
|
||||
|
||||
-- SETTINGS
|
||||
|
||||
ENABLE_WALKERS = true
|
||||
-- these guys are spawned on land near water, they do not
|
||||
-- float so they will not attack you if they happen to
|
||||
-- stumble into the water (L.O.S. limitation*)
|
||||
|
||||
ENABLE_FLOATERS = true
|
||||
-- these guys are spawned in shallow water, they float so they
|
||||
-- will follow you onto land to take a bite out of you
|
||||
|
||||
ENABLE_SWIMMERS = true
|
||||
-- these guys are spawned in shallow water, they do not float so
|
||||
-- they will only attack if you attack first (L.O.S. limitation*)
|
||||
|
||||
|
||||
-- * note: Mobs not attacking while underwater is a limitation of
|
||||
-- the MineTest LineOfSight function used in the "mobs_redo"
|
||||
-- mod to check if there is anything to attack. Seems that
|
||||
-- mobs can't see through water.
|
@ -1,11 +1,15 @@
|
||||
|
||||
if mobs.mod and mobs.mod == "redo" then
|
||||
if minetest.get_modpath("mobs") and not mobs.mod and mobs.mod ~= "redo" then
|
||||
minetest.log("error", "[mobs_crocs] mobs redo API not found!")
|
||||
return
|
||||
end
|
||||
|
||||
-- local variables
|
||||
local l_skins = {
|
||||
{"croco.png"},
|
||||
{"croco2.png"}
|
||||
}
|
||||
|
||||
local l_anims = {
|
||||
speed_normal = 24, speed_run = 24,
|
||||
stand_start = 0, stand_end = 80,
|
||||
@ -13,13 +17,17 @@ if mobs.mod and mobs.mod == "redo" then
|
||||
run_start = 81, run_end = 170,
|
||||
punch_start = 205, punch_end = 220
|
||||
}
|
||||
|
||||
local l_model = "crocodile.x"
|
||||
local l_sounds = {random = "croco"}
|
||||
local l_egg_texture = "default_grass.png"
|
||||
local l_spawn_chance = 60000
|
||||
|
||||
-- load settings
|
||||
dofile(minetest.get_modpath("mobs_crocs").."/SETTINGS.txt")
|
||||
local ENABLE_WALKERS = minetest.settings:get_bool("mobs_crocs.enable_walkers", true)
|
||||
local ENABLE_FLOATERS = minetest.settings:get_bool("mobs_crocs.enable_floaters", true)
|
||||
local ENABLE_SWIMMERS = minetest.settings:get_bool("mobs_crocs.enable_swimmers", true)
|
||||
|
||||
if not ENABLE_WALKERS then
|
||||
l_spawn_chance = l_spawn_chance - 20000
|
||||
end
|
||||
@ -32,6 +40,7 @@ if mobs.mod and mobs.mod == "redo" then
|
||||
|
||||
-- no float
|
||||
if ENABLE_WALKERS then
|
||||
|
||||
mobs:register_mob("mobs_crocs:crocodile", {
|
||||
type = "monster",
|
||||
attack_type = "dogfight",
|
||||
@ -60,16 +69,28 @@ if mobs.mod and mobs.mod == "redo" then
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
||||
},
|
||||
})
|
||||
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
|
||||
mobs:spawn_specific("mobs_crocs:crocodile",
|
||||
{"default:dirt_with_grass","default:dirt","default:jungle_grass","default:sand"},
|
||||
{"default:water_flowing","default:water_source","default:papyrus","dryplants:juncus","dryplants:reedmace"},
|
||||
-1, 18, 30, l_spawn_chance, 1, 0, 31000)
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_crocs:crocodile",
|
||||
nodes = {
|
||||
"default:dirt_with_grass", "default:dirt",
|
||||
"default:jungle_grass", "default:sand"
|
||||
},
|
||||
neighbors = {
|
||||
"default:water_flowing", "default:water_source",
|
||||
"default:papyrus", "dryplants:juncus", "dryplants:reedmace"
|
||||
},
|
||||
interval = 30,
|
||||
chance = l_spawn_chance,
|
||||
min_height = 0,
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_crocs:crocodile", "Crocodile", l_egg_texture, 1)
|
||||
end
|
||||
|
||||
-- float
|
||||
if ENABLE_FLOATERS then
|
||||
|
||||
mobs:register_mob("mobs_crocs:crocodile_float", {
|
||||
type = "monster",
|
||||
attack_type = "dogfight",
|
||||
@ -97,16 +118,27 @@ if mobs.mod and mobs.mod == "redo" then
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
||||
},
|
||||
})
|
||||
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
|
||||
mobs:spawn_specific("mobs_crocs:crocodile_float",
|
||||
{"default:water_flowing","default:water_source"},
|
||||
{"default:dirt_with_grass","default:jungle_grass","default:sand","default:dirt","default:papyrus","group:seaplants","dryplants:juncus","dryplants:reedmace"},
|
||||
-1, 18, 30, l_spawn_chance, 1, -3, 31000)
|
||||
mobs:register_egg("mobs_crocs:crocodile_float", "Crocodile (floater)", l_egg_texture, 1)
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_crocs:crocodile_float",
|
||||
nodes = {"default:water_flowing","default:water_source"},
|
||||
neighbors = {
|
||||
"default:dirt_with_grass", "default:jungle_grass", "default:sand",
|
||||
"default:dirt", "default:papyrus", "group:seaplants",
|
||||
"dryplants:juncus", "dryplants:reedmace"
|
||||
},
|
||||
interval = 30,
|
||||
chance = l_spawn_chance,
|
||||
min_height = -3,
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_crocs:crocodile_float", "Crocodile (floater)",
|
||||
l_egg_texture, 1)
|
||||
end
|
||||
|
||||
-- swim
|
||||
if ENABLE_SWIMMERS then
|
||||
|
||||
mobs:register_mob("mobs_crocs:crocodile_swim", {
|
||||
type = "monster",
|
||||
attack_type = "dogfight",
|
||||
@ -136,12 +168,16 @@ if mobs.mod and mobs.mod == "redo" then
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
||||
},
|
||||
})
|
||||
--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height
|
||||
mobs:spawn_specific("mobs_crocs:crocodile_swim",
|
||||
{"default:water_flowing","default:water_source"},
|
||||
{"default:sand","default:dirt","group:seaplants"},
|
||||
-1, 18, 30, l_spawn_chance, 1, -8, 31000)
|
||||
mobs:register_egg("mobs_crocs:crocodile_swim", "Crocodile (swimmer)", l_egg_texture, 1)
|
||||
end
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_crocs:crocodile_swim",
|
||||
nodes = {"default:water_flowing","default:water_source"},
|
||||
neighbors = {"default:sand","default:dirt","group:seaplants"},
|
||||
interval = 30,
|
||||
chance = l_spawn_chance,
|
||||
min_height = -8,
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_crocs:crocodile_swim", "Crocodile (swimmer)",
|
||||
l_egg_texture, 1)
|
||||
end
|
||||
|
30
mobs_crocs/readme.md
Normal file
30
mobs_crocs/readme.md
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
# crocodiles for mobs_redo
|
||||
|
||||
## Requirements
|
||||
|
||||
* Minetest >= 0.4.17
|
||||
|
||||
## Settings
|
||||
|
||||
### mobs_crocs.enable_walkers
|
||||
|
||||
these guys are spawned on land near water, they do not
|
||||
float so they will not attack you if they happen to
|
||||
stumble into the water (L.O.S. limitation*)
|
||||
|
||||
default: **true**
|
||||
|
||||
### mobs_crocs.enable_floaters
|
||||
|
||||
these guys are spawned in shallow water, they float so they
|
||||
will follow you onto land to take a bite out of you
|
||||
|
||||
default: **true**
|
||||
|
||||
### mobs_crocs.enable_swimmers
|
||||
|
||||
these guys are spawned in shallow water, they do not float and
|
||||
will attack you on sight.
|
||||
|
||||
default: **true**
|
9
mobs_crocs/settingtypes.txt
Normal file
9
mobs_crocs/settingtypes.txt
Normal file
@ -0,0 +1,9 @@
|
||||
#Enable walkers
|
||||
mobs_crocs.enable_walkers (Enable walkers) bool true
|
||||
|
||||
#Enable floaters
|
||||
mobs_crocs.enable_floaters (Enable floaters) bool true
|
||||
|
||||
#Enable swimmers
|
||||
mobs_crocs.enable_swimmers (Enable swimmers) bool true
|
||||
|
Loading…
x
Reference in New Issue
Block a user