RuneHive-Game
Loading...
Searching...
No Matches
WingmanSkree.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.npc.boss.armadyl;
2
3import com.runehive.game.world.entity.combat.CombatType;
4import com.runehive.game.world.entity.combat.attack.FightType;
5import com.runehive.game.world.entity.combat.hit.CombatHit;
6import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
7import com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
8import com.runehive.game.world.entity.mob.Mob;
9import com.runehive.game.world.entity.mob.npc.Npc;
10
11public class WingmanSkree extends NpcMagicStrategy {
12
13 public WingmanSkree() {
14 super(CombatProjectile.getDefinition("Wingman Skree"));
15 }
16
17 @Override
18 public boolean canOtherAttack(Mob attacker, Npc defender) {
19 if (attacker.isPlayer() && attacker.getStrategy().getCombatType().equals(CombatType.MELEE)) {
20 attacker.getPlayer().message("You can't attack this npc with melee!");
21 return false;
22 }
23 return super.canOtherAttack(attacker, defender);
24 }
25
26 @Override
27 public int getAttackDelay(Npc attacker, Mob defender, FightType fightType) {
28 return attacker.definition.getAttackDelay();
29 }
30
31
32 @Override
33 public CombatHit[] getHits(Npc attacker, Mob defender) {
34 return new CombatHit[] { nextMagicHit(attacker, defender, 16) };
35 }
36
37}
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
final CombatHit nextMagicHit(T attacker, Mob defender)
int getAttackDelay(Npc attacker, Mob defender, FightType fightType)
Handles the mob class.
Definition Mob.java:66
abstract< T extends Mob > CombatStrategy<? super T > getStrategy()
The combat strategy of the mob.
final boolean isPlayer()
Check if an entity is a player.
Definition Mob.java:564
Represents a non-player character in the in-game world.
Definition Npc.java:29
The enumerated type whose elements represent the fighting types.