RuneHive-Game
Loading...
Searching...
No Matches
DragonMace.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.player.special.melee;
2
3import com.runehive.content.achievement.AchievementHandler;
4import com.runehive.content.achievement.AchievementKey;
5import com.runehive.game.Animation;
6import com.runehive.game.Graphic;
7import com.runehive.game.UpdatePriority;
8import com.runehive.game.world.entity.combat.attack.FightType;
9import com.runehive.game.world.entity.combat.hit.Hit;
10import com.runehive.game.world.entity.combat.strategy.player.PlayerMeleeStrategy;
11import com.runehive.game.world.entity.mob.Mob;
12import com.runehive.game.world.entity.mob.player.Player;
13
14/** @author Daniel | Obey */
15public class DragonMace extends PlayerMeleeStrategy {
16 private static final Animation ANIMATION = new Animation(1060, UpdatePriority.HIGH);
17 private static final Graphic GRAPHIC = new Graphic(251);
18 private static final DragonMace INSTANCE = new DragonMace();
19
20 private DragonMace() { }
21
22 @Override
23 public void start(Player attacker, Mob defender, Hit[] hits) {
24 super.start(attacker, defender, hits);
25 attacker.graphic(GRAPHIC);
26 }
27
28 @Override
29 public void hitsplat(Player attacker, Mob defender, Hit hit) {
30 super.hitsplat(attacker, defender, hit);
31 if (defender.isPlayer() && hit.getDamage() >= 45) {
33 }
34 }
35
36 @Override
37 public void onKill(Player attacker, Mob defender, Hit hit) {
39 }
40
41 @Override
42 public int getAttackDelay(Player attacker, Mob defender, FightType fightType) {
43 return 3;
44 }
45
46 @Override
47 public Animation getAttackAnimation(Player attacker, Mob defender) {
48 return ANIMATION;
49 }
50
51 @Override
52 public int modifyAccuracy(Player attacker, Mob defender, int roll) {
53 return roll * 5 / 4;
54 }
55
56 @Override
57 public int modifyDamage(Player attacker, Mob defender, int damage) {
58 return 3 / 2;
59 }
60
61 public static DragonMace get() {
62 return INSTANCE;
63 }
64
65}
static void activate(Player player, AchievementKey achievement)
Activates the achievement for the individual player.
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 Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
int getAttackDelay(Player attacker, Mob defender, FightType fightType)
Handles the mob class.
Definition Mob.java:66
final boolean isPlayer()
Check if an entity is a player.
Definition Mob.java:564
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.