RuneHive-Game
Loading...
Searching...
No Matches
AbyssalWhip.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.player.special.melee;
2
3import com.runehive.game.Animation;
4import com.runehive.game.Graphic;
5import com.runehive.game.UpdatePriority;
6import com.runehive.game.world.entity.combat.hit.CombatHit;
7import com.runehive.game.world.entity.combat.hit.Hit;
8import com.runehive.game.world.entity.combat.strategy.player.PlayerMeleeStrategy;
9import com.runehive.game.world.entity.mob.Mob;
10import com.runehive.game.world.entity.mob.player.Player;
11
12/**
13 * Handles the abyssal whip weapon special attack.
14 *
15 * @author Daniel
16 */
17public class AbyssalWhip extends PlayerMeleeStrategy {
18 private static final Animation ANIMATION = new Animation(1658, UpdatePriority.HIGH);
19 private static final Graphic GRAPHIC = new Graphic(341);
20 private static final AbyssalWhip INSTANCE = new AbyssalWhip();
21
22 @Override
23 public void attack(Player attacker, Mob defender, Hit hit) {
24 super.attack(attacker, defender, hit);
25 defender.graphic(GRAPHIC);
26 }
27
28 @Override
29 public void start(Player attacker, Mob defender, Hit[] hits) {
30 super.start(attacker, defender, hits);
31 //TODO EFFECT
32 }
33
34 @Override
35 public CombatHit[] getHits(Player attacker, Mob defender) {
36 return new CombatHit[]{nextMeleeHit(attacker, defender)};
37 }
38
39 @Override
40 public Animation getAttackAnimation(Player attacker, Mob defender) {
41 return ANIMATION;
42 }
43
44 @Override
45 public int modifyAccuracy(Player attacker, Mob defender, int roll) {
46 return roll * 5 / 4;
47 }
48
49 public static AbyssalWhip get() {
50 return INSTANCE;
51 }
52
53}
Class that models a single animation used by an entity.
Represents a single graphic that can be used by entities.
Definition Graphic.java:10
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
Handles the mob class.
Definition Mob.java:66
Optional< Graphic > graphic
Definition Mob.java:91
This class represents a character controlled by a player.
Definition Player.java:125
Represents different priorities for updating.