aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_gather.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-12 23:52:06 -0400
committerhistoria <[not public]>2026-06-12 23:52:06 -0400
commita19e6b6ab01670a5932308c7bd0e0e5eed8cbcad (patch)
tree80a2e46c3e6cc98bb8b4f708cc403949b14742eb /internal/game/action_gather.go
parentf3a6ae488bbd2128af8356b0da016699c5abb70e (diff)
downloadthehouseoficarus-a19e6b6ab01670a5932308c7bd0e0e5eed8cbcad.tar.gz
feat: firemaking skill implemented. overhauled how ground items and despawn are handled.
Diffstat (limited to 'internal/game/action_gather.go')
-rw-r--r--internal/game/action_gather.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/internal/game/action_gather.go b/internal/game/action_gather.go
index 2ca2e82..7e53e87 100644
--- a/internal/game/action_gather.go
+++ b/internal/game/action_gather.go
@@ -214,7 +214,9 @@ func (g *Game) advanceGather(sess *net.Session, p *player.Player) {
xp = cfg.XP
}
if xp > 0 {
- p.AddXP(player.SkillName(cfg.Skill), xp)
+ if newLevel := p.AddSkillXP(player.SkillName(cfg.Skill), xp); newLevel > 0 {
+ sess.WriteLine(fmt.Sprintf("*** You are now level %d %s! ***", newLevel, cfg.Skill))
+ }
}
g.AccountStore.SaveCharacter(p)
@@ -232,7 +234,7 @@ func (g *Game) advanceGather(sess *net.Session, p *player.Player) {
if shared {
st := g.World.GetObjStateByKey(instanceKey)
if st != nil && st.SharedTimer <= 0 {
- g.depleteSharedTree(sess, p, st, cfg.DepleteDelay, instanceKey)
+ g.depleteSharedTree(sess, p, st, cfg, instanceKey)
return
}
}
@@ -301,12 +303,17 @@ func filterDropsByLevel(drops []action.DropEntry, level int) []action.DropEntry
return eligible
}
-func (g *Game) depleteSharedTree(sess *net.Session, p *player.Player, st *world.ObjState, respawnTicks int, instanceKey string) {
+func (g *Game) depleteSharedTree(sess *net.Session, p *player.Player, st *world.ObjState, cfg *action.GatherConfig, instanceKey string) {
st.Depleted = true
- st.DepleteTimer = respawnTicks
+ st.DepleteTimer = cfg.DepleteDelay
st.SharedTimer = 0
- sess.WriteLine(fmt.Sprintf("\nThe %s falls to the ground!", p.Action.TargetName))
+ msg := cfg.ExhaustedMessage
+ if msg == "" {
+ msg = fmt.Sprintf("The %s falls to the ground!", p.Action.TargetName)
+ }
+
+ sess.WriteLine(fmt.Sprintf("\n%s", msg))
for _, other := range g.Hub.PlayersInRoom(p.RoomID) {
if other == sess {
@@ -317,7 +324,7 @@ func (g *Game) depleteSharedTree(sess *net.Session, p *player.Player, st *world.
continue
}
if op.Action.Data["instance_key"] == instanceKey {
- other.WriteLine(fmt.Sprintf("\nThe %s falls to the ground!", p.Action.TargetName))
+ other.WriteLine(fmt.Sprintf("\n%s", msg))
g.CancelAction(op)
}
}