RuneHive-Game
Loading...
Searching...
No Matches
FlightKilisa.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.strategy.npc.NpcMeleeStrategy;
7import com.runehive.game.world.entity.mob.Mob;
8import com.runehive.game.world.entity.mob.npc.Npc;
9
10public class FlightKilisa extends NpcMeleeStrategy {
11
12 @Override
13 public boolean canOtherAttack(Mob attacker, Npc defender) {
14 if (attacker.isPlayer() && attacker.getStrategy().getCombatType().equals(CombatType.MELEE)) {
15 attacker.getPlayer().message("You can't attack this npc with melee!");
16 return false;
17 }
18 return super.canOtherAttack(attacker, defender);
19 }
20
21 @Override
22 public int getAttackDelay(Npc attacker, Mob defender, FightType fightType) {
23 return attacker.definition.getAttackDelay();
24 }
25
26 @Override
27 public CombatHit[] getHits(Npc attacker, Mob defender) {
28 return new CombatHit[] { nextMeleeHit(attacker, defender, 18) };
29 }
30
31}
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
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.