require("config.util") local mods = {} function mods.startup_fa(pat) pat:update_frame(301, 0, 0, { duration = 1 }) end function mods.active_time_fa(pat) pat:update_frame(301, 0, 6, { duration = 6 }) end function mods.hurtbox_fa(pat) for off = 0, 1 do for idx = 7 - off, 10 - off do pat:update_frame(301, off, idx, function(frame) table.remove(frame.hurtbox) end) end end end function mods.startup_3a(pat) pat:update_frame(304, 0, 0, { duration = 2 }) pat:update_frame(304, 0, 1, { duration = 2 }) end function mods.startup_6a(pat) pat:update_frame(302, 0, 2, { duration = 5 }) end function mods.cancel_priority_aaa(pat) pat:get_sequence(321, 0):set_priority(10, 50) end function mods.da_high_hit(pat) msgbox("mods.da_high_hit") for idx = 6, 16, 10 do pat:update_frame(305, 0, idx, function(frame) unset_aflag(frame, AF_LOWBLOCK_OK) frame.sp_damage = 200 end) end end function mods.split_da_daa(pat) local function make_first(src) pat:add_sequence(305, 0, 0, 50, 50) local dst = pat:get_sequence(305, 0) for idx = 0, 9 do dst:add_frame(idx, src:get_frame(idx)) end dst:add_frame(10, pat:get_frame(320, 0, 10)) dst:update_frame(6, { duration = 3 }) dst:update_frame(7, { duration = 6 }) dst:update_frame(8, { duration = 5 }) dst:update_frame(9, { duration = 5 }) dst:update_frame(6, { blockstop_self = 11, blockstop_enemy = 9, }) end local function make_second(src) pat:add_sequence(305, 1, 0, 50, 50) local dst = pat:get_sequence(305, 1) local base = 10 for idx = 0, 10 do dst:add_frame(idx, src:get_frame(base + idx)) end end local src = pat:get_sequence(305, 0) make_first(src) make_second(src) end function mods.startup_db(pat) pat:update_frame(408, 0, 6, { duration = 3 }) end function mods.collision_box_dc(pat) local y1, y2 = (function(frame) local hbox = frame.hurtbox[1] -- show_message_box(table.tostring(frame.collision[1])) local offset = math.abs(hbox.x1 - frame.collision[1].x1) return hbox.y1 + offset, hbox.y2 - offset end)(pat:get_frame(418, 2, 0)) for off = 1, 2 do for idx = 0, pat:get_frame_count(418, off) - 1 do pat:update_frame(418, off, idx, function(frame) frame.collision[1].y1 = y1 frame.collision[1].y2 = y2 end) end end end function mods.spectre_dense_b_startup(pat) pat:update_frame(501, 0, 1, { duration = 3 }) for idx = 0, 2 do pat:update_frame(501, 2, idx, { duration = 3 }) end end function mods.spectre_dense_c_startup(pat) pat:update_frame(501, 0, 1, { duration = 2 }) for idx = 0, 1 do pat:update_frame(501, 2, idx, { duration = 2 }) end end function mods.unpleasant_mist_recovery(pat) local function set_cancels(frame) set_fflag(frame, FF_GUARD_CANCEL + FF_ATTACK_CANCEL + FF_MOTION_CANCEL) end for seq = 545, 548 do for idx = 1, 4 do pat:update_frame(seq, 3, idx, set_cancels) end end end function mods.gnome_thin_c_bullet_skill(pat) pat:update_frame(526, 0, 0, { duration = 3 }) pat:update_frame(526, 0, 1, { duration = 3 }) pat:update_frame(526, 0, 2, { duration = 4 }) pat:update_frame(526, 0, 7, function(frame) frame.attackbox = {} end) -- pat:update_frame(526, 0, 7, { duration = 8 }) pat:update_frame(526, 0, 8, { duration = 10 }) for idx = 9, 11 do pat:update_frame(526, 0, idx, set_motion_cancel) end end function mods.gnome_thin_motion_cancel(pat) pat:update_frame(525, 0, 8, { duration = 10 }) for idx = 9, 11 do pat:update_frame(525, 0, idx, set_motion_cancel) end for idx = 8, 11 do pat:update_frame(526, 0, idx, set_motion_cancel) end end function mods.gnome_thin_object_parameters(pat) for idx = 0, 1 do pat:update_frame(816, 0, idx, { untech = 45 }) end end function mods.missing_power_startup(pat, value) pat:update_frame(602, 0, 4, { duration = value }) end function mods.missing_power_inv_duration(pat) pat:update_frame(602, 0, 18, function(frame) unset_fflag(frame, FF_GRAB_INV + FF_MELEE_INV + FF_BULLET_INV) end) end function mods.three_step_destruction_aub(pat) local function set_aub(frame) unset_aflag(frame, AF_AIR_BLOCKABLE) end pat:update_frame(612, 2, 3, set_aub) pat:update_frame(612, 3, 4, set_aub) pat:update_frame(612, 4, 4, set_aub) end function mods.atlas_mid_hit(pat) for idx = 0, 7 do pat:update_frame(603, 2, idx, function(frame) set_aflag(frame, AF_LOWBLOCK_OK) end) end end return function(pat) mods.startup_fa(pat) mods.active_time_fa(pat) mods.hurtbox_fa(pat) mods.startup_3a(pat) mods.startup_6a(pat) if config:get("suika", "da", "reject_low_block") then mods.da_high_hit(pat) end if config:get("suika", "dial_a", "aaa_skill_cancelable") then mods.cancel_priority_aaa(pat) end if config:get("suika", "da", "split_second_hit") then mods.split_da_daa(pat) end mods.startup_db(pat) mods.collision_box_dc(pat) if config:get("suika", "spectre_dense", "modify_b_startup") then mods.spectre_dense_b_startup(pat) end if config:get("suika", "spectre_dense", "modify_c_startup") then mods.spectre_dense_c_startup(pat) end if config:get("suika", "gnome_thin", "c_remove_melee") then mods.gnome_thin_c_bullet_skill(pat) end if config:get("suika", "gnome_thin", "motion_cancelable") then mods.gnome_thin_motion_cancel(pat) end mods.gnome_thin_object_parameters(pat) mods.unpleasant_mist_recovery(pat) -- mods.missing_power_inv_duration(pat) if config:get("suika", "three_step_destruction", "air_unblockable") then mods.three_step_destruction_aub(pat) end if config:get("suika", "missing_power", "reduce_startup") then mods.missing_power_startup(pat, 45) end if config:get("suika", "throwing_atlas", "accept_low_block") then mods.atlas_mid_hit(pat) end end