aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_description.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-10 01:48:28 -0400
committerhistoria <[not public]>2026-06-10 01:48:28 -0400
commita226d72e51eecb768b13600303f73483118d9104 (patch)
tree458d15ef049732c15dacc591a830d3beddbedfde /internal/game/cmd_description.go
parent6a0f3d7a252de4b1741cfe5e1c561412c602becc (diff)
downloadthehouseoficarus-a226d72e51eecb768b13600303f73483118d9104.tar.gz
feat: implemented janky object interaction model
Diffstat (limited to 'internal/game/cmd_description.go')
-rw-r--r--internal/game/cmd_description.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/game/cmd_description.go b/internal/game/cmd_description.go
new file mode 100644
index 0000000..6875840
--- /dev/null
+++ b/internal/game/cmd_description.go
@@ -0,0 +1,34 @@
+package game
+
+import (
+ "fmt"
+
+ "thirdcollapse/internal/net"
+ "thirdcollapse/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
+ sess.Write("\r\n> ")
+}