RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.activity.inferno.Inferno Class Reference
Inheritance diagram for com.runehive.content.activity.inferno.Inferno:
Collaboration diagram for com.runehive.content.activity.inferno.Inferno:

Public Member Functions

boolean canTeleport (Player player)
 Called when the player attempts to teleport.
void cleanup ()
 Cleans up the activity when finished.
void finish ()
 Finishes the activity.
Optional<? extends ActivityListener<? extends Activity > > getListener ()
 Gets an Optional of the ActivityListener for this activity.
ActivityType getType ()
void onLogout (Player player)
 Called when the player logs out.
void onRegionChange (Player player)
 Called when the player changes region.
void update ()
 The update method.
Public Member Functions inherited from com.runehive.content.activity.Activity
 Activity (int cooldown, int instance)
 Constructs a new SequencedMinigame object.
void add (Mob mob)
 Adds a mob to the activity.
boolean canDrinkPotions (Player player)
boolean canEat (Player player, FoodData foodType)
boolean canEquipItem (Player player, Item item, EquipmentType type)
boolean canLogout (Player player)
boolean canSpellCast (Player player)
boolean canUsePrayer (Player player)
boolean canUseSpecial (Player player)
void cooldown (int cooldown)
 Applies a cooldown.
ActivityDeathType deathType ()
int getInstance ()
 Gets this activity's instance level.
Optional< Activity_PanelgetPanel ()
 Gets an optional of the activity panel.
int getTicks ()
 Gets the current ticks.
void onDeath (Mob mob)
 Called when the player die.
boolean onEvent (Player player, InteractionEvent interactionEvent)
boolean onStep (Mob mob)
void remove (Mob mob)
 Removes a mob from the activity.
void removeAll (Mob... mobs)
 Removes all mobs from the activity.
void sequence ()
 Sequences the activity.
void setInstance (int instance)
void setPanel (Activity_Panel panel)
 Sets the activity panel.
void setPause (boolean pause)
 Sets the pause state of the activity.

Static Public Member Functions

static Inferno create (Player player)
static void finalWave ()
Static Public Member Functions inherited from com.runehive.content.activity.Activity
static boolean evaluate (Mob mob, Predicate< Activity > predicate)
static void forActivity (Mob mob, Consumer< Activity > consumer)
static< T extends Activity > Optional< T > search (Player player, Class< T > clazz)

Public Attributes

final Set< Npcnpcs = new HashSet<>()
 A set of npcs in this activity.

Protected Member Functions

void start ()
 Starts the next activity stage.
Protected Member Functions inherited from com.runehive.content.activity.Activity
boolean clickButton (Player player, ClickButtonInteractionEvent event)
boolean clickItem (Player player, ItemInteractionEvent event)
boolean clickNpc (Player player, NpcInteractionEvent event)
boolean clickObject (Player player, ObjectInteractionEvent event)
final void finishCooldown ()
 Sets the cooldown flag to FINISH.
final boolean isPaused ()
 Checks if the cooldown is paused.
boolean itemContainerAction (Player player, ItemContainerInteractionEvent event)
final void pause ()
 Sets the cooldown flag to PAUSE.
boolean pickupItem (Player player, PickupItemInteractionEvent event)
final void resetCooldown ()
 Resets the remaining ticks to the cached cooldown ticks.
void restart (int delay, Runnable runnable)
boolean useItem (Player player, ItemOnItemInteractionEvent event)
boolean useItem (Player player, ItemOnObjectInteractionEvent event)

Package Functions

void handleDeath (Mob dead)
 Handles what happens to a mob when they die in the activity.

Private Member Functions

 Inferno (Player player, int instance)
 Constructs a new Inferno object for a player and an instance.

Private Attributes

boolean completed
 The activity completed flag.
final InfernoCavesListener listener = new InfernoCavesListener(this)
 The combat listener to add for all mobs.
final Player player
 The player in the Inferno.
int rewards
 The amount of rewards the player has acquired.
long time
 The time it took to complete the activity.
InfernoWaveData.WaveData wave = InfernoWaveData.WaveData.WAVE_1
 The current wave of this activity.

Additional Inherited Members

Static Protected Attributes inherited from com.runehive.content.activity.Activity
static final int FINISH = -1
 The 'finish' cooldown id.
static final int PAUSE = -2
 The 'pause' cooldown id.
