MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / WimpyCheck

Method WimpyCheck

internal/users/userrecord.go:675–682  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

673}
674
675func (u *UserRecord) WimpyCheck() {
676 if currentWimpy := u.GetConfigOption(`wimpy`); currentWimpy != nil {
677 healthPct := int(math.Floor(float64(u.Character.Health) / float64(u.Character.HealthMax.Value) * 100))
678 if healthPct < currentWimpy.(int) {
679 u.Command(`flee`, -1)
680 }
681 }
682}

Callers 3

AttackPlayerVsMobFunction · 0.80
AttackPlayerVsPlayerFunction · 0.80
AttackMobVsPlayerFunction · 0.80

Calls 2

GetConfigOptionMethod · 0.95
CommandMethod · 0.95

Tested by

no test coverage detected