mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Fix and tune things, add tool "recharge" animation, add dummyball
This commit is contained in:
parent
6b7d6c27ee
commit
989aba1966
10 changed files with 460 additions and 50 deletions
|
@ -698,21 +698,6 @@ end
|
|||
-- Built-in node definitions. Also defined in C.
|
||||
--
|
||||
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
wield_image = "wieldhand.png",
|
||||
wield_scale = {x=1,y=1,z=2.5},
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 2.0,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
fleshy = {times={[2]=2.00, [3]=1.00}, maxwear=0, maxlevel=1},
|
||||
crumbly = {times={[3]=0.70}, maxwear=0, maxlevel=1},
|
||||
snappy = {times={[3]=0.70}, maxwear=0, maxlevel=1},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_item(":unknown", {
|
||||
type = "none",
|
||||
description = "Unknown Item",
|
||||
|
@ -749,6 +734,11 @@ minetest.register_node(":ignore", {
|
|||
air_equivalent = true,
|
||||
})
|
||||
|
||||
-- The hand (bare definition)
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
})
|
||||
|
||||
--
|
||||
-- Default material types
|
||||
--
|
||||
|
|
|
@ -445,6 +445,22 @@ default = {}
|
|||
-- Tool definition
|
||||
--
|
||||
|
||||
-- The hand
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
wield_image = "wieldhand.png",
|
||||
wield_scale = {x=1,y=1,z=2.5},
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 1.0,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
fleshy = {times={[2]=2.00, [3]=1.00}, maxwear=0, maxlevel=1},
|
||||
crumbly = {times={[3]=0.70}, maxwear=0, maxlevel=1},
|
||||
snappy = {times={[3]=0.70}, maxwear=0, maxlevel=1},
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("default:pick_wood", {
|
||||
description = "Wooden Pickaxe",
|
||||
inventory_image = "default_tool_woodpick.png",
|
||||
|
@ -554,7 +570,7 @@ minetest.register_tool("default:sword_wood", {
|
|||
description = "Wooden Sword",
|
||||
inventory_image = "default_tool_woodsword.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 2.0,
|
||||
full_punch_interval = 1.0,
|
||||
max_drop_level=0,
|
||||
groupcaps={
|
||||
fleshy={times={[2]=1.10, [3]=0.60}, maxwear=0.1, maxlevel=1},
|
||||
|
@ -567,7 +583,7 @@ minetest.register_tool("default:sword_stone", {
|
|||
description = "Stone Sword",
|
||||
inventory_image = "default_tool_stonesword.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 2.0,
|
||||
full_punch_interval = 1.0,
|
||||
max_drop_level=0,
|
||||
groupcaps={
|
||||
fleshy={times={[2]=0.80, [3]=0.40}, maxwear=0.05, maxlevel=1},
|
||||
|
@ -580,7 +596,7 @@ minetest.register_tool("default:sword_steel", {
|
|||
description = "Steel Sword",
|
||||
inventory_image = "default_tool_steelsword.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 2.0,
|
||||
full_punch_interval = 1.0,
|
||||
max_drop_level=1,
|
||||
groupcaps={
|
||||
fleshy={times={[1]=1.00, [2]=0.40, [3]=0.20}, maxwear=0.1, maxlevel=2},
|
||||
|
|
|
@ -374,6 +374,51 @@ minetest.register_entity("experimental:tnt", TNT)
|
|||
-- Add TNT's old name also
|
||||
minetest.register_alias("TNT", "experimental:tnt")
|
||||
|
||||
--
|
||||
-- The dummyball!
|
||||
--
|
||||
|
||||
minetest.register_alias("dummyball", "experimental:dummyball")
|
||||
|
||||
minetest.register_entity("experimental:dummyball", {
|
||||
-- Static definition
|
||||
physical = false,
|
||||
collisionbox = {-0.4,-0.4,-0.4, 0.4,0.4,0.4},
|
||||
visual = "sprite",
|
||||
visual_size = {x=1, y=1},
|
||||
textures = {"experimental_dummyball.png"},
|
||||
spritediv = {x=1, y=3},
|
||||
initial_sprite_basepos = {x=0, y=0},
|
||||
-- Dynamic variables
|
||||
phase = 0,
|
||||
phasetimer = 0,
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
minetest.log("Dummyball activated!")
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
self.phasetimer = self.phasetimer + dtime
|
||||
if self.phasetimer > 2.0 then
|
||||
self.phasetimer = self.phasetimer - 2.0
|
||||
self.phase = self.phase + 1
|
||||
if self.phase >= 3 then
|
||||
self.phase = 0
|
||||
end
|
||||
self.object:setsprite({x=0, y=self.phase})
|
||||
phasearmor = {
|
||||
[0]={cracky=3},
|
||||
[1]={crumbly=3},
|
||||
[2]={fleshy=3}
|
||||
}
|
||||
self.object:set_armor_groups(phasearmor[self.phase])
|
||||
end
|
||||
end,
|
||||
|
||||
on_punch = function(self, hitter)
|
||||
end,
|
||||
})
|
||||
|
||||
--
|
||||
-- A test entity for testing animated and yaw-modulated sprites
|
||||
--
|
||||
|
|
BIN
data/mods/experimental/textures/experimental_dummyball.png
Normal file
BIN
data/mods/experimental/textures/experimental_dummyball.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 838 B |
Loading…
Add table
Add a link
Reference in a new issue