aboutsummaryrefslogtreecommitdiff
path: root/internal/game/sys_hazard.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-01 22:30:31 -0400
committerhistoria <[not public]>2026-07-01 22:30:31 -0400
commitc14c2e403c75a913e1a6d962fb6fe64f013adae5 (patch)
tree75070293fe2535b594ac72e501cbf08a3f1146e0 /internal/game/sys_hazard.go
parent8eec7b75ff9c8c368b252373db45fb891732d2ca (diff)
downloadthehouseoficarus-c14c2e403c75a913e1a6d962fb6fe64f013adae5.tar.gz
fix: combat formulas and mob attack types (mobs switch attack styles if safespotting)
Diffstat (limited to 'internal/game/sys_hazard.go')
-rw-r--r--internal/game/sys_hazard.go8
1 files changed, 4 insertions, 4 deletions
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)