package game

import "github.com/denisovdennis/autohero/internal/model"

// combatLogPhraseKey maps combat swing to a client phrase key (see frontend adventureLog phrases).
func combatLogPhraseKey(source, outcome string) string {
	switch source {
	case "hero":
		switch outcome {
		case attackOutcomeStun:
			return model.LogPhraseCombatHeroStun
		case attackOutcomeDodge:
			return model.LogPhraseCombatHeroDodge
		default:
			return model.LogPhraseCombatHeroHit
		}
	case "enemy":
		if outcome == attackOutcomeBlock {
			return model.LogPhraseCombatEnemyBlock
		}
		return model.LogPhraseCombatEnemyHit
	default:
		return model.LogPhraseCombatHeroHit
	}
}
