RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.itemaction.impl.DragonfireShield Class Reference
Inheritance diagram for com.runehive.content.itemaction.impl.DragonfireShield:
Collaboration diagram for com.runehive.content.itemaction.impl.DragonfireShield:

Public Member Functions

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.
Public Member Functions inherited from com.runehive.content.itemaction.ItemAction
int delay ()
 The item click delay of the action.
boolean drop (Player player, Item item)
boolean itemOnItem (Player player, Item first, Item second)
String message (Item item)
 The message of the action.
String toString ()

Private Member Functions

void empty (Player player)
void inspect (Player player)

Detailed Description

Definition at line 10 of file DragonfireShield.java.

Member Function Documentation

◆ empty()

void com.runehive.content.itemaction.impl.DragonfireShield.empty ( Player player)
private

Definition at line 27 of file DragonfireShield.java.

27 {
28 if (player.dragonfireCharges > 0) {
29 player.dragonfireCharges = 0;
30 player.graphic(1160);
31 player.inventory.replace(11283, 11284, true);
32 player.message("You clear your remaining charges.");
33 } else {
34 player.message("You have no remaining charges.");
35 }
36 }

References com.runehive.game.world.entity.mob.player.Player.dragonfireCharges, com.runehive.game.world.entity.mob.Mob.graphic, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.entity.mob.player.Player.message(), and com.runehive.game.world.items.containers.ItemContainer.replace().

Referenced by inventory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ equipment()

boolean com.runehive.content.itemaction.impl.DragonfireShield.equipment ( Player player,
Item item,
int opcode )

Reimplemented from com.runehive.content.itemaction.ItemAction.

Definition at line 43 of file DragonfireShield.java.

43 {
44 if (opcode == 1) {
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.");
48 return true;
49 }
50 if (player.dragonfireCharges == 0) {
51 player.message("You have no charges to do this!");
52 return true;
53 }
54 Mob defender = player.getCombat().getDefender();
55 if (defender == null && player.getCombat().isAttacking()) {
56 defender = player.getCombat().getLastVictim();
57 }
58 if (defender == null && player.getCombat().isUnderAttack()) {
59 defender = player.getCombat().getLastAggressor();
60 }
61 if (defender == null) {
62 player.message("You are not in combat with anything...");
63 return true;
64 }
65 if (defender.isDead() || defender.getCurrentHealth() == 0) {
66 player.message("He dead tho...");
67 return true;
68 }
69 player.dragonfireUsed = System.currentTimeMillis();
70
71 final Combat<Player> combat = player.getCombat();
72 combat.performChecks(defender);
73 combat.submitStrategy(defender, DragonfireShieldStrategy.get());
74 }
75 return true;
76 }

References com.runehive.game.world.entity.mob.player.Player.dragonfireCharges, com.runehive.game.world.entity.mob.player.Player.dragonfireUsed, com.runehive.game.world.entity.combat.strategy.player.custom.DragonfireShieldStrategy.get(), com.runehive.game.world.entity.mob.player.Player.getCombat(), com.runehive.game.world.entity.mob.Mob.getCurrentHealth(), com.runehive.game.world.entity.mob.Mob.isDead(), and com.runehive.game.world.entity.mob.player.Player.message().

Here is the call graph for this function:

◆ inspect()

void com.runehive.content.itemaction.impl.DragonfireShield.inspect ( Player player)
private

Definition at line 38 of file DragonfireShield.java.

38 {
39 player.message("You have " + player.dragonfireCharges + " charges remaining.");
40 }

References com.runehive.game.world.entity.mob.player.Player.dragonfireCharges, and com.runehive.game.world.entity.mob.player.Player.message().

Referenced by inventory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inventory()

boolean com.runehive.content.itemaction.impl.DragonfireShield.inventory ( Player player,
Item item,
int opcode )

The execution method of the action.

Reimplemented from com.runehive.content.itemaction.ItemAction.

Definition at line 18 of file DragonfireShield.java.

18 {
19 if (opcode == 2) {
20 inspect(player);
21 } else if (opcode == 3) {
22 empty(player);
23 }
24 return true;
25 }

References empty(), and inspect().

Here is the call graph for this function:

◆ name()

String com.runehive.content.itemaction.impl.DragonfireShield.name ( )

The name of the action.

Reimplemented from com.runehive.content.itemaction.ItemAction.

Definition at line 13 of file DragonfireShield.java.

13 {
14 return "Dragonfire shield";
15 }

The documentation for this class was generated from the following file: