RuneHive-Game
Loading...
Searching...
No Matches
ZamorakGodsword.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.player.special.melee;
2
3import com.runehive.game.Animation;
4import com.runehive.game.Graphic;
5import com.runehive.game.UpdatePriority;
6import com.runehive.game.world.entity.combat.hit.CombatHit;
7import com.runehive.game.world.entity.combat.hit.Hit;
8import com.runehive.game.world.entity.combat.strategy.player.PlayerMeleeStrategy;
9import com.runehive.game.world.entity.mob.Mob;
10import com.runehive.game.world.entity.mob.data.LockType;
11import com.runehive.game.world.entity.mob.player.Player;
12
13/**
14 * Handles the zamorak sword weapon special attack.
15 *
16 * @author Daniel
17 */
19
20 //ZGS(normal): 7638, ZGS(OR): 7639
21 private static final Animation ANIMATION = new Animation(7638, UpdatePriority.HIGH);
22 private static final Graphic GRAPHIC = new Graphic(1210, UpdatePriority.HIGH);
23 private static final Graphic FREEZE_GRAPHIC = new Graphic(369, UpdatePriority.HIGH);
24 private static final ZamorakGodsword INSTANCE = new ZamorakGodsword();
25
26 @Override
27 public void attack(Player attacker, Mob defender, Hit hit) {
28 super.attack(attacker, defender, hit);
29 attacker.graphic(GRAPHIC);
30
31 if(hit.getDamage() > 0) {
32 if (defender.locking.locked())
33 return;
34 defender.graphic(FREEZE_GRAPHIC);
35 defender.locking.lock(20, LockType.FREEZE);
36 }
37 }
38
39 @Override
40 public CombatHit[] getHits(Player attacker, Mob defender) {
41 return new CombatHit[]{nextMeleeHit(attacker, defender)};
42 }
43
44 @Override
45 public Animation getAttackAnimation(Player attacker, Mob defender) {
46 return ANIMATION;
47 }
48
49 @Override
50 public int modifyAccuracy(Player attacker, Mob defender, int roll) {
51 return 2 * roll;
52 }
53
54 @Override
55 public int modifyDamage(Player attacker, Mob defender, int damage) {
56 return damage * 11 / 10;
57 }
58
59 public static ZamorakGodsword get() {
60 return INSTANCE;
61 }
62
63}
Class that models a single animation used by an entity.
Represents a single graphic that can be used by entities.
Definition Graphic.java:10
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
boolean locked()
Checks if the mob is locked.
Definition Locking.java:52
Handles the mob class.
Definition Mob.java:66
Optional< Graphic > graphic
Definition Mob.java:91
This class represents a character controlled by a player.
Definition Player.java:125
Represents different priorities for updating.