mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
teleport host to kolmi if far away from boss
This commit is contained in:
parent
04508ad290
commit
9db95a9cad
1 changed files with 13 additions and 0 deletions
|
@ -118,6 +118,10 @@ np.CrossCallAdd("ew_kolmi_anim", rpc.kolmi_anim)
|
||||||
|
|
||||||
np.CrossCallAdd("ew_kolmi_shield", rpc.kolmi_shield)
|
np.CrossCallAdd("ew_kolmi_shield", rpc.kolmi_shield)
|
||||||
|
|
||||||
|
local function is_in_box(x1, x2, y1, y2, x, y)
|
||||||
|
return x1 < x and x < x2 and y1 < y and y < y2
|
||||||
|
end
|
||||||
|
|
||||||
ctx.cap.item_sync.register_pickup_handler(function(item_id)
|
ctx.cap.item_sync.register_pickup_handler(function(item_id)
|
||||||
if ctx.is_host and EntityHasTag(item_id, "this_is_sampo") then
|
if ctx.is_host and EntityHasTag(item_id, "this_is_sampo") then
|
||||||
-- Check if it's the first time we pick it up to avoid that sound on later pickups.
|
-- Check if it's the first time we pick it up to avoid that sound on later pickups.
|
||||||
|
@ -129,6 +133,15 @@ ctx.cap.item_sync.register_pickup_handler(function(item_id)
|
||||||
local orbcount = GameGetOrbCountThisRun() + newgame_n
|
local orbcount = GameGetOrbCountThisRun() + newgame_n
|
||||||
rpc.kolmi_shield(true, orbcount)
|
rpc.kolmi_shield(true, orbcount)
|
||||||
rpc.init_boss(orbcount)
|
rpc.init_boss(orbcount)
|
||||||
|
local x, y = EntityGetTransform(ctx.my_player.entity)
|
||||||
|
if not is_in_box(1530, 4130, 12300, 13300, x, y) then
|
||||||
|
async(function()
|
||||||
|
x, y = 3244, 13084
|
||||||
|
EntitySetTransform(ctx.my_player.entity, x, y)
|
||||||
|
wait(30)
|
||||||
|
EntitySetTransform(ctx.my_player.entity, x, y)
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue