package game import ( "fmt" "thehouseoficarus/internal/net" "thehouseoficarus/internal/player" ) func (g *Game) doObstacle(sess *net.Session, verb string) { p := sess.Player if g.Combat.Get(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.cancelBgAction(p) g.startObstacle(sess, p, info) }