mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-01-11 18:40:25 +01:00
[mobs] Add do_not_project_items setting
- Pumpbooms don't affect items anymore (#232)
This commit is contained in:
parent
b62d415a60
commit
86e57814e6
@ -287,7 +287,9 @@ function entity_physics(pos, radius, self) --/MFF (Crabman|06/23/2015)add self t
|
||||
obj_vel = obj:getvelocity()
|
||||
--dist = math.max(1, vector.distance(pos, obj_pos))
|
||||
if obj_vel ~= nil then
|
||||
obj:setvelocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10))
|
||||
if not (obj:get_entity_name() == "__builtin:item" and self.do_not_project_items) then
|
||||
obj:setvelocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10))
|
||||
end
|
||||
end
|
||||
--local damage = math.floor((4 / dist) * radius)
|
||||
obj:punch(self.object, 1.0,{full_punch_interval=1.0, damage_groups = {fleshy=self.damage} })--/MFF (Crabman|06/23/2015) use punch
|
||||
@ -419,6 +421,7 @@ minetest.register_entity(name, {
|
||||
health = 0,
|
||||
reach = def.reach or 3,
|
||||
htimer = 0,
|
||||
do_not_project_items = def.do_not_project_items or false,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
|
||||
|
@ -84,6 +84,7 @@ mobs:register_mob("mobs:pumpboom", {
|
||||
damage = 8,
|
||||
attack_type = "explode",
|
||||
group_attack = true,
|
||||
do_not_project_items = true,
|
||||
view_range = 15,
|
||||
walk_velocity = 2,
|
||||
run_velocity = 4,
|
||||
@ -103,7 +104,7 @@ minetest.register_node("mobs:pumpking_spawner", {
|
||||
"farming_pumpkin_face_on.png"
|
||||
},
|
||||
is_ground_content = false,
|
||||
groups = {cracky=3, stone=1, mob_spawner=1},
|
||||
groups = {unbkreakable = 1, mob_spawner=1},
|
||||
sounds = default.node_sound_stone_defaults({
|
||||
dug = {name="mobs_king", gain=0.25}
|
||||
})
|
||||
@ -120,7 +121,7 @@ minetest.register_node("mobs:pumpboom_spawner", {
|
||||
"farming_pumpkin_face_off.png"
|
||||
},
|
||||
is_ground_content = false,
|
||||
groups = {cracky=3, stone=1, mob_spawner=1},
|
||||
groups = {unbreakable = 1, mob_spawner=1},
|
||||
sounds = default.node_sound_stone_defaults({
|
||||
dug = {name="mobs_boom", gain=0.25}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user