Changed the script processor code to no longer incorrectly close interfaces on SOFT queue scripts
Rewrote Jarvald
This commit is contained in:
@@ -45,28 +45,29 @@ class EctophialListener : InteractionListener {
|
||||
return@on true
|
||||
}
|
||||
delayEntity(player, 10)
|
||||
queueScript(player, 0, QueueStrength.SOFT) { stage: Int ->
|
||||
when (stage) {
|
||||
0 -> {
|
||||
sendMessage(player, "You empty the ectoplasm onto the ground around your feet...")
|
||||
playAudio(player, 4580)
|
||||
visualize(player, emptyAnimation, emptyGraphics)
|
||||
replaceSlot(player, node.asItem().slot, Item(Items.ECTOPHIAL_4252), Item(Items.ECTOPHIAL_4251))
|
||||
return@queueScript delayScript(player, emptyAnimation.duration)
|
||||
}
|
||||
1 -> {
|
||||
teleport(player, Location.create(3658, 3517, 0), TeleportType.ECTOPHIAL)
|
||||
sendMessage(player, "...and the world changes around you.")
|
||||
return@queueScript delayScript(player, 9)
|
||||
}
|
||||
2 -> {
|
||||
face(player, Location(3659, 3519, 0))
|
||||
refillEctophial(player)
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
else -> return@queueScript stopExecuting(player)
|
||||
closeAllInterfaces(player)
|
||||
queueScript(player, 0, QueueStrength.SOFT) { stage: Int ->
|
||||
when (stage) {
|
||||
0 -> {
|
||||
sendMessage(player, "You empty the ectoplasm onto the ground around your feet...")
|
||||
playAudio(player, 4580)
|
||||
visualize(player, emptyAnimation, emptyGraphics)
|
||||
replaceSlot(player, node.asItem().slot, Item(Items.ECTOPHIAL_4252), Item(Items.ECTOPHIAL_4251))
|
||||
return@queueScript delayScript(player, emptyAnimation.duration)
|
||||
}
|
||||
1 -> {
|
||||
teleport(player, Location.create(3658, 3517, 0), TeleportType.ECTOPHIAL)
|
||||
sendMessage(player, "...and the world changes around you.")
|
||||
return@queueScript delayScript(player, 9)
|
||||
}
|
||||
2 -> {
|
||||
face(player, Location(3659, 3519, 0))
|
||||
refillEctophial(player)
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
else -> return@queueScript stopExecuting(player)
|
||||
}
|
||||
}
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ class EnchantJewelleryTabListener : InteractionListener {
|
||||
|
||||
override fun defineListeners() {
|
||||
on(IntType.ITEM, "break") {player, node ->
|
||||
closeAllInterfaces(player)
|
||||
delayEntity(player, 1)
|
||||
queueScript(player, strength = QueueStrength.SOFT) {
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ class GrandSeedPodHandler : InteractionListener {
|
||||
}
|
||||
|
||||
if (opt == "squash") {
|
||||
closeAllInterfaces(player)
|
||||
visualize(player, SQUASH_ANIM_BEGIN, SQUASH_GRAPHICS_BEGIN)
|
||||
delayEntity(player, 12)
|
||||
queueScript(player, 3, QueueStrength.SOFT) {stage: Int ->
|
||||
@@ -93,4 +94,4 @@ class GrandSeedPodHandler : InteractionListener {
|
||||
return@on true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ class SteppingStoneShortcut : OptionHandler() {
|
||||
}
|
||||
val offset = getOffset(player,finalDest)
|
||||
player.debug("Offset: ${offset.first},${offset.second}")
|
||||
closeAllInterfaces(player)
|
||||
lock(player, 3)
|
||||
player.locks.lockTeleport(3)
|
||||
queueScript(player, 2, QueueStrength.SOFT) {
|
||||
@@ -87,4 +88,4 @@ class SteppingStoneShortcut : OptionHandler() {
|
||||
*/
|
||||
private val ANIMATION = Animation(741)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class StileShortcut : InteractionListener {
|
||||
val startLoc = p.location.transform(direction, 1)
|
||||
val endLoc = p.location.transform(direction, 2)
|
||||
|
||||
closeAllInterfaces(p)
|
||||
p.walkingQueue.reset()
|
||||
p.walkingQueue.addPath(startLoc.x, startLoc.y)
|
||||
forceMove(p, startLoc, endLoc, 0, animationCycles(839), direction, 839)
|
||||
@@ -75,4 +76,4 @@ class StileShortcut : InteractionListener {
|
||||
Horizontal,
|
||||
Vertical
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ abstract class AbstractGrappleShortcut : InteractionListener {
|
||||
}
|
||||
|
||||
protected fun grapple(player: Player, message: String?): Boolean {
|
||||
|
||||
closeAllInterfaces(player)
|
||||
lock(player, animationDuration)
|
||||
// TODO is this right? should we force the player to cross?
|
||||
queueScript(player, strength = QueueStrength.SOFT) { stage: Int ->
|
||||
@@ -133,4 +133,4 @@ abstract class AbstractGrappleShortcut : InteractionListener {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ class WallGrappleInterfaceImpl: WallGrappleInterface{
|
||||
|
||||
override fun jump(player: Player, destination: Location): Boolean {
|
||||
// todo this doesn't look great compared to what it used to look like
|
||||
closeAllInterfaces(player)
|
||||
forceWalk(player, destination,"smart" )
|
||||
face(player, destination)
|
||||
// We're teleporting if we are animating so make the strength SOFT
|
||||
@@ -65,4 +66,4 @@ class WallGrappleInterfaceImpl: WallGrappleInterface{
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user