|
@@ -1,8 +1,14 @@
|
|
|
--SOUNDS :
|
|
|
-- NORMAL : ??
|
|
|
+local getInitialName = function(mobName)
|
|
|
+ local isShowed = minetest.settings:get_bool("simpleanimals.initial_nametags")
|
|
|
+ if isShowed then
|
|
|
+ return mobName
|
|
|
+ end
|
|
|
+end
|
|
|
|
|
|
mobs:register_mob("frog:frog", {
|
|
|
- nametag = "frog" ,
|
|
|
+ nametag = getInitialName("FROG"),
|
|
|
type = "animal",
|
|
|
passive = false,
|
|
|
attack_type = "dogfight",
|
|
@@ -11,7 +17,7 @@ mobs:register_mob("frog:frog", {
|
|
|
pathfinding = true,
|
|
|
reach = 2,
|
|
|
damage = 5,
|
|
|
- hp_min = 2,
|
|
|
+ hp_min = 5,
|
|
|
hp_max = 5,
|
|
|
armor = 150,
|
|
|
collisionbox = {-0.3, -1.0, -0.2, 0.2, 0.05, 0.2},
|
|
@@ -20,9 +26,8 @@ mobs:register_mob("frog:frog", {
|
|
|
rotate = 180,
|
|
|
textures = {
|
|
|
{"frog.png"},
|
|
|
- {"frog_brown.png"},
|
|
|
- {"frog_red.png"},
|
|
|
-
|
|
|
+ --{"frog_brown.png"}, --colored in on_spawn
|
|
|
+ --{"frog_red.png"}, --colored in on_spawn
|
|
|
},
|
|
|
--blood_texture = "",
|
|
|
makes_footstep_sound = true,
|
|
@@ -34,16 +39,15 @@ mobs:register_mob("frog:frog", {
|
|
|
walk_velocity = 2,
|
|
|
run_velocity = 3,
|
|
|
jump = true,
|
|
|
- jump_height = 6,
|
|
|
+ jump_height = 3.1, --hight jump
|
|
|
fly_in = {"default:water_source", "default:water_flowing"},
|
|
|
- floats = 0,
|
|
|
- stepheight = 1.1,
|
|
|
- fall_damage = 1,
|
|
|
- view_range = 20,
|
|
|
+ floats = 2, --nothing in the water.
|
|
|
+ stepheight = 1.1,
|
|
|
+ --fall_damage = 1, --without damage in fall
|
|
|
+ view_range = 5, --less see distance
|
|
|
drops = {
|
|
|
--{name = "skulls:bone", chance = 2, min = 1, max = 1},
|
|
|
-
|
|
|
-
|
|
|
+ {name = "mobs_animal:bee", chance = 20, min = 0, max = 1}, --drop bee just death
|
|
|
},
|
|
|
water_damage = 0,
|
|
|
lava_damage = 5,
|
|
@@ -63,41 +67,67 @@ mobs:register_mob("frog:frog", {
|
|
|
punch_end = 140,
|
|
|
punch_speed = 30,
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- on_rightclick = function(self, clicker) -- No momento pode somente , repodruzir ou Curar...
|
|
|
-
|
|
|
+ on_rightclick = function(self, clicker) -- No momento pode somente , repodruzir ou Curar...
|
|
|
if mobs:feed_tame(self, clicker, 8, true, true) then
|
|
|
- return
|
|
|
+ return
|
|
|
end
|
|
|
|
|
|
-
|
|
|
if mobs:protect(self, clicker) then return end
|
|
|
if mobs:capture_mob(self, clicker, 30, 50, 80, false, nil) then return end
|
|
|
- end,
|
|
|
+ end,
|
|
|
+ on_spawn = function(self)
|
|
|
+ local frog_types = {
|
|
|
+ {--Spawn in Nether
|
|
|
+ nodes = {
|
|
|
+ "nether:rack",
|
|
|
+ "nether:rack_deep",
|
|
|
+ },
|
|
|
+ skins = {"frog_red.png"},
|
|
|
+ },
|
|
|
+ {--Spawn in Rain Firest
|
|
|
+ nodes = {"default:dirt_with_rainforest_litter"},
|
|
|
+ skins = {"frog_brown.png"},
|
|
|
+ },
|
|
|
+ }
|
|
|
+ local pos = self.object:get_pos() ; pos.y = pos.y - 1
|
|
|
+ local tmp
|
|
|
+ for n = 1, #frog_types do
|
|
|
+ tmp = frog_types[n]
|
|
|
+ if minetest.find_node_near(pos, 1, tmp.nodes) then
|
|
|
+ self.base_texture = tmp.skins
|
|
|
+ self.object:set_properties({textures = tmp.skins})
|
|
|
+ if tmp.drops then
|
|
|
+ self.drops = tmp.drops
|
|
|
+ end
|
|
|
+ return true
|
|
|
+ end
|
|
|
+ end
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ return true -- run only once, false/nil runs every activation
|
|
|
+ end,
|
|
|
})
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
mobs:spawn({
|
|
|
name = "frog:frog",
|
|
|
- nodes = {"default:dirt_with_rainforest_litter"},
|
|
|
- min_light = 8,
|
|
|
- --max_light = 14,
|
|
|
- chance = 10000,
|
|
|
- min_height = 0,
|
|
|
+ nodes = {
|
|
|
+ "default:dirt_with_grass", "default:dirt", "default:water_source", "default:water_flowing",--green frog
|
|
|
+ "default:dirt_with_rainforest_litter", --brown frog
|
|
|
+ "nether:rack", "nether:rack_deep", --red frog
|
|
|
+ },
|
|
|
+ --[[
|
|
|
+ neighbors = {--in surface of water, bat not in deep ocean. (Not is mandatiry exist water near.)
|
|
|
+ "air",
|
|
|
+ "default:water_source", "default:water_flowing",
|
|
|
+ },
|
|
|
+ --]]
|
|
|
+ min_light = 0,
|
|
|
+ max_light = 10,
|
|
|
+ chance = 8000,
|
|
|
+ min_height = -10,
|
|
|
max_height = 200,
|
|
|
-
|
|
|
+ --day_toggle = true,
|
|
|
})
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
mobs:register_egg("frog:frog", "Frog", "frogegg.png", 1)
|
|
|
|
|
|
|