RuneHive-Game
Loading...
Searching...
No Matches
AncientGodsword.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.hit.Hit;
9import com.runehive.game.world.entity.combat.strategy.player.PlayerMeleeStrategy;
10import com.runehive.game.world.entity.mob.Mob;
11import com.runehive.game.world.entity.mob.player.Player;
12
13/** @author Michael | Chex */
15
16 //AGS(normal): 7644, AGS(OR): 7645
17 private static final Animation ANIMATION = new Animation(9171, UpdatePriority.HIGH);
18 private static final Graphic GRAPHIC = new Graphic(1996);
19
20 private static final AncientGodsword INSTANCE = new AncientGodsword();
21
22 private AncientGodsword() {
23 }
24
25 @Override
26
27 public void start(Player attacker, Mob defender, Hit[] hits) {
28 super.start(attacker, defender, hits);
29 attacker.animate(ANIMATION, true);
30 attacker.graphic(GRAPHIC);
31 }
32
33 @Override
34 public void hitsplat(Player attacker, Mob defender, Hit hit) {
35 super.hitsplat(attacker, defender, hit);
36 if (defender.isPlayer() && hit.getDamage() >= 80) {
38 }
39 }
40
41 @Override
42 public void onKill(Player attacker, Mob defender, Hit hit) {
43 if (defender.isPlayer()) {
45 }
46 }
47
48 @Override
49 public Animation getAttackAnimation(Player attacker, Mob defender) {
50 return ANIMATION;
51 }
52
53 @Override
54 public int modifyAccuracy(Player attacker, Mob defender, int roll) {
55 return 2 * roll;
56 }
57
58 @Override
59 public int modifyDamage(Player attacker, Mob defender, int damage) {
60 return (int) (damage * 1.375);
61 }
62
63 public static AncientGodsword get() {
64 return INSTANCE;
65 }
66
67}
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
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.