static final int START = 0
 The 'start' cooldown id.

Detailed Description

Definition at line 26 of file Inferno.java.

Constructor & Destructor Documentation

◆ Inferno()

com.runehive.content.activity.inferno.Inferno.Inferno ( Player player,
int instance )
private

Constructs a new Inferno object for a player and an instance.

Definition at line 53 of file Inferno.java.

53 {
54 super(10, instance);
55 this.player = player;
56 }

References com.runehive.content.activity.Activity.instance, and player.

Referenced by create().

Here is the caller graph for this function:

Member Function Documentation

◆ canTeleport()

boolean com.runehive.content.activity.inferno.Inferno.canTeleport ( Player player)

Called when the player attempts to teleport.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 203 of file Inferno.java.

203 {
204 return true;
205 }

References player.

◆ cleanup()

void com.runehive.content.activity.inferno.Inferno.cleanup ( )

Cleans up the activity when finished.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 179 of file Inferno.java.

179 {
180 ActivityPanel.clear(player);
181 if (!npcs.isEmpty())
182 npcs.forEach(this::remove);
183 }

References com.runehive.content.activity.panel.ActivityPanel.clear(), npcs, and player.

Referenced by finish(), and onRegionChange().

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

◆ create()

Inferno com.runehive.content.activity.inferno.Inferno.create ( Player player)
static

Definition at line 58 of file Inferno.java.

58 {
59 Inferno minigame = new Inferno(player, player.playerAssistant.instance());
60 player.move(new Position(2273, 5341, player.getHeight()));
61 ActivityPanel.update(player, -1, "Inferno", "Activity Completion:", "Good Luck, " + player.getName() + "!");
62 player.dialogueFactory.sendNpcChat(5567, "Welcome to the Inferno, #name.",
63 "There are a total of 69 waves, TzKal-Zuk being the last.",
64 "Use your activity panel (bottom left tab) for wave information.", "Good luck!").execute();
65 minigame.time = System.currentTimeMillis();
66 minigame.add(player);
67 minigame.resetCooldown();
68 return minigame;
69 }

References com.runehive.content.activity.Activity.add(), Inferno(), player, com.runehive.content.activity.Activity.resetCooldown(), and com.runehive.content.activity.panel.ActivityPanel.update().

Referenced by com.runehive.content.teleport.TeleportHandler.teleport().

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

◆ finalWave()

void com.runehive.content.activity.inferno.Inferno.finalWave ( )
static

Definition at line 143 of file Inferno.java.

143 {
144 final int BOSS_ID;
145 InfernoWaveData.WaveData wavee = InfernoWaveData.WaveData.WAVE_69;
146 }

References com.runehive.content.activity.inferno.InfernoWaveData.WaveData.WAVE_69.

◆ finish()

void com.runehive.content.activity.inferno.Inferno.finish ( )

Finishes the activity.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 149 of file Inferno.java.

149 {
150 cleanup();
151 remove(player);
152 player.move(new Position(3086, 3501, 0));
153
154 if (completed) {
155 player.dialogueFactory.sendNpcChat(5567, "You have defeated Inferno, I am most impressed!",
156 "Please accept this gift, young thug.").execute();
157 rewards += 10000;
158 player.inventory.addOrDrop(new Item(7775, rewards));
159 player.message("<img=9>You now have @red@" + rewards + " Inferno Tickets!");
160 if (Utility.random(1, 3) == 3) {
161 player.inventory.addOrDrop(new Item(20211));
162 }
163 player.inventory.addOrDrop(new Item(290));
164 Pets.onReward(player, PetData.PIRATE_PETE);
165 player.send(new SendMessage(
166 "You have completed the Inferno activity. Final time: @red@" + Utility.getTime(time) + "</col>."));
167 player.activityLogger.add(ActivityLog.INFERNO);
168 return;
169 }
170
171 if (rewards <= 0)
172 rewards = 1;
173 player.inventory.addOrDrop(new Item(7775, rewards));
174 player.message("<img=9>You now have @red@" + rewards + " Inferno Tickets!");
175 player.dialogueFactory.sendNpcChat(5567, "Better luck next time!", "Take these points as a reward.").execute();
176 }

References cleanup(), completed, com.runehive.util.Utility.getTime(), com.runehive.content.ActivityLog.INFERNO, com.runehive.content.pet.Pets.onReward(), com.runehive.content.pet.PetData.PIRATE_PETE, player, com.runehive.util.Utility.random(), rewards, and time.

