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

Handles the prestige class. More...

Collaboration diagram for com.runehive.content.prestige.Prestige:

Public Member Functions

boolean activatePerk (Item item)
 Activates the perk.
int getColor (int tier)
 Gets the prestige color based on the tier.
int getPrestigeColor (int skill)
 Gets the current prestige color of the player.
int getPrestigePoint ()
boolean hasPerk (PrestigePerk perk)
void open ()
 Opens the prestige panel.
void perkInformation ()
 Displays all the perk information.
 Prestige (Player player)
 Constructs a new Prestige.
void prestige (PrestigeData data)
 Handles prestiging the skill.
void setPrestigePoint (int prestigePoint)

Public Attributes

Set< PrestigePerkactivePerks = new HashSet<>()
 The set of all the active perks for the player.
int[] prestige = new int[Skill.SKILL_COUNT]
 The prestiges.
int totalPrestige
 The total amount of prestiges.

Private Member Functions

String getColorInterface (int tier)
 Gets the prestige color based on the tier for the itemcontainer.

Private Attributes

final Player player
 The player instance.
int prestigePoint
 The prestige points.

Static Private Attributes

static final String COLOR = "<col=354CE6>"

Detailed Description

Handles the prestige class.

Author
Daniel.

Definition at line 24 of file Prestige.java.

Constructor & Destructor Documentation

◆ Prestige()

com.runehive.content.prestige.Prestige.Prestige ( Player player)

Constructs a new Prestige.

Definition at line 44 of file Prestige.java.

44 {
45 this.player = player;
46 }

References player.

Member Function Documentation

◆ activatePerk()

boolean com.runehive.content.prestige.Prestige.activatePerk ( Item item)

Activates the perk.

Definition at line 94 of file Prestige.java.

94 {
95 PrestigePerk perk = PrestigePerk.forItem(item.getId());
96 if (perk == null) {
97 return false;
98 }
99 if (activePerks == null) {
100 activePerks = new HashSet<>();
101 }
102 if (activePerks.contains(perk)) {
103 player.send(new SendMessage("The Perk: " + perk.name + " perk is already active on your account!", MessageColor.DARK_BLUE));
104 return true;
105 }
106 player.inventory.remove(item);
107 activePerks.add(perk);
108 player.send(new SendMessage("You have successfully activated the " + perk.name + " perk.", MessageColor.DARK_BLUE));
109 return true;
110 }

References activePerks, com.runehive.util.MessageColor.DARK_BLUE, com.runehive.content.prestige.PrestigePerk.forItem(), com.runehive.game.world.items.Item.getId(), com.runehive.content.prestige.PrestigePerk.name, and player.

Here is the call graph for this function:

◆ getColor()

int com.runehive.content.prestige.Prestige.getColor ( int tier)

Gets the prestige color based on the tier.

Definition at line 122 of file Prestige.java.

122 {
123 switch (tier) {
124 case 1:
125 return 0xf49242;
126 case 2:
127 return 0x42f468;
128 case 3:
129 return 0x42d1f4;
130 case 4:
131 return 0xa76ffc;
132 case 5:
133 return 0xf44949;
134 default:
135 return 0xFFFF00;
136 }
137 }

Referenced by getColorInterface(), and getPrestigeColor().

Here is the caller graph for this function:

◆ getColorInterface()

String com.runehive.content.prestige.Prestige.getColorInterface ( int tier)
private

Gets the prestige color based on the tier for the itemcontainer.

Definition at line 140 of file Prestige.java.

140 {
141 return Integer.toHexString(getColor(tier));
142 }

References getColor().

Referenced by open().

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

◆ getPrestigeColor()

int com.runehive.content.prestige.Prestige.getPrestigeColor ( int skill)

Gets the current prestige color of the player.

Definition at line 117 of file Prestige.java.

117 {
118 return getColor(prestige[skill]);
119 }

References getColor(), and prestige.

Referenced by com.runehive.net.packet.out.SendSkill.encode(), and com.runehive.content.ProfileViewer.open().

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

◆ getPrestigePoint()

int com.runehive.content.prestige.Prestige.getPrestigePoint ( )

Definition at line 144 of file Prestige.java.

144 {
145 return prestigePoint;
146 }

References prestigePoint.

Referenced by com.runehive.content.store.currency.impl.PrestigePointCurrency.currencyAmount(), com.runehive.content.store.currency.CurrencyType.getValue(), com.runehive.content.store.currency.impl.PrestigePointCurrency.recieveCurrency(), and com.runehive.content.store.currency.impl.PrestigePointCurrency.takeCurrency().

Here is the caller graph for this function:

◆ hasPerk()

boolean com.runehive.content.prestige.Prestige.hasPerk ( PrestigePerk perk)

Definition at line 112 of file Prestige.java.

112 {
113 return activePerks.contains(perk);
114 }

References activePerks.

Referenced by com.runehive.content.skill.impl.firemaking.Firemaking.bonfireAction(), com.runehive.content.skill.impl.woodcutting.BirdsNest.drop(), com.runehive.content.skill.impl.fishing.FishingAction.fish(), com.runehive.content.skill.impl.firemaking.FiremakingAction.onDestruct(), perkInformation(), and com.runehive.game.world.entity.combat.strategy.player.PlayerRangedStrategy.removeAmmunition().

Here is the caller graph for this function:

◆ open()

void com.runehive.content.prestige.Prestige.open ( )

Opens the prestige panel.

