1package com.runehive.content.skill.impl.construction;
3import com.runehive.game.Animation;
4import com.runehive.game.world.World;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.game.world.entity.mob.player.profile.ProfileRepository;
7import com.runehive.game.world.entity.skill.Skill;
8import com.runehive.game.world.items.Item;
9import com.runehive.game.world.object.CustomGameObject;
10import com.runehive.game.world.object.GameObject;
11import com.runehive.game.world.object.ObjectDirection;
12import com.runehive.game.world.object.ObjectType;
13import com.runehive.game.world.position.Position;
14import com.runehive.net.packet.out.SendMessage;
15import com.runehive.net.packet.out.SendMinimapState;
16import com.runehive.net.packet.out.SendMinimapState.MinimapState;
17import com.runehive.net.packet.out.SendString;
18import com.runehive.util.MessageColor;
19import com.runehive.util.Utility;
21import java.util.ArrayList;
30 private List<ConstructionObject>
OBJECT =
new ArrayList<ConstructionObject>();
43 player.dialogueFactory.sendStatement(
"You already have a house purchased!").execute();
47 if (!
player.inventory.contains(
new Item(995, 1000000))) {
48 player.dialogueFactory.sendStatement(
"You need 1,000,000 royale tokens to purchase a house.").execute();
53 player.inventory.remove(
new Item(995, 1000000));
54 player.dialogueFactory.sendStatement(
"You have successfully purchased a house for 1,000,000 royale tokens.",
"Your house has been set to the default location.").execute();
59 player.dialogueFactory.sendStatement(
"Please purchase a house first.").execute();
64 player.dialogueFactory.sendStatement(
"Your house is already set to this location.").execute();
69 player.dialogueFactory.sendStatement(
"You need a construction level of " + newMap.
getLevel() +
" to build this.").execute();
74 player.dialogueFactory.sendStatement(
"You need " + newMap.
getCost() +
" royale tokens to purchase this map.").execute();
81 player.dialogueFactory.sendStatement(
"You have successfully purchased the " + newMap.
getName() +
" map.").execute();
86 player.dialogueFactory.sendStatement(
"You need to purchase a house first.",
"Speak to the agent to purchase one.").execute();
90 player.send(
new SendString(
"Please wait as your house data is loaded...", 12285));
92 player.interfaceManager.open(12283);
102 player.interfaceManager.close();
113 player.dialogueFactory.sendStatement(
"According to our data base, this player does not exist.").execute();
125 if (otherHouse.
getMap() ==
null) {
126 player.dialogueFactory.sendStatement(
Utility.
formatName(name) +
" does not have a house for you to visit.").execute();
131 player.dialogueFactory.sendStatement(
Utility.
formatName(name) +
" must be in their house for you to visit.").execute();
134 player.send(
new SendString(
"Please wait as your friend's house data is loaded...", 12285));
136 player.interfaceManager.open(12283);
140 for (
int index = 0; index < otherHouse.
getObjects().size(); index++) {
146 player.interfaceManager.close();
168 for (
int index = 0; index <
OBJECT.size(); index++) {
169 if (
OBJECT.get(index).getObject() ==
object.getId() &&
OBJECT.get(index).getPosition().equals(
object.getPosition())) {
175 if (constructionObject ==
null) {
179 player.dialogueFactory.sendOption(
"Remove object", () -> {
182 },
"Change rotation", () -> {
183 player.dialogueFactory.onAction(() -> {
184 player.dialogueFactory.sendStatement(
"Please select the rotation direction").sendOption(
"North", () -> {
196 },
"Nevermind", () -> {
197 player.interfaceManager.close();
201 },
"Nevermind", () -> {
202 player.interfaceManager.close();
211 player.send(
new SendMessage(
"You need a construction level of " +
object.getLevel() +
" to build this."));
221 player.interfaceManager.close();
223 player.inventory.removeAll(
object.getItems());
246 public void setObject(List<ConstructionObject>
object) {
List< ConstructionObject > getObjects()
List< ConstructionObject > OBJECT
void setMap(BuildableMap map)
void setObject(List< ConstructionObject > object)
void location(BuildableMap newMap)
boolean toolkit(GameObject object)
Class that models a single animation used by an entity.
Represents the game world.
static void schedule(Task task)
Submits a new event.
static Optional< Player > search(String name)
Gets a player by name.
This class represents a character controlled by a player.
Handles the profile repository, used for gathering important information for all created profiles.
static boolean exist(String name)
Checks if a profile is registered to the parameter.
Represents a trainable and usable skill.
static final int CONSTRUCTION
The construction skill id.
The container class that represents an item that can be interacted with.
Represents a static game object loaded from the map fs.
String getName()
Gets the name of this entity.
void register()
Registers an entity to the World.
Represents a single tile on the game world.
int getY()
Gets the absolute y coordinate.
int getX()
Gets the absolute x coordinate.
The OutgoingPacket that sends a message to a Players chatbox in the client.
The OutgoingPacket that sends a string to a Players itemcontainer in the client.
Handles miscellaneous methods.
static String formatName(final String input)
static String getAOrAn(String nextWord)
A or an.
Holds all the construction buildable object.
The enumerated type whose elements represent the directions for objects.
SOUTH
The south orientation.
WEST
The west orientation.
EAST
The east orientation.
NORTH
The north orientation.
The enumerated type whose elements represent all of the object types.
GENERAL_PROP
Represents all kinds of objects, trees, statues, signs, fountains etc.
Represents the state a minimap can be in.
NORMAL
The default state where the map is visible and clicking is enabled.
HIDDEN
The state where the map is pitch black, and clicking is disabled.
Holds an enum of colors for ease.
Represents a game object.
default int getId()
Gets the object id.
void execute(final T player)