mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Make dropped items larger and rotate faster
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
This commit is contained in:
parent
f0cd59034c
commit
d7b3046cf6
@ -21,9 +21,9 @@ core.register_entity(":__builtin:item", {
|
|||||||
hp_max = 1,
|
hp_max = 1,
|
||||||
physical = true,
|
physical = true,
|
||||||
collide_with_objects = false,
|
collide_with_objects = false,
|
||||||
collisionbox = {-0.24, -0.24, -0.24, 0.24, 0.24, 0.24},
|
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3},
|
||||||
visual = "wielditem",
|
visual = "wielditem",
|
||||||
visual_size = {x = 0.3, y = 0.3},
|
visual_size = {x = 0.4, y = 0.4},
|
||||||
textures = {""},
|
textures = {""},
|
||||||
spritediv = {x = 1, y = 1},
|
spritediv = {x = 1, y = 1},
|
||||||
initial_sprite_basepos = {x = 0, y = 0},
|
initial_sprite_basepos = {x = 0, y = 0},
|
||||||
@ -43,8 +43,8 @@ core.register_entity(":__builtin:item", {
|
|||||||
count = max_count
|
count = max_count
|
||||||
self.itemstring = stack:get_name().." "..max_count
|
self.itemstring = stack:get_name().." "..max_count
|
||||||
end
|
end
|
||||||
local s = 0.15 + 0.15 * (count / max_count)
|
local s = 0.2 + 0.1 * (count / max_count)
|
||||||
local c = 0.8 * s
|
local c = s
|
||||||
local itemtable = stack:to_table()
|
local itemtable = stack:to_table()
|
||||||
local itemname = nil
|
local itemname = nil
|
||||||
if itemtable then
|
if itemtable then
|
||||||
@ -62,7 +62,7 @@ core.register_entity(":__builtin:item", {
|
|||||||
textures = {itemname},
|
textures = {itemname},
|
||||||
visual_size = {x = s, y = s},
|
visual_size = {x = s, y = s},
|
||||||
collisionbox = {-c, -c, -c, c, c, c},
|
collisionbox = {-c, -c, -c, c, c, c},
|
||||||
automatic_rotate = math.pi * 0.2,
|
automatic_rotate = math.pi * 0.5,
|
||||||
}
|
}
|
||||||
self.object:set_properties(prop)
|
self.object:set_properties(prop)
|
||||||
end,
|
end,
|
||||||
@ -104,7 +104,7 @@ core.register_entity(":__builtin:item", {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
local p = self.object:getpos()
|
local p = self.object:getpos()
|
||||||
p.y = p.y - 0.3
|
p.y = p.y - 0.5
|
||||||
local nn = core.get_node(p).name
|
local nn = core.get_node(p).name
|
||||||
-- If node is not registered or node is walkably solid and resting on nodebox
|
-- If node is not registered or node is walkably solid and resting on nodebox
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:getvelocity()
|
||||||
@ -133,8 +133,8 @@ core.register_entity(":__builtin:item", {
|
|||||||
local name = stack:get_name()
|
local name = stack:get_name()
|
||||||
if not overflow then
|
if not overflow then
|
||||||
obj.itemstring = name.." "..count
|
obj.itemstring = name.." "..count
|
||||||
s = 0.15 + 0.15 * (count / max_count)
|
s = 0.2 + 0.1 * (count / max_count)
|
||||||
c = 0.8 * s
|
c = s
|
||||||
object:set_properties({
|
object:set_properties({
|
||||||
visual_size = {x = s, y = s},
|
visual_size = {x = s, y = s},
|
||||||
collisionbox = {-c, -c, -c, c, c, c}
|
collisionbox = {-c, -c, -c, c, c, c}
|
||||||
@ -142,15 +142,15 @@ core.register_entity(":__builtin:item", {
|
|||||||
self.object:remove()
|
self.object:remove()
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
s = 0.3
|
s = 0.4
|
||||||
c = 0.24
|
c = 0.3
|
||||||
object:set_properties({
|
object:set_properties({
|
||||||
visual_size = {x = s, y = s},
|
visual_size = {x = s, y = s},
|
||||||
collisionbox = {-c, -c, -c, c, c, c}
|
collisionbox = {-c, -c, -c, c, c, c}
|
||||||
})
|
})
|
||||||
obj.itemstring = name.." "..max_count
|
obj.itemstring = name.." "..max_count
|
||||||
s = 0.15 + 0.15 * (count / max_count)
|
s = 0.2 + 0.1 * (count / max_count)
|
||||||
c = 0.8 * s
|
c = s
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
visual_size = {x = s, y = s},
|
visual_size = {x = s, y = s},
|
||||||
collisionbox = {-c, -c, -c, c, c, c}
|
collisionbox = {-c, -c, -c, c, c, c}
|
||||||
|
Loading…
Reference in New Issue
Block a user