1package com.osroyale.game.world.entity.combat.attack.listener.npc.dragon;
3import com.osroyale.game.world.entity.combat.CombatType;
4import com.osroyale.game.world.entity.combat.CombatUtil;
5import com.osroyale.game.world.entity.combat.attack.FightType;
6import com.osroyale.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
7import com.osroyale.game.world.entity.combat.attack.listener.SimplifiedListener;
8import com.osroyale.game.world.entity.combat.hit.CombatHit;
9import com.osroyale.game.world.entity.combat.hit.Hit;
10import com.osroyale.game.world.entity.combat.strategy.CombatStrategy;
11import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
12import com.osroyale.game.world.entity.combat.strategy.npc.impl.DragonfireStrategy;
13import com.osroyale.game.world.entity.mob.Mob;
14import com.osroyale.game.world.entity.mob.npc.Npc;
16import static com.osroyale.game.world.entity.combat.CombatUtil.createStrategyArray;
17import static com.osroyale.game.world.entity.combat.CombatUtil.getHitDelay;
18import static com.osroyale.game.world.entity.combat.CombatUtil.randomStrategy;
19import static com.osroyale.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
61 private static Dragonfire DRAGONFIRE;
62 private static CombatStrategy<Npc>[] STRATEGIES;
66 DRAGONFIRE =
new Dragonfire();
67 STRATEGIES = createStrategyArray(NpcMeleeStrategy.get(), DRAGONFIRE);
68 }
catch(Exception e) {
74 public boolean canAttack(
Npc attacker,
Mob defender) {
75 if(!NpcMeleeStrategy.get().withinDistance(attacker, defender)) {
76 attacker.setStrategy(DRAGONFIRE);
78 return attacker.
getStrategy().canAttack(attacker, defender);
82 public void start(
Npc attacker,
Mob defender,
Hit[] hits) {
83 if(!NpcMeleeStrategy.get().withinDistance(attacker, defender)) {
84 attacker.setStrategy(DRAGONFIRE);
86 attacker.setStrategy(randomStrategy(STRATEGIES));
91 private Dragonfire() {
92 super(getDefinition(
"Metalic dragonfire"));
96 public int getAttackDistance(
Npc attacker,
FightType fightType) {
CombatStrategy< Npc > getStrategy()