RuneHive-Game
Loading...
Searching...
No Matches
Ballista.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.Graphic;
5import com.runehive.game.UpdatePriority;
6import com.runehive.game.world.entity.combat.attack.FightType;
7import com.runehive.game.world.entity.combat.hit.CombatHit;
8import com.runehive.game.world.entity.combat.hit.Hit;
9import com.runehive.game.world.entity.combat.strategy.player.PlayerRangedStrategy;
10import com.runehive.game.world.entity.mob.Mob;
11import com.runehive.game.world.entity.mob.player.Player;
12
13/** @author Michael | Chex */
14public class Ballista extends PlayerRangedStrategy {
15 private static final Animation ANIMATION = new Animation(7222, UpdatePriority.HIGH);
16 private static final Graphic GRAPHIC = new Graphic(344, 50, UpdatePriority.HIGH);
17 private static final Ballista INSTANCE = new Ballista();
18
19 private Ballista() {
20 }
21
22 @Override
23 public void hitsplat(Player attacker, Mob defender, Hit hit) {
24 super.hitsplat(attacker, defender, hit);
25 defender.graphic(GRAPHIC);
26 }
27
28 @Override
29 public CombatHit[] getHits(Player attacker, Mob defender) {
30 return new CombatHit[]{nextRangedHit(attacker, defender)};
31 }
32
33 @Override
34 public int getAttackDelay(Player attacker, Mob defender, FightType fightType) {
35 return 10;
36 }
37
38 @Override
39 public Animation getAttackAnimation(Player attacker, Mob defender) {
40 return ANIMATION;
41 }
42
43 @Override
44 public int modifyAccuracy(Player attacker, Mob defender, int roll) {
45 return roll * 5 / 4;
46 }
47
48 @Override
49 public int modifyDamage(Player attacker, Mob defender, int roll) {
50 return roll * 5 / 4;
51 }
52
53 public static Ballista get() {
54 return INSTANCE;
55 }
56
57}
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
final CombatHit nextRangedHit(T attacker, Mob defender)
int getAttackDelay(Player attacker, Mob defender, FightType fightType)
Definition Ballista.java:34
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.
The enumerated type whose elements represent the fighting types.