RuneHive-Game
Loading...
Searching...
No Matches
PrestigeDialogue.java
Go to the documentation of this file.
1package com.runehive.content.dialogue.impl;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.content.dialogue.Dialogue;
5import com.runehive.content.dialogue.DialogueFactory;
6import com.runehive.content.dialogue.Expression;
7
8/**
9 * Handles the prestige dialogue.
10 *
11 * @author Daniel
12 */
13public class PrestigeDialogue extends Dialogue {
14
15 /** The dialogue npc identification. */
16 private static final int POLLY = 345;
17
18 @Override
19 public void sendDialogues(DialogueFactory factory) {
20 Player player = factory.getPlayer();
21 factory.sendNpcChat(POLLY, Expression.HAPPY, "Hello #username, my friend.", "How may I help you today?");
22 factory.sendOption("How do prestiges work?", () -> explainPrestige(factory), "How do perks work?", () -> explainPerks(factory), "Open prestige panel", player.prestige::open, "Nevermind", factory::clear);
23 factory.execute();
24 }
25
26 private void explainPrestige(DialogueFactory factory) {
27 factory.sendNpcChat(POLLY, Expression.HAPPY, "The concept of prestiges is very simple!", "Once you have achieved 200m experience in any non-combat", "skill, you will be permitted to prestige that skill.");
28 factory.sendNpcChat(POLLY, Expression.HAPPY, "Upon prestiging that skill, it will be reset back to 1 and you ", " will receive 1,000,000 coins and 1 prestige point.", "Players are only allowed to prestige each skill up to 5 times.");
29 factory.sendNpcChat(POLLY, Expression.HAPPY, "Each prestige has a different color. You have the ability", "to toggle the colors to display in your skill tab.");
30 }
31
32 private void explainPerks(DialogueFactory factory) {
33 factory.sendNpcChat(POLLY, Expression.HAPPY, "Perks are very simple to use. Once you have accumulated", "prestige points you can access my shop. Within my shops", "are different perks which all have different effects.");
34 factory.sendNpcChat(POLLY, Expression.HAPPY, "You can talk to me if you would like to see all the", "perks and their ability. All perks stack!");
35 }
36}
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
Player getPlayer()
The player that owns this factory.
final DialogueFactory sendNpcChat(int id, String... lines)
Appends an NpcDialogue to the current dialogue chain.
final DialogueFactory sendOption(String option1, Runnable action1, String option2, Runnable action2)
Appends the OptionDialogue onto the current dialogue chain.
Represents an abstract dialogue, in which extending classes will be able to construct and send dialog...
Definition Dialogue.java:11
void sendDialogues(DialogueFactory factory)
Sends a player a dialogue.
static final int POLLY
The dialogue npc identification.
This class represents a character controlled by a player.
Definition Player.java:125
Represents the expressions of entities for dialogue.