RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.task.impl.CeillingCollapseTask Class Reference
Inheritance diagram for com.runehive.game.task.impl.CeillingCollapseTask:
Collaboration diagram for com.runehive.game.task.impl.CeillingCollapseTask:

Public Member Functions

 CeillingCollapseTask (Player player)
Public Member Functions inherited from com.runehive.game.task.TickableTask
void execute ()
 A function representing the unit of work that will be carried out.
 TickableTask (boolean instant, int delay)
Public Member Functions inherited from com.runehive.game.task.Task
Task attach (Object newKey)
 Attaches a new key.
synchronized final void cancel ()
 Cancels all subsequent executions.
synchronized final void cancel (boolean logout)
 Cancels all subsequent executions.
boolean canRun ()
 Determines if the task can be ran.
Optional< Object > getAttachment ()
String getCreationStackTraceStr ()
int getDelay ()
Long getElapsedTimeFromRunStartTime ()
Optional< Long > getRunStartTime ()
long getTaskCreationTime ()
String getTaskId ()
boolean isInstant ()
boolean isRunning ()
void setDelay (int delay)
 Sets the cyclic delay.
void setExecutionTime ()
 Task (boolean instant, int delay)
 Creates a new Task.
 Task (int delay)
 Creates a new Task that doesn't execute instantly.

Protected Member Functions

void onCancel (boolean logout)
 A function executed on cancellation.
void onSchedule ()
 A function executed on registration.
void tick ()
Protected Member Functions inherited from com.runehive.game.task.Task
void baseExecute ()
boolean canSchedule ()
 A function executed on registration.

Private Attributes

final Player player

Additional Inherited Members

Package Functions inherited from com.runehive.game.task.Task
void onException (Exception e)
 A function executed on thrown exceptions.
void onLoop ()
 A function executed when iterated over.
final synchronized void process ()
synchronized void setRunning (boolean running)

Detailed Description

Definition at line 11 of file CeillingCollapseTask.java.

Constructor & Destructor Documentation

◆ CeillingCollapseTask()

com.runehive.game.task.impl.CeillingCollapseTask.CeillingCollapseTask ( Player player)

Definition at line 14 of file CeillingCollapseTask.java.

14 {
15 super(false, 6);
16 this.player = player;
17 }

References player.

Member Function Documentation

◆ onCancel()

void com.runehive.game.task.impl.CeillingCollapseTask.onCancel ( boolean logout)
protected

A function executed on cancellation.

Reimplemented from com.runehive.game.task.Task.

Definition at line 25 of file CeillingCollapseTask.java.

25 {
26 player.send(new SendCameraReset());
27 }

References player.

◆ onSchedule()

void com.runehive.game.task.impl.CeillingCollapseTask.onSchedule ( )
protected

A function executed on registration.

Reimplemented from com.runehive.game.task.Task.

Definition at line 20 of file CeillingCollapseTask.java.

20 {
21 player.send(new SendCameraShake(3, 2, 3, 2));
22 }

References player.

◆ tick()

void com.runehive.game.task.impl.CeillingCollapseTask.tick ( )
protected

Reimplemented from com.runehive.game.task.TickableTask.

Definition at line 30 of file CeillingCollapseTask.java.

30 {
31 if (!Area.inBarrowsChamber(player)) {
32 cancel();
33 return;
34 }
35 player.graphic(60);
36 player.speak("Ouch!");
37 player.damage(new Hit(Utility.random(5, 8)));
38 player.message("Some rocks fall from the ceiling and hit you.");
39 }

References com.runehive.game.task.Task.cancel(), com.runehive.game.world.position.Area.inBarrowsChamber(), player, and com.runehive.util.Utility.random().

Here is the call graph for this function:

Member Data Documentation

◆ player

final Player com.runehive.game.task.impl.CeillingCollapseTask.player
private

Definition at line 12 of file CeillingCollapseTask.java.

Referenced by CeillingCollapseTask(), onCancel(), onSchedule(), and tick().


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