mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
POH telescope now estimates the shooting star time based on its tier
This commit is contained in:
parent
ed41f3a228
commit
98c99e7550
1 changed files with 18 additions and 12 deletions
|
|
@ -26,18 +26,24 @@ class TelescopePlugin : OptionHandler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
override fun handle(player: Player?, node: Node?, option: String?): Boolean {
|
||||||
|
val obj = node?.asScenery() as Scenery
|
||||||
val star = ShootingStarPlugin.getStar()
|
val star = ShootingStarPlugin.getStar()
|
||||||
val delay: Int = 25000 + (25000 / 3)
|
val delay: Int = 25000 + (25000 / 3)
|
||||||
val timeLeft = delay - star.ticks
|
val timeLeft = delay - star.ticks
|
||||||
val fakeTimeLeftBecauseFuckPlayers = TimeUnit.MILLISECONDS.toMinutes(timeLeft * 600L) + if(RandomFunction.random(0,100) % 2 == 0) 2 else -2
|
val window = when (obj.id) {
|
||||||
val obj = node?.asScenery() as Scenery
|
13657 -> 9
|
||||||
|
13658 -> 2
|
||||||
|
else -> 24
|
||||||
|
}
|
||||||
|
val fakeTimeLeft = RandomFunction.random(-window, window+1) + TimeUnit.MILLISECONDS.toMinutes(timeLeft * 600L)
|
||||||
player?.lock()
|
player?.lock()
|
||||||
player?.animate(ANIMATION)
|
player?.animate(ANIMATION)
|
||||||
player?.interfaceManager?.open(Component(782)).also { player?.unlock()
|
player?.interfaceManager?.open(Component(782)).also {
|
||||||
|
player?.unlock()
|
||||||
Pulser.submit(object : Pulse(2, player) {
|
Pulser.submit(object : Pulse(2, player) {
|
||||||
override fun pulse(): Boolean {
|
override fun pulse(): Boolean {
|
||||||
if (obj.isActive) {
|
if (obj.isActive) {
|
||||||
player?.dialogueInterpreter?.sendDialogue("You see a shooting star! The star looks like it will land","in about $fakeTimeLeftBecauseFuckPlayers minutes!")
|
player?.dialogueInterpreter?.sendDialogue("You see a shooting star! The star looks like it will land","in about $fakeTimeLeft minutes!")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue