RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.shootingstar.ShootingStarAction Class Reference
Inheritance diagram for com.runehive.content.shootingstar.ShootingStarAction:
Collaboration diagram for com.runehive.content.shootingstar.ShootingStarAction:

Public Member Functions

String getName ()
 Gets the name of this action.
WalkablePolicy getWalkablePolicy ()
 Gets the WalkablePolicy of this action.
 ShootingStarAction (Player player, PickaxeData pickaxe, GameObject object)
Public Member Functions inherited from com.runehive.game.action.Action< T extends Mob >
 Action (T mob, int delay)
 Creates a new Action randomevent.
 Action (T mob, int delay, boolean instant)
 Creates a new Action randomevent.
boolean cancellableInProgress ()
getMob ()
 Gets the player.
boolean prioritized ()
 Determines if this action is prioritized.
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

boolean canSchedule ()
 A function executed on registration.
void execute ()
 A function representing the unit of work that will be carried out.
void onCancel (boolean logout)
 A function executed on cancellation.
void onSchedule ()
 A function executed on registration.
Protected Member Functions inherited from com.runehive.game.task.Task
void baseExecute ()

Private Member Functions

boolean mine ()

Private Attributes

GameObject object
PickaxeData pickaxe

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 12 of file ShootingStarAction.java.

Constructor & Destructor Documentation

◆ ShootingStarAction()

com.runehive.content.shootingstar.ShootingStarAction.ShootingStarAction ( Player player,
PickaxeData pickaxe,
GameObject object )

Definition at line 17 of file ShootingStarAction.java.

17 {
18 super(player, 3, false);
19 this.pickaxe = pickaxe;
20 this.object = object;
21 }

References object, and pickaxe.

Member Function Documentation

◆ canSchedule()

boolean com.runehive.content.shootingstar.ShootingStarAction.canSchedule ( )
protected

A function executed on registration.

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

Definition at line 34 of file ShootingStarAction.java.

34 {
35 return !getMob().skills.get(Skill.MINING).isDoingSkill();
36 }

References com.runehive.game.action.Action< T extends Mob >.getMob(), and com.runehive.game.world.entity.skill.Skill.MINING.

Here is the call graph for this function:

◆ execute()

void com.runehive.content.shootingstar.ShootingStarAction.execute ( )
protected

A function representing the unit of work that will be carried out.

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

Definition at line 50 of file ShootingStarAction.java.

50 {
51 if (!getMob().skills.get(Skill.MINING).isDoingSkill()) {
52 cancel();
53 return;
54 }
55
56 if (!mine()) {
57 cancel();
58 }
59 }

References com.runehive.game.task.Task.cancel(), com.runehive.game.action.Action< T extends Mob >.getMob(), mine(), and com.runehive.game.world.entity.skill.Skill.MINING.

Here is the call graph for this function:

◆ getName()

String com.runehive.content.shootingstar.ShootingStarAction.getName ( )

Gets the name of this action.

Returns
The name of this action.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 29 of file ShootingStarAction.java.

29 {
30 return "shooting-star-action";
31 }

◆ getWalkablePolicy()

WalkablePolicy com.runehive.content.shootingstar.ShootingStarAction.getWalkablePolicy ( )

Gets the WalkablePolicy of this action.

Returns
The walkable policy of this action.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 24 of file ShootingStarAction.java.

24 {
25 return WalkablePolicy.NON_WALKABLE;
26 }

References com.runehive.game.action.policy.WalkablePolicy.NON_WALKABLE.

◆ mine()

boolean com.runehive.content.shootingstar.ShootingStarAction.mine ( )
private

Definition at line 61 of file ShootingStarAction.java.

61 {
62 if (!getMob().inventory.hasCapacityFor(new Item(25527))) {
63 getMob().dialogueFactory.sendStatement("You can't carry anymore star dust.").execute();
64 return false;
65 }
66
67 getMob().animate(pickaxe.animation);
68
69 if (Mining.success(getMob(), ShootingStar.shootingStarData.getMiningLevel(), pickaxe)) {
70 if (object == null || !object.active()) {
71 return false;
72 }
73
74 if (ShootingStar.shootingStarData.availableDust <= 0) {
75 getMob().resetAnimation();
76 return false;
77 }
78
79 ShootingStar.shootingStarData.decreaseDust(getMob());
80 }
81 return true;
82 }

References com.runehive.content.shootingstar.ShootingStarData.availableDust, com.runehive.content.shootingstar.ShootingStarData.decreaseDust(), com.runehive.content.shootingstar.ShootingStarData.getMiningLevel(), com.runehive.game.action.Action< T extends Mob >.getMob(), pickaxe, com.runehive.content.shootingstar.ShootingStar.shootingStarData, and com.runehive.content.skill.impl.mining.Mining.success().

Referenced by execute().

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

◆ onCancel()

void com.runehive.content.shootingstar.ShootingStarAction.onCancel ( boolean logout)
protected

A function executed on cancellation.

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

Definition at line 44 of file ShootingStarAction.java.

44 {
45 getMob().resetFace();
46 getMob().skills.get(Skill.MINING).setDoingSkill(false);
47 }

References com.runehive.game.action.Action< T extends Mob >.getMob(), and com.runehive.game.world.entity.skill.Skill.MINING.

Here is the call graph for this function:

◆ onSchedule()

void com.runehive.content.shootingstar.ShootingStarAction.onSchedule ( )
protected

A function executed on registration.

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

Definition at line 39 of file ShootingStarAction.java.

39 {
40 getMob().animate(pickaxe.animation);
41 }

References com.runehive.game.action.Action< T extends Mob >.getMob(), and pickaxe.

Here is the call graph for this function:

Member Data Documentation

◆ object

GameObject com.runehive.content.shootingstar.ShootingStarAction.object
private

Definition at line 15 of file ShootingStarAction.java.

Referenced by ShootingStarAction().

◆ pickaxe

PickaxeData com.runehive.content.shootingstar.ShootingStarAction.pickaxe
private

Definition at line 14 of file ShootingStarAction.java.

Referenced by mine(), onSchedule(), and ShootingStarAction().


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