RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
DragonThrownaxe.java
1package com.osroyale.game.world.entity.combat.strategy.player.special.range;
2
3import com.osroyale.game.Animation;
4import com.osroyale.game.Projectile;
5import com.osroyale.game.UpdatePriority;
6import com.osroyale.game.world.entity.combat.hit.CombatHit;
7import com.osroyale.game.world.entity.combat.projectile.CombatProjectile;
8import com.osroyale.game.world.entity.combat.strategy.player.PlayerRangedStrategy;
9import com.osroyale.game.world.entity.mob.Mob;
10import com.osroyale.game.world.entity.mob.player.Player;
11
45
46public class DragonThrownaxe extends PlayerRangedStrategy {
47 private static final DragonThrownaxe INSTANCE = new DragonThrownaxe();
48 private static final Animation ANIMATION = new Animation(7521, UpdatePriority.VERY_HIGH);
49 private static Projectile PROJECTILE;
50
51 static {
52 try {
53 setProjectiles(CombatProjectile.getDefinition("Dragon thrownaxe"));
54 } catch (Exception e) {
55 e.printStackTrace();
56 }
57 }
58
59 private DragonThrownaxe() {}
60
61 @Override
62 protected void sendStuff(Player attacker, Mob defender) {
63 attacker.animate(ANIMATION, true);
64 PROJECTILE.send(attacker, defender);
65 }
66
67 @Override
68 public CombatHit[] getHits(Player attacker, Mob defender) {
69 return new CombatHit[] { nextRangedHit(attacker, defender) };
70 }
71
72 @Override
73 public int modifyAccuracy(Player attacker, Mob defender, int roll) {
74 return roll * 6 / 5;
75 }
76
77 private static void setProjectiles(CombatProjectile projectile) {
78 if (!projectile.getProjectile().isPresent())
79 throw new NullPointerException("No Dragon Thrownaxe projectile found.");
80 PROJECTILE = projectile.getProjectile().get();
81 }
82
83 public static DragonThrownaxe get() {
84 return INSTANCE;
85 }
86
87}