1package com.runehive.game.world.entity.combat.attack.listener.npc;
3import com.runehive.game.Animation;
4import com.runehive.game.UpdatePriority;
5import com.runehive.game.world.entity.combat.CombatType;
6import com.runehive.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
7import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
8import com.runehive.game.world.entity.combat.hit.CombatHit;
9import com.runehive.game.world.entity.combat.hit.Hit;
10import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
11import com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
12import com.runehive.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
13import com.runehive.game.world.entity.mob.Mob;
14import com.runehive.game.world.entity.mob.npc.Npc;
15import com.runehive.util.Utility;
17import static com.runehive.game.world.entity.combat.CombatUtil.createStrategyArray;
18import static com.runehive.game.world.entity.combat.CombatUtil.randomStrategy;
19import static com.runehive.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
30 private static final String[]
SHOUTS = {
31 "Death to the enemies of the light!",
32 "Slay the evil ones!",
33 "Saradomin lend me strength!",
34 "By the power of Saradomin!",
35 "May Saradomin be my sword!",
36 "Good will always triumph!",
37 "Forward! Our allies are with us!",
38 "Saradomin is with us!",
39 "In the name of Saradomin!",
40 "All praise Saradomin!",
41 "Attack! Find the Godsword!"
46 MAGIC =
new MagicAttack();
48 }
catch (Exception e) {
58 return attacker.
getStrategy().canAttack(attacker, defender);
80 super(getDefinition(
"EMPTY"));
95 hit.setAccurate(
true);
Class that models a single animation used by an entity.
void hit(T attacker, Mob defender, Hit hit)
void start(Npc attacker, Mob defender, Hit[] hits)
CombatHit[] getHits(Npc attacker, Mob defender)
void hit(Npc attacker, Mob defender, Hit hit)
static CombatStrategy< Npc >[] STRATEGIES
boolean canAttack(Npc attacker, Mob defender)
void block(Mob attacker, Npc defender, Hit hit, CombatType combatType)
static final String[] SHOUTS
void start(Npc attacker, Mob defender, Hit[] hits)
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
A Hit object holds the damage amount and hitsplat data.
final CombatHit nextMagicHit(T attacker, Mob defender)
boolean withinDistance(T attacker, Mob defender)
NpcMagicStrategy(CombatProjectile combatProjectile)
static NpcMeleeStrategy get()
abstract< T extends Mob > CombatStrategy<? super T > getStrategy()
The combat strategy of the mob.
void speak(String forceChat)
Sets the mob's forced chat.
void animate(int animation)
Represents a non-player character in the in-game world.
void setStrategy(CombatStrategy< Npc > strategy)
CombatStrategy< Npc > getStrategy()
The combat strategy of the mob.
Combat< Npc > getCombat()
The combat of the mob.
Handles miscellaneous methods.
static int random(int bound)
static< T > T randomElement(Collection< T > collection)
Picks a random element out of any array type.
Represents different priorities for updating.
VERY_HIGH
A very high priority.