1package com.osroyale.game.world.entity.combat.attack.listener.npc.dragon;
3import com.osroyale.game.Animation;
4import com.osroyale.game.UpdatePriority;
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.strategy.CombatStrategy;
10import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
11import com.osroyale.game.world.entity.combat.strategy.npc.impl.DragonfireStrategy;
12import com.osroyale.game.world.entity.mob.Mob;
13import com.osroyale.game.world.entity.mob.npc.Npc;
15import static com.osroyale.game.world.entity.combat.CombatUtil.createStrategyArray;
16import static com.osroyale.game.world.entity.combat.CombatUtil.randomStrategy;
17import static com.osroyale.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
53 private static CombatStrategy<Npc>[] STRATEGIES;
58 STRATEGIES = createStrategyArray(
new Melee(), DRAGONFIRE);
59 }
catch (Exception e) {
65 public boolean canAttack(
Npc attacker,
Mob defender) {
66 if (!NpcMeleeStrategy.get().withinDistance(attacker, defender)) {
67 attacker.setStrategy(DRAGONFIRE);
69 return attacker.
getStrategy().canAttack(attacker, defender);
73 public void finishOutgoing(
Npc attacker,
Mob defender) {
74 if (!NpcMeleeStrategy.get().withinDistance(attacker, defender)) {
75 attacker.setStrategy(DRAGONFIRE);
77 attacker.setStrategy(randomStrategy(STRATEGIES));
81 private static final class Melee
extends NpcMeleeStrategy {
85 public int getAttackDistance(
Npc attacker,
FightType fightType) {
96 return new CombatHit[]{nextMeleeHit(attacker, defender)};
CombatStrategy< Npc > getStrategy()