blob: 3b9696ce25c0fd9f7b2842a239932b8f05936758 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package game
import (
"fmt"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
)
func (g *Game) awardSkillXP(sess *net.Session, p *player.Player, skill player.SkillName, xp int) {
newLevel := p.AddSkillXP(skill, xp)
if newLevel > 0 {
sess.WriteLine(g.colorize(sess, "level_up", fmt.Sprintf("*** You are now level %d %s! ***", newLevel, skill)))
if skill == player.Agility {
p.ClampRunEnergy()
}
}
}
|