mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-03-31 17:50:41 +02: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,8 +287,10 @@ function entity_physics(pos, radius, self) --/MFF (Crabman|06/23/2015)add self t
|
|||||||
obj_vel = obj:getvelocity()
|
obj_vel = obj:getvelocity()
|
||||||
--dist = math.max(1, vector.distance(pos, obj_pos))
|
--dist = math.max(1, vector.distance(pos, obj_pos))
|
||||||
if obj_vel ~= nil then
|
if obj_vel ~= nil then
|
||||||
|
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))
|
obj:setvelocity(calc_velocity(pos, obj_pos, obj_vel, radius * 10))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
--local damage = math.floor((4 / dist) * radius)
|
--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
|
obj:punch(self.object, 1.0,{full_punch_interval=1.0, damage_groups = {fleshy=self.damage} })--/MFF (Crabman|06/23/2015) use punch
|
||||||
--obj:set_hp(obj:get_hp() - damage)
|
--obj:set_hp(obj:get_hp() - damage)
|
||||||
@ -419,6 +421,7 @@ minetest.register_entity(name, {
|
|||||||
health = 0,
|
health = 0,
|
||||||
reach = def.reach or 3,
|
reach = def.reach or 3,
|
||||||
htimer = 0,
|
htimer = 0,
|
||||||
|
do_not_project_items = def.do_not_project_items or false,
|
||||||
|
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ mobs:register_mob("mobs:pumpboom", {
|
|||||||
damage = 8,
|
damage = 8,
|
||||||
attack_type = "explode",
|
attack_type = "explode",
|
||||||
group_attack = true,
|
group_attack = true,
|
||||||
|
do_not_project_items = true,
|
||||||
view_range = 15,
|
view_range = 15,
|
||||||
walk_velocity = 2,
|
walk_velocity = 2,
|
||||||
run_velocity = 4,
|
run_velocity = 4,
|
||||||
@ -103,7 +104,7 @@ minetest.register_node("mobs:pumpking_spawner", {
|
|||||||
"farming_pumpkin_face_on.png"
|
"farming_pumpkin_face_on.png"
|
||||||
},
|
},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {cracky=3, stone=1, mob_spawner=1},
|
groups = {unbkreakable = 1, mob_spawner=1},
|
||||||
sounds = default.node_sound_stone_defaults({
|
sounds = default.node_sound_stone_defaults({
|
||||||
dug = {name="mobs_king", gain=0.25}
|
dug = {name="mobs_king", gain=0.25}
|
||||||
})
|
})
|
||||||
@ -120,7 +121,7 @@ minetest.register_node("mobs:pumpboom_spawner", {
|
|||||||
"farming_pumpkin_face_off.png"
|
"farming_pumpkin_face_off.png"
|
||||||
},
|
},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {cracky=3, stone=1, mob_spawner=1},
|
groups = {unbreakable = 1, mob_spawner=1},
|
||||||
sounds = default.node_sound_stone_defaults({
|
sounds = default.node_sound_stone_defaults({
|
||||||
dug = {name="mobs_boom", gain=0.25}
|
dug = {name="mobs_boom", gain=0.25}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user