@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,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "slot_machine.aigameplay",
|
|
4
|
+
"bundleType": "aigameplay",
|
|
5
|
+
"category": "gameplay",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "老虎机转轮玩法",
|
|
9
|
+
"en": "Slot Machine Reel gameplay"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"gameplay",
|
|
13
|
+
"slot",
|
|
14
|
+
"casino",
|
|
15
|
+
"reel",
|
|
16
|
+
"spin",
|
|
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": "symbolTextures",
|
|
47
|
+
"description": "符号贴图集",
|
|
48
|
+
"bindAs": "symbols",
|
|
49
|
+
"required": false,
|
|
50
|
+
"edgeKind": "compatibleWith",
|
|
51
|
+
"matchBindingRoles": [
|
|
52
|
+
"tileTextureSet"
|
|
53
|
+
],
|
|
54
|
+
"allowedBundleTypes": [
|
|
55
|
+
"aiimage"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"slot": "background",
|
|
60
|
+
"description": "老虎机背景图",
|
|
61
|
+
"bindAs": "bg",
|
|
62
|
+
"required": false,
|
|
63
|
+
"edgeKind": "compatibleWith",
|
|
64
|
+
"matchBindingRoles": [
|
|
65
|
+
"backgroundTexture"
|
|
66
|
+
],
|
|
67
|
+
"allowedBundleTypes": [
|
|
68
|
+
"aiimage"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"slot": "tutorial",
|
|
73
|
+
"description": "新手引导浮层",
|
|
74
|
+
"bindAs": "tutorial",
|
|
75
|
+
"required": false,
|
|
76
|
+
"edgeKind": "compatibleWith",
|
|
77
|
+
"matchBindingRoles": [
|
|
78
|
+
"tutorialOverlay"
|
|
79
|
+
],
|
|
80
|
+
"allowedBundleTypes": [
|
|
81
|
+
"aicomponent"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"slot": "winPanel",
|
|
86
|
+
"description": "通关反馈面板视觉",
|
|
87
|
+
"bindAs": "winPanel",
|
|
88
|
+
"required": false,
|
|
89
|
+
"edgeKind": "compatibleWith",
|
|
90
|
+
"matchBindingRoles": [
|
|
91
|
+
"successFeedbackPanel"
|
|
92
|
+
],
|
|
93
|
+
"allowedBundleTypes": [
|
|
94
|
+
"aiimage"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"slot": "losePanel",
|
|
99
|
+
"description": "失败反馈面板视觉",
|
|
100
|
+
"bindAs": "losePanel",
|
|
101
|
+
"required": false,
|
|
102
|
+
"edgeKind": "compatibleWith",
|
|
103
|
+
"matchBindingRoles": [
|
|
104
|
+
"failFeedbackPanel"
|
|
105
|
+
],
|
|
106
|
+
"allowedBundleTypes": [
|
|
107
|
+
"aiimage"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"slot": "endScreen",
|
|
112
|
+
"description": "可玩广告结算屏(含 CTA 按钮)",
|
|
113
|
+
"bindAs": "endScreen",
|
|
114
|
+
"required": false,
|
|
115
|
+
"edgeKind": "compatibleWith",
|
|
116
|
+
"matchBindingRoles": [
|
|
117
|
+
"playableEndScreenLayout"
|
|
118
|
+
],
|
|
119
|
+
"allowedBundleTypes": [
|
|
120
|
+
"aicomponent"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"generation": {
|
|
125
|
+
"kind": "pgs",
|
|
126
|
+
"pgsVersion": "1.0",
|
|
127
|
+
"gameplayType": "slot_machine",
|
|
128
|
+
"rules": {
|
|
129
|
+
"reelCount": 3,
|
|
130
|
+
"symbolsPerReel": 3,
|
|
131
|
+
"paylineCount": 5,
|
|
132
|
+
"wildSymbol": "WILD",
|
|
133
|
+
"scatterSymbol": "SCATTER",
|
|
134
|
+
"scatterMinCount": 3,
|
|
135
|
+
"rngType": "uniform"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"result": {
|
|
139
|
+
"outputFile": "reducer.ts",
|
|
140
|
+
"format": "typescript",
|
|
141
|
+
"constraints": {
|
|
142
|
+
"testCasesMustPass": true
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"binding": {
|
|
146
|
+
"role": "gameplayRule",
|
|
147
|
+
"target": "game/gameplay/slot_machine/reducer.ts",
|
|
148
|
+
"type": "gameplay-module-reference",
|
|
149
|
+
"constraints": {
|
|
150
|
+
"interface": [
|
|
151
|
+
"init(config)",
|
|
152
|
+
"dispatch(state, action)",
|
|
153
|
+
"getState(state)",
|
|
154
|
+
"spin(state)",
|
|
155
|
+
"evaluatePaylines(result, paylines, symbols)",
|
|
156
|
+
"calculatePayout(matches, bet)",
|
|
157
|
+
"checkScatter(result)"
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"files": {
|
|
162
|
+
"skill": "SKILL.md",
|
|
163
|
+
"pgsSchema": "ref/pgs-schema.json",
|
|
164
|
+
"reducerTemplate": "ref/reducer.template.ts"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 老虎机转轮玩法。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "slot_machine",
|
|
5
|
+
"entities": {
|
|
6
|
+
"reels": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"count": 3,
|
|
9
|
+
"description": "转轮数组,每个转轮显示 symbolsPerReel(默认3)个符号",
|
|
10
|
+
"fields": {
|
|
11
|
+
"symbolPool": "string[],每个转轮的符号池(决定随机权重)",
|
|
12
|
+
"visibleSymbols": "string[],当前显示的符号列表(从上到下)"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"paylines": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"description": "连线定义,每条连线是各转轮的行索引",
|
|
18
|
+
"defaultPatterns": [
|
|
19
|
+
{ "id": 0, "name": "top_row", "rows": [0, 0, 0] },
|
|
20
|
+
{ "id": 1, "name": "middle_row", "rows": [1, 1, 1] },
|
|
21
|
+
{ "id": 2, "name": "bottom_row", "rows": [2, 2, 2] },
|
|
22
|
+
{ "id": 3, "name": "diagonal_down", "rows": [0, 1, 2] },
|
|
23
|
+
{ "id": 4, "name": "diagonal_up", "rows": [2, 1, 0] }
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"symbol": {
|
|
27
|
+
"type": "enum",
|
|
28
|
+
"values": ["SEVEN", "BAR", "CHERRY", "BELL", "LEMON", "WILD", "SCATTER"],
|
|
29
|
+
"description": "符号类型定义",
|
|
30
|
+
"fields": {
|
|
31
|
+
"type": "string,符号名称",
|
|
32
|
+
"multiplier": "number,3连同符号的赔率倍数",
|
|
33
|
+
"isWild": "boolean,是否为通配符(可替代任意非SCATTER符号)",
|
|
34
|
+
"isScatter": "boolean,是否为散布符号(不受连线限制,≥3个即触发)"
|
|
35
|
+
},
|
|
36
|
+
"symbolTable": [
|
|
37
|
+
{ "type": "SEVEN", "multiplier": 20, "isWild": false, "isScatter": false },
|
|
38
|
+
{ "type": "BAR", "multiplier": 10, "isWild": false, "isScatter": false },
|
|
39
|
+
{ "type": "BELL", "multiplier": 8, "isWild": false, "isScatter": false },
|
|
40
|
+
{ "type": "CHERRY", "multiplier": 5, "isWild": false, "isScatter": false },
|
|
41
|
+
{ "type": "LEMON", "multiplier": 3, "isWild": false, "isScatter": false },
|
|
42
|
+
{ "type": "WILD", "multiplier": 0, "isWild": true, "isScatter": false },
|
|
43
|
+
{ "type": "SCATTER", "multiplier": 0, "isWild": false, "isScatter": true }
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"bet": {
|
|
47
|
+
"type": "counter",
|
|
48
|
+
"description": "当前下注金额,每次 spin 从 balance 扣除",
|
|
49
|
+
"min": 1,
|
|
50
|
+
"max": 100,
|
|
51
|
+
"default": 10
|
|
52
|
+
},
|
|
53
|
+
"balance": {
|
|
54
|
+
"type": "counter",
|
|
55
|
+
"initial": 1000,
|
|
56
|
+
"description": "玩家余额,spin 扣除 bet,中奖则增加 payout"
|
|
57
|
+
},
|
|
58
|
+
"spinResult": {
|
|
59
|
+
"type": "snapshot",
|
|
60
|
+
"description": "最近一次 spin 的结果",
|
|
61
|
+
"fields": {
|
|
62
|
+
"reels": "string[][],各转轮停止后的符号矩阵 [reelIdx][rowIdx]",
|
|
63
|
+
"matches": "PaylineMatch[],中奖的连线列表",
|
|
64
|
+
"totalPayout": "number,本次 spin 总奖励",
|
|
65
|
+
"scatterCount": "number,scatter 符号总数",
|
|
66
|
+
"scatterTriggered": "boolean,是否触发 scatter 奖励"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"rules": {
|
|
71
|
+
"spin": {
|
|
72
|
+
"description": "玩家触发旋转,每个转轮独立随机(RNG)选取符号",
|
|
73
|
+
"precondition": "balance >= bet",
|
|
74
|
+
"effect": "balance -= bet;为每个转轮随机生成 symbolsPerReel 个符号",
|
|
75
|
+
"rngType": "uniform(可换为 weighted 权重随机)"
|
|
76
|
+
},
|
|
77
|
+
"evaluate_paylines": {
|
|
78
|
+
"description": "遍历所有连线,检测是否有 ≥3 个相同符号(考虑 Wild 替换)",
|
|
79
|
+
"wildSubstitution": "WILD 可替代任意非 SCATTER 符号参与连线匹配",
|
|
80
|
+
"minMatchCount": 3,
|
|
81
|
+
"result": "返回命中的 PaylineMatch[] 列表,包含连线 ID、匹配符号、数量"
|
|
82
|
+
},
|
|
83
|
+
"wild_substitution": {
|
|
84
|
+
"description": "在连线评估中,WILD 符号视为任意普通符号",
|
|
85
|
+
"note": "若连线全为 WILD,按连线上 WILD 的最高赔率计算;WILD 不替代 SCATTER"
|
|
86
|
+
},
|
|
87
|
+
"scatter_bonus": {
|
|
88
|
+
"description": "统计所有转轮中 SCATTER 符号的总数,不受连线限制",
|
|
89
|
+
"triggerCondition": "scatterCount >= 3",
|
|
90
|
+
"reward": "scatterCount === 3: bet×5;scatterCount === 4: bet×20;scatterCount >= 5: bet×100"
|
|
91
|
+
},
|
|
92
|
+
"payout_calculation": {
|
|
93
|
+
"description": "计算本次 spin 总奖励 = 各命中连线奖励之和 + scatter 奖励",
|
|
94
|
+
"formula": "paylineReward = bet × symbol.multiplier(每条中奖连线独立计算)",
|
|
95
|
+
"balanceUpdate": "balance += totalPayout"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"algorithm": {
|
|
99
|
+
"description": "主循环:下注 → 旋转 → 结算 → 胜败检测",
|
|
100
|
+
"steps": [
|
|
101
|
+
"1. 玩家设置 bet 金额(1 ~ balance)",
|
|
102
|
+
"2. 玩家点击 spin,检验 balance >= bet",
|
|
103
|
+
"3. balance -= bet",
|
|
104
|
+
"4. 为每个转轮独立 RNG 生成 symbolsPerReel 个符号",
|
|
105
|
+
"5. 调用 evaluatePaylines(reels, paylines, symbolDefs) 检测中奖连线",
|
|
106
|
+
"6. 调用 calculatePayout(matches, bet) 计算总奖励",
|
|
107
|
+
"7. 调用 checkScatter(reels) 检测 scatter 触发",
|
|
108
|
+
"8. balance += totalPayout(包含连线奖励和 scatter 奖励)",
|
|
109
|
+
"9. 更新 spinResult 快照",
|
|
110
|
+
"10. 检测 balance <= 0 → gameOver(可选)"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"winCondition": {
|
|
114
|
+
"type": "payline_hit_or_scatter",
|
|
115
|
+
"description": "任意连线有 ≥3 相同符号(含 Wild 替换),或 ≥3 个 Scatter 出现"
|
|
116
|
+
},
|
|
117
|
+
"loseCondition": {
|
|
118
|
+
"type": "balance_depleted",
|
|
119
|
+
"description": "balance <= 0 且无法继续下注"
|
|
120
|
+
},
|
|
121
|
+
"testCases": [
|
|
122
|
+
{
|
|
123
|
+
"id": "tc_three_match_win",
|
|
124
|
+
"description": "3连中奖:中间行3个 SEVEN,赔率×20",
|
|
125
|
+
"initialState": {
|
|
126
|
+
"balance": 1000,
|
|
127
|
+
"bet": 10,
|
|
128
|
+
"reels": [
|
|
129
|
+
["CHERRY", "SEVEN", "LEMON"],
|
|
130
|
+
["BAR", "SEVEN", "BELL"],
|
|
131
|
+
["LEMON", "SEVEN", "CHERRY"]
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"actions": [
|
|
135
|
+
{ "type": "evaluate_result" }
|
|
136
|
+
],
|
|
137
|
+
"expectedState": {
|
|
138
|
+
"matches": [{ "paylineId": 1, "symbol": "SEVEN", "count": 3 }],
|
|
139
|
+
"totalPayout": 200,
|
|
140
|
+
"balance": 1190,
|
|
141
|
+
"note": "balance = 1000 - 10(bet) + 200(10×20) = 1190"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "tc_no_match",
|
|
146
|
+
"description": "无中奖:所有连线均无3连相同符号",
|
|
147
|
+
"initialState": {
|
|
148
|
+
"balance": 1000,
|
|
149
|
+
"bet": 10,
|
|
150
|
+
"reels": [
|
|
151
|
+
["SEVEN", "BAR", "CHERRY"],
|
|
152
|
+
["LEMON", "CHERRY", "SEVEN"],
|
|
153
|
+
["BAR", "SEVEN", "BELL"]
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"actions": [
|
|
157
|
+
{ "type": "evaluate_result" }
|
|
158
|
+
],
|
|
159
|
+
"expectedState": {
|
|
160
|
+
"matches": [],
|
|
161
|
+
"totalPayout": 0,
|
|
162
|
+
"balance": 990,
|
|
163
|
+
"note": "balance = 1000 - 10 = 990,无中奖"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "tc_scatter_bonus",
|
|
168
|
+
"description": "Scatter 触发奖励:3个 SCATTER 出现在任意位置",
|
|
169
|
+
"initialState": {
|
|
170
|
+
"balance": 1000,
|
|
171
|
+
"bet": 10,
|
|
172
|
+
"reels": [
|
|
173
|
+
["SCATTER", "BAR", "CHERRY"],
|
|
174
|
+
["LEMON", "SCATTER", "SEVEN"],
|
|
175
|
+
["BAR", "SEVEN", "SCATTER"]
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"actions": [
|
|
179
|
+
{ "type": "evaluate_result" }
|
|
180
|
+
],
|
|
181
|
+
"expectedState": {
|
|
182
|
+
"scatterCount": 3,
|
|
183
|
+
"scatterTriggered": true,
|
|
184
|
+
"scatterBonus": 50,
|
|
185
|
+
"balance": 1040,
|
|
186
|
+
"note": "balance = 1000 - 10 + 50(bet×5) = 1040"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "tc_wild_substitution",
|
|
191
|
+
"description": "Wild 替换:连线中一个 WILD 替换为 CHERRY,形成3连 CHERRY",
|
|
192
|
+
"initialState": {
|
|
193
|
+
"balance": 1000,
|
|
194
|
+
"bet": 10,
|
|
195
|
+
"reels": [
|
|
196
|
+
["BAR", "CHERRY", "LEMON"],
|
|
197
|
+
["SEVEN", "WILD", "BELL"],
|
|
198
|
+
["LEMON", "CHERRY", "CHERRY"]
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"actions": [
|
|
202
|
+
{ "type": "evaluate_result" }
|
|
203
|
+
],
|
|
204
|
+
"expectedState": {
|
|
205
|
+
"matches": [{ "paylineId": 1, "symbol": "CHERRY", "count": 3, "wildUsed": true }],
|
|
206
|
+
"totalPayout": 50,
|
|
207
|
+
"balance": 1040,
|
|
208
|
+
"note": "WILD 替代 CHERRY,中间行3连CHERRY,10×5=50"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* slot_machine.aigameplay — reducer 接口模板
|
|
3
|
+
*
|
|
4
|
+
* Agent 生成实际 reducer 时,必须导出以下函数。
|
|
5
|
+
* 此文件是接口约束模板,不是可执行代码。
|
|
6
|
+
*
|
|
7
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
+
* ⚠️ 重要:渲染层(GameScene)不应直接调用 dispatch()
|
|
9
|
+
*
|
|
10
|
+
* dispatch() 是一体化接口,内部执行完整的旋转+结算逻辑后只返回最终状态,
|
|
11
|
+
* 中间过程(各转轮停止时机、中奖连线高亮、奖励特效)全部丢失。
|
|
12
|
+
*
|
|
13
|
+
* 渲染层需要分步驱动转轮停止动画和结算特效,因此必须使用下方「分步函数」。
|
|
14
|
+
*
|
|
15
|
+
* dispatch() 的用途:无头测试、AI 模拟、快速验证赔率计算。
|
|
16
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// ─── 配置类型 ─────────────────────────────────────────────────────────────────
|
|
20
|
+
|
|
21
|
+
export type SlotSymbolDef = {
|
|
22
|
+
type: string;
|
|
23
|
+
/** 3连同符号的赔率倍数(payout = bet × multiplier) */
|
|
24
|
+
multiplier: number;
|
|
25
|
+
/** 是否为通配符(Wild,可替代任意非 Scatter 符号) */
|
|
26
|
+
isWild: boolean;
|
|
27
|
+
/** 是否为散布符号(Scatter,不受连线限制) */
|
|
28
|
+
isScatter: boolean;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type Payline = {
|
|
32
|
+
/** 连线唯一 ID */
|
|
33
|
+
id: number;
|
|
34
|
+
/** 连线名称(如 'middle_row') */
|
|
35
|
+
name: string;
|
|
36
|
+
/** 各转轮对应的行索引(rows[reelIdx] = rowIdx) */
|
|
37
|
+
rows: number[];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type SlotMachineConfig = {
|
|
41
|
+
/** 转轮数量,默认 3 */
|
|
42
|
+
reelCount: number;
|
|
43
|
+
/** 每轮可见符号行数,默认 3 */
|
|
44
|
+
symbolsPerReel: number;
|
|
45
|
+
/** 连线定义 */
|
|
46
|
+
paylines: Payline[];
|
|
47
|
+
/** 符号定义表 */
|
|
48
|
+
symbolDefs: SlotSymbolDef[];
|
|
49
|
+
/** 各转轮的符号池(决定随机概率)*/
|
|
50
|
+
reelSymbolPools: string[][];
|
|
51
|
+
/** Scatter 触发所需最少数量,默认 3 */
|
|
52
|
+
scatterMinCount: number;
|
|
53
|
+
/** Scatter 奖励倍率表 { count: multiplier }(如 {3: 5, 4: 20, 5: 100}) */
|
|
54
|
+
scatterMultipliers: Record<number, number>;
|
|
55
|
+
/** 初始余额 */
|
|
56
|
+
initialBalance: number;
|
|
57
|
+
/** 默认下注金额 */
|
|
58
|
+
defaultBet: number;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// ─── 动作类型 ─────────────────────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
export type SlotMachineAction =
|
|
64
|
+
| { type: 'spin' }
|
|
65
|
+
| { type: 'set_bet'; amount: number }
|
|
66
|
+
| { type: 'reset' };
|
|
67
|
+
|
|
68
|
+
// ─── 状态类型 ─────────────────────────────────────────────────────────────────
|
|
69
|
+
|
|
70
|
+
export type SlotMachineState = {
|
|
71
|
+
/** 各转轮当前显示的符号矩阵:reels[reelIdx][rowIdx] */
|
|
72
|
+
reels: string[][];
|
|
73
|
+
/** 当前下注金额 */
|
|
74
|
+
currentBet: number;
|
|
75
|
+
/** 玩家余额 */
|
|
76
|
+
balance: number;
|
|
77
|
+
/** 最近一次 spin 的结果快照 */
|
|
78
|
+
lastSpinResult: SpinResult | null;
|
|
79
|
+
/** 游戏是否结束(余额耗尽且无法下注) */
|
|
80
|
+
gameOver: boolean;
|
|
81
|
+
/** 总旋转次数 */
|
|
82
|
+
totalSpins: number;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** spin() 返回值:本次旋转的原始结果 */
|
|
86
|
+
export type SpinResult = {
|
|
87
|
+
/** 各转轮停止后的符号矩阵 */
|
|
88
|
+
reels: string[][];
|
|
89
|
+
/** 本次旋转扣除的下注金额 */
|
|
90
|
+
betAmount: number;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** evaluatePaylines 返回的单条连线命中结果 */
|
|
94
|
+
export type PaylineMatch = {
|
|
95
|
+
/** 命中的连线 ID */
|
|
96
|
+
paylineId: number;
|
|
97
|
+
/** 连线名称 */
|
|
98
|
+
paylineName: string;
|
|
99
|
+
/** 匹配的符号(Wild 替换后的实际符号) */
|
|
100
|
+
symbol: string;
|
|
101
|
+
/** 连续匹配数量 */
|
|
102
|
+
count: number;
|
|
103
|
+
/** 是否使用了 Wild 替换 */
|
|
104
|
+
wildUsed: boolean;
|
|
105
|
+
/** 该连线的奖励金额(bet × symbol.multiplier) */
|
|
106
|
+
payout: number;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** checkScatter 返回值 */
|
|
110
|
+
export type ScatterCheckResult = {
|
|
111
|
+
/** Scatter 符号在所有转轮中的总数量 */
|
|
112
|
+
count: number;
|
|
113
|
+
/** 是否达到触发条件(count >= scatterMinCount) */
|
|
114
|
+
triggered: boolean;
|
|
115
|
+
/** 散布奖励金额(bet × scatterMultipliers[count]) */
|
|
116
|
+
bonus: number;
|
|
117
|
+
/** Scatter 符号的位置列表 */
|
|
118
|
+
positions: Array<{ reelIdx: number; rowIdx: number }>;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
122
|
+
// 必须导出的函数
|
|
123
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
124
|
+
|
|
125
|
+
// ─── 初始化 ──────────────────────────────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* init:根据配置初始化游戏状态
|
|
129
|
+
*/
|
|
130
|
+
export declare function init(config: SlotMachineConfig): SlotMachineState;
|
|
131
|
+
|
|
132
|
+
// ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* dispatch:接收动作,返回新状态(纯函数,不得修改原 state)
|
|
136
|
+
* - spin:执行完整旋转(扣注、RNG、结算、更新余额)一步到位
|
|
137
|
+
* - set_bet:修改下注金额
|
|
138
|
+
* - reset:重置到初始状态
|
|
139
|
+
*
|
|
140
|
+
* ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
|
|
141
|
+
*/
|
|
142
|
+
export declare function dispatch(state: SlotMachineState, action: SlotMachineAction): SlotMachineState;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* getState:返回当前状态快照
|
|
146
|
+
*/
|
|
147
|
+
export declare function getState(state: SlotMachineState): SlotMachineState;
|
|
148
|
+
|
|
149
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
150
|
+
// 分步函数(渲染层/场景层必须使用这些函数驱动动画)
|
|
151
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* spin:执行旋转逻辑(RNG),返回各转轮停止结果,但暂不更新 balance。
|
|
155
|
+
*
|
|
156
|
+
* 场景层在玩家点击 SPIN 按钮后调用:
|
|
157
|
+
* 1. 调用 spin(state) 获取 SpinResult(同时从 balance 扣除 bet)
|
|
158
|
+
* 2. 逐个转轮播放滚动→停止动画(每个转轮间隔约500ms)
|
|
159
|
+
* 3. 全部转轮停止后,调用 evaluatePaylines + calculatePayout + checkScatter
|
|
160
|
+
* 4. 播放中奖特效,然后更新 balance
|
|
161
|
+
*
|
|
162
|
+
* @param state 当前游戏状态(balance >= currentBet 才可执行)
|
|
163
|
+
* @returns 包含各转轮结果的 SpinResult(balance 已扣除 bet)
|
|
164
|
+
*/
|
|
165
|
+
export declare function spin(state: SlotMachineState): { state: SlotMachineState; result: SpinResult };
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* evaluatePaylines:评估所有连线,检测中奖情况(考虑 Wild 替换)。
|
|
169
|
+
*
|
|
170
|
+
* 场景层在所有转轮停止动画完成后调用。
|
|
171
|
+
*
|
|
172
|
+
* @param result spin() 返回的转轮结果
|
|
173
|
+
* @param paylines 连线定义配置
|
|
174
|
+
* @param symbols 符号定义表
|
|
175
|
+
* @param bet 当前下注金额(用于计算各连线奖励)
|
|
176
|
+
* @returns 命中的连线列表(含奖励金额)
|
|
177
|
+
*/
|
|
178
|
+
export declare function evaluatePaylines(
|
|
179
|
+
result: SpinResult,
|
|
180
|
+
paylines: Payline[],
|
|
181
|
+
symbols: SlotSymbolDef[],
|
|
182
|
+
bet: number,
|
|
183
|
+
): PaylineMatch[];
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* calculatePayout:汇总所有中奖连线的总奖励金额。
|
|
187
|
+
*
|
|
188
|
+
* @param matches evaluatePaylines() 返回的命中连线列表
|
|
189
|
+
* @param bet 当前下注金额(散布奖励也需要 bet 参数,故传入)
|
|
190
|
+
* @returns 连线总奖励金额(不含 scatter bonus)
|
|
191
|
+
*/
|
|
192
|
+
export declare function calculatePayout(matches: PaylineMatch[], bet: number): number;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* checkScatter:检测散布符号数量是否触发奖励。
|
|
196
|
+
*
|
|
197
|
+
* Scatter 不受连线限制,出现在任意转轮任意行均计入总数。
|
|
198
|
+
*
|
|
199
|
+
* @param result spin() 返回的转轮结果
|
|
200
|
+
* @param symbols 符号定义表
|
|
201
|
+
* @param bet 当前下注金额
|
|
202
|
+
* @param scatterMinCount 触发所需最少 Scatter 数量
|
|
203
|
+
* @param scatterMultipliers Scatter 奖励倍率表
|
|
204
|
+
* @returns 散布检测结果(是否触发、数量、奖励金额、位置列表)
|
|
205
|
+
*/
|
|
206
|
+
export declare function checkScatter(
|
|
207
|
+
result: SpinResult,
|
|
208
|
+
symbols: SlotSymbolDef[],
|
|
209
|
+
bet: number,
|
|
210
|
+
scatterMinCount: number,
|
|
211
|
+
scatterMultipliers: Record<number, number>,
|
|
212
|
+
): ScatterCheckResult;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sniper_shot.aigameplay
|
|
3
|
+
description: 狙击射击玩法封包 - 瞄准镜瞄准、呼吸抖动、风力修正、命中检测的 PGS 实现,支持敌军/平民目标分类
|
|
4
|
+
triggers: 狙击,sniper,射击,shooting,瞄准,aim,狙击手,枪战,射手,gunshot,scope,瞄准镜,风力,wind,弹道
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# sniper_shot.aigameplay
|
|
8
|
+
|
|
9
|
+
狙击射击玩法封包。实现标准狙击玩法的 PGS (PlayCraft Gameplay Schema, 玩法定义规范) JSON 和 reducer,玩家通过瞄准镜调整瞄准位置,考虑呼吸抖动与风力修正,在合适时机射击消灭所有敌方目标。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **玩法类型**:sniper_shot(狙击射击)
|
|
14
|
+
- **参考文件**:
|
|
15
|
+
- `ref/pgs-schema.json`:PGS (PlayCraft Gameplay Schema, 玩法定义规范) 规则骨架(entities、rules、algorithm、testCases)
|
|
16
|
+
- `ref/reducer.template.ts`:reducer 接口约束模板(`init` / `dispatch` / `getState` + 分步函数)
|
|
17
|
+
- **核心规则**:
|
|
18
|
+
- `scopeDriftEnabled`: true(开启呼吸抖动,瞄准镜周期性漂移)
|
|
19
|
+
- `breathCycleMs`: 3000(每 3 秒一个呼吸周期)
|
|
20
|
+
- `windEnabled`: true(风力影响弹道,需要提前修正)
|
|
21
|
+
- `friendlyFirePenalty`: true(误伤平民扣分或失败)
|
|
22
|
+
- `maxFriendlyFireHits`: 1(最多允许 1 次误伤)
|
|
23
|
+
- **PGS Agent 操作流程**:
|
|
24
|
+
1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
|
|
25
|
+
2. 读取 `ref/reducer.template.ts` 了解接口约束
|
|
26
|
+
3. 实现 `reducer.ts`,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` 以及**全部分步函数**
|
|
27
|
+
4. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
|
|
28
|
+
5. 更新 manifest 的 `generation.pgsVersion` 和 `result.outputFile`
|
|
29
|
+
- **可 fork 变体**:
|
|
30
|
+
- 无限子弹模式:将 `ammoCount` 设置为 Infinity,改为时间限制胜负
|
|
31
|
+
- 移动靶场:将所有目标设为移动,增加难度
|
|
32
|
+
- 多镜头:增加 `zoomLevel` 切换(2x / 4x / 8x),不同倍镜影响视野范围与抖动幅度
|
|
33
|
+
|
|
34
|
+
## Result
|
|
35
|
+
|
|
36
|
+
- **产物文件**:`reducer.ts`
|
|
37
|
+
- **格式**:TypeScript,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` + 分步函数接口
|
|
38
|
+
- **验证**:所有 testCases 必须通过
|
|
39
|
+
|
|
40
|
+
## 渲染集成(⚠️ 场景层必读)
|
|
41
|
+
|
|
42
|
+
### 设计原则:逻辑与动画分离
|
|
43
|
+
|
|
44
|
+
reducer 提供两套接口:
|
|
45
|
+
|
|
46
|
+
| 接口 | 适用场景 | 特点 |
|
|
47
|
+
|------|---------|------|
|
|
48
|
+
| `dispatch()` | 无头测试、AI 模拟、跳过动画 | 一步到位,只返回最终状态 |
|
|
49
|
+
| 分步函数 | **渲染层/GameScene** | 逐步执行,返回中间过程数据用于动画驱动 |
|
|
50
|
+
|
|
51
|
+
### 分步函数返回值与动画映射
|
|
52
|
+
|
|
53
|
+
| 分步函数 | 返回值 | 场景层动画 |
|
|
54
|
+
|---------|--------|-----------|
|
|
55
|
+
| `aimScope(dx, dy)` | `{ scopePos }` | 移动瞄准镜 overlay 到新位置 |
|
|
56
|
+
| `applyBreathDrift(deltaMs)` | `{ driftOffset }` | 叠加抖动偏移到瞄准镜显示位置 |
|
|
57
|
+
| `shoot()` | `{ hit, targetId, isCivilian, score }` | 播放枪声、命中/穿透特效、更新 HUD |
|
|
58
|
+
| `hitDetection(scopePos)` | `HitResult` | 判断瞄准镜中心是否命中目标 |
|
|
59
|
+
| `updateTargets(deltaMs)` | `Target[]` | 按运动模式更新目标位置,驱动精灵移动 |
|
|
60
|
+
|
|
61
|
+
## Binding
|
|
62
|
+
|
|
63
|
+
- **Binding Role**:`gameplayRule`
|
|
64
|
+
- **挂载目标**:`game/gameplay/sniper_shot/reducer.ts`
|
|
65
|
+
- **引用类型**:`gameplay-module-reference`
|
|
66
|
+
- **接口契约**:`init(config)` / `dispatch(action)` / `getState()` / `aimScope()` / `applyBreathDrift()` / `shoot()` / `hitDetection()` / `updateTargets()` / `calculateScore()`
|
|
67
|
+
|
|
68
|
+
## Skill Definition
|
|
69
|
+
|
|
70
|
+
tools:
|
|
71
|
+
- bash
|
|
72
|
+
- write
|
|
73
|
+
- read
|
|
74
|
+
prompt_extension: |
|
|
75
|
+
You are implementing a sniper shooting gameplay module following the PGS specification.
|
|
76
|
+
Write the PGS JSON with entities (scope, targets, wind, ammo, score), rules, algorithm, and testCases.
|
|
77
|
+
Implement the reducer.ts with:
|
|
78
|
+
- init/dispatch/getState (一体化接口,用于测试)
|
|
79
|
+
- aimScope/applyBreathDrift/shoot/hitDetection/updateTargets/calculateScore (分步函数,用于渲染层驱动)
|
|
80
|
+
The breath drift must be sinusoidal over breathCycleMs, with amplitude scaling by zoom level.
|
|
81
|
+
Hit detection must combine: scope center position + breath drift offset + wind correction offset.
|
|
82
|
+
Friendly fire (civilian hit) must trigger penalty immediately and check maxFriendlyFireHits.
|
|
83
|
+
Run the testCases to verify the logic before finalizing.
|
|
84
|
+
Apply the Binding to wire the reducer into the game's gameplay module path.
|