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

Public Member Functions

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 equipment (Player player, Item item, int opcode)
boolean itemOnItem (Player player, Item first, Item second)
String message (Item item)
 The message of the action.
String toString ()

Static Private Attributes

static final EmoteUnlockable[] EMOTES = {EmoteUnlockable.GLASS_BOX, EmoteUnlockable.GLASS_WALL, EmoteUnlockable.LEAN, EmoteUnlockable.CLIMB_ROPE}
static final Item[] MIME_COSTUME = { new Item(3057), new Item(3058), new Item(3059), new Item(3060), new Item(3061) }

Detailed Description

Definition at line 11 of file MimeBox.java.

Member Function Documentation

◆ inventory()

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

The execution method of the action.

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

Definition at line 23 of file MimeBox.java.

23 {
24 if (opcode != 1)
25 return false;
26
27
28 player.inventory.remove(item);
29 int random = Utility.random(1, 5);
30
31 switch (random) {
32 case 1:
33 case 2:
34 if (!EmoteHandler.containsAll(player, EMOTES)) {
35 EmoteUnlockable emote = EmoteHandler.selectRandom(player, EMOTES);
36 player.emoteUnlockable.add(emote);
37 EmoteHandler.refresh(player);
38 player.send(new SendMessage("You have unlocked the " + Utility.formatName(emote.name().toLowerCase().replace("_", "")) + " emote!"));
39 return true;
40 }
41 int random2 = Utility.random(1, 2);
42 if (random2 == 1) {
43 Item clothing = Utility.randomElement(MIME_COSTUME);
44 player.inventory.add(clothing);
45 player.send(new SendMessage("You have received the " + clothing.getName() + " item!"));
46 } else {
47 player.inventory.add(new Item(995, 75000));
48 }
49 break;
50 case 3:
51 case 4:
52 player.inventory.add(Utility.randomElement(MIME_COSTUME));
53 break;
54 case 5:
55 player.inventory.add(new Item(995, 75000));
56 break;
57 }
58 return true;
59 }

References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.content.emote.EmoteHandler.containsAll(), EMOTES, com.runehive.game.world.entity.mob.player.Player.emoteUnlockable, com.runehive.util.Utility.formatName(), com.runehive.game.world.items.Item.getName(), com.runehive.game.world.entity.mob.player.Player.inventory, MIME_COSTUME, com.runehive.util.Utility.random(), com.runehive.util.Utility.randomElement(), com.runehive.content.emote.EmoteHandler.refresh(), com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.content.emote.EmoteHandler.selectRandom(), and com.runehive.game.world.entity.mob.player.Player.send().

Here is the call graph for this function:

◆ name()

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

The name of the action.

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

Definition at line 18 of file MimeBox.java.

18 {
19 return "Mime box";
20 }

Member Data Documentation

◆ EMOTES

final EmoteUnlockable [] com.runehive.content.itemaction.impl.MimeBox.EMOTES = {EmoteUnlockable.GLASS_BOX, EmoteUnlockable.GLASS_WALL, EmoteUnlockable.LEAN, EmoteUnlockable.CLIMB_ROPE}
staticprivate

Definition at line 13 of file MimeBox.java.

13{EmoteUnlockable.GLASS_BOX, EmoteUnlockable.GLASS_WALL, EmoteUnlockable.LEAN, EmoteUnlockable.CLIMB_ROPE};

Referenced by inventory().

◆ MIME_COSTUME

final Item [] com.runehive.content.itemaction.impl.MimeBox.MIME_COSTUME = { new Item(3057), new Item(3058), new Item(3059), new Item(3060), new Item(3061) }
staticprivate

Definition at line 15 of file MimeBox.java.

15{ new Item(3057), new Item(3058), new Item(3059), new Item(3060), new Item(3061) };

Referenced by inventory().


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