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

@ -5,7 +5,7 @@ artifact = {
-- This toggles a lot of things, including whether initialization takes place,
-- whether nodes can be pointed, and whether the player is permitted to
-- bypass certain restrictions imposed by the story.
debug = true,
debug = false,
colors = {
gold = "#faf17a",
red = "#e94f3f",
@ -54,6 +54,25 @@ function Promise(fn)
}
end
function artifact.play_sound(def)
def.max_hear_distance = def.range
--def.gain = nil
if def.pos then
for _, m in pairs(artifact.players) do
local dist = m.pos:distance(def.pos)
if dist <= (def.range or 32) and m.name ~= def.exclude_player and not (def.to_player and m.name ~= def.to_player) then
def.to_player = m.name
def.gain = (def.gain or 1) *(1 -math.sqrt(dist /(def.range or 32)))
minetest.sound_play(def, def)
end
end
else
minetest.sound_play(def.name, def)
end
end
-- HACK: Lookup table for getting a rotation from a
-- facedir (because Minetest doesn't have any way
-- to get this information normally)