RuneHive-Game
Loading...
Searching...
No Matches
ClimbOverInteraction.java
Go to the documentation of this file.
1package com.runehive.content.skill.impl.agility.obstacle.impl;
2
3import com.runehive.content.skill.impl.agility.obstacle.ObstacleInteraction;
4import com.runehive.game.world.entity.mob.Direction;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.game.world.position.Position;
7
8public interface ClimbOverInteraction extends ObstacleInteraction {
9 @Override
10 default void start(Player player) { }
11
12 @Override
13 default void onExecution(Player player, Position start, Position end) {
14 int modX = end.getX() - player.getPosition().getX();
15 int modY = end.getY() - player.getPosition().getY();
16 Position destination = Position.create(modX, modY);
17 Direction direction = Direction.getFollowDirection(player.getPosition(), end);
18 player.forceMove(2, getAnimation(), 23, 60, destination, direction);
19 }
20
21 @Override
22 default void onCancellation(Player player) { }
23}
void forceMove(int animation, int x, int y)
Definition Mob.java:255
This class represents a character controlled by a player.
Definition Player.java:125
Represents a single tile on the game world.
Definition Position.java:14
int getY()
Gets the absolute y coordinate.
Definition Position.java:46
int getX()
Gets the absolute x coordinate.
Definition Position.java:41
static Position create(int x, int y, int z)
Creates a location.
Represents the enumerated directions an entity can walk or face.
static Direction getFollowDirection(Position source, Position target)
default void onExecution(Player player, Position start, Position end)