require("config.util") local mods = {} function mods.crouch_hurtbox(pat) local function adjust(seq, off, idx) pat:update_frame(seq, off, idx, function(frame) frame.hurtbox[1].y1 = frame.hurtbox[1].y1 - 10 end) end for idx = 2, 4 do adjust(1, 0, idx) end for idx = 0, 1 do adjust(3, 0, idx) end adjust(2, 0, 0) end function mods.adjust_j44_cancel(pat, delta) pat:update_frame(203, 0, 0, { duration = 2 + delta }) end function mods.hit_parameters_aaa(pat) pat:update_frame(321, 0, 4, { hit_ani_ground = 0, combo_correction = 0, }) end function mods.frame_advantage_dc(pat) table.foreach({{0,9},{0,10},{0,0},{0,1},{0,2}}, function(off, idx) pat:update_frame(418, off, idx, { blockstop_self = 10 }) end) end function mods.b_series_motion_cancel_2(pat) table.foreach({400, 401, 402, 404, 405, 406}, function(seq) pat:update_frame(seq, 0, 7, function(frame) unset_fflag(frame, FF_MOTION_CANCEL) end) end) end function mods.b_series_motion_cancel_2(pat) table.foreach({400, 401, 402, 404, 405, 406}, function(seq) local shift = seq < 404 and 1 or 0 pat:update_frame(seq, 0, 3, { duration = 1 }) pat:update_frame(seq, 0, 4 + shift, { duration = 2 }) pat:update_frame(seq, 0, 6, { duration = 1 }) pat:update_frame(seq, 0, 7 + shift, { duration = 2 }) pat:update_frame(seq, 0, 10, { duration = 6 }) pat:update_frame(seq, 0, 11, { duration = 6 }) pat:update_frame(seq, 0, 12, { duration = 6 }) pat:update_frame(seq, 0, 13, { duration = 6 }) for idx = 7, 9 do pat:update_frame(seq, 0, idx, function(frame) unset_fflag(frame, FF_MOTION_CANCEL) end) end end) end function mods.mind_explosion_motion_cancel(pat) for seq = 500, 501 do pat:update_frame(seq, 0, 3, { duration = 3 }) pat:update_frame(seq, 0, 4, { duration = 3 }) -- pat:update_frame(seq, 0, 5, { duration = 6 }) -- pat:update_frame(seq, 0, 6, { duration = 6 }) end end function mods.mind_explosion_object_parameters(pat) pat:update_frame(810, 0, 0, { chip_damage = 70 }) pat:update_frame(810, 0, 1, { chip_damage = 70 }) pat:update_frame(810, 1, 0, { chip_damage = 80 }) end function mods.elixir_explosion_mutual_damage(pat) for idx = 0, 1 do pat:update_frame(859, 6, idx, function(frame) frame.damage = 10000 set_aflag(frame, AF_CAN_HIT_SELF) frame.attackbox[1] = { x1=-10000, y1=-10000, x2=10000, y2=10000 } -- show_message_box(frame.scale_x) end) end end return function(pat) if config:get("udonge", "grand_patriots_elixir", "mutual_explosion") then mods.elixir_explosion_mutual_damage(pat) end if config:get("udonge", "dial_a", "aaa_remove_launch") then mods.hit_parameters_aaa(pat) end if config:get("udonge", "b_series", "adjust_motion_cancel") == 1 then mods.b_series_motion_cancel_1(pat) end if config:get("udonge", "b_series", "adjust_motion_cancel") == 2 then mods.b_series_motion_cancel_2(pat) end if config:get("udonge", "dc", "adjust_frame_advantage") then mods.frame_advantage_dc(pat) end if config:get("udonge", "mind_explosion", "adjust_motion_cancel") then mods.mind_explosion_motion_cancel(pat) end if config:get("udonge", "mind_explosion", "adjust_object_parameters") then mods.mind_explosion_object_parameters(pat) end if config:get("udonge", "crouch", "adjust_hurtbox") then mods.crouch_hurtbox(pat) end mods.adjust_j44_cancel(pat, config:getdef("udonge", "j44", "delay_attack_cancel_by", 0)) end