Definition at line 49 of file Prestige.java.

49 {
50 player.send(new SendString(player.getName(), 52007));
51 player.send(new SendString("Total Prestiges: <col=76E34B>" + totalPrestige + "</col>", 52008));
52 player.send(new SendString("Prestige Points: <col=76E34B>" + prestigePoint + "</col>", 52009));
53 Arrays.stream(PrestigeData.values).forEach(p -> player.send(new SendString(p.name + " " + "(<col=" + getColorInterface(prestige[p.skill]) + ">" + prestige[p.skill] + "</col>)", p.string)));
54 player.interfaceManager.open(52000);
55 }

References getColorInterface(), player, prestige, prestigePoint, totalPrestige, and com.runehive.content.prestige.PrestigeData.values.

Referenced by prestige().

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

◆ perkInformation()

void com.runehive.content.prestige.Prestige.perkInformation ( )

Displays all the perk information.

Definition at line 74 of file Prestige.java.

74 {
75 final int totalPerks = PrestigePerk.values.length;
76 for (int i = 0, string = 37114; i < totalPerks; i++) {
77 PrestigePerk perk = PrestigePerk.forId(i);
78 player.send(new SendString("<col=" + (hasPerk(perk) ? "347043" : "3c50b2") + ">" + perk.name, string++));
79 player.send(new SendString(perk.description, string++));
80 player.send(new SendString("", string++));
81 }
82
83 player.send(new SendString("<col=000000>This is a list of all the available perks.", 37111));
84 player.send(new SendString("<col=000000>Perks with green names indicate that it is active.", 37112));
85 player.send(new SendString("", 37113));
86 player.send(new SendString("", 37107));
87 player.send(new SendString("Prestige Perks Information", 37103));
88 player.send(new SendScrollbar(37110, totalPerks * 65));
89 player.send(new SendItemOnInterface(37199));
90 player.interfaceManager.open(37100);
91 }

References com.runehive.content.prestige.PrestigePerk.description, com.runehive.content.prestige.PrestigePerk.forId(), hasPerk(), com.runehive.content.prestige.PrestigePerk.name, player, and com.runehive.content.prestige.PrestigePerk.values.

Here is the call graph for this function:

◆ prestige()

void com.runehive.content.prestige.Prestige.prestige ( PrestigeData data)

Handles prestiging the skill.

Definition at line 58 of file Prestige.java.

58 {
59 prestige[data.skill]++;
60 totalPrestige += 1;
61 prestigePoint += 1;
62 player.skills.setExperience(data.skill, Skill.getExperienceForLevel(data.skill == 3 ? 10 : 1));
63 player.skills.setMaxLevel(data.skill, data.skill == 3 ? 10 : 1);
64 player.skills.setLevel(data.skill, data.skill == 3 ? 10 : 1);
65 player.skills.refresh(data.skill);
66 player.skills.setCombatLevel();
67 player.bankVault.add(COINS, 1_000_000);
68 player.send(new SendMessage("You have successfully prestiged your <col=255>" + Skill.getName(data.skill) + "</col> skill!"));
69 World.sendMessage( "<icon=21> Prestige: <col=354CE6>" + player.getName() + "</col> has prestiged " + Skill.getName(data.skill) + " and has a total of " + player.prestige.totalPrestige + " prestiges!");
70 open();
71 }

References com.runehive.game.world.entity.skill.Skill.getExperienceForLevel(), com.runehive.game.world.entity.skill.Skill.getName(), open(), player, prestige, prestigePoint, com.runehive.game.world.World.sendMessage(), com.runehive.content.prestige.PrestigeData.skill, and totalPrestige.

Here is the call graph for this function:

◆ setPrestigePoint()

void com.runehive.content.prestige.Prestige.setPrestigePoint ( int prestigePoint)

Definition at line 148 of file Prestige.java.

148 {
149 this.prestigePoint = prestigePoint;
150 }

References prestigePoint.

Referenced by com.runehive.content.store.currency.impl.PrestigePointCurrency.recieveCurrency(), and com.runehive.content.store.currency.impl.PrestigePointCurrency.takeCurrency().

Here is the caller graph for this function:

Member Data Documentation

◆ activePerks

Set<PrestigePerk> com.runehive.content.prestige.Prestige.activePerks = new HashSet<>()

The set of all the active perks for the player.

Definition at line 41 of file Prestige.java.

Referenced by activatePerk(), and hasPerk().

◆ COLOR

final String com.runehive.content.prestige.Prestige.COLOR = "<col=354CE6>"
staticprivate

Definition at line 28 of file Prestige.java.

◆ player

final Player com.runehive.content.prestige.Prestige.player
private

The player instance.

Definition at line 27 of file Prestige.java.

Referenced by activatePerk(), open(), perkInformation(), Prestige(), and prestige().

◆ prestige

int [] com.runehive.content.prestige.Prestige.prestige = new int[Skill.SKILL_COUNT]

The prestiges.

Definition at line 38 of file Prestige.java.

Referenced by getPrestigeColor(), open(), prestige(), and com.runehive.game.service.HighscoreService.saveHighscores().

◆ prestigePoint

int com.runehive.content.prestige.Prestige.prestigePoint
private

The prestige points.

Definition at line 35 of file Prestige.java.

Referenced by getPrestigePoint(), open(), prestige(), and setPrestigePoint().

◆ totalPrestige

int com.runehive.content.prestige.Prestige.totalPrestige

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