Fix gear quenching, more item sounds

This commit is contained in:
Aaron Suen 2022-12-01 23:23:55 -05:00
parent a2ddc8fc7c
commit 43034d93e2
9 changed files with 57 additions and 12 deletions

@ -45,11 +45,11 @@ This game exists for a few reasons:
### TODO
- Add wieldtips (at least) as colorblindness is apparently a big obstacle for potion puzzles.
- Make the mold-cooling work the same way as in the original.
- The simplification compromise is probably no longer needed, and it breaks the new placement limitations.
- A lot of sound is missing
- Puzzle completion, magic effects
- Hiss of gear quenching
- Ambiance from fire, water
- Clock machine buttons
- Running forest machine
- More particle effects.
- Steam from quenching the molds?

@ -24,7 +24,6 @@ api.digparticles = function(pos, node)
})
end
local model = "piredo_terrain:xdecor__candle"
api.digsound = function(pos, node)
local def = minetest.registered_items[node.name]
local spec = def and def.sounds and (def.sounds.dug
@ -34,8 +33,6 @@ api.digsound = function(pos, node)
for k, v in pairs(spec) do param[k] = v end
param.pos = pos
minetest.sound_play(param.name, param, true)
elseif node.name ~= model then
return api.digsound(pos, {name = model})
end
end

@ -1,6 +1,6 @@
-- LUALOCALS < ---------------------------------------------------------
local ItemStack, addgroups, minetest, pairs, posrel
= ItemStack, addgroups, minetest, pairs, posrel
local ItemStack, addgroups, minetest, pairs, piredo_items, posrel
= ItemStack, addgroups, minetest, pairs, piredo_items, posrel
-- LUALOCALS > ---------------------------------------------------------
addgroups("piredo_terrain:piranesi__hot_stone", "hot_stone")
@ -36,14 +36,44 @@ minetest.override_item("piredo_terrain:piranesi__mold", {
end
})
minetest.override_item("piredo_terrain:piranesi__ice", {
on_apply_mold_full = function(_, _, _, user, pointed)
minetest.item_place_node(ItemStack("piredo_terrain:piranesi__gear"),
user, pointed)
return "piredo_terrain:piranesi__mold"
minetest.register_abm({
nodenames = {"piredo_terrain:piranesi__mold_full"},
interval = 2,
chance = 1,
action = function(pos, node)
local bpos = posrel(pos)(0, -1, 0)
local bnode = minetest.get_node(bpos)
if bnode.name ~= "piredo_terrain:piranesi__ice" then return end
node.name = "piredo_terrain:piranesi__mold_done"
minetest.swap_node(pos, node)
minetest.add_particlespawner({
amount = 50,
time = 1,
pos = pos,
radius = {min = 0, max = 0.5},
acc = {x = 0, y = 3, z = 0},
exptime = {min = 1, max = 3},
size = {min = 0.5, max = 2},
glow = 10,
texture = "default_item_smoke.png^[opacity:64",
})
end
})
do
local gear = "piredo_terrain:piranesi__gear"
minetest.override_item("piredo_terrain:piranesi__mold_done", {
on_punch = function(pos, node, player)
local stack = ItemStack(gear)
stack = player:get_inventory():add_item("main", stack)
if not stack:is_empty() then return end
node.name = "piredo_terrain:piranesi__mold"
minetest.swap_node(pos, node)
piredo_items.pickupeffect(pos, {name = gear})
end
})
end
for i = 1, 2 do
minetest.override_item("piredo_terrain:piranesi__machine_gear_" .. i .. "_e", {
on_apply_gear = function(pos, node, stack)

@ -252,6 +252,7 @@
"piranesi:machine_red" : true,
"piranesi:machine_yellow" : true,
"piranesi:mold" : true,
"piranesi:mold_done" : true,
"piranesi:mold_full" : true,
"piranesi:neck_totem" : true,
"piranesi:pine_tree" : true,
@ -358,6 +359,7 @@
},
"media" :
{
"default_item_smoke.png" : "textures",
"doors_door_open.ogg" : "sounds",
"doors_fencegate_open.ogg" : "sounds",
"doors_steel_door_open.ogg" : "sounds"

@ -3214,6 +3214,14 @@ reg({_raw_name = "piranesi:mold",
tiles = {"mold.png"},
type = "node"})
reg({_raw_name = "piranesi:mold_done",
description = "Mold",
drawtype = "nodebox",
node_box = piranesi_mold_node_box,
selection_box = piranesi_mold_node_box,
tiles = {"mold_done.png"},
type = "node"})
reg({_raw_name = "piranesi:mold_full",
description = "Mold",
drawtype = "nodebox",

@ -34,6 +34,12 @@ loadfile(minetest.get_modpath(modname) .. "/exported.lua")(function(def)
def.groups.connecty = 1
end
def.sounds = def.sounds or {}
def.sounds.dug = def.sounds.dug
or {gain = 0.25, name = "default_dug_node"}
def.sounds.place = def.sounds.place
or {gain = 1, name = "default_place_node_hard"}
minetest.register_item(myname, def)
minetest.register_alias(orig, myname)
end)

@ -154,6 +154,7 @@
"/textures/default_gravel.png" : "default",
"/textures/default_ice.png" : "default",
"/textures/default_invisible_node_overlay.png" : "default",
"/textures/default_item_smoke.png" : "default",
"/textures/default_jungleleaves.png" : "default",
"/textures/default_jungleleaves_simple.png" : "default",
"/textures/default_junglewood.png" : "default",
@ -265,6 +266,7 @@
"/textures/machine_yellow.png" : "piranesi",
"/textures/manu_clue_inv.png" : "piranesi",
"/textures/mold.png" : "piranesi",
"/textures/mold_done.png" : "piranesi",
"/textures/mold_full.png" : "piranesi",
"/textures/morelights_chain_d_inv.png" : "morelights",
"/textures/morelights_chain_l_inv.png" : "morelights",

Binary file not shown.

After

(image error) Size: 307 B

Binary file not shown.

After

(image error) Size: 719 B