simplified ring of the star sprite teleport dialogue, now tells you if star has been mined

This commit is contained in:
Ryan
2022-05-19 23:11:47 +00:00
parent 907838bb5f
commit 01a4292123
@@ -113,24 +113,15 @@ class ShootingStarPlugin : LoginListener, InteractionListener, TickListener, Com
private class RingDialogue(val shouldWarn: Boolean, val star: ShootingStar) : DialogueFile(){ private class RingDialogue(val shouldWarn: Boolean, val star: ShootingStar) : DialogueFile(){
override fun handle(componentID: Int, buttonID: Int) { override fun handle(componentID: Int, buttonID: Int) {
if(shouldWarn){ when (stage) {
when(stage) { 0 -> dialogue(if (star.spriteSpawned) "The star sprite has already been freed." else "The star sprite is still trapped.").also { if (shouldWarn) stage++ else stage += 2 }
0 -> dialogue("WARNING: That mining site is located in the wilderness.").also { stage++ } 1 -> dialogue("WARNING: The star is located in the wilderness.").also { stage++ }
1 -> player!!.dialogueInterpreter.sendOptions("Continue?","Yes","No").also { stage++ } 2 -> player!!.dialogueInterpreter.sendOptions("Teleport to the star?", "Yes", "No").also { stage++ }
2 -> when(buttonID){ 3 -> when (buttonID) {
1 -> teleport(player!!, star).also { end() } 1 -> teleport(player!!, star).also { end() }
2 -> end() 2 -> end()
} }
} }
} else {
when(stage){
0 -> player!!.dialogueInterpreter.sendOptions("Teleport to the Star?", "Yes", "No").also { stage++ }
1 -> when(buttonID){
1 -> teleport(player!!, star).also { end() }
2 -> end()
}
}
}
} }
fun teleport(player: Player, star: ShootingStar){ fun teleport(player: Player, star: ShootingStar){