# Fateforge Slots — Portrait Edition Open `Assets/Fateforge/Scenes/FateforgeMain.unity` in Unity **6000.3.26f1** and press Play. The Editor uses local saves and simulated services. iOS device builds use Game Center and Google AdMob rewarded videos. ## Playing - Choose **Normal Mode**, then **Continue** to resume a saved normal run or **New Game** to review the starting loadout. Press **Start** to play. Each mode resumes its own run from the shared save slot. Starting a new game replaces the unfinished run. - Use **Swap** or **Discard**, then select cards. Discard costs one energy on its first replacement and permits two replacements. All newly drawn cards are protected during that use, including expansion cards. Click Discard again to end the session, or collect directly. - Double-click or double-tap a Scatter to replace it for free. Three Scatters trigger expansion: 4×3 → 5×3 → 5×4 → 6×4. - Press **Collect ×N**, the cabinet's right-hand lever, or Space, to settle. The deck drawer shows remaining inventory and probabilities. Tooltips dismiss on a tap or after five seconds; their dismissal consumes the tap. - In Miracle Market, tap artwork for details and the price to buy. Sticker, elixir-pack, and burn purchases are paid before selection. Skipping does not refund coins. Burn requires a second confirmation. Sell mode supports tricks, tickets, and magnets. - Escape closes a dismissible overlay or opens Settings. Settings contain independent Music and Sound Effects toggles and 1×/2× animation speed. ## Editable assets The scene contains an authored Canvas hierarchy: background, safe-area root, Home, header, five magnet slots, cabinet, reels, market container, preview, action dock, equipment, dialog, and tooltip layers. The Canvas Scaler uses 750×1334, width matching (`matchWidthOrHeight = 0`). Interactive content follows `Screen.safeArea`; portrait orientation is configured in Player Settings. `Prefabs/Card.prefab`, `MarketOffer.prefab`, `ActionButton.prefab`, and `GuideEntry.prefab` are reusable editable components. Variable card and item instances use these Prefabs. `Theme/PortraitTheme.asset` controls fonts, colors, rounded panels, and reel blur. `Theme/ArtLibrary.asset` references existing artwork and audio without a runtime dependency on the original Godot or HTML folders. The current physical casino skin uses `Art/PhysicalCasino/`: the curtain stage, separate artistic wordmark, blank brass/enamel cabinet, nine control sprites, and four equipment sprites. `PhysicalCabinet`, `MainMenu`, and `DialogShell` are editable Prefabs. Cards continue to use the original HTML symbol sprites through `ArtLibrary`; only their surrounding tiles changed. Labels remain editable TMP text. Native `UiGlyph` and `MatchConnections` components require RectTransform and CanvasRenderer. Crimson Text regular, semibold and italic fonts are included under the SIL Open Font License in `Art/Fonts/OFL.txt`. `Fateforge/Build Portrait Scene` is a reconstruction command. It regenerates this scene and the generated UI Prefabs; use it intentionally because it replaces manual layout changes to those assets. Normal Play Mode and ordinary imports do not rebuild the scene. ## Rules and text The rules in `Core/` and presentation in `Runtime/` compile into `Fateforge`. Editor tools use Unity’s predefined editor assembly. `Game` accepts commands; the presentation reads results and snapshots. Settlement, rewards, purchases, and unlocks commit before animation. Board and campaign random states are saved independently. Animation uses time and indices, never gameplay randomness. The current HTML playable pool is retained: 6 tricks, 4 tickets, 8 magnets, 3 stickers, symbol purchases, elixirs, and elixir packs. Help independently includes all 15 reference tricks and 46 reference tickets. Reference entries do not expand the shop pool. English item text is in `Resources/Fateforge/content.json`. General UI copy is centralized in `Resources/Fateforge/ui-en.json`, with generated `Runtime/EnglishCopy.cs` constants. Original content IDs, filenames, and GUIDs are preserved. The application has no language switch. ## Persistence and services Progress is stored under `Application.persistentDataPath/Fateforge/`. The versioned envelope includes the run ID, revision, stage, both random states, board, stock, card growth and stickers, equipment, pending purchases and candidates, market offers, and independent slot unlock flags. Settings use a separate file. Checkpoints use atomic replacement, checksums, a backup, and an ended-run journal. Prepared loadouts and committed settlements can be continued. Browser and landscape records are not migrated. `ILocalSaveStore`, `ICloudSaveService`, and `IRewardedAdService` are replaceable boundaries. `SaveCoordinator` chooses whole cloud records and applies restoration from Home. Local play works offline and signed out. `RewardedSlotCoordinator` validates request and run identity and grants only from a rewarded callback. The rewarded slot unlocks independently of the 10-coin slot, generates a normally priced offer, persists for the run, and resets on New Game. In the Unity Editor during Play Mode, open **Fateforge → Service Simulation**. The visual Settings page contains only music, sound, animation speed, and navigation. Controls cover availability, sign-in, offline mode, upload failure, conflicting device progress, duplicate callbacks, and callbacks delayed by five seconds. The market's **Watch Ad** opens **Ad Simulation**, offering completion, closure without reward, error, and no-fill outcomes. Cloud synchronization is available from Home; conflicts offer **Use This Device** and **Use Cloud Save**. ### Endless runs Choose **Endless Mode** on Home to start at level 1 with a fresh deck and zero score. Alternatively, after the normal campaign’s level 12 upgrades, choose **Continue Endless** or **End Run**. Continuing carries the full run score and inventory into level 13. Each six-level floor draws two bosses from a saved eight-boss bag. The endless Game Over screen shows the run score and personal best. The separate **Leaderboard** button on Home opens the global all-time Game Center leaderboard on iOS. An exhausted run automatically uses an available Free Spin ticket. After that, an endless run can earn one extra Collect from a completed rewarded video. An unavailable or interrupted video returns to the choice. **End Run** commits defeat. The market offer slot has its own reward. Both the level 12 decision and the revive decision survive restarting the app. ### iOS service configuration 1. In App Store Connect, enable Game Center for the signed app identifier. Create a classic integer leaderboard with **Best Score** and **High to Low**. Put its identifier in `Assets/Fateforge/Resources/Fateforge/mobile-services.json` as `leaderboardId`. 2. Set the shared production rewarded ad unit for the market slot and endless revive in the same JSON under `adMobIosRewardedAdUnitId`. The iOS export writes the AdMob app ID to `GADApplicationIdentifier` in Info.plist. Google UMP checks consent before ad requests. Settings offers Ad Privacy Options when required. 3. Export iOS into an empty directory and open `Unity-iPhone.xcodeproj`. Xcode resolves Google Mobile Ads through **Package Dependencies**. Select the provisioning profile with Game Center enabled and run on the iPhone. 4. Debug, ReleaseForRunning and ReleaseForProfiling use Google's iOS rewarded test unit. Archive with Release to use the production rewarded unit. Filter the Xcode console by `[Fateforge Ads]` to see the selected unit and the load result. Watch a video in each reward opportunity, then skip one in a fresh run to verify retry behavior. 5. With two Game Center sandbox accounts, verify a higher score ranks first. Disconnect, beat a record, reconnect, and verify the same account receives the pending score. Switching accounts must preserve each player’s pending submission. ## Tools and verification Run these from the Unity project root: ```powershell python -X utf8 Tools/Fateforge/import_html_reference.py python -X utf8 Tools/Fateforge/centralize_copy.py node Tools/Fateforge/generate_reference.cjs python -X utf8 Tools/Fateforge/audit_delivery.py ``` The importer reuses original resources and records mappings and transparent bounds. The reference generator reads the approved local HTML, generates deterministic fixtures, and executes its 104 checks without writing to reference files. Its reference path can be passed as the first argument. Run the `Fateforge.Tests` namespace in EditMode (`Game.EditModeTests`) and PlayMode (`Game.PlayModeTests`) in the Unity Test Runner or through Unity MCP. Play Mode tests use a separate Validation save profile. The full-route test uses a controlled score fixture to exercise all 12 levels; it does not claim an unassisted balance playthrough. `Fateforge.Editor.PortraitVerification` provides Editor-only screen fixtures and rejects normal save profiles. Enable `useValidationProfile` before entering Play Mode for fixtures. `Fateforge.Editor.FateforgeBuilder.Resolution(width, height)` configures Game View. `SafeAreaLayout.simulateInsets` is an Editor inspection aid; leave it disabled for normal play. Capture overlay UI with `ScreenCapture.CaptureScreenshot` through Unity MCP. Test records, screenshots, source hashes, and the audit report are in `Validation/Fateforge/`; the latest physical casino implementation and screenshots are in `Validation/Fateforge/PhysicalUI/TEST_RECORD.md` and `Review.html`. The older skin repair is retained in `Validation/Fateforge/UIRefresh/TEST_RECORD.md`. ## Scene and content `Assets/Fateforge/Scenes/FateforgeMain.unity` is the build entry point. The shared sprites, audio, and source fonts are under `Assets/Fateforge/Resources/Fateforge`. The HTML importer reads its source catalog from `Assets/Fateforge/Editor/Reference/catalog.json`.