1package com.runehive.content.itemaction.impl;
3import com.runehive.content.itemaction.ItemAction;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.game.world.items.Item;
6import com.runehive.util.Utility;
8import java.math.RoundingMode;
9import java.text.DecimalFormat;
14 private static final DecimalFormat
FORMATTER =
new DecimalFormat(
"#.#");
17 FORMATTER.setRoundingMode(RoundingMode.FLOOR);
22 return "Trident of the Seas";
32 player.
message(
"Your Trident of the Swamp is already fully charged.");
36 int id1 = first.
getId();
37 int id2 = second.
getId();
40 if (id2 != 560 && id2 != 562 && id2 != 554 && id2 != 12934)
44 if (id1 != 560 && id1 != 562 && id1 != 554 && id1 != 12934)
52 if (death >= 1 && chaos >= 1 && fire >= 5 && scales >= 1) {
54 int charges = Math.min(Math.min(death, chaos), Math.min(scales, minF));
68 player.tridentSwampCharges += charges;
69 player.
message(
"You added " + charges +
" charges to your Trident of the Swamp");
72 player.
message(
"You need at least 1x zulrah scale, 1x death rune, 1x chaos rune, and 5x fire runes",
"for one charge. Your Trident of the Swamp can hold 2,500 charges.");
116 player.
message(
"You don't have enough inventory space to uncharge your trident.");
124 player.tridentSwampCharges = 0;
125 player.
message(
"You uncharge your trident.");
Handles executing an item action.
boolean itemOnItem(Player player, Item first, Item second)
static final short CHARGE_LIMIT
static final short TRIDENT_ID
String name()
The name of the action.
boolean inventory(Player player, Item item, int opcode)
The execution method of the action.
static void check(Player player)
boolean equipment(Player player, Item item, int opcode)
static final DecimalFormat FORMATTER
static void uncharge(Player player)
This class represents a character controlled by a player.
final Inventory inventory
void message(String message)
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
final int computeAmountForId(int id)
Computes the total quantity of the Items in this container with id.
boolean remove(Item item)
Attempts to withdraw item from this container.
boolean add(Item item)
Attempts to deposit item into this container.
final boolean hasCapacityFor(Item... item)
Determines if this container has the capacity for item.
void refresh()
Refreshes the players inventory.
Handles miscellaneous methods.
static String formatDigits(final int amount)
Formats digits for integers.