mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-21 10:25:13 -06:00
isWaitingArea and isInHalls
This commit is contained in:
parent
67d32e43d1
commit
1266a1b459
1 changed files with 28 additions and 15 deletions
|
|
@ -18,6 +18,7 @@ import core.game.node.entity.Entity
|
|||
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.Location
|
||||
import core.game.world.map.zone.ZoneBorders
|
||||
import core.game.world.map.zone.ZoneRestriction
|
||||
import org.rs09.consts.Items
|
||||
|
|
@ -251,26 +252,38 @@ class BALobby : InteractionListener, MapArea {
|
|||
fun handleWaveDoor(player: Player, node: Node,iface: Int){
|
||||
val doorLoc = node.location
|
||||
val playerLoc = player.location
|
||||
var wave = getBAWave(player)
|
||||
if (wave == BARBWAVEDOOR[node.id]) {
|
||||
val insideRoom = playerLoc.y <= doorLoc.y
|
||||
val moveY = if (insideRoom) 1 else -1
|
||||
//ToDo fix walking trough wall when Using door from side.
|
||||
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?.cancleStartingPhase()
|
||||
abandonTeam(player)
|
||||
closeOverlay(player)
|
||||
if (node.id == Scenery.DOOR_20209) { BarbassQuickWaveActivity.removeQuickQue(player) } // needs to happen sooner
|
||||
} else {
|
||||
openOverlay(player, iface)
|
||||
}
|
||||
|
||||
if (getBAWave(player) != BARBWAVEDOOR[node.id]) return
|
||||
|
||||
val insideRoom = isWaitingArea(playerLoc)
|
||||
val moveY = if (insideRoom) 1 else -1
|
||||
//ToDo fix walking trough wall when Using door from side.
|
||||
forceMove(player, playerLoc, playerLoc.transform(0, moveY, 0), 25, 60, null, 819) {
|
||||
if (insideRoom) {
|
||||
//player.baSession?.cancleStartingPhase()
|
||||
abandonTeam(player)
|
||||
closeOverlay(player)
|
||||
if (node.id == Scenery.DOOR_20209) { BarbassQuickWaveActivity.removeQuickQue(player) } // needs to happen sooner
|
||||
} else {
|
||||
openOverlay(player, iface)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
fun isWaitingArea(location: Location): Boolean {
|
||||
return QUICK_START.insideBorder(location) || waveLobbies.any { it.insideBorder(location) && it != MAIN_LOBBY }
|
||||
}
|
||||
fun isInHalls(location: Location): Boolean {
|
||||
return getRegionBorders(10322).insideBorder(location) &&
|
||||
!QUICK_START.insideBorder(location) &&
|
||||
waveLobbies.none {
|
||||
it != MAIN_LOBBY && it.insideBorder(location)
|
||||
}
|
||||
}
|
||||
|
||||
fun TeamToLobby(team: BarbTeam, wave: Int) {
|
||||
if (wave in 0..waveLobbies.size) {
|
||||
val targetLobby = waveLobbies[wave]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue