1package com.runehive.content.itemaction.impl;
3import com.runehive.content.itemaction.ItemAction;
4import com.runehive.game.world.entity.combat.Combat;
5import com.runehive.game.world.entity.combat.strategy.player.custom.DragonfireShieldStrategy;
6import com.runehive.game.world.entity.mob.Mob;
7import com.runehive.game.world.entity.mob.player.Player;
8import com.runehive.game.world.items.Item;
14 return "Dragonfire shield";
21 }
else if (opcode == 3) {
29 player.dragonfireCharges = 0;
32 player.
message(
"You clear your remaining charges.");
34 player.
message(
"You have no remaining charges.");
45 long remaining = System.currentTimeMillis() - player.
dragonfireUsed;
46 if (remaining < 120_000) {
47 player.
message(
"My shield still needs " + (120 - remaining / 1000) +
" seconds to recharge.");
51 player.
message(
"You have no charges to do this!");
55 if (defender ==
null && player.
getCombat().isAttacking()) {
56 defender = player.
getCombat().getLastVictim();
58 if (defender ==
null && player.
getCombat().isUnderAttack()) {
59 defender = player.
getCombat().getLastAggressor();
61 if (defender ==
null) {
62 player.
message(
"You are not in combat with anything...");
66 player.
message(
"He dead tho...");
69 player.dragonfireUsed = System.currentTimeMillis();
72 combat.performChecks(defender);
Handles executing an item action.
void inspect(Player player)
boolean equipment(Player player, Item item, int opcode)
boolean inventory(Player player, Item item, int opcode)
The execution method of the action.
String name()
The name of the action.
void empty(Player player)
static DragonfireShieldStrategy get()
Optional< Graphic > graphic
This class represents a character controlled by a player.
final Inventory inventory
void message(String message)
Combat< Player > getCombat()
The combat of the mob.
The container class that represents an item that can be interacted with.
final boolean replace(int oldId, int newId, int index, boolean refresh)
Replaces the first occurrence of the Item having the identifier oldId with newId.