Skip to content

Add 5 major features: Template Library, Custom Judges, Spectator Mode, Achievements, and Game History#1

Draft
Copilot wants to merge 5 commits intomasterfrom
copilot/add-new-features
Draft

Add 5 major features: Template Library, Custom Judges, Spectator Mode, Achievements, and Game History#1
Copilot wants to merge 5 commits intomasterfrom
copilot/add-new-features

Conversation

Copy link

Copilot AI commented Jan 19, 2026

Adds comprehensive feature set to enhance gameplay experience and player engagement based on analysis of existing game mechanics.

Core Features

Prompt Template Library

  • 12 pre-made templates categorized by style (搞笑, 戲劇, 正經, 文藝, 黑暗)
  • Category filtering and one-click application
  • Service: PromptTemplateService

Custom Judge Personas

  • Host-configurable judge personalities that mix with defaults
  • Per-room storage with add/remove UI in lobby settings
  • Integrated into round persona selection logic

Spectator Mode

  • Late joiners enter as spectators when game in progress
  • View-only access, separate from active player list
  • Host-toggleable via room settings

Achievement System

  • 8 achievement types with stat tracking (wins, streaks, scores)
  • Leaderboard and player stats page (/stats)
  • Auto-unlock notifications on game completion

Game History

  • Full round-by-round recording with themes, judges, scores
  • Player-filterable history page (/history)
  • Integrated tracking in game lifecycle

Implementation Notes

All services use singleton registration and integrate with existing GameService flow. History and achievements trigger on game completion.

Performance optimizations:

  • Static Random instance (thread-safe singleton)
  • Dictionary-based O(1) lookups for player name resolution
  • Cheat detection threshold extracted to constant
private static readonly Random _random = new Random();
private const int CHEAT_DETECTION_THRESHOLD = 30;

Achievement cloning uses dedicated method to ensure property consistency:

public Achievement Clone(DateTime unlockedAt) => new Achievement
{
    Id = this.Id,
    Type = this.Type,
    // ... all properties
    UnlockedAt = unlockedAt
};
Original prompt

幫我想一下新功能要加什麼


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 19, 2026 00:21
Co-authored-by: breezy89757 <116503439+breezy89757@users.noreply.github.com>
Co-authored-by: breezy89757 <116503439+breezy89757@users.noreply.github.com>
Co-authored-by: breezy89757 <116503439+breezy89757@users.noreply.github.com>
Co-authored-by: breezy89757 <116503439+breezy89757@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new features to the existing application Add 5 major features: Template Library, Custom Judges, Spectator Mode, Achievements, and Game History Jan 19, 2026
Copilot AI requested a review from breezy89757 January 19, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants