aboutsummaryrefslogtreecommitdiff
path: root/internal/game/sys_hazard.go
diff options
context:
space:
mode:
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)