Add forcefields, and start building the map.

This commit is contained in:
Signal 2025-11-20 03:15:30 -05:00
parent 5fd67703c0
commit b5bc0a34ea
12 changed files with 509 additions and 15 deletions

View file

@ -129,7 +129,7 @@ Player = setmetatable({
-- MARK: Pointing callbacks
local pointed_found = nil
m.pointed_node = nil
local pointed_node_found = nil
for x in minetest.raycast(m.pos, m.pos +(dir *5)) do
-- We should ignore all objects when placing a grabbed node.
if x and x.type == "object" and not m._grabbed_item then
@ -171,6 +171,24 @@ Player = setmetatable({
end
end
elseif x and x.type == "node" then
pointed_node_found = true
x.node_under = minetest.get_node(x.under)
local was_whackable = m.pointed_node and minetest.registered_nodes[m.pointed_node.node_under.name].groups.whackable
local whackable = m.character == "key" and minetest.registered_nodes[x.node_under.name].groups.whackable
if whackable and not was_whackable then
m.whack_hud = m.object:hud_add {
type = "image_waypoint",
world_pos = x.under,
scale = {x=3,y=3},
text = "artifact_icon_whack.png"
}
elseif whackable and x.under ~= (m.pointed_node and m.pointed_node.under) then
m.object:hud_change(m.whack_hud, "world_pos", x.under)
elseif not whackable and m.whack_hud then
m.object:hud_remove(m.whack_hud)
m.whack_hud = nil
end
m.pointed_node = x
if m.pointed_obj then
if m.pointed_obj.on_unhover then
@ -197,6 +215,14 @@ Player = setmetatable({
end
m.pointed_obj = nil
end
if not pointed_node_found then
m.pointed_node = nil
if m.whack_hud then
m.object:hud_remove(m.whack_hud)
m.whack_hud = nil
end
end
local ctl = m.object:get_player_control()
-- MARK: Animations
@ -314,6 +340,8 @@ Player = setmetatable({
-- MARK: Radial menu handling
--[[ Disabled for the present due to a dearth of usecases...
-- This should only work once we have Vix, since we can't use it without her.
if state >= artifact.story.states.main and ctl.place and not m.ctl.place and wi:get_name():find "artifact:input" and (not m.pointed_obj or not m.pointed_obj.on_interact or m.pointed_obj._no_interact) then
artifact.show_radial_menu(m, {
@ -389,6 +417,8 @@ Player = setmetatable({
end
end
--]]
-- MARK: Health regen
if m.next_regen and time -m.next_regen >= 0 then