mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-06-28 06:11:47 +02:00
Resolve problems
This commit is contained in:
@ -28,10 +28,11 @@ This mod contains the following additions:
|
||||
|
||||
Changelog:
|
||||
|
||||
beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop
|
||||
1,10- Footstep removed (use replace), explosion routine added for exploding mobs.
|
||||
1.09- reworked breeding routine, added mob rotation value, added footstep feature, added jumping mobs with sounds feature, added magic lasso for picking up animals
|
||||
1.08- Mob throwing attack has been rehauled so that they can damage one another, also drops and on_die function added
|
||||
1.07- Npc's can now be set to follow player or stand by using self.order and self.owner variables
|
||||
beta- Npc mob added, kills monsters, attacks player when punched, right click with food to heal or gold lump for drop
|
||||
1.06- Changed recovery times after breeding, and time taken to grow up (can be sped up by feeding baby animal)
|
||||
1.05- Added ExeterDad's bunny's which can be picked up and tamed with 4 carrots from farming redo or farming_plus, also shears added to get wool from sheep and lastly Jordach/BSD's kitten
|
||||
1.04- Added mating for sheep, cows and hogs... feed animals to make horny and hope for a baby which is half size, will grow up quick though :)
|
||||
|
@ -1,4 +1,4 @@
|
||||
-- Mobs Api (11th April 2015)
|
||||
-- Mobs Api (20th April 2015)
|
||||
mobs = {}
|
||||
mobs.mod = "redo"
|
||||
|
||||
@ -19,7 +19,6 @@ function mobs:register_mob(name, def)
|
||||
on_die = def.on_die,
|
||||
jump_height = def.jump_height or 6,
|
||||
jump_chance = def.jump_chance or 0,
|
||||
footstep = def.footstep,
|
||||
rotate = def.rotate or 0, -- 0=front, 1.5=side, 3.0=back, 4.5=side2
|
||||
lifetimer = def.lifetimer or 600,
|
||||
hp_min = def.hp_min or 5,
|
||||
@ -182,26 +181,36 @@ lifetimer = def.lifetimer or 600,
|
||||
end
|
||||
|
||||
-- check for mob drop/replace (used for chicken egg and sheep eating grass/wheat)
|
||||
if self.replace_rate and math.random(1,self.replace_rate) == 1 and self.child == false then
|
||||
local pos = self.object:getpos() ; pos.y = pos.y + self.replace_offset
|
||||
if self.footstep and self.object:getvelocity().y == 0 and minetest.get_node(pos).name == "air" then minetest.set_node(pos, {name = self.footstep}) end
|
||||
if self.replace_rate
|
||||
and math.random(1,self.replace_rate) == 1
|
||||
and self.child == false then
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + self.replace_offset
|
||||
if #minetest.find_nodes_in_area(pos,pos,self.replace_what) > 0
|
||||
and self.object:getvelocity().y == 0
|
||||
and self.replace_what
|
||||
and self.state == "stand" then
|
||||
and self.replace_what then
|
||||
--and self.state == "stand" then
|
||||
minetest.set_node(pos, {name = self.replace_with})
|
||||
end
|
||||
end
|
||||
|
||||
-- gravity, falling or floating in water
|
||||
if self.floats == 1 then
|
||||
-- jump direction (adapted from Carbone mobs), gravity, falling or floating in water
|
||||
if self.object:getvelocity().y > 0.1 then
|
||||
local yaw = self.object:getyaw() + self.rotate
|
||||
local x = math.sin(yaw) * -2
|
||||
local z = math.cos(yaw) * 2
|
||||
|
||||
if minetest.get_item_group(minetest.get_node(self.object:getpos()).name, "water") ~= 0 then
|
||||
self.object:setacceleration({x = 0, y = 1.5, z = 0})
|
||||
if self.floats == 1 then self.object:setacceleration({x = x, y = 1.5, z = z}) end
|
||||
else
|
||||
self.object:setacceleration({x = x, y = self.fall_speed, z = z})
|
||||
end
|
||||
else
|
||||
if minetest.get_item_group(minetest.get_node(self.object:getpos()).name, "water") ~= 0 then
|
||||
if self.floats == 1 then self.object:setacceleration({x = 0, y = 1.5, z = 0}) end
|
||||
else
|
||||
self.object:setacceleration({x = 0, y = self.fall_speed, z = 0})
|
||||
end
|
||||
else
|
||||
self.object:setacceleration({x = 0, y = self.fall_speed, z = 0})
|
||||
end
|
||||
|
||||
-- fall damage
|
||||
@ -214,7 +223,7 @@ lifetimer = def.lifetimer or 600,
|
||||
self.old_y = self.object:getpos().y
|
||||
end
|
||||
|
||||
-- knock back timer
|
||||
-- knockback timer
|
||||
if self.pause_timer > 0 then
|
||||
self.pause_timer = self.pause_timer - dtime
|
||||
if self.pause_timer < 1 then
|
||||
@ -540,7 +549,21 @@ lifetimer = def.lifetimer or 600,
|
||||
|
||||
elseif self.state == "walk" then
|
||||
|
||||
if math.random(1, 100) <= 30 then
|
||||
local lp = nil
|
||||
local s = self.object:getpos()
|
||||
-- if there is water nearby, try to avoid it
|
||||
local lp = minetest.find_node_near(s, 2, {"group:water"})
|
||||
|
||||
if lp ~= nil then
|
||||
local vec = {x=lp.x-s.x, y=lp.y-s.y, z=lp.z-s.z}
|
||||
yaw = math.atan(vec.z/vec.x) + 3*math.pi / 2 + self.rotate
|
||||
if lp.x > s.x then
|
||||
yaw = yaw+math.pi
|
||||
end
|
||||
self.object:setyaw(yaw)
|
||||
|
||||
-- no water near, so randomly turn
|
||||
elseif math.random(1, 100) <= 30 then
|
||||
self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/180*math.pi))
|
||||
end
|
||||
if self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
|
||||
@ -555,6 +578,7 @@ lifetimer = def.lifetimer or 600,
|
||||
self.state = "stand"
|
||||
self:set_animation("stand")
|
||||
end
|
||||
|
||||
-- Modif MFF "attack type kamicaze" des creepers /DEBUT
|
||||
elseif self.state == "attack" and self.attack_type == "kamicaze" then
|
||||
if not self.attack.player or not self.attack.player:is_player() then
|
||||
@ -595,7 +619,7 @@ lifetimer = def.lifetimer or 600,
|
||||
self.v_start = true
|
||||
self.set_velocity(self, self.run_velocity)
|
||||
self.timer = 0
|
||||
self.blinktimer = 0
|
||||
self.blinktimer = 0
|
||||
else
|
||||
self.timer = 0
|
||||
self.blinktimer = 0
|
||||
@ -683,6 +707,7 @@ lifetimer = def.lifetimer or 600,
|
||||
end
|
||||
end
|
||||
-- Modif MFF "attack type kamicaze" des creepers /FIN
|
||||
|
||||
elseif self.state == "attack" and self.attack_type == "dogfight" then
|
||||
|
||||
if not self.attack.player or not self.attack.player:getpos() then
|
||||
@ -710,7 +735,7 @@ lifetimer = def.lifetimer or 600,
|
||||
yaw = yaw+math.pi
|
||||
end
|
||||
self.object:setyaw(yaw)
|
||||
if self.attack.dist > 2 then
|
||||
if self.attack.dist > 3 then -- was set to 2 but slimes didnt hurt when above player
|
||||
-- jump attack
|
||||
if (self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0)
|
||||
or (self.object:getvelocity().y == 0 and self.jump_chance > 0) then
|
||||
@ -979,11 +1004,11 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, inter
|
||||
|
||||
-- are we spawning inside a solid node?
|
||||
local nod = minetest.get_node_or_nil(pos)
|
||||
if not nod or not minetest.registered_nodes[nod.name]
|
||||
if not nod or not nod.name or not minetest.registered_nodes[nod.name]
|
||||
or minetest.registered_nodes[nod.name].walkable == true then return end
|
||||
pos.y = pos.y + 1
|
||||
nod = minetest.get_node_or_nil(pos)
|
||||
if not nod or not minetest.registered_nodes[nod.name]
|
||||
if not nod or not nod.name or not minetest.registered_nodes[nod.name]
|
||||
or minetest.registered_nodes[nod.name].walkable == true then return end
|
||||
|
||||
if minetest.setting_getbool("display_mob_spawn") then
|
||||
@ -1053,6 +1078,7 @@ function check_for_death(self)
|
||||
self.on_die(self, pos)
|
||||
end
|
||||
end
|
||||
|
||||
-- Modif MFF "fonction TNT" des creepers /DEBUT
|
||||
function do_tnt_physics(tnt_np,tntr,entity)
|
||||
local objs = minetest.get_objects_inside_radius(tnt_np, tntr)
|
||||
|
@ -93,7 +93,7 @@ mobs:register_mob("mobs:chicken", {
|
||||
end,
|
||||
})
|
||||
-- spawn on default or bamboo grass between 8 and 20 light, 1 in 10000 change, 1 chicken in area up to 31000 in height
|
||||
mobs:register_spawn("mobs:chicken", {"default:dirt_with_grass"}, 20, 0, 10000, 1, 31000)
|
||||
mobs:register_spawn("mobs:chicken", {"default:dirt_with_grass"}, 20, 8, 10000, 1, 31000)
|
||||
-- register spawn egg
|
||||
mobs:register_egg("mobs:chicken", "Chicken", "mobs_chicken_inv.png", 0)
|
||||
|
||||
|
@ -112,7 +112,7 @@ mobs:register_mob("mobs:cow", {
|
||||
end,
|
||||
})
|
||||
-- spawn on default;green;prairie grass between 0 and 20 light, 1 in 11000 chance, 1 cow in area up to 31000 in height
|
||||
mobs:register_spawn("mobs:cow", {"default:dirt_with_grass"}, 20, 0, 10000, 1, 31000)
|
||||
mobs:register_spawn("mobs:cow", {"default:dirt_with_grass"}, 20, 8, 10000, 1, 31000)
|
||||
-- register spawn egg
|
||||
mobs:register_egg("mobs:cow", "Cow", "default_grass.png", 1)
|
||||
|
||||
|
@ -31,7 +31,7 @@ mobs:register_mob("mobs:lava_flan", {
|
||||
walk_velocity = 0.5,
|
||||
run_velocity = 2,
|
||||
jump = true,
|
||||
-- step = 2, (c'était pas mal, voir comment faire pour le remettre comme ça ?)
|
||||
-- step = 2, (was good with this value, but don't care now because Lava Slime remplace Lava Flan)
|
||||
view_range = 16,
|
||||
floats = 1,
|
||||
-- chance of dropping lava orb when dead
|
||||
|
@ -20,7 +20,7 @@ mobs:register_mob("mobs:stone_monster", {
|
||||
{"mobs_stone_monster.png"},
|
||||
},
|
||||
visual_size = {x=3, y=2.6},
|
||||
blood_texture = "mobs_blood.png",
|
||||
blood_texture = "default_stone.png",
|
||||
-- sounds
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
|
BIN
mods/mobs/textures/mobs_shears.png
Executable file → Normal file
BIN
mods/mobs/textures/mobs_shears.png
Executable file → Normal file
Binary file not shown.
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 224 B |
@ -57,7 +57,7 @@ mobs:register_mob("mobs:tree_monster", {
|
||||
},
|
||||
})
|
||||
-- spawn on leaves and beech_leaves, between 0 and 5 light, 1 in 8000 chance, 1 in area up to 31000 in height
|
||||
mobs:register_spawn("mobs:tree_monster", {"default:leaves", "moretrees:beech_leaves"}, 3, -1, 8000, 1, 31000)
|
||||
mobs:register_spawn("mobs:tree_monster", {"default:leaves", "moretrees:beech_leaves"}, 5, 0, 8000, 1, 31000)
|
||||
-- register spawn egg
|
||||
mobs:register_egg("mobs:tree_monster", "Tree Monster", "default_tree_top.png", 1)
|
||||
|
||||
|
Reference in New Issue
Block a user