From 175e141970a4984bb790706bc9fbfb4526f7a378 Mon Sep 17 00:00:00 2001 From: Tooze Date: Fri, 29 May 2026 19:06:20 -0400 Subject: [PATCH] Readable attacker style checker --- .../barbassault/arena/BAArenaListener.kt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Server/src/main/content/minigame/barbassault/arena/BAArenaListener.kt b/Server/src/main/content/minigame/barbassault/arena/BAArenaListener.kt index c1ec5c5da..c979dfc6d 100644 --- a/Server/src/main/content/minigame/barbassault/arena/BAArenaListener.kt +++ b/Server/src/main/content/minigame/barbassault/arena/BAArenaListener.kt @@ -23,6 +23,10 @@ import core.game.node.entity.Entity import core.game.node.entity.combat.BattleState import core.game.node.entity.combat.CombatStyle import core.game.node.entity.combat.ImpactHandler +import core.game.node.entity.combat.equipment.WeaponInterface.STYLE_ACCURATE +import core.game.node.entity.combat.equipment.WeaponInterface.STYLE_AGGRESSIVE +import core.game.node.entity.combat.equipment.WeaponInterface.STYLE_CONTROLLED +import core.game.node.entity.combat.equipment.WeaponInterface.STYLE_DEFENSIVE import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.game.node.entity.player.info.LogType @@ -361,17 +365,17 @@ object BACombatValidation { fun resolveAttackerStyle( attacker: Player, state: BattleState ): AttackerStyle? { return when (state.style) { CombatStyle.MELEE -> when (attacker.properties.attackStyle.style) { - 2 -> AttackerStyle.STYLE_1 // Controlled - 0 -> AttackerStyle.STYLE_2 // Accurate - 1 -> AttackerStyle.STYLE_3 // Aggressive - 3 -> AttackerStyle.STYLE_4 // Defensive + STYLE_CONTROLLED -> AttackerStyle.STYLE_1 + STYLE_ACCURATE -> AttackerStyle.STYLE_2 + STYLE_AGGRESSIVE -> AttackerStyle.STYLE_3 + STYLE_DEFENSIVE -> AttackerStyle.STYLE_4 else -> null } CombatStyle.RANGE -> when (state.ammunition.itemId) { - 882 -> AttackerStyle.STYLE_1 // bronze - 884 -> AttackerStyle.STYLE_2 // iron - 886 -> AttackerStyle.STYLE_3 // steel - 888 -> AttackerStyle.STYLE_4 // mithril + Items.BRONZE_ARROW_882 -> AttackerStyle.STYLE_1 + Items.IRON_ARROW_884 -> AttackerStyle.STYLE_2 + Items.STEEL_ARROW_886 -> AttackerStyle.STYLE_3 + Items.MITHRIL_ARROW_888 -> AttackerStyle.STYLE_4 else -> null } CombatStyle.MAGIC -> when (state.spell.spellId) {