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

Method AutoTrain

internal/characters/character.go:1553–1575  ·  view source on GitHub ↗

AutoTrain() spends any training points for this character

()

Source from the content-addressed store, hash-verified

1551
1552// AutoTrain() spends any training points for this character
1553func (c *Character) AutoTrain() {
1554
1555 if c.StatPoints < 0 {
1556 return
1557 }
1558
1559 statPtrs := [...]*int{
1560 &c.Stats.Strength.Training,
1561 &c.Stats.Speed.Training,
1562 &c.Stats.Smarts.Training,
1563 &c.Stats.Vitality.Training,
1564 &c.Stats.Mysticism.Training,
1565 &c.Stats.Perception.Training,
1566 }
1567
1568 for i := 0; c.StatPoints > 0; i++ {
1569 *statPtrs[i%len(statPtrs)]++
1570 c.StatPoints--
1571 }
1572
1573 c.Validate()
1574
1575}
1576
1577func (c *Character) CanDualWield() bool {
1578 return c.GetSkillLevel(skills.DualWield) > 0

Callers 2

newSimMobFunction · 0.80
NewMobByIdFunction · 0.80

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected