RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
DagannothRex.java
1package com.osroyale.game.world.entity.combat.strategy.npc.boss.dagannoths;
2
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.hit.CombatHit;
7import com.osroyale.game.world.entity.combat.strategy.CombatStrategy;
8import com.osroyale.game.world.entity.combat.strategy.npc.MultiStrategy;
9import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
10import com.osroyale.game.world.entity.mob.Mob;
11import com.osroyale.game.world.entity.mob.npc.Npc;
12
13import static com.osroyale.game.world.entity.combat.CombatUtil.createStrategyArray;
14import static com.osroyale.game.world.entity.combat.CombatUtil.randomStrategy;
15
46
47public class DagannothRex extends MultiStrategy {
48 private static final CrushMelee CRUSH = new CrushMelee();
49 private static final SlashMelee SLASH = new SlashMelee();
50
51 private static final CombatStrategy<Npc>[] STRATEGIES = createStrategyArray(CRUSH, SLASH);
52
53 public DagannothRex() {
54 currentStrategy = randomStrategy(STRATEGIES);
55 }
56
57 @Override
58 public int getAttackDelay(Npc attacker, Mob defender, FightType fightType) {
59 return attacker.definition.getAttackDelay();
60 }
61
62 private static final class CrushMelee extends NpcMeleeStrategy {
63 private static final Animation ANIMATION = new Animation(2853, UpdatePriority.HIGH);
64
65 @Override
66 public void finishOutgoing(Npc attacker, Mob defender) {
67 attacker.getCombat().setFightType(FightType.SCYTHE_JAB);
68 }
69
70 @Override
71 public int getAttackDistance(Npc attacker, FightType fightType) {
72 return 1;
73 }
74
75 @Override
76 public Animation getAttackAnimation(Npc attacker, Mob defender) {
77 return ANIMATION;
78 }
79
80 @Override
81 public CombatHit[] getHits(Npc attacker, Mob defender) {
82 return new CombatHit[]{nextMeleeHit(attacker, defender)};
83 }
84 }
85
86 private static final class SlashMelee extends NpcMeleeStrategy {
87 private static final Animation ANIMATION = new Animation(2851, UpdatePriority.HIGH);
88
89 @Override
90 public void finishOutgoing(Npc attacker, Mob defender) {
91 attacker.getCombat().setFightType(FightType.SCYTHE_REAP);
92 }
93
94 @Override
95 public int getAttackDistance(Npc attacker, FightType fightType) {
96 return 1;
97 }
98
99 @Override
100 public Animation getAttackAnimation(Npc attacker, Mob defender) {
101 return ANIMATION;
102 }
103
104 @Override
105 public CombatHit[] getHits(Npc attacker, Mob defender) {
106 return new CombatHit[]{nextMeleeHit(attacker, defender)};
107 }
108 }
109
110}