RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.StarterKit Class Reference

Handles the starter kits. More...

Classes

enum  KitData
 Holds the starter kit data. More...

Static Public Member Functions

static void open (Player player)
 Handles opening the starter kit interface.
static void refresh (Player player, StarterKit.KitData kit)
 Handles refreshing the starter kit interface.

Detailed Description

Handles the starter kits.

Author
Daniel

Definition at line 19 of file StarterKit.java.

Member Function Documentation

◆ open()

void com.runehive.content.StarterKit.open ( Player player)
static

Handles opening the starter kit interface.

Definition at line 21 of file StarterKit.java.

21 {
22 player.locking.lock();
23 refresh(player, KitData.NORMAL);
24 player.interfaceManager.open(45000);
25 }

References com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.Locking.lock, com.runehive.game.world.entity.mob.Mob.locking, com.runehive.content.StarterKit.KitData.NORMAL, com.runehive.game.world.entity.mob.player.InterfaceManager.open(), and refresh().

Referenced by com.runehive.game.action.impl.TutorialActivity.finish(), and com.runehive.game.world.entity.mob.player.PlayerAssistant.setActivity().

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

◆ refresh()

void com.runehive.content.StarterKit.refresh ( Player player,
StarterKit.KitData kit )
static

Handles refreshing the starter kit interface.

Definition at line 28 of file StarterKit.java.

28 {
29 player.attributes.set("STARTER_KEY", kit);
30 for (int index = 0, string = 45004; index < 4; index++, string += 1) {
31 String desc = index >= kit.getDescription().length ? "" : kit.getDescription()[index];
32 player.send(new SendString(desc, string));
33 }
34
35 player.equipment.clear();
36 player.movement.setRunningToggled(true);
37 player.send(new SendRunEnergy());
38 if (kit.equipment == null) {
39 player.equipment.clear();
40 player.updateFlags.add(UpdateFlag.APPEARANCE);
41 } else {
42 Arrays.stream(kit.getEquipment()).forEach(player.equipment::manualWear);
43 }
44
45 player.equipment.refresh();
46 player.send(new SendConfig(1085, kit.ordinal()));
47 player.send(new SendItemOnInterface(45021, kit.getItems()));
48 }
val index

References com.runehive.game.world.entity.mob.UpdateFlag.APPEARANCE, com.runehive.game.world.entity.mob.Mob.attributes, com.runehive.game.world.items.containers.equipment.Equipment.clear(), com.runehive.game.world.entity.mob.player.Player.equipment, com.runehive.game.world.entity.mob.Mob.movement, com.runehive.game.world.items.containers.equipment.Equipment.refresh(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.util.generic.GenericAttributes.set(), com.runehive.game.world.entity.mob.movement.Movement.setRunningToggled(), and com.runehive.game.world.entity.mob.Mob.updateFlags.

Referenced by open().

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

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