mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-01 14:39:13 -06:00
Agility arena fixes
Fixed looping when a player attempted dart trap, spinning blades, floor spikes and pressure pads Fixed direction player faces when traversing hand holds Fixed animation for walking across planks
This commit is contained in:
parent
a643299b0c
commit
a6699243db
7 changed files with 49 additions and 5 deletions
|
|
@ -139,6 +139,13 @@ public final class AgilityHandler {
|
||||||
* @return The force movement instance, if force movement is used.
|
* @return The force movement instance, if force movement is used.
|
||||||
*/
|
*/
|
||||||
public static ForceMovement forceWalk(final Player player, final int courseIndex, Location start, Location end, Animation animation, int speed, final double experience, final String message) {
|
public static ForceMovement forceWalk(final Player player, final int courseIndex, Location start, Location end, Animation animation, int speed, final double experience, final String message) {
|
||||||
|
return forceWalk(player, courseIndex, start, end, animation, speed, experience, message, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Walks across an obstacle while using an explicit force-movement facing direction.
|
||||||
|
*/
|
||||||
|
public static ForceMovement forceWalk(final Player player, final int courseIndex, Location start, Location end, Animation animation, int speed, final double experience, final String message, Direction direction) {
|
||||||
player.logoutListeners.put("forcewalk", p -> {
|
player.logoutListeners.put("forcewalk", p -> {
|
||||||
p.setLocation(player.getLocation().transform(0,0,0));
|
p.setLocation(player.getLocation().transform(0,0,0));
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
|
|
@ -158,6 +165,9 @@ public final class AgilityHandler {
|
||||||
player.logoutListeners.remove("forcewalk");
|
player.logoutListeners.remove("forcewalk");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (direction != null) {
|
||||||
|
movement.setDirection(direction);
|
||||||
|
}
|
||||||
movement.start();
|
movement.start();
|
||||||
GameWorld.getPulser().submit(movement);
|
GameWorld.getPulser().submit(movement);
|
||||||
return movement;
|
return movement;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,10 @@ public final class BladeTrap implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
|
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,8 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
final Direction dir = direction;
|
final Direction dir = direction;
|
||||||
final Direction faceDirection = Direction.get(object.getDirection().toInteger() - 1 & 3);
|
final Direction faceDirection = Direction.get(object.getDirection().toInteger() - 1 & 3);
|
||||||
final Location start = player.getLocation();
|
final Location start = player.getLocation();
|
||||||
|
player.setDirection(faceDirection);
|
||||||
|
player.faceLocation(start.transform(faceDirection));
|
||||||
player.getAppearance().setAnimations(Animation.create(1118 + m));
|
player.getAppearance().setAnimations(Animation.create(1118 + m));
|
||||||
player.getAppearance().sync();
|
player.getAppearance().sync();
|
||||||
AgilityHandler.climb(player, -1, new Animation(1117 + m), start.transform(dir), 0.0, null);
|
AgilityHandler.climb(player, -1, new Animation(1117 + m), start.transform(dir), 0.0, null);
|
||||||
|
|
@ -143,12 +145,12 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
} else if (count == 6) {
|
} else if (count == 6) {
|
||||||
player.getAppearance().setAnimations();
|
player.getAppearance().setAnimations();
|
||||||
player.getAppearance().sync();
|
player.getAppearance().sync();
|
||||||
AgilityHandler.forceWalk(player, -1, last, last.transform(dir), Animation.create(1120 + m), 5, getExp(player, 22.0), null).setDirection(faceDirection);
|
AgilityHandler.forceWalk(player, -1, last, last.transform(dir), Animation.create(1120 + m), 5, getExp(player, 22.0), null, faceDirection);
|
||||||
player.logoutListeners.remove("brimcourse");
|
player.logoutListeners.remove("brimcourse");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
player.logoutListeners.remove("brimcourse");
|
player.logoutListeners.remove("brimcourse");
|
||||||
AgilityHandler.forceWalk(player, -1, last, last = last.transform(dir), Animation.create(1118 + m), 5, 0.0, null).setDirection(faceDirection);
|
AgilityHandler.forceWalk(player, -1, last, last = last.transform(dir), Animation.create(1118 + m), 5, 0.0, null, faceDirection);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -272,7 +274,7 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
public boolean pulse() {
|
public boolean pulse() {
|
||||||
if (!finish) {
|
if (!finish) {
|
||||||
setDelay(2);
|
setDelay(2);
|
||||||
AgilityHandler.fail(player, 1, player.getLocation().transform(0, 0, -3), Animation.create(189), getHitAmount(player), "You stepped on a broken piece of plank!");
|
AgilityHandler.fail(player, 1, player.getLocation().transform(0, 0, -3), Animation.create(768), getHitAmount(player), "You stepped on a broken piece of plank!");
|
||||||
finish = true;
|
finish = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -282,7 +284,7 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AgilityHandler.walk(player, -1, start, end, ForceMovement.WALK_ANIMATION, getExp(player, 6.0), null);
|
AgilityHandler.walk(player, -1, start, end, Animation.create(1426), getExp(player, 6.0), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -389,6 +391,7 @@ public final class BrimhavenCourse extends OptionHandler {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3551:
|
case 3551:
|
||||||
|
case 3583:
|
||||||
return n.getLocation();
|
return n.getLocation();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import core.game.node.entity.impl.Projectile;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -29,6 +31,9 @@ public final class DartTrap implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
e.lock(6);
|
e.lock(6);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,9 @@ public final class FloorSpikes implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,10 @@ public final class PressurePad implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = dest.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = dest.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
|
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.system.task.MovementHook;
|
import core.game.system.task.MovementHook;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import core.net.packet.PacketRepository;
|
||||||
|
import core.net.packet.context.PlayerContext;
|
||||||
|
import core.net.packet.out.ClearMinimapFlag;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import core.game.world.GameWorld;
|
import core.game.world.GameWorld;
|
||||||
import core.game.world.map.Direction;
|
import core.game.world.map.Direction;
|
||||||
|
|
@ -24,6 +27,9 @@ public final class SpinningBlades implements MovementHook {
|
||||||
final Direction dir = e.getDirection();
|
final Direction dir = e.getDirection();
|
||||||
final Player player = (Player) e;
|
final Player player = (Player) e;
|
||||||
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
final Location start = l.transform(-dir.getStepX(), -dir.getStepY(), 0);
|
||||||
|
player.getPulseManager().clear();
|
||||||
|
player.getWalkingQueue().reset();
|
||||||
|
PacketRepository.send(ClearMinimapFlag.class, new PlayerContext(player));
|
||||||
e.lock(5);
|
e.lock(5);
|
||||||
if(e.isPlayer())
|
if(e.isPlayer())
|
||||||
{
|
{
|
||||||
|
|
@ -70,4 +76,4 @@ public final class SpinningBlades implements MovementHook {
|
||||||
}
|
}
|
||||||
player.getPacketDispatch().sendSceneryAnimation(RegionManager.getObject(l), Animation.create(1107));
|
player.getPacketDispatch().sendSceneryAnimation(RegionManager.getObject(l), Animation.create(1107));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue