Add the rest of the game.
This commit is contained in:
parent
dd73665a23
commit
9096c33a48
49 changed files with 855 additions and 57 deletions
|
|
@ -528,13 +528,22 @@ Player = setmetatable({
|
|||
end
|
||||
})
|
||||
|
||||
-- Skip the death screen. Once we have an actual damage
|
||||
-- system, this can be customized properly.
|
||||
function minetest.show_death_screen(p, reason)
|
||||
p:respawn()
|
||||
end
|
||||
|
||||
-- Override respawning, so we can save progress.
|
||||
minetest.register_on_respawnplayer(function(p)
|
||||
local m = artifact.players[p:get_player_name()]
|
||||
return true
|
||||
--[[ Disabled due to current lack of purpose.
|
||||
if m.spawn_point then
|
||||
p:set_pos(m.spawn_point)
|
||||
return true
|
||||
end
|
||||
--]]
|
||||
end)
|
||||
|
||||
-- Mirror the player's HP in our custom HUD.
|
||||
|
|
@ -584,14 +593,6 @@ function artifact.register_input(name)
|
|||
local m = artifact.players[p:get_player_name()]
|
||||
if not m._swapping_character and (artifact.debug or artifact.story.get_state() > artifact.story.states.pre_vix) then
|
||||
artifact.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
|
||||
end
|
||||
return s
|
||||
end,
|
||||
|
|
@ -634,6 +635,13 @@ minetest.register_on_joinplayer(function(p)
|
|||
end
|
||||
end)
|
||||
|
||||
-- Imposters will be kicked. (But why would you run this on a server anyway?)
|
||||
minetest.register_on_prejoinplayer(function(name)
|
||||
if name == "Key" or name == "Vix" then
|
||||
return "That name is already taken by one of the characters!"
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(p)
|
||||
artifact.players[p:get_player_name()] = nil
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue