RuneHive-Game
Loading...
Searching...
No Matches
ElysianListener.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.attack.listener.item;
2
3import com.runehive.game.Graphic;
4import com.runehive.game.UpdatePriority;
5import com.runehive.game.world.entity.combat.CombatType;
6import com.runehive.game.world.entity.combat.attack.listener.ItemCombatListenerSignature;
7import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
8import com.runehive.game.world.entity.combat.hit.Hit;
9import com.runehive.game.world.entity.mob.Mob;
10import com.runehive.game.world.entity.mob.player.Player;
11
12/**
13 * Handles the Elysian spirit shield listener.
14 * OSRS Wiki: http://oldschoolrunescape.wikia.com/wiki/Elysian_spirit_shield
15 *
16 * @author Daniel
17 */
18@ItemCombatListenerSignature(requireAll = false, items = {12817})
20
21 @Override
22 public void block(Mob attacker, Player defender, Hit hit, CombatType combatType) {
23 if (Math.random() > 0.30) {
24 hit.modifyDamage(damage -> damage * 3 / 4);
25 defender.graphic(new Graphic(321, UpdatePriority.HIGH));
26 }
27 }
28}
Represents a single graphic that can be used by entities.
Definition Graphic.java:10
void block(Mob attacker, Player defender, Hit hit, CombatType combatType)
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
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.