make players non-physical in balloon_bop

master
MisterE123 2022-04-17 00:33:43 -04:00
parent 903436715c
commit ec53b34b24
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,7 @@
local modname = "balloon_bop"
balloon_bop = {}
balloon_bop.physical = {}
local round_time_default = 20
@ -34,12 +35,14 @@ arena_lib.register_minigame( modname , {
},
-- The prefix (string) is what's going to appear in most of the lines printed by your mod. Default is [Arena_lib]
-- The prefix (string) is what's going to appear in most of the lines printed by your mod.
-- Default is [Arena_lib]
prefix = "["..modname.."] ",
time_mode = 'incremental', -- for our sample minigame, we will use incrementing time. This will allow us to use on_time_tick if we want to.
time_mode = 'incremental', -- for our sample minigame, we will use incrementing time.
-- This will allow us to use on_time_tick if we want to.
hotbar = {

View File

@ -7,6 +7,7 @@
-- replace "sample_minigame" with the mod name here
balloon_bop.infohuds = {}
arena_lib.on_start("balloon_bop", function(arena)
for pl_name,stats in pairs(arena.players) do -- it is a good convention to use "pl_name" in for loops and "p_name" elsewhere
@ -22,6 +23,8 @@ arena_lib.on_start("balloon_bop", function(arena)
scale = {x = 100, y = 100}, -- covered later
size = {x = 2 },
})
balloon_bop.physical[pl_name] = player:get_properties().physical
player:set_properties({physical=false})
end
end
-- arena.current_round_time = arena.round_time
@ -52,6 +55,8 @@ arena_lib.on_join("balloon_bop", function(p_name, arena, as_spectator)
scale = {x = 100, y = 100}, -- covered later
size = {x = 2 },
})
balloon_bop.physical[pl_name] = player:get_properties().physical
player:set_properties({physical=false})
end
end
end)

View File

@ -75,5 +75,6 @@ arena_lib.on_quit("balloon_bop", function(arena, p_name, is_spectator)
if player then
player:hud_remove(balloon_bop.infohuds[pl_name])
balloon_bop.infohuds[p_name] = nil
player:set_properties({physical= balloon_bop.physical[pl_name] or true})
end
end)