mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-24 20:05:13 -06:00
Deterministic trapdoor destination
This commit is contained in:
parent
eca0f81a1c
commit
029870a1bd
2 changed files with 35 additions and 4 deletions
|
|
@ -81,6 +81,9 @@ private val castleWarsStairDestinationOverrides: Map<Location, Location> = mapOf
|
|||
Location.create(2374, 3131, 2) to Location.create(2373, 3133, 3)
|
||||
)
|
||||
|
||||
private val saradominTrapdoorDestination: Location = Location.create(2429, 3075, 1)
|
||||
private val zamorakTrapdoorDestination: Location = Location.create(2370, 3132, 1)
|
||||
|
||||
internal fun getCastleWarsStairDestination(start: Location): Location? {
|
||||
return SpecialLadders.getDestination(start) ?: castleWarsStairDestinationOverrides[start]
|
||||
}
|
||||
|
|
@ -814,8 +817,7 @@ class CastleWarsListeners : InteractionListener {
|
|||
sendMessage(player, "You cannot take the flag into your respawn room!")
|
||||
return@on true
|
||||
}
|
||||
val destination = CastleWarsRespawnArea.saradominRespawnRoom.randomWalkableLoc
|
||||
teleport(player, destination, TeleportManager.TeleportType.INSTANT)
|
||||
teleport(player, saradominTrapdoorDestination, TeleportManager.TeleportType.INSTANT)
|
||||
return@on true
|
||||
}
|
||||
on(CastleWars.zamorakTrapdoor, IntType.SCENERY, "Go-down") { player, node ->
|
||||
|
|
@ -828,8 +830,7 @@ class CastleWarsListeners : InteractionListener {
|
|||
sendMessage(player, "You cannot take the flag into your respawn room!")
|
||||
return@on true
|
||||
}
|
||||
val destination = CastleWarsRespawnArea.zamorakRespawnRoom.randomWalkableLoc
|
||||
teleport(player, destination, TeleportManager.TeleportType.INSTANT)
|
||||
teleport(player, zamorakTrapdoorDestination, TeleportManager.TeleportType.INSTANT)
|
||||
return@on true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,6 +359,36 @@ class CastleWarsTests {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun trapdoorsTeleportPlayersToSpecificTilesInsideRespawnRooms() {
|
||||
TestUtils.getMockPlayer("cwtrapdoorsara").use { saradominPlayer ->
|
||||
TestUtils.getMockPlayer("cwtrapdoorzam").use { zamorakPlayer ->
|
||||
CastleWarsGameArea.saradominPlayers.add(saradominPlayer)
|
||||
CastleWarsGameArea.zamorakPlayers.add(zamorakPlayer)
|
||||
|
||||
assertTrue(
|
||||
runSceneryInteraction(
|
||||
CastleWars.saradominTrapdoor,
|
||||
"Go-down",
|
||||
saradominPlayer,
|
||||
Scenery(CastleWars.saradominTrapdoor, Location.create(2429, 3075, 2), 10, 0)
|
||||
)
|
||||
)
|
||||
assertTrue(
|
||||
runSceneryInteraction(
|
||||
CastleWars.zamorakTrapdoor,
|
||||
"Go-down",
|
||||
zamorakPlayer,
|
||||
Scenery(CastleWars.zamorakTrapdoor, Location.create(2370, 3132, 2), 10, 0)
|
||||
)
|
||||
)
|
||||
|
||||
assertEquals(Location.create(2429, 3075, 1), saradominPlayer.properties.teleportLocation)
|
||||
assertEquals(Location.create(2370, 3132, 1), zamorakPlayer.properties.teleportLocation)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun gameEndAwardsDrawTicketWithoutFivePerTeamOrTenMinuteGate() {
|
||||
TestUtils.getMockPlayer("cwticket1").use { sara1 ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue