@playcraft/skills 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +333 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/skills.loader.d.ts +31 -0
- package/dist/src/skills.loader.d.ts.map +1 -0
- package/dist/src/skills.loader.js +200 -0
- package/dist/src/skills.loader.js.map +1 -0
- package/dist/src/skills.types.d.ts +44 -0
- package/dist/src/skills.types.d.ts.map +1 -0
- package/dist/src/skills.types.js +9 -0
- package/dist/src/skills.types.js.map +1 -0
- package/package.json +35 -0
- package/skills/2048_core.aigameplay/SKILL.md +123 -0
- package/skills/2048_core.aigameplay/manifest.json +159 -0
- package/skills/2048_core.aigameplay/ref/pgs-schema.json +194 -0
- package/skills/2048_core.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/SKILL.md +46 -0
- package/skills/ad_compliance_rules.aiconfig/SKILL.md +85 -0
- package/skills/ad_compliance_rules.aiconfig/manifest.json +60 -0
- package/skills/agent_remix_orchestrator.aicomponent/SKILL.md +257 -0
- package/skills/agent_remix_orchestrator.aicomponent/manifest.json +12 -0
- package/skills/app_metadata.aiconfig/SKILL.md +53 -0
- package/skills/app_metadata.aiconfig/manifest.json +32 -0
- package/skills/appear_sfx.aiaudio/SKILL.md +59 -0
- package/skills/appear_sfx.aiaudio/manifest.json +45 -0
- package/skills/appear_sfx.aiaudio/ref/appear.mp3 +0 -0
- package/skills/arrow_move_error_sfx.aiaudio/SKILL.md +59 -0
- package/skills/arrow_move_error_sfx.aiaudio/manifest.json +45 -0
- package/skills/arrow_move_error_sfx.aiaudio/ref/arrow_move_error.mp3 +0 -0
- package/skills/arrow_path_data_format.aicomponent/SKILL.md +152 -0
- package/skills/arrow_path_data_format.aicomponent/manifest.json +57 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelParser.ts +188 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelTypes.ts +131 -0
- package/skills/arrow_pick_match_rules.aigameplay/SKILL.md +117 -0
- package/skills/arrow_pick_match_rules.aigameplay/manifest.json +105 -0
- package/skills/arrow_pick_match_rules.aigameplay/ref/pgs-schema.json +180 -0
- package/skills/asset_pipeline_scripts.aicomponent/SKILL.md +117 -0
- package/skills/asset_pipeline_scripts.aicomponent/manifest.json +17 -0
- package/skills/asset_pipeline_scripts.aicomponent/ref/gen-sprite.sh +105 -0
- package/skills/ball_sort.aigameplay/SKILL.md +109 -0
- package/skills/ball_sort.aigameplay/manifest.json +155 -0
- package/skills/ball_sort.aigameplay/ref/pgs-schema.json +192 -0
- package/skills/ball_sort.aigameplay/ref/reducer.template.ts +156 -0
- package/skills/basketball_shot.aigameplay/SKILL.md +94 -0
- package/skills/basketball_shot.aigameplay/manifest.json +150 -0
- package/skills/basketball_shot.aigameplay/ref/pgs-schema.json +229 -0
- package/skills/basketball_shot.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/bg_music.aiaudio/SKILL.md +61 -0
- package/skills/bg_music.aiaudio/manifest.json +48 -0
- package/skills/bg_music.aiaudio/ref/bg.mp3 +0 -0
- package/skills/big_watermelon.aigameplay/SKILL.md +94 -0
- package/skills/big_watermelon.aigameplay/manifest.json +155 -0
- package/skills/big_watermelon.aigameplay/ref/pgs-schema.json +191 -0
- package/skills/big_watermelon.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/block_puzzle.aigameplay/SKILL.md +121 -0
- package/skills/block_puzzle.aigameplay/manifest.json +154 -0
- package/skills/block_puzzle.aigameplay/ref/pgs-schema.json +170 -0
- package/skills/block_puzzle.aigameplay/ref/reducer.template.ts +182 -0
- package/skills/board_entity_sprite.aiimage/SKILL.md +255 -0
- package/skills/board_entity_sprite.aiimage/manifest.json +153 -0
- package/skills/board_entity_sprite.aiimage/ref/ProceduralCar.ts +357 -0
- package/skills/board_entity_sprite.aiimage/ref/car.png +0 -0
- package/skills/board_entity_sprite.aiimage/ref/car.webp +0 -0
- package/skills/bottom_ui_bar.aicomponent/SKILL.md +50 -0
- package/skills/bottom_ui_bar.aicomponent/manifest.json +31 -0
- package/skills/bottom_ui_bar.aicomponent/ref/GameBottomUI.ts +27 -0
- package/skills/bubble_shooter.aigameplay/SKILL.md +129 -0
- package/skills/bubble_shooter.aigameplay/manifest.json +181 -0
- package/skills/bubble_shooter.aigameplay/ref/pgs-schema.json +226 -0
- package/skills/bubble_shooter.aigameplay/ref/reducer.template.ts +228 -0
- package/skills/button_click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/button_click_sfx.aiaudio/manifest.json +45 -0
- package/skills/button_click_sfx.aiaudio/ref/button_click.mp3 +0 -0
- package/skills/calm_piano.aiaudio/SKILL.md +68 -0
- package/skills/calm_piano.aiaudio/manifest.json +50 -0
- package/skills/camera_controller_3d.aicomponent/SKILL.md +100 -0
- package/skills/camera_controller_3d.aicomponent/manifest.json +52 -0
- package/skills/camera_controller_3d.aicomponent/ref/CameraController.ts +199 -0
- package/skills/camera_controller_3d.aicomponent/ref/OrbitControlsAdapter.ts +152 -0
- package/skills/candy_tile.aiimage/SKILL.md +62 -0
- package/skills/candy_tile.aiimage/manifest.json +49 -0
- package/skills/car_parking.aigameplay/SKILL.md +105 -0
- package/skills/car_parking.aigameplay/manifest.json +164 -0
- package/skills/car_parking.aigameplay/ref/pgs-schema.json +163 -0
- package/skills/car_parking.aigameplay/ref/reducer.template.ts +166 -0
- package/skills/castle.aiimage/SKILL.md +64 -0
- package/skills/castle.aiimage/manifest.json +48 -0
- package/skills/cheerful_ukulele.aiaudio/SKILL.md +72 -0
- package/skills/cheerful_ukulele.aiaudio/manifest.json +50 -0
- package/skills/click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/click_sfx.aiaudio/manifest.json +45 -0
- package/skills/click_sfx.aiaudio/ref/click.mp3 +0 -0
- package/skills/combo_display.aicomponent/SKILL.md +45 -0
- package/skills/combo_display.aicomponent/manifest.json +31 -0
- package/skills/combo_display.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/combo_display.aicomponent/ref/ComboSmallUI.ts +232 -0
- package/skills/combo_praise_text.aicomponent/SKILL.md +56 -0
- package/skills/combo_praise_text.aicomponent/manifest.json +34 -0
- package/skills/combo_praise_text.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/countdown_timer.aicomponent/SKILL.md +44 -0
- package/skills/countdown_timer.aicomponent/manifest.json +35 -0
- package/skills/countdown_timer.aicomponent/ref/CountdownDisplay.ts +213 -0
- package/skills/cta_platform_config.aiconfig/SKILL.md +72 -0
- package/skills/cta_platform_config.aiconfig/manifest.json +56 -0
- package/skills/debug_overlay.aicomponent/SKILL.md +75 -0
- package/skills/debug_overlay.aicomponent/manifest.json +17 -0
- package/skills/debug_overlay.aicomponent/ref/DebugOverlay.ts +144 -0
- package/skills/desert.aiimage/SKILL.md +63 -0
- package/skills/desert.aiimage/manifest.json +49 -0
- package/skills/difficulty_curve_designer.aiconfig/SKILL.md +68 -0
- package/skills/difficulty_curve_designer.aiconfig/manifest.json +36 -0
- package/skills/digit_renderer.aicomponent/SKILL.md +43 -0
- package/skills/digit_renderer.aicomponent/manifest.json +25 -0
- package/skills/digit_renderer.aicomponent/ref/DigitRenderer.ts +237 -0
- package/skills/download_button.aicomponent/SKILL.md +44 -0
- package/skills/download_button.aicomponent/manifest.json +25 -0
- package/skills/download_button.aicomponent/ref/DownloadButton.ts +137 -0
- package/skills/draw_line_puzzle.aigameplay/SKILL.md +84 -0
- package/skills/draw_line_puzzle.aigameplay/manifest.json +152 -0
- package/skills/draw_line_puzzle.aigameplay/ref/pgs-schema.json +189 -0
- package/skills/draw_line_puzzle.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/easy_to_hard.aiconfig/SKILL.md +52 -0
- package/skills/easy_to_hard.aiconfig/manifest.json +33 -0
- package/skills/eight_ball_pool.aigameplay/SKILL.md +104 -0
- package/skills/eight_ball_pool.aigameplay/manifest.json +152 -0
- package/skills/eight_ball_pool.aigameplay/ref/pgs-schema.json +205 -0
- package/skills/eight_ball_pool.aigameplay/ref/reducer.template.ts +198 -0
- package/skills/energetic_electronic.aiaudio/SKILL.md +69 -0
- package/skills/energetic_electronic.aiaudio/manifest.json +51 -0
- package/skills/fail_sfx.aiaudio/SKILL.md +59 -0
- package/skills/fail_sfx.aiaudio/manifest.json +44 -0
- package/skills/fail_sfx.aiaudio/ref/fail.mp3 +0 -0
- package/skills/figer_icon.aiimage/SKILL.md +58 -0
- package/skills/figer_icon.aiimage/manifest.json +48 -0
- package/skills/figer_icon.aiimage/ref/figer.png +0 -0
- package/skills/figer_icon.aiimage/ref/figer.webp +0 -0
- package/skills/forest.aiimage/SKILL.md +74 -0
- package/skills/forest.aiimage/manifest.json +48 -0
- package/skills/fruit_tile.aiimage/SKILL.md +68 -0
- package/skills/fruit_tile.aiimage/manifest.json +48 -0
- package/skills/game_over_panel.aicomponent/SKILL.md +47 -0
- package/skills/game_over_panel.aicomponent/manifest.json +61 -0
- package/skills/game_over_panel.aicomponent/ref/GameOverPanel.ts +74 -0
- package/skills/game_scene.aicomponent/SKILL.md +57 -0
- package/skills/game_scene.aicomponent/manifest.json +36 -0
- package/skills/game_scene.aicomponent/ref/Game.ts +748 -0
- package/skills/gameplay_balance_check.aivalidator/SKILL.md +69 -0
- package/skills/gameplay_balance_check.aivalidator/manifest.json +21 -0
- package/skills/gameplay_unit_test.aivalidator/SKILL.md +89 -0
- package/skills/gameplay_unit_test.aivalidator/manifest.json +17 -0
- package/skills/gameplay_unit_test.aivalidator/ref/gameplay.test.ts +202 -0
- package/skills/gameplay_unit_test.aivalidator/ref/vitest.config.ts +13 -0
- package/skills/grid_board_layout.aicomponent/SKILL.md +85 -0
- package/skills/grid_board_layout.aicomponent/manifest.json +69 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout.ts +416 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout3D.ts +125 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayoutMath.ts +85 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardRenderer3D.ts +298 -0
- package/skills/heart_lives.aicomponent/SKILL.md +42 -0
- package/skills/heart_lives.aicomponent/manifest.json +25 -0
- package/skills/heart_lives.aicomponent/ref/HeartDisplay.ts +96 -0
- package/skills/idle-breathe.aicomponent/SKILL.md +27 -0
- package/skills/idle-breathe.aicomponent/manifest.json +20 -0
- package/skills/idle-breathe.aicomponent/ref/phaser.js +25 -0
- package/skills/idle-breathe.aicomponent/ref/playcanvas.js +29 -0
- package/skills/jewel_tile.aiimage/SKILL.md +63 -0
- package/skills/jewel_tile.aiimage/manifest.json +49 -0
- package/skills/knife_hit.aigameplay/SKILL.md +103 -0
- package/skills/knife_hit.aigameplay/manifest.json +151 -0
- package/skills/knife_hit.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/knife_hit.aigameplay/ref/reducer.template.ts +196 -0
- package/skills/left_right_parkour.aigameplay/SKILL.md +120 -0
- package/skills/left_right_parkour.aigameplay/manifest.json +165 -0
- package/skills/left_right_parkour.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/left_right_parkour.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/level_data_pack.aiconfig/SKILL.md +64 -0
- package/skills/level_data_pack.aiconfig/manifest.json +37 -0
- package/skills/level_data_validator.aivalidator/SKILL.md +85 -0
- package/skills/level_data_validator.aivalidator/manifest.json +17 -0
- package/skills/level_data_validator.aivalidator/ref/LevelValidator.ts +113 -0
- package/skills/level_lifecycle.aicomponent/SKILL.md +81 -0
- package/skills/level_lifecycle.aicomponent/manifest.json +87 -0
- package/skills/level_lifecycle.aicomponent/ref/LevelLifecycle.ts +235 -0
- package/skills/level_solvability_validator.aivalidator/SKILL.md +74 -0
- package/skills/level_solvability_validator.aivalidator/manifest.json +23 -0
- package/skills/level_solvability_validator.aivalidator/ref/LevelValidator.ts +186 -0
- package/skills/level_state.aicomponent/SKILL.md +55 -0
- package/skills/level_state.aicomponent/manifest.json +34 -0
- package/skills/level_state.aicomponent/ref/LevelDataManager.ts +26 -0
- package/skills/level_state.aicomponent/ref/LevelManager.ts +26 -0
- package/skills/loading_screen.aicomponent/SKILL.md +57 -0
- package/skills/loading_screen.aicomponent/manifest.json +43 -0
- package/skills/loading_screen.aicomponent/ref/LoadingUI.ts +339 -0
- package/skills/lose_result_panel.aiimage/SKILL.md +58 -0
- package/skills/lose_result_panel.aiimage/manifest.json +47 -0
- package/skills/lose_result_panel.aiimage/ref/lose.png +0 -0
- package/skills/lose_result_panel.aiimage/ref/lose.webp +0 -0
- package/skills/lose_sfx.aiaudio/SKILL.md +59 -0
- package/skills/lose_sfx.aiaudio/manifest.json +45 -0
- package/skills/lose_sfx.aiaudio/ref/lose.mp3 +0 -0
- package/skills/match-pop.aicomponent/SKILL.md +29 -0
- package/skills/match-pop.aicomponent/manifest.json +19 -0
- package/skills/match-pop.aicomponent/ref/phaser.js +30 -0
- package/skills/match-pop.aicomponent/ref/playcanvas.js +22 -0
- package/skills/match3_core.aigameplay/SKILL.md +125 -0
- package/skills/match3_core.aigameplay/manifest.json +107 -0
- package/skills/match3_core.aigameplay/ref/pgs-schema.json +154 -0
- package/skills/match3_core.aigameplay/ref/reducer.template.ts +191 -0
- package/skills/match_engine.aicomponent/SKILL.md +84 -0
- package/skills/match_engine.aicomponent/manifest.json +23 -0
- package/skills/match_engine.aicomponent/ref/MatchEngine.ts +75 -0
- package/skills/memory_match.aigameplay/SKILL.md +111 -0
- package/skills/memory_match.aigameplay/manifest.json +164 -0
- package/skills/memory_match.aigameplay/ref/pgs-schema.json +190 -0
- package/skills/memory_match.aigameplay/ref/reducer.template.ts +162 -0
- package/skills/merge_core.aigameplay/SKILL.md +112 -0
- package/skills/merge_core.aigameplay/manifest.json +154 -0
- package/skills/merge_core.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/merge_core.aigameplay/ref/reducer.template.ts +179 -0
- package/skills/mistake_sfx.aiaudio/SKILL.md +59 -0
- package/skills/mistake_sfx.aiaudio/manifest.json +45 -0
- package/skills/mistake_sfx.aiaudio/ref/mistake.mp3 +0 -0
- package/skills/nomove_hint_overlay.aiimage/SKILL.md +58 -0
- package/skills/nomove_hint_overlay.aiimage/manifest.json +48 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.png +0 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.webp +0 -0
- package/skills/normal_dot.aiimage/SKILL.md +58 -0
- package/skills/normal_dot.aiimage/manifest.json +46 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.png +0 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.webp +0 -0
- package/skills/ocean.aiimage/SKILL.md +71 -0
- package/skills/ocean.aiimage/manifest.json +49 -0
- package/skills/particle-confetti.aicomponent/SKILL.md +32 -0
- package/skills/particle-confetti.aicomponent/manifest.json +21 -0
- package/skills/particle-confetti.aicomponent/ref/html5-spritesheet.js +17 -0
- package/skills/particle-confetti.aicomponent/ref/phaser.js +38 -0
- package/skills/particle-explosion.aicomponent/SKILL.md +37 -0
- package/skills/particle-explosion.aicomponent/manifest.json +24 -0
- package/skills/particle-explosion.aicomponent/ref/html5-spritesheet.js +40 -0
- package/skills/particle-explosion.aicomponent/ref/phaser.js +46 -0
- package/skills/particle-explosion.aicomponent/ref/playcanvas.js +33 -0
- package/skills/particle-trail.aicomponent/SKILL.md +25 -0
- package/skills/particle-trail.aicomponent/manifest.json +22 -0
- package/skills/particle-trail.aicomponent/ref/phaser.js +31 -0
- package/skills/path_animation.aicomponent/SKILL.md +82 -0
- package/skills/path_animation.aicomponent/manifest.json +77 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager.ts +694 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager3D.ts +317 -0
- package/skills/path_elimination_rules.aigameplay/SKILL.md +88 -0
- package/skills/path_elimination_rules.aigameplay/manifest.json +119 -0
- package/skills/path_elimination_rules.aigameplay/ref/pgs-schema.json +227 -0
- package/skills/path_input_handler.aicomponent/SKILL.md +87 -0
- package/skills/path_input_handler.aicomponent/manifest.json +97 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler.ts +714 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler3D.ts +204 -0
- package/skills/path_renderer.aicomponent/SKILL.md +101 -0
- package/skills/path_renderer.aicomponent/manifest.json +69 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer.ts +509 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer3D.ts +176 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderers.ts +640 -0
- package/skills/phaser.aicomponent/SKILL.md +315 -0
- package/skills/phaser.aicomponent/manifest.json +156 -0
- package/skills/phaser.aicomponent/ref/BootScene.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameConfig.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameScene.ts +88 -0
- package/skills/phaser.aicomponent/ref/PreloaderScene.ts +78 -0
- package/skills/phaser.aicomponent/ref/SceneKeys.ts +7 -0
- package/skills/phaser.aicomponent/ref/SoundUtils.ts +21 -0
- package/skills/phaser.aicomponent/ref/UiLayout.ts +74 -0
- package/skills/phaser.aicomponent/ref/globals.d.ts +52 -0
- package/skills/phaser.aicomponent/ref/index.css +40 -0
- package/skills/phaser.aicomponent/ref/index.html +14 -0
- package/skills/phaser.aicomponent/ref/index.ts +48 -0
- package/skills/phaser.aicomponent/ref/main.ts +16 -0
- package/skills/phaser.aicomponent/ref/package.json +22 -0
- package/skills/phaser.aicomponent/ref/tsconfig.json +25 -0
- package/skills/phaser.aicomponent/ref/webpack.config.js +57 -0
- package/skills/phaser_scene_lifecycle.aicomponent/SKILL.md +63 -0
- package/skills/phaser_scene_lifecycle.aicomponent/manifest.json +33 -0
- package/skills/pick_and_match_rules.aigameplay/SKILL.md +113 -0
- package/skills/pick_and_match_rules.aigameplay/manifest.json +121 -0
- package/skills/pick_and_match_rules.aigameplay/ref/pgs-schema.json +354 -0
- package/skills/pin_pull.aigameplay/SKILL.md +110 -0
- package/skills/pin_pull.aigameplay/manifest.json +164 -0
- package/skills/pin_pull.aigameplay/ref/pgs-schema.json +201 -0
- package/skills/pin_pull.aigameplay/ref/reducer.template.ts +216 -0
- package/skills/playable_app_logo.aiimage/SKILL.md +58 -0
- package/skills/playable_app_logo.aiimage/manifest.json +47 -0
- package/skills/playable_app_logo.aiimage/ref/logo.png +0 -0
- package/skills/playable_app_logo.aiimage/ref/logo.webp +0 -0
- package/skills/playable_end_screen_layout.aicomponent/SKILL.md +75 -0
- package/skills/playable_end_screen_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_guidance_layer.aicomponent/SKILL.md +89 -0
- package/skills/playable_guidance_layer.aicomponent/manifest.json +24 -0
- package/skills/playable_hud_layout.aicomponent/SKILL.md +96 -0
- package/skills/playable_hud_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_scripts_build.aicomponent/SKILL.md +69 -0
- package/skills/playable_scripts_build.aicomponent/manifest.json +53 -0
- package/skills/playable_scripts_build.aicomponent/ref/builds.config.js +257 -0
- package/skills/playcraft-3d-flip-sprite/SKILL.md +336 -0
- package/skills/playcraft-3d-flip-sprite/renderer/flatten_glb.mjs +62 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render.mjs +325 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render_single.mjs +138 -0
- package/skills/playcraft-asset-management/SKILL.md +73 -0
- package/skills/playcraft-audio-generation/SKILL.md +126 -0
- package/skills/playcraft-build/SKILL.md +44 -0
- package/skills/playcraft-code-editor/SKILL.md +71 -0
- package/skills/playcraft-create-remix/SKILL.md +62 -0
- package/skills/playcraft-deploy/SKILL.md +59 -0
- package/skills/playcraft-image-generation/SKILL.md +148 -0
- package/skills/playcraft-image-processing/SKILL.md +216 -0
- package/skills/playcraft-platform-intro/SKILL.md +41 -0
- package/skills/playcraft-prefab/SKILL.md +98 -0
- package/skills/playcraft-project-management/SKILL.md +57 -0
- package/skills/playcraft-remix-workflow/SKILL.md +119 -0
- package/skills/playcraft-remix-workflow/references/xplatform.schema.json5 +31 -0
- package/skills/playcraft-save/SKILL.md +46 -0
- package/skills/playcraft-skill-recommender/SKILL.md +152 -0
- package/skills/playcraft-sprite-generation/SKILL.md +534 -0
- package/skills/playcraft-sprite-remix/SKILL.md +155 -0
- package/skills/playcraft-sprite-sheet/SKILL.md +97 -0
- package/skills/playtest_report.aivalidator/SKILL.md +103 -0
- package/skills/playtest_report.aivalidator/manifest.json +21 -0
- package/skills/preloader_scene.aicomponent/SKILL.md +58 -0
- package/skills/preloader_scene.aicomponent/manifest.json +43 -0
- package/skills/preloader_scene.aicomponent/ref/Preloader.ts +339 -0
- package/skills/progress_bar.aicomponent/SKILL.md +38 -0
- package/skills/progress_bar.aicomponent/manifest.json +25 -0
- package/skills/progress_bar.aicomponent/ref/ProgressDisplay.ts +140 -0
- package/skills/references/xplatform.schema.json5 +31 -0
- package/skills/responsive_2d_layout.aicomponent/SKILL.md +161 -0
- package/skills/responsive_2d_layout.aicomponent/manifest.json +43 -0
- package/skills/responsive_2d_layout.aicomponent/ref/UiLayout.ts +56 -0
- package/skills/run_context_state.aicomponent/SKILL.md +54 -0
- package/skills/run_context_state.aicomponent/manifest.json +40 -0
- package/skills/run_context_state.aicomponent/ref/RunContextRuntime.ts +30 -0
- package/skills/score-fly.aicomponent/SKILL.md +31 -0
- package/skills/score-fly.aicomponent/manifest.json +21 -0
- package/skills/score-fly.aicomponent/ref/phaser.js +26 -0
- package/skills/score-fly.aicomponent/ref/playcanvas.js +28 -0
- package/skills/score_goal.aiconfig/SKILL.md +46 -0
- package/skills/score_goal.aiconfig/manifest.json +33 -0
- package/skills/screen-flash.aicomponent/SKILL.md +30 -0
- package/skills/screen-flash.aicomponent/manifest.json +20 -0
- package/skills/screen-flash.aicomponent/ref/phaser.js +48 -0
- package/skills/screen-shake.aicomponent/SKILL.md +30 -0
- package/skills/screen-shake.aicomponent/manifest.json +19 -0
- package/skills/screen-shake.aicomponent/ref/phaser.js +23 -0
- package/skills/screen-shake.aicomponent/ref/playcanvas.js +44 -0
- package/skills/screw_puzzle.aigameplay/SKILL.md +116 -0
- package/skills/screw_puzzle.aigameplay/manifest.json +164 -0
- package/skills/screw_puzzle.aigameplay/ref/pgs-schema.json +235 -0
- package/skills/screw_puzzle.aigameplay/ref/reducer.template.ts +213 -0
- package/skills/settings_state.aicomponent/SKILL.md +61 -0
- package/skills/settings_state.aicomponent/manifest.json +33 -0
- package/skills/settings_state.aicomponent/ref/SettingsManager.ts +130 -0
- package/skills/slide_out_to_tray_animation.aicomponent/SKILL.md +64 -0
- package/skills/slide_out_to_tray_animation.aicomponent/manifest.json +58 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager.ts +164 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager3D.ts +198 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/BezierUtils.ts +59 -0
- package/skills/slot_machine.aigameplay/SKILL.md +119 -0
- package/skills/slot_machine.aigameplay/manifest.json +166 -0
- package/skills/slot_machine.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/slot_machine.aigameplay/ref/reducer.template.ts +212 -0
- package/skills/sniper_shot.aigameplay/SKILL.md +84 -0
- package/skills/sniper_shot.aigameplay/manifest.json +153 -0
- package/skills/sniper_shot.aigameplay/ref/pgs-schema.json +211 -0
- package/skills/sniper_shot.aigameplay/ref/reducer.template.ts +211 -0
- package/skills/solitaire.aigameplay/SKILL.md +101 -0
- package/skills/solitaire.aigameplay/manifest.json +151 -0
- package/skills/solitaire.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/solitaire.aigameplay/ref/reducer.template.ts +176 -0
- package/skills/sound-effects/SKILL.md +46 -0
- package/skills/sound_utils.aicomponent/SKILL.md +52 -0
- package/skills/sound_utils.aicomponent/manifest.json +30 -0
- package/skills/sound_utils.aicomponent/ref/SoundUtils.ts +29 -0
- package/skills/sprite-animation-2d.aicomponent/SKILL.md +45 -0
- package/skills/sprite-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/sprite-animation-2d.aicomponent/ref/html5.js +83 -0
- package/skills/sprite-animation-2d.aicomponent/ref/phaser.js +38 -0
- package/skills/sprite-animation-2d.aicomponent/ref/playcanvas.js +67 -0
- package/skills/sprite_entity_renderer.aicomponent/SKILL.md +148 -0
- package/skills/sprite_entity_renderer.aicomponent/manifest.json +17 -0
- package/skills/sprite_entity_renderer.aicomponent/ref/SpriteEntityRenderer.ts +126 -0
- package/skills/success_sfx.aiaudio/SKILL.md +59 -0
- package/skills/success_sfx.aiaudio/manifest.json +45 -0
- package/skills/success_sfx.aiaudio/ref/success.mp3 +0 -0
- package/skills/tap_blast.aigameplay/SKILL.md +116 -0
- package/skills/tap_blast.aigameplay/manifest.json +153 -0
- package/skills/tap_blast.aigameplay/ref/pgs-schema.json +208 -0
- package/skills/tap_blast.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/theme_state.aicomponent/SKILL.md +53 -0
- package/skills/theme_state.aicomponent/manifest.json +33 -0
- package/skills/theme_state.aicomponent/ref/ThemeManager.ts +174 -0
- package/skills/theme_switcher_build.aicomponent/SKILL.md +62 -0
- package/skills/theme_switcher_build.aicomponent/manifest.json +38 -0
- package/skills/theme_switcher_build.aicomponent/ref/theme-index.ts +8 -0
- package/skills/theme_variant.aiconfig/SKILL.md +78 -0
- package/skills/theme_variant.aiconfig/manifest.json +39 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/index.ts +16 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/levelEasy.json +141 -0
- package/skills/threejs.aicomponent/SKILL.md +422 -0
- package/skills/threejs.aicomponent/manifest.json +166 -0
- package/skills/threejs.aicomponent/ref/AssetLoader.ts +158 -0
- package/skills/threejs.aicomponent/ref/BaseScene.ts +88 -0
- package/skills/threejs.aicomponent/ref/GameConfig.ts +47 -0
- package/skills/threejs.aicomponent/ref/MainScene.ts +170 -0
- package/skills/threejs.aicomponent/ref/PreloaderScene.ts +93 -0
- package/skills/threejs.aicomponent/ref/SceneKeys.ts +6 -0
- package/skills/threejs.aicomponent/ref/SceneManager.ts +69 -0
- package/skills/threejs.aicomponent/ref/ViewportManager.ts +62 -0
- package/skills/threejs.aicomponent/ref/globals.d.ts +74 -0
- package/skills/threejs.aicomponent/ref/index.css +80 -0
- package/skills/threejs.aicomponent/ref/index.html +20 -0
- package/skills/threejs.aicomponent/ref/index.ts +117 -0
- package/skills/threejs.aicomponent/ref/main.ts +10 -0
- package/skills/threejs.aicomponent/ref/package.json +23 -0
- package/skills/threejs.aicomponent/ref/tsconfig.json +24 -0
- package/skills/threejs.aicomponent/ref/webpack.config.js +61 -0
- package/skills/time_clear_goal.aiconfig/SKILL.md +46 -0
- package/skills/time_clear_goal.aiconfig/manifest.json +32 -0
- package/skills/time_icon.aiimage/SKILL.md +58 -0
- package/skills/time_icon.aiimage/manifest.json +47 -0
- package/skills/time_icon.aiimage/ref/time.png +0 -0
- package/skills/time_icon.aiimage/ref/time.webp +0 -0
- package/skills/top_ui_bar.aicomponent/SKILL.md +45 -0
- package/skills/top_ui_bar.aicomponent/manifest.json +27 -0
- package/skills/top_ui_bar.aicomponent/ref/GameTopUI.ts +229 -0
- package/skills/tower_defence.aigameplay/SKILL.md +117 -0
- package/skills/tower_defence.aigameplay/manifest.json +175 -0
- package/skills/tower_defence.aigameplay/ref/pgs-schema.json +247 -0
- package/skills/tower_defence.aigameplay/ref/reducer.template.ts +239 -0
- package/skills/tray_container.aicomponent/SKILL.md +143 -0
- package/skills/tray_container.aicomponent/manifest.json +58 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer.ts +155 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer3D.ts +281 -0
- package/skills/tray_container.aicomponent/ref/TrayRendererHtmlOverlay.ts +228 -0
- package/skills/tutorial_overlay.aicomponent/SKILL.md +46 -0
- package/skills/tutorial_overlay.aicomponent/manifest.json +34 -0
- package/skills/tutorial_overlay.aicomponent/ref/TutorialManager.ts +367 -0
- package/skills/tween-animation-2d.aicomponent/SKILL.md +35 -0
- package/skills/tween-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/tween-animation-2d.aicomponent/ref/phaser.js +49 -0
- package/skills/tween-animation-2d.aicomponent/ref/playcanvas.js +36 -0
- package/skills/typescript_module_patterns.aicomponent/SKILL.md +209 -0
- package/skills/typescript_module_patterns.aicomponent/manifest.json +28 -0
- package/skills/typescript_module_patterns.aicomponent/ref/globals.d.ts +31 -0
- package/skills/ui-transition.aicomponent/SKILL.md +33 -0
- package/skills/ui-transition.aicomponent/manifest.json +19 -0
- package/skills/ui-transition.aicomponent/ref/phaser.js +45 -0
- package/skills/ux_flow_spec.aiconfig/SKILL.md +82 -0
- package/skills/ux_flow_spec.aiconfig/manifest.json +39 -0
- package/skills/wave_difficulty.aiconfig/SKILL.md +46 -0
- package/skills/wave_difficulty.aiconfig/manifest.json +33 -0
- package/skills/webpack_build.aicomponent/SKILL.md +204 -0
- package/skills/webpack_build.aicomponent/manifest.json +29 -0
- package/skills/webpack_build.aicomponent/ref/package.json +16 -0
- package/skills/webpack_build.aicomponent/ref/webpack.config.js +53 -0
- package/skills/win_anim_sfx.aiaudio/SKILL.md +59 -0
- package/skills/win_anim_sfx.aiaudio/manifest.json +46 -0
- package/skills/win_anim_sfx.aiaudio/ref/win_anim.mp3 +0 -0
- package/skills/win_dot.aiimage/SKILL.md +58 -0
- package/skills/win_dot.aiimage/manifest.json +47 -0
- package/skills/win_dot.aiimage/ref/win_dot.png +0 -0
- package/skills/win_dot.aiimage/ref/win_dot.webp +0 -0
- package/skills/win_result_panel.aiimage/SKILL.md +58 -0
- package/skills/win_result_panel.aiimage/manifest.json +47 -0
- package/skills/win_result_panel.aiimage/ref/win.png +0 -0
- package/skills/win_result_panel.aiimage/ref/win.webp +0 -0
- package/skills/word_connect.aigameplay/SKILL.md +86 -0
- package/skills/word_connect.aigameplay/manifest.json +154 -0
- package/skills/word_connect.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/word_connect.aigameplay/ref/reducer.template.ts +186 -0
- package/src/index.ts +10 -0
- package/src/skills.loader.ts +225 -0
- package/src/skills.types.ts +42 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "sniper_shot.aigameplay",
|
|
4
|
+
"bundleType": "aigameplay",
|
|
5
|
+
"category": "gameplay",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "狙击射击玩法",
|
|
9
|
+
"en": "Sniper Shot gameplay"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"gameplay",
|
|
13
|
+
"sniper",
|
|
14
|
+
"shooting",
|
|
15
|
+
"action",
|
|
16
|
+
"aim",
|
|
17
|
+
"casual"
|
|
18
|
+
],
|
|
19
|
+
"bindingRoles": [
|
|
20
|
+
"gameplayRule"
|
|
21
|
+
],
|
|
22
|
+
"imports": [
|
|
23
|
+
{
|
|
24
|
+
"slot": "engine",
|
|
25
|
+
"pinAtomId": "phaser.aicomponent",
|
|
26
|
+
"edgeKind": "requires",
|
|
27
|
+
"bindAs": "engine"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"slot": "bgMusic",
|
|
31
|
+
"description": "背景循环音乐",
|
|
32
|
+
"bindAs": "bgm",
|
|
33
|
+
"required": false,
|
|
34
|
+
"edgeKind": "compatibleWith",
|
|
35
|
+
"matchBindingRoles": [
|
|
36
|
+
"bgMusic"
|
|
37
|
+
],
|
|
38
|
+
"allowedBundleTypes": [
|
|
39
|
+
"aiaudio"
|
|
40
|
+
],
|
|
41
|
+
"constraints": {
|
|
42
|
+
"loop": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"slot": "background",
|
|
47
|
+
"description": "游戏背景图(狙击场景)",
|
|
48
|
+
"bindAs": "bg",
|
|
49
|
+
"required": false,
|
|
50
|
+
"edgeKind": "compatibleWith",
|
|
51
|
+
"matchBindingRoles": [
|
|
52
|
+
"backgroundTexture"
|
|
53
|
+
],
|
|
54
|
+
"allowedBundleTypes": [
|
|
55
|
+
"aiimage"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"slot": "tutorial",
|
|
60
|
+
"description": "新手引导浮层",
|
|
61
|
+
"bindAs": "tutorial",
|
|
62
|
+
"required": false,
|
|
63
|
+
"edgeKind": "compatibleWith",
|
|
64
|
+
"matchBindingRoles": [
|
|
65
|
+
"tutorialOverlay"
|
|
66
|
+
],
|
|
67
|
+
"allowedBundleTypes": [
|
|
68
|
+
"aicomponent"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"slot": "winPanel",
|
|
73
|
+
"description": "通关反馈面板视觉",
|
|
74
|
+
"bindAs": "winPanel",
|
|
75
|
+
"required": false,
|
|
76
|
+
"edgeKind": "compatibleWith",
|
|
77
|
+
"matchBindingRoles": [
|
|
78
|
+
"successFeedbackPanel"
|
|
79
|
+
],
|
|
80
|
+
"allowedBundleTypes": [
|
|
81
|
+
"aiimage"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"slot": "losePanel",
|
|
86
|
+
"description": "失败反馈面板视觉",
|
|
87
|
+
"bindAs": "losePanel",
|
|
88
|
+
"required": false,
|
|
89
|
+
"edgeKind": "compatibleWith",
|
|
90
|
+
"matchBindingRoles": [
|
|
91
|
+
"failFeedbackPanel"
|
|
92
|
+
],
|
|
93
|
+
"allowedBundleTypes": [
|
|
94
|
+
"aiimage"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"slot": "endScreen",
|
|
99
|
+
"description": "可玩广告结算屏(含 CTA 按钮)",
|
|
100
|
+
"bindAs": "endScreen",
|
|
101
|
+
"required": false,
|
|
102
|
+
"edgeKind": "compatibleWith",
|
|
103
|
+
"matchBindingRoles": [
|
|
104
|
+
"playableEndScreenLayout"
|
|
105
|
+
],
|
|
106
|
+
"allowedBundleTypes": [
|
|
107
|
+
"aicomponent"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"generation": {
|
|
112
|
+
"kind": "pgs",
|
|
113
|
+
"pgsVersion": "1.0",
|
|
114
|
+
"gameplayType": "sniper_shot",
|
|
115
|
+
"rules": {
|
|
116
|
+
"scopeDriftEnabled": true,
|
|
117
|
+
"breathCycleMs": 3000,
|
|
118
|
+
"windEnabled": true,
|
|
119
|
+
"friendlyFirePenalty": true,
|
|
120
|
+
"maxFriendlyFireHits": 1
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"result": {
|
|
124
|
+
"outputFile": "reducer.ts",
|
|
125
|
+
"format": "typescript",
|
|
126
|
+
"constraints": {
|
|
127
|
+
"testCasesMustPass": true
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"binding": {
|
|
131
|
+
"role": "gameplayRule",
|
|
132
|
+
"target": "game/gameplay/sniper_shot/reducer.ts",
|
|
133
|
+
"type": "gameplay-module-reference",
|
|
134
|
+
"constraints": {
|
|
135
|
+
"interface": [
|
|
136
|
+
"init(config)",
|
|
137
|
+
"dispatch(action)",
|
|
138
|
+
"getState()",
|
|
139
|
+
"aimScope(state, dx, dy)",
|
|
140
|
+
"applyBreathDrift(state, deltaMs)",
|
|
141
|
+
"shoot(state)",
|
|
142
|
+
"hitDetection(state, scopePos)",
|
|
143
|
+
"updateTargets(state, deltaMs)",
|
|
144
|
+
"calculateScore(hit, target)"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"files": {
|
|
149
|
+
"skill": "SKILL.md",
|
|
150
|
+
"pgsSchema": "ref/pgs-schema.json",
|
|
151
|
+
"reducerTemplate": "ref/reducer.template.ts"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 狙击射击玩法。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "sniper_shot",
|
|
5
|
+
"entities": {
|
|
6
|
+
"scope": {
|
|
7
|
+
"type": "aim-overlay",
|
|
8
|
+
"description": "瞄准镜,覆盖在场景上的瞄准视图",
|
|
9
|
+
"fields": {
|
|
10
|
+
"position": { "type": "vec2", "description": "瞄准镜中心坐标(世界空间)" },
|
|
11
|
+
"driftOffset": { "type": "vec2", "description": "呼吸抖动叠加偏移量,周期性变化" },
|
|
12
|
+
"zoom": { "type": "number", "default": 4, "description": "当前放大倍数(2/4/8)" }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"targets": {
|
|
16
|
+
"type": "entity-list",
|
|
17
|
+
"description": "场景中的所有目标",
|
|
18
|
+
"item": {
|
|
19
|
+
"id": { "type": "string" },
|
|
20
|
+
"targetType": { "type": "enum", "values": ["enemy", "civilian"], "description": "敌人可击杀,平民误伤扣分" },
|
|
21
|
+
"position": { "type": "vec2" },
|
|
22
|
+
"radius": { "type": "number", "description": "命中判定圆半径(px)" },
|
|
23
|
+
"movementPattern": {
|
|
24
|
+
"type": "enum",
|
|
25
|
+
"values": ["static", "linear", "patrol", "random"],
|
|
26
|
+
"description": "运动模式"
|
|
27
|
+
},
|
|
28
|
+
"movementSpeed": { "type": "number", "default": 0 },
|
|
29
|
+
"patrolPoints": { "type": "vec2[]", "description": "巡逻路径点(patrol 模式)" },
|
|
30
|
+
"state": { "type": "enum", "values": ["alive", "dead"], "default": "alive" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"wind": {
|
|
34
|
+
"type": "environmental",
|
|
35
|
+
"description": "风力,影响弹道偏移",
|
|
36
|
+
"fields": {
|
|
37
|
+
"direction": { "type": "number", "description": "风向角度(度,0=右,90=下)" },
|
|
38
|
+
"strength": { "type": "number", "description": "风力强度(0~1),影响弹道偏移量" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"ammoCount": {
|
|
42
|
+
"type": "counter",
|
|
43
|
+
"initial": 10,
|
|
44
|
+
"description": "剩余子弹数(由 config 覆盖)"
|
|
45
|
+
},
|
|
46
|
+
"score": {
|
|
47
|
+
"type": "counter",
|
|
48
|
+
"initial": 0,
|
|
49
|
+
"description": "当前得分"
|
|
50
|
+
},
|
|
51
|
+
"friendlyFireCount": {
|
|
52
|
+
"type": "counter",
|
|
53
|
+
"initial": 0,
|
|
54
|
+
"description": "误伤平民次数"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"rules": {
|
|
58
|
+
"aim": {
|
|
59
|
+
"description": "玩家拖动屏幕,移动瞄准镜中心位置",
|
|
60
|
+
"input": "drag (dx, dy)",
|
|
61
|
+
"effect": "scope.position += (dx, dy),受边界钳制"
|
|
62
|
+
},
|
|
63
|
+
"breathe_cycle": {
|
|
64
|
+
"description": "瞄准镜随呼吸周期自动漂移,形成正弦曲线抖动",
|
|
65
|
+
"period": "breathCycleMs(默认 3000ms)",
|
|
66
|
+
"amplitude": { "base": 8, "zoomScale": "amplitude / zoom", "description": "放大倍数越高抖动越小" },
|
|
67
|
+
"formula": "driftOffset.x = sin(t/period * 2π) * amplitude; driftOffset.y = cos(t/period * 2π) * amplitude * 0.5"
|
|
68
|
+
},
|
|
69
|
+
"wind_correction": {
|
|
70
|
+
"description": "玩家需手动调整瞄准偏移来补偿风力",
|
|
71
|
+
"trajectoryOffset": "wind.strength * wind.direction_vector * 20px(基础偏移量)",
|
|
72
|
+
"note": "实际命中检测使用 scope.position + wind_trajectory_offset,玩家须预判"
|
|
73
|
+
},
|
|
74
|
+
"shoot": {
|
|
75
|
+
"description": "玩家点击屏幕发射子弹",
|
|
76
|
+
"steps": [
|
|
77
|
+
"1. ammoCount - 1",
|
|
78
|
+
"2. 计算有效瞄准位置 = scope.position + driftOffset + wind_trajectory_offset",
|
|
79
|
+
"3. 检测命中:遍历所有 alive 目标,判断有效瞄准位置是否在目标圆内",
|
|
80
|
+
"4a. 命中 enemy:target.state = dead,score += calculateScore(target)",
|
|
81
|
+
"4b. 命中 civilian:friendlyFireCount++,score -= 200,若 friendlyFireCount >= max 则 gameOver",
|
|
82
|
+
"4c. 未命中:无效果"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"target_move": {
|
|
86
|
+
"description": "目标按运动模式移动",
|
|
87
|
+
"linear": "以固定速度向初始方向运动,碰壁反弹",
|
|
88
|
+
"patrol": "在 patrolPoints 之间来回巡逻",
|
|
89
|
+
"random": "每隔 1~3 秒随机改变方向"
|
|
90
|
+
},
|
|
91
|
+
"ammo_depletion": {
|
|
92
|
+
"description": "子弹耗尽时检查胜负条件"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"algorithm": {
|
|
96
|
+
"description": "主循环:aim → drift → shoot → check",
|
|
97
|
+
"steps": [
|
|
98
|
+
"1. 每帧:applyBreathDrift(deltaMs) 更新 scope.driftOffset",
|
|
99
|
+
"2. 每帧:updateTargets(deltaMs) 按运动模式移动目标",
|
|
100
|
+
"3. 玩家拖动:aimScope(dx, dy) 移动 scope.position",
|
|
101
|
+
"4. 玩家点击射击:shoot()",
|
|
102
|
+
" 4a. ammoCount - 1",
|
|
103
|
+
" 4b. hitDetection(effectiveScopePos)",
|
|
104
|
+
" 4c. 根据命中类型更新 score / friendlyFireCount / target.state",
|
|
105
|
+
"5. 检查胜负:",
|
|
106
|
+
" - Win: 所有 enemy targets 均为 dead",
|
|
107
|
+
" - Lose: ammoCount == 0 且仍有 alive enemy,或 friendlyFireCount >= maxFriendlyFireHits"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"winCondition": {
|
|
111
|
+
"type": "all_enemies_eliminated",
|
|
112
|
+
"description": "在子弹耗尽前,将所有 enemy 类型目标射杀"
|
|
113
|
+
},
|
|
114
|
+
"loseCondition": {
|
|
115
|
+
"type": "ammo_exhausted_or_friendly_fire",
|
|
116
|
+
"description": "ammoCount == 0 且有 alive enemy,或累计误伤平民超过 maxFriendlyFireHits"
|
|
117
|
+
},
|
|
118
|
+
"testCases": [
|
|
119
|
+
{
|
|
120
|
+
"id": "tc_direct_hit_win",
|
|
121
|
+
"description": "直接命中:瞄准位置正好在唯一敌人圆内,射击后胜利",
|
|
122
|
+
"initialState": {
|
|
123
|
+
"scope": { "position": { "x": 200, "y": 150 }, "driftOffset": { "x": 0, "y": 0 }, "zoom": 4 },
|
|
124
|
+
"targets": [
|
|
125
|
+
{ "id": "enemy_1", "targetType": "enemy", "position": { "x": 200, "y": 150 }, "radius": 20, "movementPattern": "static", "state": "alive" }
|
|
126
|
+
],
|
|
127
|
+
"wind": { "direction": 0, "strength": 0 },
|
|
128
|
+
"ammoCount": 3,
|
|
129
|
+
"score": 0,
|
|
130
|
+
"friendlyFireCount": 0
|
|
131
|
+
},
|
|
132
|
+
"actions": [
|
|
133
|
+
{ "type": "shoot" }
|
|
134
|
+
],
|
|
135
|
+
"expectedState": {
|
|
136
|
+
"targets[0].state": "dead",
|
|
137
|
+
"ammoCount": 2,
|
|
138
|
+
"score": { "min": 100 },
|
|
139
|
+
"gameOver": false,
|
|
140
|
+
"win": true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "tc_miss_ammo_depleted",
|
|
145
|
+
"description": "连续射失:子弹耗尽仍有存活敌人,游戏失败",
|
|
146
|
+
"initialState": {
|
|
147
|
+
"scope": { "position": { "x": 0, "y": 0 }, "driftOffset": { "x": 0, "y": 0 }, "zoom": 4 },
|
|
148
|
+
"targets": [
|
|
149
|
+
{ "id": "enemy_1", "targetType": "enemy", "position": { "x": 300, "y": 300 }, "radius": 20, "movementPattern": "static", "state": "alive" }
|
|
150
|
+
],
|
|
151
|
+
"wind": { "direction": 0, "strength": 0 },
|
|
152
|
+
"ammoCount": 1,
|
|
153
|
+
"score": 0,
|
|
154
|
+
"friendlyFireCount": 0
|
|
155
|
+
},
|
|
156
|
+
"actions": [
|
|
157
|
+
{ "type": "shoot" }
|
|
158
|
+
],
|
|
159
|
+
"expectedState": {
|
|
160
|
+
"targets[0].state": "alive",
|
|
161
|
+
"ammoCount": 0,
|
|
162
|
+
"win": false,
|
|
163
|
+
"gameOver": true
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "tc_civilian_hit_penalty",
|
|
168
|
+
"description": "误伤平民:命中平民扣分,friendlyFireCount 达上限后游戏失败",
|
|
169
|
+
"initialState": {
|
|
170
|
+
"scope": { "position": { "x": 150, "y": 150 }, "driftOffset": { "x": 0, "y": 0 }, "zoom": 4 },
|
|
171
|
+
"targets": [
|
|
172
|
+
{ "id": "civilian_1", "targetType": "civilian", "position": { "x": 150, "y": 150 }, "radius": 20, "movementPattern": "static", "state": "alive" },
|
|
173
|
+
{ "id": "enemy_1", "targetType": "enemy", "position": { "x": 400, "y": 400 }, "radius": 20, "movementPattern": "static", "state": "alive" }
|
|
174
|
+
],
|
|
175
|
+
"wind": { "direction": 0, "strength": 0 },
|
|
176
|
+
"ammoCount": 5,
|
|
177
|
+
"score": 500,
|
|
178
|
+
"friendlyFireCount": 0,
|
|
179
|
+
"config": { "maxFriendlyFireHits": 1 }
|
|
180
|
+
},
|
|
181
|
+
"actions": [
|
|
182
|
+
{ "type": "shoot" }
|
|
183
|
+
],
|
|
184
|
+
"expectedState": {
|
|
185
|
+
"friendlyFireCount": 1,
|
|
186
|
+
"score": 300,
|
|
187
|
+
"win": false,
|
|
188
|
+
"gameOver": true
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"id": "tc_breath_drift_applied",
|
|
193
|
+
"description": "呼吸抖动:经过半个呼吸周期后 driftOffset 不为零",
|
|
194
|
+
"initialState": {
|
|
195
|
+
"scope": { "position": { "x": 200, "y": 200 }, "driftOffset": { "x": 0, "y": 0 }, "zoom": 4 },
|
|
196
|
+
"targets": [],
|
|
197
|
+
"wind": { "direction": 0, "strength": 0 },
|
|
198
|
+
"ammoCount": 5,
|
|
199
|
+
"score": 0,
|
|
200
|
+
"friendlyFireCount": 0,
|
|
201
|
+
"breathTimer": 0
|
|
202
|
+
},
|
|
203
|
+
"actions": [
|
|
204
|
+
{ "type": "tick", "deltaMs": 1500 }
|
|
205
|
+
],
|
|
206
|
+
"expectedState": {
|
|
207
|
+
"scope.driftOffset.x": { "notEqual": 0 }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sniper_shot.aigameplay — reducer 接口模板
|
|
3
|
+
*
|
|
4
|
+
* Agent 生成实际 reducer 时,必须导出以下函数。
|
|
5
|
+
* 此文件是接口约束模板,不是可执行代码。
|
|
6
|
+
*
|
|
7
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
+
* ⚠️ 重要:渲染层(GameScene)不应直接调用 dispatch()
|
|
9
|
+
*
|
|
10
|
+
* dispatch() 是一体化接口,内部跑完整个射击判定后只返回最终状态,
|
|
11
|
+
* 中间过程(瞄准位置、呼吸偏移、命中特效触发点)全部丢失。
|
|
12
|
+
*
|
|
13
|
+
* 渲染层需要分步动画(抖动更新 → 移动精灵 → 枪声+特效 → HUD 刷新),
|
|
14
|
+
* 因此必须使用下方的「分步函数」逐步驱动,每步之间播放对应动画。
|
|
15
|
+
*
|
|
16
|
+
* dispatch() 的用途:无头测试、AI 模拟、快速跳过动画等场景。
|
|
17
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// ─── 配置类型 ─────────────────────────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
export type SniperConfig = {
|
|
23
|
+
/** 场景宽度(px) */
|
|
24
|
+
sceneWidth: number;
|
|
25
|
+
/** 场景高度(px) */
|
|
26
|
+
sceneHeight: number;
|
|
27
|
+
/** 初始子弹数 */
|
|
28
|
+
initialAmmo: number;
|
|
29
|
+
/** 瞄准镜默认放大倍数 */
|
|
30
|
+
defaultZoom: number;
|
|
31
|
+
/** 呼吸周期(ms) */
|
|
32
|
+
breathCycleMs: number;
|
|
33
|
+
/** 呼吸抖动基础振幅(px,zoom=1 时) */
|
|
34
|
+
breathAmplitude: number;
|
|
35
|
+
/** 风力是否启用 */
|
|
36
|
+
windEnabled: boolean;
|
|
37
|
+
/** 最大误伤次数(超过则游戏失败) */
|
|
38
|
+
maxFriendlyFireHits: number;
|
|
39
|
+
/** 命中敌人基础得分 */
|
|
40
|
+
baseScorePerKill: number;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// ─── 动作类型 ─────────────────────────────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
export type SniperAction =
|
|
46
|
+
| { type: 'aim'; dx: number; dy: number }
|
|
47
|
+
| { type: 'shoot' }
|
|
48
|
+
| { type: 'tick'; deltaMs: number }
|
|
49
|
+
| { type: 'reset' };
|
|
50
|
+
|
|
51
|
+
// ─── 状态类型 ─────────────────────────────────────────────────────────────────
|
|
52
|
+
|
|
53
|
+
export type Vec2 = { x: number; y: number };
|
|
54
|
+
|
|
55
|
+
export type TargetType = 'enemy' | 'civilian';
|
|
56
|
+
export type TargetState = 'alive' | 'dead';
|
|
57
|
+
export type MovementPattern = 'static' | 'linear' | 'patrol' | 'random';
|
|
58
|
+
|
|
59
|
+
export type Target = {
|
|
60
|
+
id: string;
|
|
61
|
+
targetType: TargetType;
|
|
62
|
+
position: Vec2;
|
|
63
|
+
radius: number;
|
|
64
|
+
movementPattern: MovementPattern;
|
|
65
|
+
movementSpeed: number;
|
|
66
|
+
patrolPoints: Vec2[];
|
|
67
|
+
patrolIndex: number;
|
|
68
|
+
randomMoveTimer: number;
|
|
69
|
+
moveDirection: Vec2;
|
|
70
|
+
state: TargetState;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type Wind = {
|
|
74
|
+
direction: number;
|
|
75
|
+
strength: number;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export type Scope = {
|
|
79
|
+
position: Vec2;
|
|
80
|
+
driftOffset: Vec2;
|
|
81
|
+
zoom: number;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type SniperState = {
|
|
85
|
+
scope: Scope;
|
|
86
|
+
targets: Target[];
|
|
87
|
+
wind: Wind;
|
|
88
|
+
ammoCount: number;
|
|
89
|
+
score: number;
|
|
90
|
+
friendlyFireCount: number;
|
|
91
|
+
breathTimer: number;
|
|
92
|
+
gameOver: boolean;
|
|
93
|
+
win: boolean;
|
|
94
|
+
lastShotResult: ShootResult | null;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// ─── 分步操作返回类型 ─────────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
export type HitResult = {
|
|
100
|
+
hit: boolean;
|
|
101
|
+
targetId: string | null;
|
|
102
|
+
targetType: TargetType | null;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type ShootResult = {
|
|
106
|
+
hit: boolean;
|
|
107
|
+
targetId: string | null;
|
|
108
|
+
isCivilian: boolean;
|
|
109
|
+
scoreGained: number;
|
|
110
|
+
scoreLost: number;
|
|
111
|
+
effectiveScopePos: Vec2;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
115
|
+
// 必须导出的函数
|
|
116
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
117
|
+
|
|
118
|
+
// ─── 初始化 ──────────────────────────────────────────────────────────────────
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* init:根据配置初始化游戏状态
|
|
122
|
+
*/
|
|
123
|
+
export declare function init(config: SniperConfig, targets: Target[], wind?: Wind): SniperState;
|
|
124
|
+
|
|
125
|
+
// ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* dispatch:接收动作,返回新状态(纯函数,不得修改原 state)
|
|
129
|
+
* - aim:移动瞄准镜位置
|
|
130
|
+
* - shoot:发射子弹,包含命中检测、计分、胜负判定(一步到位)
|
|
131
|
+
* - tick:更新物理(呼吸抖动、目标移动)
|
|
132
|
+
* - reset:重置到初始状态
|
|
133
|
+
*
|
|
134
|
+
* ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
|
|
135
|
+
*/
|
|
136
|
+
export declare function dispatch(state: SniperState, action: SniperAction): SniperState;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* getState:返回当前状态快照
|
|
140
|
+
*/
|
|
141
|
+
export declare function getState(state: SniperState): SniperState;
|
|
142
|
+
|
|
143
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
144
|
+
// 分步函数(渲染层/场景层必须使用这些函数驱动动画)
|
|
145
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* aimScope:玩家拖动屏幕,移动瞄准镜中心位置
|
|
149
|
+
* 返回更新后的 scope position(已钳制在场景边界内)
|
|
150
|
+
*
|
|
151
|
+
* 场景层根据返回值移动瞄准镜 overlay Sprite/Container 的位置。
|
|
152
|
+
*/
|
|
153
|
+
export declare function aimScope(
|
|
154
|
+
state: SniperState,
|
|
155
|
+
dx: number,
|
|
156
|
+
dy: number,
|
|
157
|
+
): { scopePos: Vec2 };
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* applyBreathDrift:更新呼吸抖动偏移
|
|
161
|
+
* 基于正弦函数,每帧调用,deltaMs 为帧时长
|
|
162
|
+
*
|
|
163
|
+
* 场景层将 driftOffset 叠加到瞄准镜显示位置(但不修改 scope.position)。
|
|
164
|
+
* driftOffset 随 zoom 增大而减小(放大镜稳定瞄准)。
|
|
165
|
+
*/
|
|
166
|
+
export declare function applyBreathDrift(
|
|
167
|
+
state: SniperState,
|
|
168
|
+
deltaMs: number,
|
|
169
|
+
): { driftOffset: Vec2 };
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* shoot:执行射击
|
|
173
|
+
* 内部调用 hitDetection,根据结果更新 ammoCount / score / target.state / friendlyFireCount
|
|
174
|
+
*
|
|
175
|
+
* 场景层根据返回值:
|
|
176
|
+
* - 播放枪声音效
|
|
177
|
+
* - 若 hit=true 且非平民:播放命中特效
|
|
178
|
+
* - 若 hit=true 且平民:播放误伤警告
|
|
179
|
+
* - 更新 HUD(弹药数、得分)
|
|
180
|
+
*/
|
|
181
|
+
export declare function shoot(state: SniperState): ShootResult;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* hitDetection:判断有效瞄准位置是否命中任何目标
|
|
185
|
+
* 有效瞄准位置 = scope.position + scope.driftOffset + wind_trajectory_offset
|
|
186
|
+
*/
|
|
187
|
+
export declare function hitDetection(
|
|
188
|
+
state: SniperState,
|
|
189
|
+
scopePos: Vec2,
|
|
190
|
+
): HitResult;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* updateTargets:按运动模式更新所有目标位置
|
|
194
|
+
* 每帧调用,deltaMs 为帧时长
|
|
195
|
+
*
|
|
196
|
+
* 场景层根据返回的 targets 数组更新每个目标精灵的位置。
|
|
197
|
+
*/
|
|
198
|
+
export declare function updateTargets(
|
|
199
|
+
state: SniperState,
|
|
200
|
+
deltaMs: number,
|
|
201
|
+
): Target[];
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* calculateScore:计算命中该类型目标所得的分数
|
|
205
|
+
* - enemy:baseScorePerKill(可加距离/难度系数)
|
|
206
|
+
* - civilian:负分(-200)
|
|
207
|
+
*/
|
|
208
|
+
export declare function calculateScore(
|
|
209
|
+
hit: boolean,
|
|
210
|
+
target: Target,
|
|
211
|
+
): number;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solitaire.aigameplay
|
|
3
|
+
description: Klondike 纸牌接龙核心玩法封包 - 标准 7 列牌堆、翻牌堆、4 个花色目标堆的 PGS 实现
|
|
4
|
+
triggers: 纸牌,solitaire,接龙,klondike,扑克,poker,cards,牌堆,tableau,foundation,stock,waste,翻牌,移牌
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# solitaire.aigameplay
|
|
8
|
+
|
|
9
|
+
Klondike 纸牌接龙核心玩法封包。实现标准 Klondike 单人纸牌接龙的 PGS (PlayCraft Gameplay Schema, 玩法定义规范) JSON 和 reducer。7 列牌堆(交替颜色降序叠放)+ 翻牌堆 + 4 个花色目标堆(A→K),将所有牌移到目标堆则胜利。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **玩法类型**:solitaire(Klondike 纸牌接龙)
|
|
14
|
+
- **参考文件**:
|
|
15
|
+
- `ref/pgs-schema.json`:PGS 规则骨架(entities、rules、algorithm、testCases)
|
|
16
|
+
- `ref/reducer.template.ts`:reducer 接口约束模板
|
|
17
|
+
- **核心规则**:
|
|
18
|
+
- `tableauColumns`: 7(7 列牌堆,第 i 列初始有 i 张牌,最上面翻开)
|
|
19
|
+
- `foundationPiles`: 4(4 个花色目标堆:♠♥♦♣)
|
|
20
|
+
- `drawCount`: 1(翻牌堆每次翻 1 张)
|
|
21
|
+
- `stockRecycleLimit`: -1(-1 表示无限次循环翻牌堆)
|
|
22
|
+
- **移牌规则**:
|
|
23
|
+
- `move_to_tableau`:目标列顶牌 face_up,且颜色交替(红↔黑),数值恰好比移动牌大 1
|
|
24
|
+
- `move_to_foundation`:目标堆同花色,数值比当前堆顶大 1(空堆只接受 A)
|
|
25
|
+
- 空列(tableau)只接受 K 作为起始牌
|
|
26
|
+
- **PGS Agent 操作流程**:
|
|
27
|
+
1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
|
|
28
|
+
2. 读取 `ref/reducer.template.ts` 了解接口约束
|
|
29
|
+
3. 实现 `reducer.ts`,导出所有必需函数
|
|
30
|
+
4. 翻牌逻辑:移走 tableau 顶牌后,若新顶牌 face_down → 自动翻开
|
|
31
|
+
5. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
|
|
32
|
+
- **自动完成(auto_complete)**:
|
|
33
|
+
- 当所有牌都已翻面(face_up)时,可启用自动完成
|
|
34
|
+
- 自动将可移到目标堆的牌逐一移入
|
|
35
|
+
- **可 fork 变体**:
|
|
36
|
+
- Spider Solitaire:2副牌,8列,可同色叠放
|
|
37
|
+
- FreeCell:4个自由格,不同叠牌规则
|
|
38
|
+
- 计时/计分模式:添加时间奖励分、撤销惩罚
|
|
39
|
+
|
|
40
|
+
## Result
|
|
41
|
+
|
|
42
|
+
- **产物文件**:`reducer.ts`
|
|
43
|
+
- **格式**:TypeScript,导出 `init(config)`、`dispatch(action)`、`getState()` + 分步函数接口
|
|
44
|
+
- **验证**:所有 testCases 必须通过
|
|
45
|
+
|
|
46
|
+
## 渲染集成(⚠️ 场景层必读)
|
|
47
|
+
|
|
48
|
+
### 设计原则:逻辑校验先行,动画后置
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
// ✅ 正确做法:先验证合法性,再播放动画
|
|
52
|
+
// Step 1: 玩家拖动一组牌到目标列
|
|
53
|
+
const targetCol = getDropTargetColumn(dragPos);
|
|
54
|
+
const movingCards = state.tableau[fromCol].slice(-count);
|
|
55
|
+
|
|
56
|
+
// Step 2: 验证是否合法
|
|
57
|
+
const canMove = canMoveToTableau(state, movingCards[0], targetCol);
|
|
58
|
+
if (!canMove) {
|
|
59
|
+
await playSnapbackAnimation(movingCards);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Step 3: 执行移牌
|
|
64
|
+
const newState = moveCards(state, { zone: 'tableau', col: fromCol }, { zone: 'tableau', col: targetCol }, count);
|
|
65
|
+
|
|
66
|
+
// Step 4: 若源列有牌需要翻面
|
|
67
|
+
if (newState.lastFlipped) {
|
|
68
|
+
await playFlipAnimation(fromCol);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Step 5: 检查是否可以自动完成
|
|
72
|
+
if (newState.allFaceUp) {
|
|
73
|
+
triggerAutoComplete(newState);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Binding
|
|
78
|
+
|
|
79
|
+
- **Binding Role**:`gameplayRule`
|
|
80
|
+
- **挂载目标**:`game/gameplay/solitaire/reducer.ts`
|
|
81
|
+
- **引用类型**:`gameplay-module-reference`
|
|
82
|
+
- **接口契约**:`init(config)` / `dispatch(action)` / `getState()` / `canMoveToTableau()` / `canMoveToFoundation()` / `moveCards()` / `drawFromStock()` / `getValidMoves()`
|
|
83
|
+
|
|
84
|
+
## Skill Definition
|
|
85
|
+
|
|
86
|
+
tools:
|
|
87
|
+
- bash
|
|
88
|
+
- write
|
|
89
|
+
- read
|
|
90
|
+
prompt_extension: |
|
|
91
|
+
You are implementing a Klondike Solitaire gameplay module following the PGS specification.
|
|
92
|
+
Write the PGS JSON with entities, rules, algorithm, and testCases.
|
|
93
|
+
Implement the reducer.ts with:
|
|
94
|
+
- init/dispatch/getState (一体化接口,用于测试)
|
|
95
|
+
- canMoveToTableau/canMoveToFoundation/moveCards/drawFromStock/getValidMoves (分步函数)
|
|
96
|
+
Card suits: 'S' (Spades♠), 'H' (Hearts♥), 'D' (Diamonds♦), 'C' (Clubs♣)
|
|
97
|
+
Card colors: Spades+Clubs = black, Hearts+Diamonds = red
|
|
98
|
+
Tableau rule: alternating color, descending value (K=13, Q=12, J=11, A=1)
|
|
99
|
+
Foundation rule: same suit, ascending from A (1) to K (13)
|
|
100
|
+
After moving cards, auto-flip the new top card of source column if face_down.
|
|
101
|
+
Run the testCases to verify the logic before finalizing.
|