A cross-platform Yu-Gi-Oh! life points tracker built with .NET 8 and .NET MAUI (Windows + mobile).
This project is a faithful migration of an original Next.js / React (TSX) prototype, keeping the same UX and rules while adopting a clean, testable C# architecture.
⚠️ Disclaimer: This is a fan-made utility app. Yu-Gi-Oh! is a trademark of its respective owners. This project is not affiliated with or endorsed by Konami.
- 2 players with configurable starting Life Points (default: 8000)
- Tap to edit LP using a calculator-style input
- Game log with:
- automatic history entries per change
- Undo / Redo
- Clear log
- Export log to
.txt(same format as the original)
- Reset duel (clears LP + history)
Supports the same shortcuts and behavior as the TSX version:
- Absolute:
8000→ set to 8000 - Relative:
+1000,-800 - Multiplication:
*2,*3 - Division:
/2,/3 - Percentage shortcut:
%2(divide current LP by 2) - Thousands suffix:
8k,+2k - Result is floored and LP never goes below 0
- Timer (start/pause/reset)
- Dice roll (1–6)
- Coin flip (heads/tails)
- Phase tracker (Draw → Standby → Main 1 → Battle → Main 2 → End)
- Counters (spell counters, tokens, turns, custom)
- Notes (auto-saved locally)
- Starting LP presets (8000 / 4000 / 2000)
- Theme: Dark / Light / Auto (system)
- Haptic feedback (mobile)
- Sound effects (optional)
- Keep screen on (optional)
- “Clear all data” (local-only)
- All data is stored locally on the device.
- No backend. No tracking.
The original app used:
- Next.js + React (TSX)
- Zustand + persistence (localStorage)
- UI built with a mobile-first layout and a battery-friendly dark theme
This MAUI version keeps the same functional rules, but changes the internals to be:
- strongly typed
- unit-testable
- cross-platform (Windows + Android/iOS)
- The original TSX prototype did not enforce a strict history size.
- In this MAUI port we enforce a hard cap of 1000 log entries per duel to avoid memory/perf issues on mobile devices.
This repository follows a simple, clean separation of concerns:
- YugiohLifeCounter (MAUI UI)
- Pages, Views, ViewModels (MVVM)
- Dependency Injection setup
- YugiohLifeCounter.Application
- Use-cases/services (orchestrates domain operations)
- App-level abstractions (storage, vibration, sound, etc.)
- YugiohLifeCounter.Core
- Domain models + pure logic (game engine, calculator, state transitions)
- No MAUI dependencies
- YugiohLifeCounter.Core.Tests
- Unit tests for the pure domain logic (xUnit)
- .NET 8
- .NET MAUI
- MVVM pattern (CommunityToolkit.Mvvm)
- Dependency Injection (built-in .NET host)
- xUnit (tests)
- Visual Studio 2022 with workloads:
- “.NET Multi-platform App UI development”
- .NET 8 SDK (recent patch recommended)
- Windows 10/11 SDK (10.0.19041+)
If you see MVVM Toolkit errors about Windows SDK references, update your .NET SDK / Visual Studio.
(As a temporary workaround, you can pin WindowsSdkPackageVersion in the MAUI .csproj.)
- Install MAUI workload:
dotnet workload install maui
- Open the solution in Visual Studio.
- Set startup project:
YugiohLifeCounter - Choose target: Windows Machine
- Run (F5)
- Install Android emulator (via Android Device Manager) or connect a device.
- Select target: Android emulator/device
- Run (F5)
dotnet restore
dotnet build ./src/YugiohLifeCounter/YugiohLifeCounter.csproj -f net8.0-windows10.0.19041.0
### Run tests
```bash
dotnet testThe export matches the original behavior:
- Header with duel title
- Current LP per player
- Duel duration
- History ordered from first change to last change, including timestamp, change, resulting LP, and optional expression
Example:
Yu-Gi-Oh! Duel Log
===================
Player 1: 6500 LP
Player 2: 8000 LP
Duration: 3m 12s
History:
--------
1. [15:02:01] Player 1: -1500 → 6500 LP (-1500)
-
Finish 1:1 UI parity with the TSX prototype (layout, spacing, typography)
-
Implement local persistence for:
- game state + undo stack
- notes
- settings
-
Optional: sound + haptics toggles wired per platform
-
Optional: “keep screen on” wiring per platform
-
Polish + packaging (Windows MSIX / Android APK/AAB)
- Keep domain logic inside Core (pure + testable)
- Keep UI logic inside MAUI project (ViewModels bind to services)
- Add tests for any domain rule changes (
YugiohLifeCounter.Core.Tests) - Prefer small commits with clear messages
- Original functional reference: Next.js / React (TSX) prototype
- UI inspiration: mobile-first duel tracker design principles
- Built as a clean, testable port to .NET MAUI
::contentReference[oaicite:0]{index=0}