balobby clean up

pennance runner text for escaping
This commit is contained in:
Tooze 2026-05-23 13:55:43 -04:00
parent 2263604c7b
commit 950b591ac6
2 changed files with 9 additions and 58 deletions

View file

@ -31,6 +31,7 @@ class PenanceRunnerNPC : NPCBehavior(*PENANCE_RUNNER_IDS.toIntArray()) {
val GOOD_EAT = "Chomp, chomp"
val BAD_EAT = "Blurghh"
val TRAP_HIT = "Urghhh!"
val ESCAPE = "Raaa!!"
override fun getXpMultiplier(self: NPC, attacker: Entity): Double {
return 0.0

View file

@ -138,8 +138,11 @@ class BALobby : InteractionListener, MapArea {
on(Scenery.LADDER_20193, IntType.SCENERY, "Climb-down") { player, _ ->
val session = getBASession(player)
val team = session?.team
if (session == null) { player.debug("[DEBUG] You are not in a session!"); return@on true }
if (session.team.isLeader(player)) return@on true
if (team?.isLeader(player) == false) return@on true
//todo uncomment when goes to test
//if (team?.isFull() == false) return@on true
if (session.state != BarbassaultState.PARTY_CREATION) { player.debug("[DEBUG] Your team is already starting or in the arena!"); return@on true }
closeOverlay(player) // close party
@ -180,7 +183,7 @@ class BALobby : InteractionListener, MapArea {
on(BARBDOORS, IntType.SCENERY, "Pass") { player, node ->
//todo find authentic message no capes
// if (capeCheck(player)) { sendMessage(player,"Your not allowed to wear capes."); return@on true }
if (!capeCheck(player)) { sendMessage(player,"You are not allowed to wear capes."); return@on true }
handleWaveDoor(player, node,256)
return@on true
}
@ -216,29 +219,7 @@ class BALobby : InteractionListener, MapArea {
// [3] "Healer"
// [4] "I'll be any role!"
/*private val pulse = object : Pulse(1) {
override fun pulse(): Boolean {
ticks++
//setInterfaceText(player, ticks.toString(),494,0)
// for people in party update our time to next wave start
// maybe this is not the right way to do it?
if (ticks >= 500) {
ticks = 400
}
return false
}
}
*/
fun getModelFromButton(button: Int): Int {
return when (button) {
2 -> 20561
3 -> 20566
4 -> 20563
5 -> 20569
else -> 0 // Unknown or no match
}
}
fun getRoleFromButton(button: Int): BarbRole? {
return when (button) {
2 -> BarbRole.ATTACKER
@ -249,7 +230,6 @@ class BALobby : InteractionListener, MapArea {
}
}
fun writeRole(player: Player, buttonId: Int) {
if (buttonId == 6) return
val playerRole = getRoleFromButton(buttonId) ?: return
@ -264,38 +244,10 @@ class BALobby : InteractionListener, MapArea {
}
fun handlePlayerOptionDoor(player: Player, roomRoleOptions:(BarbRole?) -> Unit){
sendDialogueOptions(
player,
"Which role would you like to perform?",
"Attacker", "Defender","Collector","Healer","I'll be any role!")
addDialogueAction(player) { _, buttonId ->
val role = when (buttonId) {
2 -> BarbRole.ATTACKER
3 -> BarbRole.DEFENDER
4 -> BarbRole.COLLECTOR
5 -> BarbRole.HEALER
6 -> null
else -> null
}
roomRoleOptions(role)
}
sendDialogueOptions(player,"Which role would you like to perform?","Attacker", "Defender","Collector","Healer","I'll be any role!")
addDialogueAction(player) { _, buttonId -> roomRoleOptions(getRoleFromButton(buttonId)) }
}
fun handleWriteRole(player: Player){
sendDialogueOptions(
player,
"Which role do you wish to be?",
"Attacker", "Defender","Collector","Healer","Cancel")
addDialogueAction(player) { _, buttonId ->
when (buttonId) {
2 -> BarbRole.ATTACKER
3 -> BarbRole.DEFENDER
4 -> BarbRole.COLLECTOR
5 -> BarbRole.HEALER
else -> {}
}
}
}
fun handleWaveDoor(player: Player, node: Node,iface: Int){
val doorLoc = node.location
val playerLoc = player.location
@ -307,14 +259,12 @@ class BALobby : InteractionListener, MapArea {
if (insideRoom) { forceMove(player, playerLoc, doorLoc, 25, 60, null, 819) }
forceMove(player, playerLoc, playerLoc.transform(0, moveY, 0), 25, 60, null, 819) {
if (insideRoom) {
//player.baSession = null
//player.baSession?.cancleStartingPhase()
abandonTeam(player)
closeOverlay(player)
if (node.id == Scenery.DOOR_20209) { BarbassQuickWaveActivity.removeQuickQue(player) } // needs to happen sooner
} else {
openOverlay(player, iface)
// player.sendMessage("you enter wave ${BARBWAVEDOOR[node.id]}")
}
}
}
@ -334,7 +284,7 @@ class BALobby : InteractionListener, MapArea {
fun waveAdvance(player: Player) {
val wave = getBAWave(player)
if (wave in 1..waveLobbies.size) {
if (wave == 10) {player.setAttribute("/save:barbass:wave", 1)}
if (wave == 10) {setBAWave(player,1)}
} else {
sendMessage(player,"Invalid wave number: $wave. PLEASE REPORT THIS!")
}