diff options
| author | workhorse <workhorse@localhost.localdomain> | 2026-06-19 03:57:06 -0400 |
|---|---|---|
| committer | workhorse <workhorse@localhost.localdomain> | 2026-06-19 03:57:06 -0400 |
| commit | 52a3ce6a4b4a254dc5d3067979a09e93c060fa20 (patch) | |
| tree | 167c62990013733bc8669c1387078bc86ea48db5 /internal/game/cmd_task.go | |
| parent | fbd1c30d7b9777c9df6653f0c393afa7a7dfa519 (diff) | |
| download | thehouseoficarus-52a3ce6a4b4a254dc5d3067979a09e93c060fa20.tar.gz | |
feat: shops and rough assassin skill
Diffstat (limited to 'internal/game/cmd_task.go')
| -rw-r--r-- | internal/game/cmd_task.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/game/cmd_task.go b/internal/game/cmd_task.go new file mode 100644 index 0000000..2dcf3f4 --- /dev/null +++ b/internal/game/cmd_task.go @@ -0,0 +1,34 @@ +package game + +import ( + "fmt" + + "thehouseoficarus/internal/net" + "thehouseoficarus/internal/player" +) + +func (g *Game) doTask(sess *net.Session) { + p := sess.Player.(*player.Player) + + mobID := getPlayerFlagString(p, "assassin_task_mob") + remaining := getPlayerFlagInt(p, "assassin_task_remaining") + total := getPlayerFlagInt(p, "assassin_task_total") + streak := getPlayerFlagInt(p, "assassin_streak") + rep := getPlayerFlagInt(p, "assassin_reputation") + + if mobID == "" || remaining <= 0 { + if getPlayerFlagInt(p, "assassin_tasks_completed") > 0 { + sess.WriteLine("You have no active task. Talk to The Client for a new assignment.") + } else { + sess.WriteLine("You don't have an Assassin task. Talk to The Client to get one.") + } + } else { + def, err := g.MobStore.LoadDef(mobID) + name := mobID + if err == nil { + name = def.Name + } + sess.WriteLine(fmt.Sprintf("Assassin task: Kill %ss. %d of %d remaining.", name, remaining, total)) + } + sess.WriteLine(fmt.Sprintf("Streak: %d | Reputation: %d", streak, rep)) +} |
