RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Spinolyp.java
1package com.osroyale.game.world.entity.combat.strategy.npc.boss.dagannoths;
2
3import com.osroyale.game.world.entity.combat.attack.FightType;
4import com.osroyale.game.world.entity.combat.hit.CombatHit;
5import com.osroyale.game.world.entity.combat.projectile.CombatProjectile;
6import com.osroyale.game.world.entity.combat.strategy.CombatStrategy;
7import com.osroyale.game.world.entity.combat.strategy.npc.MultiStrategy;
8import com.osroyale.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
9import com.osroyale.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
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
42
43public class Spinolyp extends MultiStrategy {
44 private static final Ranged RANGED = new Ranged();
45 private static final Magic MAGIC = new Magic();
46
47 private static final CombatStrategy<Npc>[] STRATEGIES = createStrategyArray(RANGED, MAGIC);
48
49 public Spinolyp() {
50 currentStrategy = randomStrategy(STRATEGIES);
51 }
52
53 @Override
54 public int getAttackDelay(Npc attacker, Mob defender, FightType fightType) {
55 return attacker.definition.getAttackDelay();
56 }
57
58 private static final class Magic extends NpcMagicStrategy {
59
60 public Magic() {
61 super(CombatProjectile.getDefinition("Water Strike"));
62 }
63
64 @Override
65 public int getAttackDistance(Npc attacker, FightType fightType) {
66 return 15;
67 }
68
69 @Override
70 public CombatHit[] getHits(Npc attacker, Mob defender) {
71 return new CombatHit[]{nextMagicHit(attacker, defender, 10)};
72 }
73 }
74
75 private static final class Ranged extends NpcRangedStrategy {
76
77 public Ranged() {
78 super(CombatProjectile.getDefinition("EMPTY"));
79 }
80
81 @Override
82 public int getAttackDistance(Npc attacker, FightType fightType) {
83 return 15;
84 }
85
86 @Override
87 public CombatHit[] getHits(Npc attacker, Mob defender) {
88 return new CombatHit[]{nextRangedHit(attacker, defender, 10)};
89 }
90 }
91
92}