From c14c2e403c75a913e1a6d962fb6fe64f013adae5 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 1 Jul 2026 22:30:31 -0400 Subject: fix: combat formulas and mob attack types (mobs switch attack styles if safespotting) --- internal/game/sys_hazard.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/game/sys_hazard.go') diff --git a/internal/game/sys_hazard.go b/internal/game/sys_hazard.go index 971da99..6e9c40d 100644 --- a/internal/game/sys_hazard.go +++ b/internal/game/sys_hazard.go @@ -75,19 +75,19 @@ func (g *Game) hasEquipped(p *player.Player, itemID string) bool { func (g *Game) rollHazard(sess *net.Session, p *player.Player, hz *world.HazardDef) { attackType := hz.AttackType if attackType == "" { - attackType = "crush" + attackType = combat.DefaultAttackType } - attRoll := combat.EffectiveRoll(hz.Attack, 0, hz.AttackBonus) + attRoll := combat.AttackRoll(combat.NPCEffective(hz.Attack), hz.AttackBonus) _, _, defStyleBonus := combat.AttackStyleBonus(string(p.AttackStyle)) totals := g.playerEquipBonuses(p) equipDef := combat.SelectBonus(attackType, totals.StabDefense, totals.SlashDefense, totals.CrushDefense, totals.ScienceDefense, totals.RangedDefense) - defRoll := combat.EffectiveRoll( + defRoll := combat.AttackRoll(combat.PlayerEffective( p.Level(player.Defense)+g.techLevelBonus(p, "defense")+g.buffLevelBonus(p, "defense"), - defStyleBonus, equipDef) + defStyleBonus), equipDef) if combat.HitCheck(attRoll, defRoll) { g.applyHazardHit(sess, p, hz) -- cgit v1.2.3