69public class Skotizo extends MultiStrategy {
70 private static Magic MAGIC =
new Magic();
71 private static LightingRain LIGHTNING_RAIN =
new LightingRain();
72 private static TeleGrab TELE_GRAB =
new TeleGrab();
74 private static final CombatStrategy<Npc>[] FULL_STRATEGIES = createStrategyArray(NpcMeleeStrategy.get(), MAGIC, TELE_GRAB, LIGHTNING_RAIN);
75 private static final CombatStrategy<Npc>[] MAGIC_STRATEGIES = createStrategyArray(MAGIC, MAGIC, MAGIC,TELE_GRAB, LIGHTNING_RAIN);
77 private static final String[] SHOUTS = {
78 "Feel the wrath of Skotizo!",
79 "The dark times have come for you all!"
84 currentStrategy = MAGIC;
88 public boolean canAttack(
Npc attacker,
Mob defender) {
89 if (!currentStrategy.withinDistance(attacker, defender)) {
90 currentStrategy = randomStrategy(MAGIC_STRATEGIES);
92 return currentStrategy.canAttack(attacker, defender);
97 currentStrategy.block(attacker, defender, hit, combatType);
100 if (!defender.
getCombat().isAttacking()) {
102 defender.graphic(481);
103 defender.
speak(
"ARHHHH! TIME TO SWITCH IT UP!!");
108 public void finishOutgoing(
Npc attacker,
Mob defender) {
109 currentStrategy.finishOutgoing(attacker, defender);
110 if (NpcMeleeStrategy.get().withinDistance(attacker, defender)) {
111 currentStrategy = randomStrategy(FULL_STRATEGIES);
113 currentStrategy = randomStrategy(MAGIC_STRATEGIES);
118 public int getAttackDelay(Npc attacker,
Mob defender, FightType fightType) {
119 return attacker.definition.getAttackDelay();
123 private static class Magic
extends NpcMagicStrategy {
125 super(CombatProjectile.getDefinition(
"EMPTY"));
129 public void hit(Npc attacker, Mob defender, Hit hit) {
133 public void attack(Npc attacker, Mob defender, Hit hit) {
137 public void start(Npc attacker, Mob defender, Hit[] hits) {
138 Projectile projectile =
new Projectile(1242, 50, 80, 85, 25);
139 attacker.animate(
new Animation(69, UpdatePriority.VERY_HIGH));
140 RegionManager.forNearbyPlayer(attacker, 16, other -> {
141 projectile.send(attacker, other);
142 World.schedule(2, () -> other.damage(nextMagicHit(attacker, other, 38)));
145 if (Utility.random(0, 2) == 1)
146 attacker.speak(Utility.randomElement(SHOUTS));
150 public CombatHit[] getHits(Npc attacker, Mob defender) {
151 CombatHit hit = nextMagicHit(attacker, defender, 38);
152 hit.setAccurate(
false);
153 return new CombatHit[]{hit};
157 public int modifyAccuracy(Npc attacker, Mob defender,
int roll) {
158 return roll + 50_000;
162 private static class TeleGrab
extends NpcMagicStrategy {
164 super(CombatProjectile.getDefinition(
"EMPTY"));
168 public void hit(Npc attacker, Mob defender, Hit hit) {
172 public void attack(Npc attacker, Mob defender, Hit hit) {
176 public void start(Npc attacker, Mob defender, Hit[] hits) {
177 attacker.animate(
new Animation(69, UpdatePriority.VERY_HIGH));
178 attacker.graphic(481);
179 attacker.speak(
"ARHHHH! TIME TO SWITCH IT UP!!");
183 public CombatHit[] getHits(Npc attacker, Mob defender) {
184 CombatHit hit = nextMagicHit(attacker, defender, 38);
185 hit.setAccurate(
false);
186 return new CombatHit[]{hit};
190 private static class LightingRain
extends NpcMagicStrategy {
192 super(CombatProjectile.getDefinition(
"Vet'ion"));
196 public void hit(Npc attacker, Mob defender, Hit hit) {
200 public void attack(Npc attacker, Mob defender, Hit hit) {
204 public void start(Npc attacker, Mob defender, Hit[] hits) {
205 attacker.animate(
new Animation(69, UpdatePriority.VERY_HIGH));
206 attacker.speak(
"YOU WILL NOW FEEL THE TRUE WRATH OF SKOTIZO!");
208 RegionManager.forNearbyPlayer(attacker, 16, other -> {
209 Position position = other.getPosition();
210 combatProjectile.getProjectile().ifPresent(projectile -> World.sendProjectile(attacker, position, projectile));
212 World.schedule(2, () -> {
213 World.sendGraphic(
new Graphic(775), position, attacker.instance);
214 if (other.getPosition().equals(position)) {
215 other.damage(
new Hit(Utility.random(20, 50)));
216 other.speak(
"OUCH!");
217 other.message(
"Skotizo has just electrocuted your entire body! Don't stay in one spot!");
224 public CombatHit[] getHits(Npc attacker, Mob defender) {
225 CombatHit hit = nextMagicHit(attacker, defender, 38);
226 hit.setAccurate(
false);
227 return new CombatHit[]{hit};