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.
28 lines
724 B
Go
28 lines
724 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
|
|
case attackOutcomeHeal:
|
|
return model.LogPhraseCombatHeroHeal
|
|
default:
|
|
return model.LogPhraseCombatHeroHit
|
|
}
|
|
case "enemy":
|
|
if outcome == attackOutcomeBlock {
|
|
return model.LogPhraseCombatEnemyBlock
|
|
}
|
|
return model.LogPhraseCombatEnemyHit
|
|
default:
|
|
return model.LogPhraseCombatHeroHit
|
|
}
|
|
}
|