diff options
| author | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
| commit | 9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch) | |
| tree | 0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/game/act_combine.go | |
| parent | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff) | |
| download | thehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz | |
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/game/act_combine.go')
| -rw-r--r-- | internal/game/act_combine.go | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/internal/game/act_combine.go b/internal/game/act_combine.go index d7aed04..a50d310 100644 --- a/internal/game/act_combine.go +++ b/internal/game/act_combine.go @@ -18,6 +18,21 @@ func (g *Game) startCombine(sess *net.Session, p *player.Player, item *item.Item return } + // See startProduction: combine recipes can start outside the crafting + // menus, so the station/tool gate must live at the execution site. + if len(craft.Station) > 0 { + if stID, _ := g.findStation(p.RoomID, craft.Station); stID == "" { + sess.WriteLine("You are not near the required station.") + g.reprompt(sess) + return + } + } + if craft.Tool != "" && !g.hasToolType(p, craft.Tool) { + sess.WriteLine("You do not have the required tool.") + g.reprompt(sess) + return + } + outDef, _ := g.ItemStore.Load(item.ID) outputName := item.ID if outDef != nil { @@ -47,13 +62,12 @@ func (g *Game) startCombine(sess *net.Session, p *player.Player, item *item.Item g.broadcastAction(sess, "%s starts combining.", p.Name) } -// combineSkill resolves the skill a combine recipe trains. Combine recipes -// declare type "combine", which is an action, not a skill: player.SkillName -// of it is the literal "combine", so p.Level would read a map miss as level 1 -// when rolling success and awardSkillXP would persist a phantom "combine" -// skill entry. A recipe that declares a real skill name is honored; anything -// else trains Crafting, the skill combine work belongs to. -func combineSkill(craft *item.CraftDef) player.SkillName { +// recipeSkill resolves the skill a recipe trains and rolls against. A recipe +// type is an action name, not necessarily a skill: player.SkillName of e.g. +// "combine" or "cleaning" is a literal action, so p.Level would read a map +// miss as level 1 and AddSkillXP would persist a phantom skill key. A recipe +// that declares a real skill name is honored; anything else trains Crafting. +func recipeSkill(craft *item.CraftDef) player.SkillName { skill := player.SkillName(craft.EffectiveSkill()) if player.ValidSkill(skill) { return skill @@ -61,6 +75,13 @@ func combineSkill(craft *item.CraftDef) player.SkillName { return player.Crafting } +// combineSkill resolves the skill a combine recipe trains. Combine recipes +// declare type "combine", which is an action, not a skill: the shared +// recipeSkill fallback keeps success rolls and XP on Crafting. +func combineSkill(craft *item.CraftDef) player.SkillName { + return recipeSkill(craft) +} + func (g *Game) advanceCombine(sess *net.Session, p *player.Player) { d, ok := p.Action.Data.(*behavior.CombineData) if !ok { |
