aboutsummaryrefslogtreecommitdiff
path: root/internal/game/sys_construction.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-01 19:41:34 -0400
committerhistoria <[not public]>2026-07-01 19:41:34 -0400
commit8eec7b75ff9c8c368b252373db45fb891732d2ca (patch)
tree528ab3f235e3082a51b8bd6c8e5ae269c41b4f2b /internal/game/sys_construction.go
parent78b522d57a9ebc691e075523910d7cdaa06b6493 (diff)
downloadthehouseoficarus-8eec7b75ff9c8c368b252373db45fb891732d2ca.tar.gz
mob combat stats overhauled and standardized
Diffstat (limited to 'internal/game/sys_construction.go')
-rw-r--r--internal/game/sys_construction.go74
1 files changed, 0 insertions, 74 deletions
diff --git a/internal/game/sys_construction.go b/internal/game/sys_construction.go
deleted file mode 100644
index 06713cd..0000000
--- a/internal/game/sys_construction.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package game
-
-import (
- "fmt"
-
- "thehouseoficarus/internal/net"
- "thehouseoficarus/internal/player"
-)
-
-func (g *Game) processSawmill(sess *net.Session, p *player.Player) {
- logTypes := map[string]struct {
- plankID string
- cost int
- name string
- }{
- "logs": {"planks", 5, "regular planks"},
- "oak_logs": {"oak_planks", 10, "oak planks"},
- "teak_logs": {"teak_planks", 20, "teak planks"},
- "mahogany_logs": {"mahogany_planks", 40, "mahogany planks"},
- }
-
- totalCost := 0
- totalPlanks := 0
- type plankResult struct {
- plankID string
- qty int
- }
-
- var results []plankResult
-
- for logID, info := range logTypes {
- qty := p.CountItem(logID)
- if qty == 0 {
- continue
- }
- cost := qty * info.cost
- totalCost += cost
- totalPlanks += qty
- results = append(results, plankResult{info.plankID, qty})
- p.RemoveItem(logID, qty)
- }
-
- if totalPlanks == 0 {
- sess.WriteLine("You don't have any logs to process.")
- return
- }
-
- if p.Credits < totalCost {
- sess.WriteLine(fmt.Sprintf("You need %d credits to process all your logs (you have %d).", totalCost, p.Credits))
- return
- }
-
- p.Credits -= totalCost
-
- processed := 0
- for _, r := range results {
- for i := 0; i < r.qty; i++ {
- freeSlot := p.FirstFreeSlot()
- if freeSlot == -1 {
- g.World.AddGroundItem(p.RoomID, r.plankID, r.qty-i)
- break
- }
- p.SetInvSlot(freeSlot, &player.InventorySlot{ItemID: r.plankID, Quantity: 1})
- processed++
- }
- }
-
- g.AccountStore.SaveCharacter(p)
-
- sess.WriteLine(fmt.Sprintf("The sawmill operator processes your logs into %d planks for %d credits.", processed, totalCost))
- if processed < totalPlanks {
- sess.WriteLine(fmt.Sprintf("Your inventory is full. The remaining %d planks fall to the ground.", totalPlanks-processed))
- }
-}