RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.wintertodt.actions.FletchKindling Class Reference
Inheritance diagram for com.runehive.content.wintertodt.actions.FletchKindling:
Collaboration diagram for com.runehive.content.wintertodt.actions.FletchKindling:

Public Member Functions

 FletchKindling (Player player, int amount)
Public Member Functions inherited from com.runehive.content.wintertodt.WintertodtAction
String getName ()
 Gets the name of this action.
WalkablePolicy getWalkablePolicy ()
 Gets the WalkablePolicy of this action.
 WintertodtAction (Player player)
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

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

Package Attributes

int amount
int tick

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 10 of file FletchKindling.java.

Constructor & Destructor Documentation

◆ FletchKindling()

com.runehive.content.wintertodt.actions.FletchKindling.FletchKindling ( Player player,
int amount )

Definition at line 14 of file FletchKindling.java.

14 {
15 super(player);
16 this.amount = amount;
17 }

References amount.

Member Function Documentation

◆ execute()

void com.runehive.content.wintertodt.actions.FletchKindling.execute ( )
protected

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

Reimplemented from com.runehive.content.wintertodt.WintertodtAction.

Definition at line 20 of file FletchKindling.java.

20 {
21
22 if(!getMob().inventory.contains(Wintertodt.BRUMA_ROOT)) {
23 getMob().animate(65535);
24 getMob().action.getCurrentAction().cancel();
25 return;
26 }
27
28 if(tick % 3 == 0) {
29 getMob().animate(1248);
30
31 getMob().inventory.remove(new Item(Wintertodt.BRUMA_ROOT));
32 getMob().inventory.add(new Item(Wintertodt.BRUMA_KINDLING));
33 getMob().inventory.refresh();
34 double xp = Skill.getLevelForExperience(getMob().skills.get(Skill.FLETCHING).getExperience()) * 0.6;
35 if(xp > 0) getMob().skills.addExperience(Skill.FLETCHING, xp * Config.FLETCHING_MODIFICATION);
36
37 amount--;
38 if(amount <= 0) {
39 getMob().animate(65535);
40 getMob().action.getCurrentAction().cancel();
41 return;
42 }
43 }
44 tick++;
45 }

References amount, com.runehive.content.wintertodt.Wintertodt.BRUMA_KINDLING, com.runehive.content.wintertodt.Wintertodt.BRUMA_ROOT, com.runehive.game.world.entity.skill.Skill.FLETCHING, com.runehive.Config.FLETCHING_MODIFICATION, com.runehive.game.world.entity.skill.Skill.getLevelForExperience(), com.runehive.game.action.Action< T extends Mob >.getMob(), and tick.

Here is the call graph for this function:

Member Data Documentation

◆ amount

int com.runehive.content.wintertodt.actions.FletchKindling.amount
package

Definition at line 12 of file FletchKindling.java.

Referenced by execute(), and FletchKindling().

◆ tick

int com.runehive.content.wintertodt.actions.FletchKindling.tick
package

Definition at line 12 of file FletchKindling.java.

Referenced by execute().


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