Referenced by handleDeath(), onLogout(), and start().

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

◆ getListener()

Optional<? extends ActivityListener<? extends Activity > > com.runehive.content.activity.inferno.Inferno.getListener ( )

Gets an Optional of the ActivityListener for this activity.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 228 of file Inferno.java.

228 {
229 return Optional.of(listener);
230 }

References listener.

◆ getType()

ActivityType com.runehive.content.activity.inferno.Inferno.getType ( )

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 223 of file Inferno.java.

223 {
224 return ActivityType.INFERNO;
225 }

References com.runehive.content.activity.ActivityType.INFERNO.

◆ handleDeath()

void com.runehive.content.activity.inferno.Inferno.handleDeath ( Mob dead)
package

Handles what happens to a mob when they die in the activity.

Definition at line 72 of file Inferno.java.

72 {
73 if (dead.isPlayer() && dead.equals(player)) {
74 finish();
75 return;
76 }
77 if (dead.isNpc() && npcs.contains(dead)) {
78 if (dead.id == 3162) {
79 remove(dead);
80 npcs.remove(dead);
81 for (int index = 0; index < 2; index++) {
82 Position position = new Position(dead.getX() + (index == 0 ? -1 : +1), dead.getY(),
83 dead.getHeight());
84 Npc roc = new Npc(763, position);
85 add(roc);
86 npcs.add(roc);
87 roc.getCombat().attack(player);
88 dead.animate(Animation.RESET, true);
89 dead.graphic(Graphic.RESET, true);
90 }
91 return;
92 }
93
94 npcs.remove(dead);
95 remove(dead);
96 rewards += Utility.random(250, 1000);
97 if (npcs.isEmpty()) {
98 wave = InfernoWaveData.WaveData.getNext(wave.ordinal());
99 if (wave == null) {
100 completed = true;
101 player.send(new SendMessage("You have finished the activity!"));
102 } else {
103 player.send(new SendMessage("The next wave will commence soon."));
104 }
105 resetCooldown();
106 return;
107 }
108 }
109 }
val index

References com.runehive.content.activity.Activity.add(), com.runehive.game.world.entity.mob.Mob.animate(), completed, com.runehive.game.world.entity.Entity.equals(), finish(), com.runehive.game.world.entity.mob.npc.Npc.getCombat(), com.runehive.game.world.entity.Entity.getHeight(), com.runehive.content.activity.inferno.InfernoWaveData.WaveData.getNext(), com.runehive.game.world.entity.Entity.getX(), com.runehive.game.world.entity.Entity.getY(), com.runehive.game.world.entity.mob.Mob.graphic, com.runehive.game.world.entity.mob.Mob.id, com.runehive.game.world.entity.mob.Mob.isNpc(), com.runehive.game.world.entity.mob.Mob.isPlayer(), npcs, player, com.runehive.util.Utility.random(), com.runehive.game.Animation.RESET, com.runehive.game.Graphic.RESET, com.runehive.content.activity.Activity.resetCooldown(), rewards, and wave.

Here is the call graph for this function:

◆ onLogout()

void com.runehive.content.activity.inferno.Inferno.onLogout ( Player player)

Called when the player logs out.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 217 of file Inferno.java.

217 {
218 finish();
219 remove(player);
220 }

References finish(), and player.

Here is the call graph for this function:

◆ onRegionChange()

void com.runehive.content.activity.inferno.Inferno.onRegionChange ( Player player)

Called when the player changes region.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 208 of file Inferno.java.

208 {
209 if (!Area.inInferno(player)) {
210 cleanup();
211 remove(player);
212 player.send(new SendMessage("You have lost your current progress as you have teleported."));
213 }
214 }

References cleanup(), com.runehive.game.world.position.Area.inInferno(), and player.

Here is the call graph for this function:

◆ start()

void com.runehive.content.activity.inferno.Inferno.start ( )
protected

Starts the next activity stage.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 112 of file Inferno.java.

