From 0d374b03ed9b948d7481c145257b582e2de23f30 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Sun, 13 Sep 2026 15:34:42 +0700 Subject: [PATCH] feat : add fix delay helper and target --- README.md | 11 ++++++-- components/translator.tsx | 2 +- lib/translator/generate.ts | 5 +++- lib/translator/import.test.ts | 2 ++ lib/translator/import.ts | 4 ++- lib/translator/rotation-defaults.ts | 40 +++++++++++++++++++++++++++++ lib/translator/rotation.test.ts | 25 ++++++++++++++++-- lib/translator/rotation.ts | 7 +++-- 8 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 lib/translator/rotation-defaults.ts diff --git a/README.md b/README.md index 1dca292..5d7ead0 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,14 @@ Mavuika E > Xilonen E N2 Use character names or keys from that team, separated by `>` or newlines. Supported shorthand: `E` (skill), `Q` (burst), `N2` (two normals), `C` (charged attack), `D` (dash), `J` (jump), `tE` / `hE` (tap / hold skill), and `W(60)` (wait 60 frames). Combine actions with `N2CD` or repeat groups with `3(N2CD)`; nested groups are supported. Compact repeats such as `2N2D` mean `2(N2D)`: perform two normals and a dash twice. A following spaced action runs once, so `2N2D Q` repeats `N2D` twice, then uses burst. **Repeat rotation** loops the actions until the simulation ends. -Both toggles default to off. Rotation text and settings save with each team in this browser; turning rotation off preserves the text and outputs only builds. Invalid enabled rotations show an error and disable copying. The translator checks shorthand, not combat legality or energy requirements. Output contains build blocks and optional actions; add simulation settings and targets in gcsim. +Both toggles default to off. Rotation text and settings save with each team in this browser; turning rotation off preserves the text and outputs only builds. Invalid enabled rotations show an error and disable copying. The translator checks shorthand, not combat legality or energy requirements. Enabling rotation automatically includes the fixed action-delay helper above the character builds, then these fixed environment settings below all character stats: + +```text +target lvl=100 resist=0.1 radius=2 pos=0,2.4 hp=999999999 freeze_resist=1; +energy every interval=480,720 amount=1; +``` + +The helper and environment settings are not editable in the app. Rotation actions follow these settings. Add simulation options in gcsim. ## Import from gcsim @@ -35,7 +42,7 @@ Click **Import from gcsim**, paste a config, review the preview, and click **Imp Imported rotations remain editable gcsim script, retaining loops, conditionals, waits, and action parameters. **Include rotation** controls whether that script is copied. Use **Clear script and use shorthand** to start a new shorthand rotation instead. -Imports support up to four characters from the current catalog, common character aliases, and Favonius aliases such as `favsword`, `favgs`, `favbow`, `favspear`, and `favcodex`. Unknown catalog entries, malformed build settings, and invalid values show errors before any team is added. Simulation options, targets, and energy settings are omitted with a notice in the import preview; full script validation happens in gcsim. +Imports support up to four characters from the current catalog, common character aliases, and Favonius aliases such as `favsword`, `favgs`, `favbow`, `favspear`, and `favcodex`. Unknown catalog entries, malformed build settings, and invalid values show errors before any team is added. Imported simulation options, targets, and energy settings are omitted with a notice in the import preview. Enabled rotations use the fixed defaults, and reimported delay helpers are removed to prevent duplicate definitions. Full script validation happens in gcsim. ## Production diff --git a/components/translator.tsx b/components/translator.tsx index e9bac80..5d95015 100644 --- a/components/translator.tsx +++ b/components/translator.tsx @@ -147,7 +147,7 @@ function RotationEditor({ team, onChange }: { team: Team; onChange: (team: Team) return Rotation translator{rotation.format === "gcsim" ? "Imported script with its original loops and action parameters." : "Write your combo using character names and shorthand."} - update({ enabled })} aria-controls={`${inputId}-controls`}>Include rotation{rotation.enabled ? "Rotation actions will be included in the copied config." : "Off: only character builds are included."} + update({ enabled })} aria-controls={`${inputId}-controls`}>Include rotation{rotation.enabled ? "Includes rotation, the fixed delay helper, target, and energy settings." : "Off: only character builds are included."} {rotation.enabled && {rotation.format === "gcsim" ? "Imported gcsim rotation" : "Rotation"}