team interface only if inside a wave lobby

This commit is contained in:
Tooze 2026-03-18 14:49:43 -04:00
parent b8a8fde2c5
commit 4e0c144bda
3 changed files with 25 additions and 17 deletions

View file

@ -9,7 +9,9 @@ import core.api.log
import core.api.sendMessage
import core.game.activity.ActivityManager
import core.game.activity.ActivityPlugin
import core.game.node.Node
import core.game.node.entity.Entity
import core.game.node.entity.combat.CombatStyle
import core.game.node.entity.impl.PulseManager
import core.game.node.entity.player.Player
import core.game.system.task.Pulse
@ -53,10 +55,13 @@ open class BarbassaultActivity : ActivityPlugin("barbassault",false, true, true,
return true
}
override fun enter(e: Entity?): Boolean {
return super.enter(e)
override fun enter(e: Entity?): Boolean { return super.enter(e) }
override fun continueAttack(e: Entity?, target: Node?, style: CombatStyle?, message: Boolean): Boolean {
//BERR must of been good, idk why I put this in here
return super.continueAttack(e, target, style, message)
}
override fun death(e: Entity?, killer: Entity?): Boolean{
override fun death(e: Entity?, killer: Entity?): Boolean {
val ename = e?.name
log(this.javaClass, Log.FINE,"$ename has died in Barbass")
if (e is Player) {
@ -67,6 +72,7 @@ open class BarbassaultActivity : ActivityPlugin("barbassault",false, true, true,
}
return false
}
override fun newInstance(p: Player?): ActivityPlugin {
ActivityManager.register(this)
return this

View file

@ -96,7 +96,7 @@ class BarbassaultGameArea : InteractionListener, MapArea {
override fun areaLeave(entity: Entity, logout: Boolean) {
val player = entity as? Player ?: return
//val player = entity as? Player ?: return
log(this::class.java, Log.FINE, "EXITED BARBASS TUT")
}
@ -160,7 +160,7 @@ class BarbassaultGameArea : InteractionListener, MapArea {
val animationDuration = animationDuration(ClimbActionHandler.CLIMB_UP)
player.lock(animationDuration)
player.animate(ClimbActionHandler.CLIMB_UP)
Pulser.submit(object : Pulse(animationDuration) { override fun pulse(): Boolean {player.baSession?.forfet(); return true }})
Pulser.submit(object : Pulse(animationDuration) { override fun pulse(): Boolean {player.baSession?.forfeit(); return true }})
}
}
return@on true

View file

@ -1,17 +1,12 @@
package content.minigame.barbassault.lobby
import content.minigame.barbassault.BarbRole
import content.minigame.barbassault.BarbassaultActivity
import content.minigame.barbassault.arena.BarbassaultSession
import content.minigame.barbassault.arena.BarbassaultState
import content.minigame.barbassault.lobby.BarbTeamManager.abandonTeam
import content.minigame.barbassault.lobby.BarbTeamManager.createTeam
import content.minigame.barbassault.lobby.BarbTeamManager.disbandTeam
import content.minigame.barbassault.lobby.BarbTeamManager.joinTeam
import content.minigame.barbassault.lobby.BarbassLobbyActivity.Companion.addToQueue
import content.minigame.duel.DuelSession
import content.minigame.barbassault.lobby.BarbassQuickWaveActivity.Companion.addToQueue
import core.api.*
import core.game.component.Component
import core.game.interaction.IntType
import core.game.interaction.InteractionListener
import core.game.node.Node
@ -20,7 +15,7 @@ import core.game.node.entity.impl.PulseManager
import core.game.node.entity.player.Player
import core.game.node.item.Item
import core.game.world.map.zone.ZoneBorders
import core.game.world.map.zone.ZoneRestriction
import org.rs09.consts.Items
import org.rs09.consts.Scenery
import org.rs09.consts.Sounds
@ -34,20 +29,25 @@ class BarbassaultLobby : InteractionListener, MapArea {
override fun defineAreaBorders(): Array<ZoneBorders> {
return areaBorders
}
override fun getRestrictions(): Array<ZoneRestriction> {
return arrayOf(ZoneRestriction.CANNON, ZoneRestriction.FIRES, ZoneRestriction.FOLLOWERS)
}
override fun areaEnter(entity: Entity) {
PulseManager.cancelDeathTask(entity)
val enteredZone = areaBorders.firstOrNull { it.insideBorder(entity.location) }
if (enteredZone == QUICK_START) { return }
if (enteredZone == REGION_10322) { return }
updatePlayerWave(entity)
openOverlay(entity as Player, 256)
PulseManager.cancelDeathTask(entity)
}
override fun areaLeave(entity: Entity, logout: Boolean) {
if (entity is Player) {
entity.interfaceManager.closeOverlay()
//this is redundant.
val barbassItems = intArrayOf(Items.POISONED_WORMS_10540)
//abandonTeam(entity) // Right here, its breaking things
entity.equipment.removeAll(barbassItems)
entity.inventory.removeAll(barbassItems)
@ -309,7 +309,7 @@ class BarbassaultLobby : InteractionListener, MapArea {
//player.baSession = null
abandonTeam(player)
closeOverlay(player)
if (node.id == 20209) { BarbassLobbyActivity.removeQuickQue(player) }
if (node.id == 20209) { BarbassQuickWaveActivity.removeQuickQue(player) }
} else {
openOverlay(player, iface)
// player.sendMessage("you enter wave ${BARBWAVEDOOR[node.id]}")
@ -356,6 +356,7 @@ class BarbassaultLobby : InteractionListener, MapArea {
val WAVE_LOBBY9: ZoneBorders = ZoneBorders(2576, 5278, 2583, 5271, 0)
val WAVE_LOBBY10: ZoneBorders = ZoneBorders(2584, 5278, 2591, 5271, 0)
private val REGION_10322 = getRegionBorders(10322)
val areaBorders = arrayOf(
QUICK_START,
@ -368,7 +369,8 @@ class BarbassaultLobby : InteractionListener, MapArea {
WAVE_LOBBY7,
WAVE_LOBBY8,
WAVE_LOBBY9,
WAVE_LOBBY10
WAVE_LOBBY10,
REGION_10322
)
val waveLobbies = listOf(
MAIN_LOBBY,WAVE_LOBBY1, WAVE_LOBBY2, WAVE_LOBBY3, WAVE_LOBBY4,