require("config.util") local mods = {} function mods.startup_6dd(pat) pat:update_frame(223, 0, 1, { duration = 6 }) end function mods.startup_6a(pat) pat:update_frame(302, 0, 0, { duration = 2 }) pat:update_frame(302, 0, 2, { duration = 3 }) pat:update_frame(302, 0, 3, { duration = 3 }) pat:update_frame(302, 0, 4, { duration = 3 }) end function mods.startup_3a(pat) -- for idx = 3, 5 do -- pat:update_frame(304, 0, idx, { duration = 4 }) -- end -- pat:remove_frame(304, 0, 0) -- pat:remove_frame(304, 0, 0) -- pat:remove_frame(304, 0, 0) -- pat:split_frame(304, 0, 0, 1, 1) -- pat:split_frame(304, 0, 0, 1, 1) -- pat:split_frame(304, 0, 0, 1, 1) for idx = 0, 5 do pat:update_frame(304, 0, idx, { duration = 2 }) end end function mods.untech_ja(pat) pat:update_frame(306, 0, 3, { untech = 30 }) pat:update_frame(306, 0, 4, { untech = 30 }) end function mods.untech_j6a(pat, untech) pat:update_frame(307, 0, 6, { untech = 60 }) pat:update_frame(307, 0, 7, { untech = 60 }) end function mods.recovery_j6a(pat) pat:update_frame(307, 0, 13, { duration = 4 }) pat:update_frame(307, 0, 15, { duration = 4 }) end function mods.j2a_damage_parameters(pat, damage, proration, limit) for idx = 0, 7 do pat:update_frame(308, 1, idx, { damage = damage, proration = proration, limit = limit }) end end function mods.recovery_j8a(pat) pat:update_frame(309, 2, 4, { duration = 4 }) end function mods.db_recovery(pat) pat:update_frame(408, 2, 1, { duration = 4 }) pat:update_frame(408, 2, 2, { duration = 3 }) pat:update_frame(408, 2, 3, { duration = 3 }) end function mods.db_cancel(pat) for off = 0, 2 do pat:get_sequence(408, off):set_priority(50, 50) end end function mods.hit_parameters_b(pat) pat:update_frame(800, 0, 0, { hitstop_enemy = 5 }) end function mods.motion_cancel_6b_j6b(pat) for seq = 401, 405, 4 do pat:update_frame(seq, 2, 4, function(frame) set_fflag(frame, FF_MOTION_CANCEL) end) end end function mods.motion_cancel_2b(pat) pat:update_frame(402, 0, 6, { duration = 3 }) pat:update_frame(402, 0, 7, { duration = 22 }) end function mods.motion_cancel_j2b(pat) -- pat:update_frame(406, 0, 6, { duration = 7 }) -- pat:update_frame(406, 0, 7, { duration = 23 }) pat:update_frame(406, 0, 6, { duration = 5 }) end function mods.hit_parameters_6c(pat) pat:update_frame(806, 3, 0, { untech = 40, hitstop_enemy = 20, sp_damage = 50, }) end function mods.bullet_priority_c(pat) for off = 0, 4 do pat:get_sequence(805, off):set_priority(20, 0) end end function mods.bullet_priority_6c(pat) for off = 0, 7 do pat:get_sequence(806, off):set_priority(20, 0) end end function mods.bullet_priority_2c(pat) for off = 0, 7 do pat:get_sequence(808, off):set_priority(20, 0) end end function mods.icicle_shot_startup(pat) for seq = 500, 502, 2 do pat:update_frame(seq, 0, 0, { duration = 3 }) pat:update_frame(seq, 0, 1, { duration = 3 }) pat:update_frame(seq, 0, 2, { duration = 4 }) pat:update_frame(seq, 0, 3, { duration = 4 }) pat:update_frame(seq, 1, 0, { duration = 4 }) pat:update_frame(seq, 1, 1, { duration = 4 }) end end function mods.frost_pillars_object_parameters(pat) for idx = 0, 3 do pat:update_frame(811, 11, idx, { sp_damage = 200 }) end end function mods.frost_pillars_motion_cancel(pat) pat:update_frame(506, 2, 4, set_motion_cancel) pat:update_frame(506, 2, 6, set_motion_cancel) end function mods.freezing_light_motion_cancel(pat) for seq = 510, 512 do pat:update_frame(seq, 2, 6, set_motion_cancel) end end function mods.freezing_light_enable_multihit(pat) pat:update_frame(812, 0, 0, { -- hitstop_enemy = 10, limit = 5, proration = 960, damage = 150, sp_damage = 20, }) end function mods.create_freezing_light_jc_version(pat) pat:add_mapping(513, 512) end function mods.ice_kick_hit_parameters(pat, untech) table.foreach({{530,3}, {531,3}, {532,1}, {533,1}}, function(seq, off) for idx = 0, 3 do pat:update_frame(seq, off, idx, { untech = untech }) end end) end function mods.icicle_rise_motion_cancel(pat) pat:update_frame(565, 2, 6, set_motion_cancel) pat:update_frame(565, 2, 7, set_motion_cancel) end function mods.icicle_rise_object_parameters(pat) for off = 6, 7 do pat:update_frame(826, off, 0, { damage = 200, chip_damage = 40, untech = 60, }) end end function mods.icicle_sword_ground_bounce(pat, y, untech) for seq = 570, 573 do pat:update_frame(seq, 2, 1, { untech = untech, hit_ani_air = 88, hit_ani_ground = 88, launch_vector_y = y, -- limit = 40, }) end end function mods.icicle_sword_hit_parameters(pat) local function expand_collision_box(frame) local box = frame.collision[1] local width = math.abs(box.x2 - box.x1) box.x1 = box.x1 - width box.x2 = box.x2 - width box.y1 = box.y1 - 70 end for seq = 570, 572, 2 do for off = 1, 3, 2 do for idx = 0, 7 do pat:update_frame(seq, off, idx, { launch_vector_x = 1300, launch_vector_y = 1000, }) end end end for seq = 571, 573, 2 do for off = 1, 3, 2 do for idx = 0, 7 do pat:update_frame(seq, off, idx, { launch_vector_x = 1000, launch_vector_y = 2500, }) end end end end function mods.icicle_bomb_motion_cancel(pat) for seq = 545, 547, 2 do pat:update_frame(seq, 0, 6, set_motion_cancel) end end function mods.icicle_bomb_object_parameters(pat) end function mods.cold_sprinkler_time_windows(pat) for seq = 602, 652, 50 do pat:update_frame(seq, 0, 0, { duration = 3 }) pat:update_frame(seq, 0, 1, { duration = 3 }) pat:update_frame(seq, 0, 2, { duration = 3 }) pat:update_frame(seq, 0, 3, { duration = 35 }) pat:update_frame(seq, 0, 14, { duration = 4 }) pat:update_frame(seq, 0, 15, { duration = 4 }) pat:remove_frame(seq, 0, 10) pat:remove_frame(seq, 0, 10) end end function mods.cold_sprinkler_object_parameters(pat) pat:update_frame(852, 5, 0, { launch_vector_x = 0, blockstop_enemy = 5, }) end return function(pat) -- mods.startup_6dd(pat) mods.startup_6a(pat) mods.untech_ja(pat) -- mods.untech_j6a(pat) mods.recovery_j6a(pat) mods.recovery_j8a(pat) mods.j2a_damage_parameters(pat, 250, 950, 10) if config:get("chirno", "3a", "reduce_startup") then mods.startup_3a(pat) end mods.db_recovery(pat) if config:get("chirno", "db", "special_cancelable") then mods.db_cancel(pat) end if config:get("chirno", "b_series", "increase_hitstop") then mods.hit_parameters_b(pat) end mods.hit_parameters_6c(pat) mods.motion_cancel_6b_j6b(pat) if config:get("chirno", "b_series", "2b_j2b", "reduce_motion_cancel") then mods.motion_cancel_2b(pat) mods.motion_cancel_j2b(pat) end if config:get("chirno", "c_series", "high_priority") then mods.bullet_priority_c(pat) mods.bullet_priority_6c(pat) mods.bullet_priority_2c(pat) end mods.icicle_shot_startup(pat) if config:get("chirno", "frost_pillars", "reduce_motion_cancel") then mods.frost_pillars_motion_cancel(pat) end if config:get("chirno", "frost_pillars", "increase_spirit_damage") then mods.frost_pillars_object_parameters(pat) end if config:get("chirno", "freezing_light", "enable_multihit") then mods.freezing_light_enable_multihit(pat) -- mods.freezing_light_motion_cancel(pat) else mods.freezing_light_motion_cancel(pat) end mods.create_freezing_light_jc_version(pat) mods.icicle_rise_motion_cancel(pat) mods.icicle_rise_object_parameters(pat) mods.ice_kick_hit_parameters(pat, config:getdef( "chirno", "ice_kick", "untech", 45 )) if config:get("chirno", "icicle_sword", "ground_bounce") == 1 then mods.icicle_sword_ground_bounce(pat, -1500, 60) elseif config:get("chirno", "icicle_sword", "ground_bounce") == 2 then mods.icicle_sword_ground_bounce(pat, -2450, 90) end -- mods.icicle_sword_hit_parameters(pat) mods.icicle_bomb_motion_cancel(pat) mods.icicle_bomb_object_parameters(pat) mods.cold_sprinkler_time_windows(pat) mods.cold_sprinkler_object_parameters(pat) end