feat(effect): 实现战斗效果1785、2195、2215、2219并更新文档规则 新增战斗效果1785:N回合内每回合使用技能吸取对手最大体力的1/M, 满体力时额外恢复己方所有不在场精灵O点体力 修复战斗效果2195:当对方回合存在效果时才降低技能优先级,
This commit is contained in:
@@ -113,6 +113,58 @@ Task documents may flag effects as missing even when they already exist in group
|
||||
- For battle-end rewards or delayed settlement, confirm the hook is actually executed in `loop.go` before coding against it.
|
||||
- Keep comments short and effect-focused.
|
||||
|
||||
## Batch Work Rules
|
||||
|
||||
When continuing `docs/effect-unimplemented-tasks/` in batches:
|
||||
|
||||
- Split work by grouped file and assign disjoint write ranges.
|
||||
- Avoid touching `logic/service/fight/effect/effect_info_map.go` during parallel effect implementation unless the user explicitly asks for description-map updates in the same pass.
|
||||
- Treat task docs as a backlog, not ground truth. A task file may still exist even when some IDs in the slice were already implemented or partially repaired.
|
||||
- Prefer finishing the easiest grounded IDs in a partial slice instead of repeatedly rescanning the entire slice.
|
||||
- Keep a clear list of:
|
||||
- newly implemented IDs,
|
||||
- already-existing IDs,
|
||||
- still-partial IDs,
|
||||
- task docs safe to delete.
|
||||
|
||||
## Frequent Compile Pitfalls
|
||||
|
||||
Before considering a slice done, check these repo-specific issues:
|
||||
|
||||
- `input.InitEffect(...)` always needs all three args: effect type, numeric ID, effect instance.
|
||||
- If a new sub-effect type is added, also register the sub-effect explicitly in `init()`.
|
||||
- `SkillEntity.XML.Power` and `Priority` are `int`-based in current generated structs; avoid mixing with `int8`, `int32`, or `int64` arithmetic.
|
||||
- Skill PP on runtime battle state is commonly `uint32`; cast carefully when subtracting or restoring PP.
|
||||
- `model.SkillInfo` does not expose fields like `MaxPP` or `Category`; look them up through `xmlres.SkillMap[int(skill.ID)]`.
|
||||
- `xmlres.Move` does not expose every runtime field. Use runtime state such as `SkillEntity.AttackTime` when the XML struct lacks a field.
|
||||
- `input.Input` does not always expose nested objects assumed by task text, such as `Opp.SkillEntity`; verify available runtime fields before coding.
|
||||
- Decimal math must use `alpacadecimal` values, not raw integer literals.
|
||||
- Large grouped files can accidentally keep stale duplicate `init()` registration blocks after manual merges or batch patches. Check the file tail before closing out a slice.
|
||||
|
||||
## Partial Slice Strategy
|
||||
|
||||
When a grouped file is only partially grounded:
|
||||
|
||||
- Do not delete the task docs for that slice yet.
|
||||
- Keep the implemented IDs in place and make the remaining gaps explicit.
|
||||
- Prefer conservative, repo-shaped implementations over speculative full feature work for heavy system effects.
|
||||
- Good candidates to finish in partial slices are:
|
||||
- simple priority modifiers,
|
||||
- PP-based power changes,
|
||||
- round-based sub-effects using existing helper bases,
|
||||
- status immunity or status application patterns that already exist nearby.
|
||||
- Leave highly coupled systems partial if they appear to depend on larger mechanics not yet modeled in nearby code, such as custom resource tracks or complex transformation states.
|
||||
|
||||
## Task Doc Deletion
|
||||
|
||||
Delete a task file only when one of these is true:
|
||||
|
||||
- every effect ID in the task range is now implemented in repo code,
|
||||
- the IDs already existed and were verified as not missing,
|
||||
- or the user explicitly accepts documented non-implementation for reserved placeholders.
|
||||
|
||||
Do not delete the task doc when the slice is still mixed between implemented and partial IDs.
|
||||
|
||||
## Common Tasks
|
||||
|
||||
### Random power or conditional power effects
|
||||
@@ -150,6 +202,11 @@ Run, at minimum:
|
||||
- `cd /workspace/logic && go test ./service/fight/effect`
|
||||
- `cd /workspace/logic && go build ./...`
|
||||
|
||||
If the user explicitly says tests are not required for the current pass, downgrade validation to:
|
||||
- `gofmt -w` on every edited Go file,
|
||||
- fix current editor/compiler diagnostics for touched files,
|
||||
- and report that package tests/build were intentionally skipped by user request.
|
||||
|
||||
If the task came from `docs/effect-unimplemented-tasks/`, remove the completed task file when the user asked for it.
|
||||
|
||||
## Output
|
||||
|
||||
Reference in New Issue
Block a user