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

Public Member Functions

Optional< SkillAnimationanimation ()
 The skill animation to execute.
boolean canInit ()
 Determines if this action can be initialized.
double experience ()
 The experience given from this action.
String getName ()
 Gets the name of this action.
WalkablePolicy getWalkablePolicy ()
 Gets the WalkablePolicy of this action.
void init ()
 Any functionality that should be handled when this action is submitted.
void onCancel (boolean logout)
 A function executed on cancellation.
void onExecute ()
 The method which is called on intervals of the specified #delay;.
boolean prioritized ()
 Determines if this action is prioritized.
 ScatterAshAction (Player player, AshData ashes, int slot)
int skill ()
 The skill we should hand to experience to.
Public Member Functions inherited from com.runehive.content.skill.SkillAction
boolean ignore ()
 Determines if future skill actions from the same type should be ignored.
 SkillAction (Mob mob, Optional< Position > position, boolean instant)
 Creates a new Action randomevent.
 SkillAction (Mob mob, Optional< Position > position, int delay, boolean instant)
 Creates a new Action randomevent.
final void start ()
 Attempts to start the skill.
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.
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.

Private Attributes

final AshData ashes
final Item item
final int slot

Additional Inherited Members

Protected Member Functions inherited from com.runehive.content.skill.SkillAction
final void execute ()
 A function representing the unit of work that will be carried out.
final void onSchedule ()
 A function executed on registration.
Protected Member Functions inherited from com.runehive.game.task.Task
void baseExecute ()
boolean canSchedule ()
 A function executed on registration.
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 19 of file ScatterAshAction.java.

Constructor & Destructor Documentation

◆ ScatterAshAction()

com.runehive.game.action.impl.ScatterAshAction.ScatterAshAction ( Player player,
AshData ashes,
int slot )

Definition at line 24 of file ScatterAshAction.java.

24 {
25 super(player, Optional.empty(), true);
26 this.slot = slot;
27 this.ashes = ashes;
28 this.item = player.inventory.get(slot);
29 }

References ashes, com.runehive.game.world.items.containers.ItemContainer.get(), and com.runehive.game.world.entity.mob.player.Player.inventory.

Here is the call graph for this function:

Member Function Documentation

◆ animation()

Optional< SkillAnimation > com.runehive.game.action.impl.ScatterAshAction.animation ( )

The skill animation to execute.

Returns
the skill animation to execute.

Reimplemented from com.runehive.content.skill.SkillAction.

Definition at line 58 of file ScatterAshAction.java.

58 {
59 return Optional.empty();
60 }

◆ canInit()

boolean com.runehive.game.action.impl.ScatterAshAction.canInit ( )

Determines if this action can be initialized.

Returns
true if it can, false otherwise.

Reimplemented from com.runehive.content.skill.SkillAction.

Definition at line 32 of file ScatterAshAction.java.

32 {
33 return getMob().skills.getSkills()[skill()].stopwatch.elapsed(1200);
34 }

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

Here is the call graph for this function:

◆ experience()

double com.runehive.game.action.impl.ScatterAshAction.experience ( )

The experience given from this action.

Returns
the numerical value representing the amount of experience given.

Reimplemented from com.runehive.content.skill.SkillAction.

Definition at line 63 of file ScatterAshAction.java.

63 {
64 double exp = (ashes.getExperience() * Config.PRAYER_MODIFICATION);
65 if (SkillCape.isEquipped(getMob().getPlayer(), SkillCape.PRAYER)) {
66 exp *= 2.0;
67 }
68 return exp;
69 }

References ashes, com.runehive.game.action.Action< T extends Mob >.getMob(), com.runehive.content.skillcape.SkillCape.isEquipped(), com.runehive.content.skillcape.SkillCape.PRAYER, and com.runehive.Config.PRAYER_MODIFICATION.

Referenced by onExecute().

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

◆ getName()

String com.runehive.game.action.impl.ScatterAshAction.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 77 of file ScatterAshAction.java.

77 {
78 return "Ash scatter";
79 }

◆ getWalkablePolicy()

WalkablePolicy com.runehive.game.action.impl.ScatterAshAction.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 87 of file ScatterAshAction.java.

87 {
88 return WalkablePolicy.NON_WALKABLE;
89 }

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

◆ init()

void com.runehive.game.action.impl.ScatterAshAction.init ( )

Any functionality that should be handled when this action is submitted.

Reimplemented from com.runehive.content.skill.SkillAction.

Definition at line 37 of file ScatterAshAction.java.

37 {
38
39 }

◆ onCancel()

void com.runehive.game.action.impl.ScatterAshAction.onCancel ( boolean logout)

A function executed on cancellation.

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

Definition at line 53 of file ScatterAshAction.java.

53 {
54 getMob().skills.getSkills()[skill()].stopwatch.reset();
55 }

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

Here is the call graph for this function:

◆ onExecute()

void com.runehive.game.action.impl.ScatterAshAction.onExecute ( )

The method which is called on intervals of the specified #delay;.

Reimplemented from com.runehive.content.skill.SkillAction.

Definition at line 42 of file ScatterAshAction.java.

42 {
43 getMob().animate(new Animation(2295));
44 Player player = getMob().getPlayer();
45 player.inventory.remove(item, slot, true);
46 player.skills.addExperience(skill(), experience());
47 player.send(new SendMessage("You scatter the ashes."));
48
49 cancel();
50 }

References com.runehive.game.world.entity.skill.SkillManager.addExperience(), com.runehive.game.task.Task.cancel(), experience(), com.runehive.game.action.Action< T extends Mob >.getMob(), com.runehive.game.world.entity.mob.Mob.getPlayer(), com.runehive.game.world.entity.mob.player.Player.inventory, item, com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.game.world.entity.mob.player.Player.send(), skill(), and com.runehive.game.world.entity.mob.Mob.skills.

Here is the call graph for this function:

◆ prioritized()

boolean com.runehive.game.action.impl.ScatterAshAction.prioritized ( )

Determines if this action is prioritized.

When making an action prioritized, the next action will be ignored if not queued.

Returns
true if this action is prioritized, false otherwise.

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

Definition at line 82 of file ScatterAshAction.java.

82 {
83 return false;
84 }

◆ skill()

int com.runehive.game.action.impl.ScatterAshAction.skill ( )

The skill we should hand to experience to.

Reimplemented from com.runehive.content.skill.SkillAction.

Definition at line 72 of file ScatterAshAction.java.

72 {
73 return Skill.PRAYER;
74 }

References com.runehive.game.world.entity.skill.Skill.PRAYER.

Referenced by canInit(), onCancel(), and onExecute().

Here is the caller graph for this function:

Member Data Documentation

◆ ashes

final AshData com.runehive.game.action.impl.ScatterAshAction.ashes
private

Definition at line 22 of file ScatterAshAction.java.

Referenced by experience(), and ScatterAshAction().

◆ item

final Item com.runehive.game.action.impl.ScatterAshAction.item
private

Definition at line 21 of file ScatterAshAction.java.

Referenced by onExecute().

◆ slot

final int com.runehive.game.action.impl.ScatterAshAction.slot
private

Definition at line 20 of file ScatterAshAction.java.


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