From 34d6849d33b379dd953a50525c35c4094de34148 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Mon, 28 Oct 2024 11:58:03 -0400 Subject: [PATCH] get stuck less in HM walls from tether and stuff* --- quant.ew/files/system/ending/ending.lua | 6 ++++++ quant.ew/files/system/notplayer_ai/notplayer_ai.lua | 12 +++++++++++- .../files/system/player_tether/player_tether.lua | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/quant.ew/files/system/ending/ending.lua b/quant.ew/files/system/ending/ending.lua index 5444a2b1..e1a6c2f2 100644 --- a/quant.ew/files/system/ending/ending.lua +++ b/quant.ew/files/system/ending/ending.lua @@ -9,6 +9,11 @@ local module = {} util.replace_text_in("data/entities/animals/boss_centipede/sampo.xml", "data/entities/animals/boss_centipede/ending/sampo_start_ending_sequence.lua", "mods/quant.ew/files/system/ending/ending_sequence.lua") +local function float() + local character_data = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "CharacterDataComponent") + ComponentSetValue2(character_data, "mVelocity", 0, -40) +end + rpc.opts_reliable() rpc.opts_everywhere() function rpc.gather_and_do_ending(x, y, sx, sy) @@ -30,6 +35,7 @@ function rpc.gather_and_do_ending(x, y, sx, sy) wait(30) EntitySetTransform(ctx.my_player.entity, x, y) + float() -- Emulate the following script being called from LuaComponent local old_updated = GetUpdatedEntityID diff --git a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua index d9624fa0..6c1bac2b 100644 --- a/quant.ew/files/system/notplayer_ai/notplayer_ai.lua +++ b/quant.ew/files/system/notplayer_ai/notplayer_ai.lua @@ -882,6 +882,11 @@ local function teleport_to_next_hm() end end +local function float() + local character_data = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "CharacterDataComponent") + ComponentSetValue2(character_data, "mVelocity", 0, -40) +end + local function teleport_outside_cursed() --17370 < x < 18470 --53210 < x @@ -894,7 +899,12 @@ local function teleport_outside_cursed() local x, _ = EntityGetTransform(ctx.my_player.entity) local how_far_right = (x - (17370+550)) % 35840 if how_far_right <= 550 or how_far_right >= (35840 - 550) then - EntitySetTransform(ctx.my_player.entity, 14074, -820) + async(function() + EntitySetTransform(ctx.my_player.entity, 14074, -820) + wait(30) + EntitySetTransform(ctx.my_player.entity, 14074, -820) + float() + end) end end diff --git a/quant.ew/files/system/player_tether/player_tether.lua b/quant.ew/files/system/player_tether/player_tether.lua index 511aa006..56fd6570 100644 --- a/quant.ew/files/system/player_tether/player_tether.lua +++ b/quant.ew/files/system/player_tether/player_tether.lua @@ -161,11 +161,17 @@ local function set_tether_length(length, entity) end end +local function float() + local character_data = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "CharacterDataComponent") + ComponentSetValue2(character_data, "mVelocity", 0, -80) +end + function rpc.teleport_to_tower() async(function() EntitySetTransform(ctx.my_player.entity, 9740, 9100) wait(30) EntitySetTransform(ctx.my_player.entity, 9740, 9100) + float() end) end @@ -241,6 +247,7 @@ function module.on_world_update_client() EntitySetTransform(ctx.my_player.entity, x, y) wait(40) EntitySetTransform(ctx.my_player.entity, x, y) + float() end) elseif tether_length_3 > tether_length_2 then tether_length_3 = math.max(math.min(tether_length_3, math.sqrt(dist_sq) + 256), tether_length_2)