You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
658 B
Go

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
}
}