From 6f3d21d6e7f01155ce0c461857a053b43d329392 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 27 Jun 2026 02:29:55 -0400 Subject: feat: recall/home cmd, line break option --- internal/game/sys_science.go | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'internal/game/sys_science.go') diff --git a/internal/game/sys_science.go b/internal/game/sys_science.go index 0ee446b..b04072f 100644 --- a/internal/game/sys_science.go +++ b/internal/game/sys_science.go @@ -25,15 +25,16 @@ const ( ) type ModDef struct { - ID string `yaml:"id"` - Name string `yaml:"name"` - Level int `yaml:"level"` - MaxHit int `yaml:"max_hit"` - BaseXP int `yaml:"base_xp"` - JunkCost map[string]int `yaml:"junk_cost"` - Category ModCategory `yaml:"category"` - Element string `yaml:"element"` - Destination int `yaml:"destination"` + ID string `yaml:"id"` + Name string `yaml:"name"` + Level int `yaml:"level"` + MaxHit int `yaml:"max_hit"` + BaseXP int `yaml:"base_xp"` + JunkCost map[string]int `yaml:"junk_cost"` + Category ModCategory `yaml:"category"` + Element string `yaml:"element"` + Destination int `yaml:"destination"` + Sequence []behavior.ModTriggerStep `yaml:"sequence"` } var AllMods []*ModDef @@ -241,9 +242,6 @@ func (g *Game) triggerModReward(sess *net.Session, p *player.Player, mod *ModDef g.consumeJunkCost(p, mod) sciXP := int(float64(mod.BaseXP) * multiplier) - if sciXP < 1 { - sciXP = 1 - } g.awardSkillXP(sess, p, player.Science, sciXP) for _, gain := range extraGains { @@ -253,11 +251,18 @@ func (g *Game) triggerModReward(sess *net.Session, p *player.Player, mod *ModDef g.AccountStore.SaveCharacter(p) if p.OptionBool("xp_drops") { - parts := []string{fmt.Sprintf("+%dxp %s", sciXP, player.SkillAbbr[player.Science])} + var parts []string + if sciXP > 0 { + parts = append(parts, fmt.Sprintf("+%dxp %s", sciXP, player.SkillAbbr[player.Science])) + } for _, gain := range extraGains { - parts = append(parts, fmt.Sprintf("+%dxp %s", gain.XP, player.SkillAbbr[player.SkillName(gain.Skill)])) + if gain.XP > 0 { + parts = append(parts, fmt.Sprintf("+%dxp %s", gain.XP, player.SkillAbbr[player.SkillName(gain.Skill)])) + } + } + if len(parts) > 0 { + sess.WriteLine(g.colorize(sess, "xp", "("+strings.Join(parts, ", ")+")")) } - sess.WriteLine(g.colorize(sess, "xp", "("+strings.Join(parts, ", ")+")")) } return sciXP } -- cgit v1.2.3