RuneHive-Game
Loading...
Searching...
No Matches
DragonThrownaxe.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.player.special.range;
2
3import com.runehive.game.Animation;
4import com.runehive.game.Projectile;
5import com.runehive.game.UpdatePriority;
6import com.runehive.game.world.entity.combat.hit.CombatHit;
7import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
8import com.runehive.game.world.entity.combat.strategy.player.PlayerRangedStrategy;
9import com.runehive.game.world.entity.mob.Mob;
10import com.runehive.game.world.entity.mob.player.Player;
11
12/**
13 * Handles the magic shortbow weapon special attack.
14 *
15 * @author Daniel
16 * @author Michaael | Chex
17 */
19 private static final DragonThrownaxe INSTANCE = new DragonThrownaxe();
20 private static final Animation ANIMATION = new Animation(7521, UpdatePriority.VERY_HIGH);
21 private static Projectile PROJECTILE;
22
23 static {
24 try {
26 } catch (Exception e) {
27 e.printStackTrace();
28 }
29 }
30
31 private DragonThrownaxe() {}
32
33 @Override
34 protected void sendStuff(Player attacker, Mob defender) {
35 attacker.animate(ANIMATION, true);
36 PROJECTILE.send(attacker, defender);
37 }
38
39 @Override
40 public CombatHit[] getHits(Player attacker, Mob defender) {
41 return new CombatHit[] { nextRangedHit(attacker, defender) };
42 }
43
44 @Override
45 public int modifyAccuracy(Player attacker, Mob defender, int roll) {
46 return roll * 6 / 5;
47 }
48
50 if (!projectile.getProjectile().isPresent())
51 throw new NullPointerException("No Dragon Thrownaxe projectile found.");
52 PROJECTILE = projectile.getProjectile().get();
53 }
54
55 public static DragonThrownaxe get() {
56 return INSTANCE;
57 }
58
59}
Class that models a single animation used by an entity.
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
final CombatHit nextRangedHit(T attacker, Mob defender)
Handles the mob class.
Definition Mob.java:66
This class represents a character controlled by a player.
Definition Player.java:125
Represents different priorities for updating.