
migrate-attackid-cards
by bcollazo
Open-source Pokémon TCG Pocket (PTCGP) game engine written in Rust.
SKILL.md
name: Migrate AttackId Cards description: Migrates attack implementations from the old approach (using AttackId) to use new approach (Mechanic enum)
The codebase is in a dirty state, don't try to eliminate compilation warnings, or apply clippy suggestions.
-
Read the
modelsmodule and thestatemodule. -
Find the
AttackIdto migrate in the commented match statement inapply_attack_action.rs -
Search for the card information with the following script (e.g. AttackId::A1004VenusaurExGiantBloom):
cargo run --bin search "Venusaur" --attack "Giant Bloom" -
Search for the effect text in the above JSON in the
effect_mechanic_map.rsfile. -
Decide if we should introduce a new Mechanic or re-use or generalize an existing one. Try to re-use existing ones first.
-
Uncomment the all the effect lines in
effect_mechanic_map.rsthat just require different parameters on the decided Mechanic variant, and map to the correct Mechanic variant instance. -
Implement the mechanic logic in
forecast_effect_attack_by_mechanicinapply_attack_action.rs.- Identify how it was implemented before. Refactor the old function to be usable with the new structure.
- Keep the code as a simple one-liner in the match statement by using helper functions
- Remove their old usage in the big commented out match statement, and any other old implementation for this attack.
-
DO NOT run
cargo fmtorclippyfor now, or try to cleanup unused functions for now.
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon