aboutsummaryrefslogtreecommitdiff
path: root/internal/game/sys_science.go
diff options
context:
space:
mode:
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
}