aboutsummaryrefslogtreecommitdiff
path: root/internal/game/sys_science.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-27 02:29:55 -0400
committerhistoria <[not public]>2026-06-27 02:29:55 -0400
commit6f3d21d6e7f01155ce0c461857a053b43d329392 (patch)
tree51e96b62deb5f99a3d70c3a15ab94c520a1ee8e8 /internal/game/sys_science.go
parent3102525d97aa6f1ad152c74b2ccfbd4b3a9b83f5 (diff)
downloadthehouseoficarus-6f3d21d6e7f01155ce0c461857a053b43d329392.tar.gz
feat: recall/home cmd, line break option
Diffstat (limited to 'internal/game/sys_science.go')
-rw-r--r--internal/game/sys_science.go35
1 files changed, 20 insertions, 15 deletions
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
}