feat: achievement system with 10 unlockable achievements
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,8 @@ type GameState struct {
|
||||
SubmittedActions map[string]string // fingerprint -> action description
|
||||
PendingLogs []string // logs waiting to be revealed one by one
|
||||
TurnResolving bool // true while logs are being replayed
|
||||
BossKilled bool
|
||||
FleeSucceeded bool
|
||||
}
|
||||
|
||||
func (s *GameSession) addLog(msg string) {
|
||||
@@ -277,6 +279,8 @@ func (s *GameSession) GetState() GameState {
|
||||
SubmittedActions: submittedCopy,
|
||||
PendingLogs: pendingCopy,
|
||||
TurnResolving: s.state.TurnResolving,
|
||||
BossKilled: s.state.BossKilled,
|
||||
FleeSucceeded: s.state.FleeSucceeded,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ func (s *GameSession) resolvePlayerActions() {
|
||||
case ActionFlee:
|
||||
if combat.AttemptFlee() {
|
||||
s.addLog(fmt.Sprintf("%s fled from battle!", p.Name))
|
||||
s.state.FleeSucceeded = true
|
||||
if s.state.SoloMode {
|
||||
s.state.Phase = PhaseExploring
|
||||
return
|
||||
@@ -255,6 +256,7 @@ func (s *GameSession) resolvePlayerActions() {
|
||||
}
|
||||
s.addLog(fmt.Sprintf("%s defeated! +%d gold", m.Name, goldReward))
|
||||
if m.IsBoss {
|
||||
s.state.BossKilled = true
|
||||
s.grantBossRelic()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user