aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_agility.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-19 13:28:06 -0400
committerhistoria <[not public]>2026-06-19 13:28:06 -0400
commit3a58125d14bb307f861b38c6c5b0a63babde7e08 (patch)
treebd89e866447d55e6dffd447d8ef5fabf9b8fbe9d /internal/game/cmd_agility.go
parent575a71dcfed3b9fa44af244836f638a23df05a9a (diff)
downloadthehouseoficarus-3a58125d14bb307f861b38c6c5b0a63babde7e08.tar.gz
feat: all skills kind of implemented, random prototype content added
Diffstat (limited to 'internal/game/cmd_agility.go')
-rw-r--r--internal/game/cmd_agility.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/internal/game/cmd_agility.go b/internal/game/cmd_agility.go
new file mode 100644
index 0000000..3bd777f
--- /dev/null
+++ b/internal/game/cmd_agility.go
@@ -0,0 +1,37 @@
+package game
+
+import (
+ "fmt"
+
+ "thehouseoficarus/internal/combat"
+ "thehouseoficarus/internal/net"
+ "thehouseoficarus/internal/player"
+)
+
+func (g *Game) doObstacle(sess *net.Session, verb string) {
+ p := sess.Player.(*player.Player)
+
+ if combat.GetCombat(p.Name) != nil {
+ sess.WriteLine("You can't do that during combat!")
+ return
+ }
+
+ info := g.CourseStore.GetObstacle(p.RoomID)
+ if info == nil || info.Verb != verb {
+ sess.WriteLine("You can't do that here.")
+ return
+ }
+
+ agilityLevel := p.Level(player.Agility)
+ if agilityLevel < info.RequiredLevel {
+ sess.WriteLine(fmt.Sprintf("You need level %d agility to attempt this course.", info.RequiredLevel))
+ return
+ }
+
+ if p.Action != nil {
+ g.CancelAction(p)
+ }
+ g.CancelBackgroundAction(p)
+
+ g.startObstacle(sess, p, info)
+}