RuneHive-Game
Loading...
Searching...
No Matches
Ahrim.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.attack.listener.npc;
2
3import com.runehive.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
4import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
5import com.runehive.game.world.entity.combat.hit.CombatHit;
6import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
7import com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
8import com.runehive.game.world.entity.mob.Mob;
9import com.runehive.game.world.entity.mob.npc.Npc;
10
11import static com.runehive.game.world.entity.combat.CombatUtil.createStrategyArray;
12import static com.runehive.game.world.entity.combat.CombatUtil.randomStrategy;
13import static com.runehive.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
14
15/**
16 * @author Daniel
17 */
18@NpcCombatListenerSignature(npcs = { 1672 })
19public class Ahrim extends SimplifiedListener<Npc> {
20
21 private static FireBlast FIRE_BLAST = new FireBlast();
22 private static Confuse CONFUSE = new Confuse();
23 private static Weaken WEAKEN = new Weaken();
24 private static Curse CURSE = new Curse();
25 private static final CombatStrategy<Npc>[] STRATEGIES = createStrategyArray(
27 );
28
29 @Override
30 public void finishOutgoing(Npc attacker, Mob defender) {
31 attacker.setStrategy(randomStrategy(STRATEGIES));
32 }
33
34 private static class FireBlast extends NpcMagicStrategy {
35 private FireBlast() {
36 super(getDefinition("Fire Blast"));
37 }
38
39 @Override
40 public CombatHit[] getHits(Npc attacker, Mob defender) {
41 CombatHit hit = nextMagicHit(attacker, defender, 25);
42 hit.setAccurate(true);
43 return new CombatHit[] { hit };
44 }
45 }
46
47 private static class Confuse extends NpcMagicStrategy {
48 private Confuse() {
49 super(getDefinition("Confuse"));
50 }
51 }
52
53 private static class Weaken extends NpcMagicStrategy {
54 private Weaken() {
55 super(getDefinition("Weaken"));
56 }
57 }
58
59 private static class Curse extends NpcMagicStrategy {
60 private Curse() {
61 super(getDefinition("Curse"));
62 }
63 }
64}
static final CombatStrategy< Npc >[] STRATEGIES
Definition Ahrim.java:25
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
final CombatHit nextMagicHit(T attacker, Mob defender)
Handles the mob class.
Definition Mob.java:66
Represents a non-player character in the in-game world.
Definition Npc.java:29
void setStrategy(CombatStrategy< Npc > strategy)
Definition Npc.java:212