RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.combat.Killstreak Class Reference
Collaboration diagram for com.runehive.content.combat.Killstreak:

Public Member Functions

void add ()
void end (Player killer)
 Killstreak (Player player)
void reward ()

Public Attributes

int streak

Private Member Functions

void announce ()
boolean announcementNeeded ()

Private Attributes

final Player player

Detailed Description

Definition at line 11 of file Killstreak.java.

Constructor & Destructor Documentation

◆ Killstreak()

com.runehive.content.combat.Killstreak.Killstreak ( Player player)

Definition at line 15 of file Killstreak.java.

15 {
16 this.player = player;
17 }

References player.

Member Function Documentation

◆ add()

void com.runehive.content.combat.Killstreak.add ( )

Definition at line 19 of file Killstreak.java.

19 {
20 streak++;
21
22 if (announcementNeeded()) {
23 reward();
24 announce();
25 }
26 }

References announce(), announcementNeeded(), reward(), and streak.

Referenced by com.runehive.game.world.entity.mob.player.PlayerKilling.handle().

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

◆ announce()

void com.runehive.content.combat.Killstreak.announce ( )
private

Definition at line 47 of file Killstreak.java.

47 {
48 String icon = "<icon=0>";
49 String name = PlayerRight.getCrown(player) + " " + player.getName();
50 int bounty = streak * 150;
51 World.sendMessage("<col=FF0000>" + icon + " " + name + " </col>is now on a killstreak of <col=FF0000>" + streak + "</col>. Bounty: <col=FF0000>" + Utility.formatDigits(bounty) + "</col> BM.");
52
53 if (streak == 5) {
54 AchievementHandler.activate(player, AchievementKey.KILLSTKREAK_5);
55 } else if (streak == 10) {
56 AchievementHandler.activate(player, AchievementKey.KILLSTKREAK_10);
57 } else if (streak == 15) {
58 AchievementHandler.activate(player, AchievementKey.KILLSTKREAK_15);
59 } else if (streak == 25) {
60 AchievementHandler.activate(player, AchievementKey.KILLSTKREAK_25);
61 }
62 }

References com.runehive.content.achievement.AchievementHandler.activate(), com.runehive.util.Utility.formatDigits(), com.runehive.game.world.entity.mob.player.PlayerRight.getCrown(), com.runehive.content.achievement.AchievementKey.KILLSTKREAK_10, com.runehive.content.achievement.AchievementKey.KILLSTKREAK_15, com.runehive.content.achievement.AchievementKey.KILLSTKREAK_25, com.runehive.content.achievement.AchievementKey.KILLSTKREAK_5, player, com.runehive.game.world.World.sendMessage(), and streak.

Referenced by add().

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

◆ announcementNeeded()

boolean com.runehive.content.combat.Killstreak.announcementNeeded ( )
private

Definition at line 64 of file Killstreak.java.

64 {
65 return streak >= 5;
66 }

References streak.

Referenced by add(), and end().

Here is the caller graph for this function:

◆ end()

void com.runehive.content.combat.Killstreak.end ( Player killer)

Definition at line 28 of file Killstreak.java.

28 {
29 if (announcementNeeded()) {
30 String icon = "<icon=0>";
31 String name = PlayerRight.getCrown(player) + " " + player.getName();
32 int bounty = streak * 150;
33 World.sendMessage("" + icon + " <col=FF0000>" + name + "</col> has lost their kill streak of <col=FF0000>" + streak + "</col> to <col=FF0000>" + killer.getName() + "</col>!");
34 killer.inventory.addOrDrop(new Item(13307, bounty));
35 killer.message("You were rewarded with " + Utility.formatDigits(bounty) + " blood money for claiming " + player.getName() + "'s bounty!");
36 }
37
38 streak = 0;
39 }

References com.runehive.game.world.items.containers.inventory.Inventory.addOrDrop(), announcementNeeded(), com.runehive.util.Utility.formatDigits(), com.runehive.game.world.entity.mob.player.PlayerRight.getCrown(), com.runehive.game.world.entity.mob.player.Player.getName(), com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.entity.mob.player.Player.message(), player, com.runehive.game.world.World.sendMessage(), and streak.

Here is the call graph for this function:

◆ reward()

void com.runehive.content.combat.Killstreak.reward ( )

Definition at line 41 of file Killstreak.java.

41 {
42 int bm = streak * 500;
43 player.inventory.addOrDrop(new Item(13307, bm));
44 player.message("<col=FF0000>You are rewarded with " + Utility.formatDigits(bm) + " blood money.");
45 }

References com.runehive.util.Utility.formatDigits(), player, and streak.

Referenced by add().

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

Member Data Documentation

◆ player

final Player com.runehive.content.combat.Killstreak.player
private

Definition at line 12 of file Killstreak.java.

Referenced by announce(), end(), Killstreak(), and reward().

◆ streak

int com.runehive.content.combat.Killstreak.streak

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