Skip to content

Commit

Permalink
Fix hunt mode helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
GregHib committed Feb 24, 2024
1 parent 4cfdf44 commit 945914f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fun huntNPC(npc: String = "*", targetNpc: String = "*", mode: String = "*", bloc
on<HuntNPC>({ 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<HuntNPC>({ wildcardEquals(mode, this.mode) }, block = block)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fun huntPlayer(npc: String = "*", mode: String = "*", block: suspend HuntPlayer.
on<HuntPlayer>({ 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<HuntPlayer>({ wildcardEquals(mode, this.mode) }, block = block)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

0 comments on commit 945914f

Please sign in to comment.