aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_attack.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-20 03:20:01 -0400
committerhistoria <[not public]>2026-06-20 03:20:01 -0400
commite4400c5f1e84c18d2126f2cb502ae10685977cbb (patch)
tree0523e9d68f1cfdc6f81b862e3068fe12c1a85054 /internal/game/cmd_attack.go
parent5ea082ab4e82409aebc889b496f43e52b003d4f7 (diff)
downloadthehouseoficarus-e4400c5f1e84c18d2126f2cb502ae10685977cbb.tar.gz
refactor: combined all station crafting
Diffstat (limited to 'internal/game/cmd_attack.go')
-rw-r--r--internal/game/cmd_attack.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/internal/game/cmd_attack.go b/internal/game/cmd_attack.go
index f9cfba2..89cde46 100644
--- a/internal/game/cmd_attack.go
+++ b/internal/game/cmd_attack.go
@@ -126,7 +126,7 @@ func (g *Game) findMob(sess *net.Session, input string, roomID int) *world.MobIn
func (g *Game) startCombat(sess *net.Session, p *player.Player, mob *world.MobInstance) {
g.cancelRest(p.Name)
- g.cancelBackgroundAction(p)
+ g.cancelBgAction(p)
combat.EnterCombat(p.Name, mob.InstanceID)
p.AttackTimer = 0
@@ -162,13 +162,7 @@ func (g *Game) startCombat(sess *net.Session, p *player.Player, mob *world.MobIn
}
p.ActionState = &ActionState{Type: ActionCombating, TargetName: mob.Name}
- if g.Hub != nil {
- for _, other := range g.Hub.PlayersInRoom(p.RoomID) {
- if other != sess && other.Player != nil {
- other.WriteLine(g.colorize(other, "broadcast", fmt.Sprintf("\n%s attacks %s!", p.Name, mobDisplayName(mob, true))))
- }
- }
- }
+ g.broadcastAction(sess, "\n%s attacks %s!", p.Name, mobDisplayName(mob, true))
g.Ticks.Subscribe(1, func() bool {
cs := combat.GetCombat(p.Name)
@@ -567,7 +561,7 @@ func (g *Game) endCombat(sess *net.Session, p *player.Player, mob *world.MobInst
}
if mob.Drops.Remains != "" {
- g.World.AddReservedGroundItem(p.RoomID, mob.Drops.Remains, 1, p.Name)
+ g.World.AddReservedItem(p.RoomID, mob.Drops.Remains, 1, p.Name)
def, _ := g.ItemStore.Load(mob.Drops.Remains)
name := mob.Drops.Remains
if def != nil {
@@ -588,7 +582,7 @@ func (g *Game) endCombat(sess *net.Session, p *player.Player, mob *world.MobInst
if qty <= 0 {
qty = 1
}
- g.World.AddReservedGroundItem(p.RoomID, entry.ItemID, qty, p.Name)
+ g.World.AddReservedItem(p.RoomID, entry.ItemID, qty, p.Name)
def, _ := g.ItemStore.Load(entry.ItemID)
name := entry.ItemID
if def != nil {