RuneHive-Game
Loading...
Searching...
No Matches
DragonScimitar.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.player.special.melee;
2
3import com.runehive.net.packet.out.SendMessage;
4import com.runehive.game.Animation;
5import com.runehive.game.Graphic;
6import com.runehive.game.UpdatePriority;
7import com.runehive.game.world.entity.combat.attack.FightType;
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;
12import com.runehive.game.world.entity.mob.prayer.Prayer;
13
14/** @author Daniel | Obey */
15public class DragonScimitar extends PlayerMeleeStrategy {
16 private static final Animation ANIMATION = new Animation(1872, UpdatePriority.HIGH);
17 private static final Graphic GRAPHIC = new Graphic(347);
18 private static final DragonScimitar INSTANCE = new DragonScimitar();
19
20 private DragonScimitar() { }
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 attack(Player attacker, Mob defender, Hit h) {
30 if (!defender.isPlayer())
31 return;
32
34 defender.getPlayer().send(new SendMessage("Your overhead prayers have been disabled!"));
35 attacker.getPlayer().send(new SendMessage("You have disabled " + defender.getName() + "'s overhead prayers!"));
36 }
37
38 @Override
39 public int getAttackDelay(Player attacker, Mob defender, FightType fightType) {
40 return 4;
41 }
42
43 @Override
44 public Animation getAttackAnimation(Player attacker, Mob defender) {
45 return ANIMATION;
46 }
47
48 public static DragonScimitar get() {
49 return INSTANCE;
50 }
51
52}
Class that models a single animation used by an entity.
Represents a single graphic that can be used by entities.
Definition Graphic.java:10
abstract String getName()
Gets the name of this entity.
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
void deactivate(Prayer... prayers)
Sends the dectivate prayer packet to the client.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Represents different priorities for updating.
The enumerated type whose elements represent the fighting types.