Files
aventuriers-des-mots/scripts/profiles/save_factory.gd
T
Denis Defolie 65a0cb46f9 Add mission scoring, rewards collection and save schema v2
Phase "score et récompenses" of the post-0.1.0 plan (user feedback:
wants a more game-like experience with scoring and rewards).

- MissionScoring: 1-3 stars from how each exercise was solved (never
  speed; a finished mission always gives at least one star).
- Save schema v2: mission_results (best/last stars, completions) with a
  v1->v2 migration that keeps existing stars and items.
- Total only grows by the improvement over a mission's best score.
- Data-driven collection (data/rewards, reward_item schema, validated
  incl. mission cross-check) unlocked by RewardRules.
- Reward screen, collection screen, stars on the world map.
- Version 0.2.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 22:20:59 +02:00

19 lines
609 B
GDScript

class_name SaveFactory
extends RefCounted
## Construit une nouvelle sauvegarde vide pour un profil, conforme a
## data/schemas/save.schema.json. Code pur.
static func new_save(profile_id: String, display_name: String, school_level: String) -> Dictionary:
return {
"schema_version": SaveMigration.CURRENT_SCHEMA_VERSION,
"profile_id": profile_id,
"display_name": display_name,
"school_level": school_level,
"session_count": 0,
"unlocked_regions": [],
"skills": {},
"mission_results": {},
"rewards": {"stars": 0, "items": []},
}