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

Handles viewing other player's profiles. More...

Static Public Member Functions

static void open (Player player, Player other)
 Opens the profile interface.
static String[] string (Player player)
 Gets the main strings to display.

Detailed Description

Handles viewing other player's profiles.

Author
Daniel

Definition at line 20 of file ProfileViewer.java.

Member Function Documentation

◆ open()

void com.runehive.content.ProfileViewer.open ( Player player,
Player other )
static

Opens the profile interface.

Definition at line 42 of file ProfileViewer.java.

42 {
43 if (!other.getPosition().isWithinDistance(player.getPosition(), 26)) {
44 player.message("You must get closer to that player if you want to view their profile!");
45 return;
46 }
47
48 if (player.getCombat().inCombat()) {
49 player.send(new SendMessage("You can't view profiles whilst in combat!"));
50 return;
51 }
52
53 for (int index = 0, string = 51832; index < Skill.SKILL_COUNT; index++, string += 2) {
54 Skill skill = other.skills.get(index);
55 String color = Integer.toHexString(other.prestige.getPrestigeColor(index));
56 player.send(new SendString(skill.getMaxLevel() + "<col=" + color + "></col>/<col=" + color + ">" + skill.getMaxLevel(), string));
57 }
58
59 int string = 51902;
60 for (String context : string(other)) {
61 player.send(new SendString(context, string));
62 string += 2;
63 }
64
65 if (PlayerRight.isModerator(player) && !player.equals(other)) {
66 player.send(new SendString("Manage Player: " + other.getName(), 51811));
67 player.send(new SendTooltip("Manage Player: " + other.getName(), 51811));
68 player.managing = Optional.of(other);
69 } else {
70 player.send(new SendString("", 51811));
71 player.send(new SendTooltip("", 51811));
72 }
73
74 player.send(new SendPlayerIndex(other.getIndex()));
75 player.send(new SendString("", 51810));
76 player.send(new SendString("</col>Name: <col=FFB83F>" + other.getName(), 51807));
77 player.send(new SendString("</col>Rank: <col=FFB83F>" + PlayerRight.getCrown(other) + " " + other.right.getName(), 51808));
78 player.send(new SendString("</col>Level: <col=FFB83F>" + other.skills.getCombatLevel(), 51809));
79 player.send(new SendMessage("You are now viewing " + other.getName() + "'s profile."));
80 player.interfaceManager.open(51800);
81 }
val index

References com.runehive.game.world.entity.mob.player.Player.equals(), com.runehive.game.world.entity.skill.SkillManager.get(), com.runehive.game.world.entity.mob.player.Player.getCombat(), com.runehive.game.world.entity.skill.SkillManager.getCombatLevel(), com.runehive.game.world.entity.mob.player.PlayerRight.getCrown(), com.runehive.game.world.entity.Entity.getIndex(), com.runehive.game.world.entity.mob.player.Player.getName(), com.runehive.game.world.entity.mob.player.PlayerRight.getName(), com.runehive.game.world.entity.Entity.getPosition(), com.runehive.content.prestige.Prestige.getPrestigeColor(), com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.PlayerRight.isModerator(), com.runehive.game.world.position.Position.isWithinDistance(), com.runehive.game.world.entity.mob.player.Player.message(), com.runehive.game.world.entity.mob.player.InterfaceManager.open(), com.runehive.game.world.entity.mob.player.Player.prestige, com.runehive.game.world.entity.mob.player.Player.right, com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.game.world.entity.skill.Skill.SKILL_COUNT, and com.runehive.game.world.entity.mob.Mob.skills.

Referenced by com.runehive.game.plugin.PluginContext.onClick().

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

◆ string()

String[] com.runehive.content.ProfileViewer.string ( Player player)
static

Gets the main strings to display.

Definition at line 23 of file ProfileViewer.java.

23 {
24 return new String[]{
25 "Created: ", player.created,
26 "Total play time:", Utility.getTime(player.playTime),
27 "Networth:", "" + Utility.formatPrice(player.playerAssistant.networth()),
28 "Clan:", player.clanChannel == null ? "None" : player.clanChannel.getName(),
29 "Total level:", "" + Utility.formatDigits(player.skills.getTotalLevel()),
30 "Kills/Deaths/KDR", "" + player.kill + "/" + player.death + "/" + player.playerAssistant.kdr() + "",
31 "Current KC:", "" + player.killstreak.streak,
32 "Vote Points:", "" + Utility.formatDigits(player.votePoints),
33 "Total Votes:", "" + Utility.formatDigits(player.totalVotes),
34 "Skilling Points:", "" + Utility.formatDigits(player.skillingPoints),
35 "Mage's Arena Points:", "" + Utility.formatDigits(player.mageArenaPoints),
36 "Pest Control Points:", "" + Utility.formatDigits(player.pestPoints),
37 "Achievements Completed:", "" + AchievementHandler.getTotalCompleted(player) + "",
38 };
39 }

References com.runehive.game.world.entity.mob.player.Player.clanChannel, com.runehive.game.world.entity.mob.player.Player.created, com.runehive.util.Utility.formatDigits(), com.runehive.util.Utility.formatPrice(), com.runehive.content.clanchannel.channel.ClanChannel.getName(), com.runehive.util.Utility.getTime(), com.runehive.content.achievement.AchievementHandler.getTotalCompleted(), com.runehive.game.world.entity.skill.SkillManager.getTotalLevel(), com.runehive.game.world.entity.mob.player.PlayerAssistant.kdr(), com.runehive.game.world.entity.mob.player.Player.killstreak, com.runehive.game.world.entity.mob.player.Player.mageArenaPoints, com.runehive.game.world.entity.mob.player.PlayerAssistant.networth(), com.runehive.game.world.entity.mob.player.Player.pestPoints, com.runehive.game.world.entity.mob.player.Player.playerAssistant, com.runehive.game.world.entity.mob.player.Player.playTime, com.runehive.game.world.entity.mob.player.Player.skillingPoints, com.runehive.game.world.entity.mob.Mob.skills, com.runehive.content.combat.Killstreak.streak, com.runehive.game.world.entity.mob.player.Player.totalVotes, and com.runehive.game.world.entity.mob.player.Player.votePoints.

Here is the call graph for this function:

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