From 4171fefb00c12fffc5d67e7e3a84bdf842efe3de Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 26 Feb 2023 12:26:01 -0800 Subject: [PATCH] Fixed human mode --- celeste/resources/carts/hackcel.p8 | 67 ++++++++++++++++-------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/celeste/resources/carts/hackcel.p8 b/celeste/resources/carts/hackcel.p8 index 5d4bfd2..82e6594 100755 --- a/celeste/resources/carts/hackcel.p8 +++ b/celeste/resources/carts/hackcel.p8 @@ -38,7 +38,7 @@ k_dash=5 -- - screenshots at every frame -- - frame skipping -- - waiting for input -hack_human_mode = false +hack_human_mode = true -- If true, disable screensake hack_no_shake = true @@ -286,11 +286,11 @@ player = this.djump-=1 this.dash_time=4 has_dashed=true - + -- HACK: fast-forward dashes hack_frame_foward_bonus = 10 hack_can_dash = false - + this.dash_effect_time=10 local v_input=(btn(k_up) and -1 or (btn(k_down) and 1 or 0)) if input!=0 then @@ -1211,9 +1211,38 @@ function load_room(x,y) end end --- update function -- ------------------------ +function hack_send_state() + out_string = "dc:" .. tostr(deaths) .. ";" + + -- Dash status + if hack_can_dash then + out_string = out_string .. "ds:t;" + else + out_string = out_string .. "ds:f;" + end + + -- Player state + for k, v in pairs(hack_player_state) do + out_string = out_string .. k ..":" .. v .. ";" + end + + -- Fruit status + out_string = out_string .. "fr:" + for i = 0,29 do + if got_fruit[i] then + out_string = out_string .. "t" + else + out_string = out_string .. "f" + end + end + out_string = out_string .. ";" + printh(out_string) +end + + +-- update function -- +---------------------- -- _update runs at 30 fps -- _update60 does 60 fps @@ -1221,6 +1250,7 @@ end function _update() if hack_human_mode then old_update() + hack_send_state() return end @@ -1287,32 +1317,7 @@ function _update() hack_has_sent_first_message = true - out_string = "dc:" .. tostr(deaths) .. ";" - - -- Dash status - if hack_can_dash then - out_string = out_string .. "ds:t;" - else - out_string = out_string .. "ds:f;" - end - - - -- Fruit status - out_string = out_string .. "fr:" - for i = 0,29 do - if got_fruit[i] then - out_string = out_string .. "t" - else - out_string = out_string .. "f" - end - end - out_string = out_string .. ";" - - - for k, v in pairs(hack_player_state) do - out_string = out_string .. k ..":" .. v .. ";" - end - printh(out_string) + hack_send_state() end -- Called at the same rate as _update,