blob: 20ada37b0d782cb77d539c0bb57d6e3805493981 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package game
import (
"fmt"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
)
func (g *Game) doDescription(sess *net.Session) {
p := sess.Player.(*player.Player)
sess.WriteLine("")
if p.Description != "" {
sess.WriteLine(fmt.Sprintf("Current description: %s", p.Description))
} else {
sess.WriteLine("You don't have a description set.")
}
sess.WriteLine("")
sess.Write("Enter a new description (or press enter to keep current): ")
sess.State = net.StateChangeDescription
}
func (g *Game) handleDescriptionChange(sess *net.Session, input string) {
if input != "" {
p := sess.Player.(*player.Player)
p.Description = input
g.AccountStore.SaveCharacter(p)
sess.WriteLine(fmt.Sprintf("Description set to: %s", input))
} else {
sess.WriteLine("Description left unchanged.")
}
sess.State = net.StateGame
g.writePrompt(sess)
}
|