From 945914fb76ee7ee465e2ff12cacd1d7712df7321 Mon Sep 17 00:00:00 2001 From: GregHib Date: Sat, 24 Feb 2024 18:51:13 +0000 Subject: [PATCH] Fix hunt mode helpers --- .../voidps/engine/entity/character/npc/hunt/HuntNPC.kt | 2 +- .../voidps/engine/entity/character/npc/hunt/HuntPlayer.kt | 2 +- .../world/gregs/voidps/bot/skill/combat/CombatGear.kt | 1 - .../world/interact/entity/npc/combat/Aggression.kts | 8 ++++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntNPC.kt b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntNPC.kt index e3d2d3466..e664521cd 100644 --- a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntNPC.kt +++ b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntNPC.kt @@ -14,7 +14,7 @@ fun huntNPC(npc: String = "*", targetNpc: String = "*", mode: String = "*", bloc on({ wildcardEquals(npc, it.id) && wildcardEquals(targetNpc, target.id) && wildcardEquals(mode, this.mode) }, block = block) } -fun huntNPC(vararg modes: String, block: suspend HuntNPC.(npc: NPC) -> Unit) { +fun huntNPCModes(vararg modes: String, block: suspend HuntNPC.(npc: NPC) -> Unit) { for(mode in modes) { on({ wildcardEquals(mode, this.mode) }, block = block) } diff --git a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntPlayer.kt b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntPlayer.kt index 76aa7de30..afb320fe4 100644 --- a/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntPlayer.kt +++ b/engine/src/main/kotlin/world/gregs/voidps/engine/entity/character/npc/hunt/HuntPlayer.kt @@ -15,7 +15,7 @@ fun huntPlayer(npc: String = "*", mode: String = "*", block: suspend HuntPlayer. on({ wildcardEquals(npc, it.id) && wildcardEquals(mode, this.mode) }, block = block) } -fun huntPlayer(vararg modes: String, block: suspend HuntPlayer.(npc: NPC) -> Unit) { +fun huntPlayerModes(vararg modes: String, block: suspend HuntPlayer.(npc: NPC) -> Unit) { for (mode in modes) { on({ wildcardEquals(mode, this.mode) }, block = block) } diff --git a/game/src/main/kotlin/world/gregs/voidps/bot/skill/combat/CombatGear.kt b/game/src/main/kotlin/world/gregs/voidps/bot/skill/combat/CombatGear.kt index 676c9bfe4..5ccc09976 100644 --- a/game/src/main/kotlin/world/gregs/voidps/bot/skill/combat/CombatGear.kt +++ b/game/src/main/kotlin/world/gregs/voidps/bot/skill/combat/CombatGear.kt @@ -93,7 +93,6 @@ fun Bot.hasExactGear(gear: GearDefinition): Boolean { } private suspend fun Bot.setupGearAndInv(gear: GearDefinition, buy: Boolean) { - println("Setup $gear") // Pick one of each item to equip for each required slot for ((_, equipmentList) in gear.equipment) { val items = equipmentList diff --git a/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/npc/combat/Aggression.kts b/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/npc/combat/Aggression.kts index 64fecb09b..695d55109 100644 --- a/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/npc/combat/Aggression.kts +++ b/game/src/main/kotlin/world/gregs/voidps/world/interact/entity/npc/combat/Aggression.kts @@ -2,14 +2,14 @@ package world.gregs.voidps.world.interact.entity.npc.combat import world.gregs.voidps.engine.entity.character.mode.interact.Interact import world.gregs.voidps.engine.entity.character.npc.NPCOption -import world.gregs.voidps.engine.entity.character.npc.hunt.huntNPC -import world.gregs.voidps.engine.entity.character.npc.hunt.huntPlayer +import world.gregs.voidps.engine.entity.character.npc.hunt.huntNPCModes +import world.gregs.voidps.engine.entity.character.npc.hunt.huntPlayerModes import world.gregs.voidps.engine.entity.character.player.PlayerOption -huntPlayer("aggressive", "cowardly") { npc -> +huntPlayerModes("aggressive", "cowardly") { npc -> npc.mode = Interact(npc, target, PlayerOption(npc, target, "Attack")) } -huntNPC("aggressive", "cowardly") { npc -> +huntNPCModes("aggressive", "cowardly") { npc -> npc.mode = Interact(npc, target, NPCOption(npc, target, target.def, "Attack")) } \ No newline at end of file