Beispiel #1
0
func (team Team) CalculateXPUncapped(creature mobs.Creature) int {
	c := creature.Coefficient()
	x := float64(xp.BaseXP(creature.Level.Level - team.HighestSkill))
	exp := (2.0 / (float64(team.Size) + 1)) * c * x

	return int(math.Ceil(exp))
}
Beispiel #2
0
func (team Team) FindLevelDifference(desiredXP int, coefficient float64) (int, error) {
	requiredX := int(math.Ceil((float64(desiredXP) / ((2 / (float64(team.Size) + 1)) * coefficient))))

	for l := -49; l <= 100; l++ {
		if xp.BaseXP(l) >= requiredX {
			return l, nil
		}
	}

	return 0, errors.New("No suitable level found")
}