Add color swappers, color swapping, and color targets.

This commit is contained in:
Signal 2025-11-19 11:43:24 -05:00
parent 9acd605c86
commit 5fd67703c0
34 changed files with 688 additions and 29 deletions

View file

@ -41,7 +41,7 @@ function ns.apply_vix(m)
end
end
function ns.swap_character(m)
function ns._swap_character(m)
if m.character == "vix" then
artifact.sidekick.character = "vix"
m:set_character("key")
@ -103,6 +103,45 @@ function ns.swap_character(m)
artifact.sidekick.save()
end
function ns.swap_character(m)
if m._swapping_character then return end
if artifact.sidekick.ref then
artifact.sidekick.ref._no_interact = true
end
m._swapping_character = true
local fade = artifact.hud_add(m, {
type = "image",
pos = {x=0.5,y=1},
offset = {x=0,y=0},
align = {x=0,y=0},
scale = {x=50000,y=50000},
opacity = 0,
image = "[fill:1x1:0,0:#000",
})
fade:animate {
opacity = {
value = 256,
duration = 0.3
}
}
minetest.after(0.3, function()
ns._swap_character(m)
fade:animate {
opacity = {
value = 0,
duration = 0.3
}
}
minetest.after(0.3, function()
m._swapping_character = nil
if artifact.sidekick.ref then
artifact.sidekick.ref._no_interact = nil
end
end)
end)
end
include "key.lua"