RuneHive-Game
Loading...
Searching...
No Matches
AbyssalBludgen.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.player.special.melee;
2
3import com.runehive.game.Animation;
4import com.runehive.game.Graphic;
5import com.runehive.game.UpdatePriority;
6import com.runehive.game.world.entity.combat.hit.Hit;
7import com.runehive.game.world.entity.combat.strategy.player.PlayerMeleeStrategy;
8import com.runehive.game.world.entity.mob.Mob;
9import com.runehive.game.world.entity.mob.player.Player;
10import com.runehive.game.world.entity.skill.Skill;
11
12/**
13 * Handles the staff of the dead weapon special attack.
14 *
15 * @author Daniel
16 */
17public class AbyssalBludgen extends PlayerMeleeStrategy {
18
19 private static final Animation ANIMATION = new Animation(3299, UpdatePriority.HIGH);
20 private static final Graphic GRAPHIC = new Graphic(1284, UpdatePriority.HIGH);
21
22 private static final AbyssalBludgen INSTANCE = new AbyssalBludgen();
23
24 @Override
25 public void hitsplat(Player attacker, Mob defender, Hit hit) {
26 super.hitsplat(attacker, defender, hit);
27 defender.graphic(GRAPHIC);
28 }
29
30 @Override
31 public int modifyDamage(Player attacker, Mob defender, int damage) {
32 int level = attacker.skills.getLevel(Skill.PRAYER);
33 int max = attacker.skills.getMaxLevel(Skill.PRAYER);
34 return damage + damage * (max - level) / 200;
35 }
36
37 @Override
38 public Animation getAttackAnimation(Player attacker, Mob defender) {
39 return ANIMATION;
40 }
41
42 public static AbyssalBludgen get() {
43 return INSTANCE;
44 }
45
46}
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
Optional< Graphic > graphic
Definition Mob.java:91
This class represents a character controlled by a player.
Definition Player.java:125
Represents a trainable and usable skill.
Definition Skill.java:18
static final int PRAYER
The prayer skill id.
Definition Skill.java:36
int getLevel(int id)
Gets the level of a skill.
int getMaxLevel(int id)
Gets the highest possible level of a skill.
Represents different priorities for updating.