112 {
113 if (wave == null) {
114 finish();
115 return;
116 }
117 if (player.locking.locked()) {
118 return;
119 }
120
121 Position spawn = new Position(2273, 5337, player.getHeight());
122 Position[] boundaries = Utility.getInnerBoundaries(spawn, Utility.random(1, 8), Utility.random(1, 8));
123
124 for (int id : wave.getMonster()) {
125 Npc npc = new Npc(id, RandomUtils.random(boundaries));
126 npc.owner = player;
127 add(npc);
128 npcs.add(npc);
129 npc.getCombat().attack(player);
130 npc.face(player);
131 npc.attack(player);
132 player.face(npc.getPosition());
133 npc.locking.unlock();
134 // pause();
135
136 }
137 if (wave == InfernoWaveData.WaveData.WAVE_69) {
138 player.message("WAVE 69 is here!!");
139 }
140 pause();
141 }

References com.runehive.content.activity.Activity.add(), com.runehive.game.world.entity.mob.Mob.attack(), com.runehive.game.world.entity.mob.Mob.face(), finish(), com.runehive.game.world.entity.mob.npc.Npc.getCombat(), com.runehive.util.Utility.getInnerBoundaries(), com.runehive.game.world.entity.Entity.getPosition(), com.runehive.game.world.entity.mob.Mob.locking, npcs, com.runehive.content.activity.Activity.pause(), player, com.runehive.util.RandomUtils.random(), com.runehive.util.Utility.random(), com.runehive.game.world.entity.mob.Locking.unlock(), wave, and com.runehive.content.activity.inferno.InfernoWaveData.WaveData.WAVE_69.

Here is the call graph for this function:

◆ update()

void com.runehive.content.activity.inferno.Inferno.update ( )

The update method.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 186 of file Inferno.java.

186 {
187 if (wave == null) {
188 ActivityPanel.update(player, 100, "Inferno", new Item(21295), "Congratulations, you have",
189 "completed the Inferno", "activity!");
190 return;
191 }
192 int progress = (int) Utility.getPercentageAmount(wave.ordinal() + 1, InfernoWaveData.WaveData.values().length);
193 if (progress >= 100 && !completed)
194 progress = 99;
195 ActivityPanel.update(player, progress, "Inferno", new Item(22325),
196 "</col>Wave: <col=FF5500>" + (wave.ordinal() + 1) + "/" + (InfernoWaveData.WaveData.values().length),
197 "</col>Monsters Left: <col=FF5500>" + npcs.size(),
198 "</col>Points Gained: <col=FF5500>" + Utility.formatDigits(rewards),
199 "</col>Time: <col=FF5500>" + Utility.getTime());
200 }

References completed, com.runehive.util.Utility.formatDigits(), com.runehive.util.Utility.getPercentageAmount(), com.runehive.util.Utility.getTime(), npcs, player, rewards, com.runehive.content.activity.panel.ActivityPanel.update(), and wave.

Here is the call graph for this function:

Member Data Documentation

◆ completed

boolean com.runehive.content.activity.inferno.Inferno.completed
private

The activity completed flag.

Definition at line 32 of file Inferno.java.

Referenced by finish(), handleDeath(), and update().

◆ listener

final InfernoCavesListener com.runehive.content.activity.inferno.Inferno.listener = new InfernoCavesListener(this)
private

The combat listener to add for all mobs.

Definition at line 47 of file Inferno.java.

Referenced by getListener().

◆ npcs

final Set<Npc> com.runehive.content.activity.inferno.Inferno.npcs = new HashSet<>()

A set of npcs in this activity.

Definition at line 41 of file Inferno.java.

Referenced by cleanup(), handleDeath(), start(), and update().

◆ player

final Player com.runehive.content.activity.inferno.Inferno.player
private

The player in the Inferno.

Definition at line 29 of file Inferno.java.

Referenced by canTeleport(), cleanup(), create(), finish(), handleDeath(), Inferno(), onLogout(), onRegionChange(), start(), and update().

◆ rewards

int com.runehive.content.activity.inferno.Inferno.rewards
private

The amount of rewards the player has acquired.

Definition at line 38 of file Inferno.java.

Referenced by finish(), handleDeath(), and update().

◆ time

long com.runehive.content.activity.inferno.Inferno.time
private

The time it took to complete the activity.

Definition at line 35 of file Inferno.java.

Referenced by finish().

◆ wave

InfernoWaveData.WaveData com.runehive.content.activity.inferno.Inferno.wave = InfernoWaveData.WaveData.WAVE_1
private

The current wave of this activity.

Definition at line 44 of file Inferno.java.

Referenced by handleDeath(), start(), and update().


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