diff options
| author | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-25 15:40:48 -0400 |
| commit | abd612c15799f604e671e83dc7c410ed2b44185f (patch) | |
| tree | 0597ca92350de73aac2a7cf26b2f2d6595dac0cc /internal/game/sys_combat.go | |
| parent | 2725e2927a1595c7b100d942d1f14146252adeb7 (diff) | |
| download | thehouseoficarus-abd612c15799f604e671e83dc7c410ed2b44185f.tar.gz | |
slop refactor
Diffstat (limited to 'internal/game/sys_combat.go')
| -rw-r--r-- | internal/game/sys_combat.go | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/internal/game/sys_combat.go b/internal/game/sys_combat.go index 91a07cf..e020ccf 100644 --- a/internal/game/sys_combat.go +++ b/internal/game/sys_combat.go @@ -4,7 +4,6 @@ import ( "fmt" "sort" - "thehouseoficarus/internal/combat" "thehouseoficarus/internal/engine" "thehouseoficarus/internal/net" "thehouseoficarus/internal/player" @@ -29,10 +28,10 @@ func (g *Game) dropItemsOnDeath(p *player.Player) { val = def.Value * inv.Quantity } items = append(items, deathDrop{ - itemID: inv.ItemID, - quantity: inv.Quantity, + itemID: inv.ItemID, + quantity: inv.Quantity, totalValue: val, - invSlot: slot, + invSlot: slot, }) } @@ -42,11 +41,11 @@ func (g *Game) dropItemsOnDeath(p *player.Player) { val = def.Value } items = append(items, deathDrop{ - itemID: itemID, - quantity: 1, + itemID: itemID, + quantity: 1, totalValue: val, - isEquip: true, - equipSlot: eqSlot, + isEquip: true, + equipSlot: eqSlot, }) } @@ -72,7 +71,7 @@ func (g *Game) dropItemsOnDeath(p *player.Player) { func (g *Game) checkAggro(sess *net.Session) { p := sess.Player - if combat.GetCombat(p.Name) != nil { + if g.Combat.Get(p.Name) != nil { return } @@ -83,7 +82,7 @@ func (g *Game) checkAggro(sess *net.Session) { if !mob.Aggressive || mob.HP <= 0 || mob.Protected { continue } - if combat.IsMobInCombat(mob.InstanceID) { + if g.Combat.IsMobInCombat(mob.InstanceID) { continue } mobLevel := mobCombatLevel(mob) @@ -95,13 +94,13 @@ func (g *Game) checkAggro(sess *net.Session) { } aggMob := mob g.Ticks.Subscribe(engine.ToTicks(1), func() bool { - if combat.GetCombat(p.Name) != nil { + if g.Combat.Get(p.Name) != nil { return false } if aggMob.HP <= 0 || aggMob.RoomID != p.RoomID { return false } - if combat.IsMobInCombat(aggMob.InstanceID) { + if g.Combat.IsMobInCombat(aggMob.InstanceID) { return false } attacker := aggMob.Name |
