AutoTrain() spends any training points for this character
()
| 1551 | |
| 1552 | // AutoTrain() spends any training points for this character |
| 1553 | func (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 | |
| 1577 | func (c *Character) CanDualWield() bool { |
| 1578 | return c.GetSkillLevel(skills.DualWield) > 0 |
no test coverage detected