Add the rest of the game.

This commit is contained in:
Signal 2025-11-29 17:24:33 -05:00
parent dd73665a23
commit 9096c33a48
49 changed files with 855 additions and 57 deletions

View file

@ -42,6 +42,15 @@ function ns.apply_vix(m)
end
function ns._swap_character(m)
-- If Key was pointing at something Vix shouldn't be able to interact with,
-- but Vix is also pointing at it, then remove the interaction marker since
-- it would be misleading.
if m.pointed_obj and m.interaction_marker and (not m.pointed_obj._can_interact or m.pointed_obj:_can_interact(m)) then
m.object:hud_remove(m.interaction_marker)
m.interaction_marker = nil
m.interaction_start = nil
end
if m.character == "vix" then
artifact.sidekick.character = "vix"
m:set_character("key")
@ -52,6 +61,17 @@ function ns._swap_character(m)
ns.apply_vix(m)
end
-- If Vix was pointing at something whackable, and the player then switches
-- to Key who is pointing at the same thing, we should show the whack icon.
if m.character == "key" and m.pointed_node and minetest.registered_nodes[m.pointed_node.node_under.name].groups.whackable then
m.whack_hud = m.object:hud_add {
type = "image_waypoint",
world_pos = m.pointed_node.under,
scale = {x=3,y=3},
text = "artifact_icon_whack.png"
}
end
-- We don't need to have the sidekick entity during testing.
if artifact.sidekick.pos or not artifact.debug then
-- `m.pos` includes eye_height, and we don't want that here.
@ -124,6 +144,10 @@ function ns.swap_character(m)
duration = 0.3
}
}
artifact.play_sound {
name = "artifact_character_swap",
to_player = m.name
}
minetest.after(0.3, function()
ns._swap_character(m)
fade:animate {