diff options
| author | historia <[not public]> | 2026-07-01 03:21:52 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 03:21:52 -0400 |
| commit | fbe5090ac3325ff8ea6989cdf4515c7f077c975b (patch) | |
| tree | 1811ad9c6a596e7177bb2c42944c389c0a120066 /internal/game/production_engine.go | |
| parent | 5f37dc9b6f6b79da04da70ae0c33ec8d02998587 (diff) | |
| download | thehouseoficarus-fbe5090ac3325ff8ea6989cdf4515c7f077c975b.tar.gz | |
feat: item messaging standardized, custom messages for production paths implemented
Diffstat (limited to 'internal/game/production_engine.go')
| -rw-r--r-- | internal/game/production_engine.go | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/internal/game/production_engine.go b/internal/game/production_engine.go index 048e152..1d54714 100644 --- a/internal/game/production_engine.go +++ b/internal/game/production_engine.go @@ -113,8 +113,8 @@ func (g *Game) startProduction(sess *net.Session, p *player.Player, item *item.I ItemID: item.ID, Phase: 0, Wait: wait, - StartMsg: startMsg, - EndMsg: endMsg, + StartMessage: startMsg, + EndMessage: endMsg, Remaining: count, }, WaitLeft: engine.ToTicks(1), @@ -129,6 +129,11 @@ func (g *Game) startProductionFromItem(sess *net.Session, p *player.Player, item return } + if craft.Type == "combine" { + g.startCombine(sess, p, item, craft, count) + return + } + _, stationName := g.findStation(p.RoomID, craft.Station) if stationName == "" { stationName = "inventory" @@ -177,8 +182,8 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { itemID := d.ItemID phase := d.Phase wait := d.Wait - startMsg := d.StartMsg - endMsg := d.EndMsg + startMsg := d.StartMessage + endMsg := d.EndMessage remaining := d.Remaining item := g.loadCraftItem(itemID) @@ -192,27 +197,11 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { if startMsg != "" { sess.WriteLine(startMsg) } - if len(craft.Steps) > 0 { - d.NextStepIndex = 0 - d.StepsAccumulatedTicks = 0 - } d.Phase = 1 p.Action.WaitLeft = engine.ToTicks(wait) return true } - if stepsIdx := d.NextStepIndex; stepsIdx < len(craft.Steps) { - accTicks := d.StepsAccumulatedTicks - accTicks += wait - d.StepsAccumulatedTicks = accTicks - for i := stepsIdx; i < len(craft.Steps); i++ { - if accTicks >= craft.Steps[i].Tick { - sess.WriteLine(g.resolveCraftVar(sess, craft.Steps[i].Message, craft, item.ID, nil, p.HasItem)) - d.NextStepIndex = i + 1 - } - } - } - skill := craft.EffectiveSkill() skillLevel := p.Level(player.SkillName(skill)) chance := 1.0 @@ -278,7 +267,7 @@ func (g *Game) advanceProduction(sess *net.Session, p *player.Player) bool { } else { defaultSuccess = "You produce %n." } - msg := g.resolveCraftMessage(sess, craft.Message, defaultSuccess, craft, item.ID, byproducts, p.HasItem) + msg := g.resolveCraftMessage(sess, craft.SuccessMessage, defaultSuccess, craft, item.ID, byproducts, p.HasItem) if p.OptionBool("xp_drops") && craft.XP > 0 { msg += g.formatXpDropSingle(sess, p, player.SkillName(skill), craft.XP) } |
