RuneHive-Game
Loading...
Searching...
No Matches
SpritualMage.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.attack.listener.npc.godwar;
2
3import com.runehive.game.Animation;
4import com.runehive.game.UpdatePriority;
5import com.runehive.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
6import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
7import com.runehive.game.world.entity.combat.hit.CombatHit;
8import com.runehive.game.world.entity.combat.hit.Hit;
9import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
10import com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
11import com.runehive.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
12import com.runehive.game.world.entity.mob.Mob;
13import com.runehive.game.world.entity.mob.npc.Npc;
14
15import static com.runehive.game.world.entity.combat.CombatUtil.createStrategyArray;
16import static com.runehive.game.world.entity.combat.CombatUtil.randomStrategy;
17import static com.runehive.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
18
19/**
20 * @author Daniel
21 */
22@NpcCombatListenerSignature(npcs = { 3161, 2212 })
24
25 private static MagicAttack MAGIC = new MagicAttack();
26
27 @Override
28 public void start(Npc attacker, Mob defender, Hit[] hits) {
29 attacker.setStrategy(MAGIC);
30 }
31
32 private static class MagicAttack extends NpcMagicStrategy {
33 private MagicAttack() {
34 super(getDefinition("Spirtual Mage"));
35 }
36
37 @Override
38 public Animation getAttackAnimation(Npc attacker, Mob defender) {
39 return new Animation(1167, UpdatePriority.VERY_HIGH);
40 }
41
42 @Override
43 public CombatHit[] getHits(Npc attacker, Mob defender) {
44 CombatHit combatHit = nextMagicHit(attacker, defender, 15);
45 combatHit.setAccurate(true);
46 return new CombatHit[] { combatHit };
47 }
48 }
49}
Class that models a single animation used by an entity.
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
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
Represents different priorities for updating.