|
RuneHive-Game
|
Holds functionality for skills such as woodcutting and mining. More...
Classes | |
| enum | DoubleReward |
| The double onReward types. More... | |
Public Member Functions | |
| final boolean | canRun () |
| Determines if the task can be ran. | |
| DoubleReward | doubleReward () |
| If mob will get a double onReward. | |
| WalkablePolicy | getWalkablePolicy () |
| Gets the WalkablePolicy of this action. | |
| HarvestingSkillAction (Mob mob, Optional< Position > position, boolean instant) | |
Creates a new Action randomevent. | |
| HarvestingSkillAction (Mob mob, Optional< Position > position, int delay, boolean instant) | |
Creates a new Action randomevent. | |
| abstract Item[] | harvestItems () |
| The items to be harvested upon a successful harvest. | |
| void | onExecute () |
The method which is called on intervals of the specified #delay;. | |
| void | onHarvest (Item[] items, boolean success) |
| The method executed upon harvest of the items. | |
| boolean | prioritized () |
| Determines if this action is prioritized. | |
| abstract Optional< Item[]> | removeItems () |
| The items to be removed upon a successful harvest. | |
| abstract double | successFactor () |
| The success factor for the harvest. | |
| Public Member Functions inherited from com.runehive.content.skill.SkillAction | |
| abstract Optional< SkillAnimation > | animation () |
| The skill animation to execute. | |
| abstract boolean | canInit () |
| Determines if this action can be initialized. | |
| abstract double | experience () |
| The experience given from this action. | |
| boolean | ignore () |
| Determines if future skill actions from the same type should be ignored. | |
| abstract void | init () |
| Any functionality that should be handled when this action is submitted. | |
| abstract int | skill () |
| The skill we should hand to experience to. | |
| 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 () |
| T | getMob () |
| Gets the player. | |
| abstract String | getName () |
| Gets the name of this action. | |
| 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. | |
| 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 RandomGen | random = new RandomGen() |
| The random generator instance that will generate random numbers. | |
Static Private Attributes | |
| static final int | SUCCESS_FACTOR = 10 |
| The factor boost that determines the success rate for harvesting based on skill level. | |
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. | |
| void | onCancel (boolean logout) |
| A function executed on cancellation. | |
| 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) |
Holds functionality for skills such as woodcutting and mining.
Definition at line 23 of file HarvestingSkillAction.java.
| com.runehive.content.skill.impl.HarvestingSkillAction.HarvestingSkillAction | ( | Mob | mob, |
| Optional< Position > | position, | ||
| boolean | instant ) |
Creates a new Action randomevent.
Definition at line 52 of file HarvestingSkillAction.java.
References com.runehive.game.task.Task.instant, com.runehive.game.action.Action< T extends Mob >.mob, and com.runehive.content.skill.SkillAction.position.
| com.runehive.content.skill.impl.HarvestingSkillAction.HarvestingSkillAction | ( | Mob | mob, |
| Optional< Position > | position, | ||
| int | delay, | ||
| boolean | instant ) |
Creates a new Action randomevent.
Definition at line 64 of file HarvestingSkillAction.java.
References com.runehive.game.task.Task.delay, com.runehive.game.task.Task.instant, com.runehive.game.action.Action< T extends Mob >.mob, and com.runehive.content.skill.SkillAction.position.
| final boolean com.runehive.content.skill.impl.HarvestingSkillAction.canRun | ( | ) |
Determines if the task can be ran.
Reimplemented from com.runehive.game.task.Task.
Definition at line 110 of file HarvestingSkillAction.java.
References com.runehive.util.StringUtils.appendIndefiniteArticle(), com.runehive.game.world.items.containers.ItemContainer.contains(), com.runehive.game.world.items.containers.ItemContainer.containsAll(), com.runehive.game.action.Action< T extends Mob >.getMob(), com.runehive.game.world.items.Item.getName(), com.runehive.game.world.entity.mob.Mob.getPlayer(), com.runehive.game.world.entity.mob.player.Player.inventory, removeItems(), and com.runehive.game.world.entity.mob.player.Player.send().
| DoubleReward com.runehive.content.skill.impl.HarvestingSkillAction.doubleReward | ( | ) |
If mob will get a double onReward.
Definition at line 83 of file HarvestingSkillAction.java.
References com.runehive.content.skill.impl.HarvestingSkillAction.DoubleReward.NONE.
Referenced by onExecute().
| WalkablePolicy com.runehive.content.skill.impl.HarvestingSkillAction.getWalkablePolicy | ( | ) |
Gets the WalkablePolicy of this action.
Reimplemented from com.runehive.game.action.Action< T extends Mob >.
Definition at line 183 of file HarvestingSkillAction.java.
References com.runehive.game.action.policy.WalkablePolicy.NON_WALKABLE.
|
abstract |
The items to be harvested upon a successful harvest.
Referenced by onExecute().
| void com.runehive.content.skill.impl.HarvestingSkillAction.onExecute | ( | ) |
The method which is called on intervals of the specified #delay;.
Reimplemented from com.runehive.content.skill.SkillAction.
Definition at line 135 of file HarvestingSkillAction.java.
References com.runehive.content.skill.impl.HarvestingSkillAction.DoubleReward.ALL, doubleReward(), com.runehive.content.skill.impl.HarvestingSkillAction.DoubleReward.EXPERIENCE, com.runehive.content.skill.SkillAction.experience(), com.runehive.game.action.Action< T extends Mob >.getMob(), harvestItems(), com.runehive.content.skill.impl.HarvestingSkillAction.DoubleReward.ITEM, onHarvest(), random, removeItems(), com.runehive.content.skill.SkillAction.skill(), SUCCESS_FACTOR, and successFactor().
| void com.runehive.content.skill.impl.HarvestingSkillAction.onHarvest | ( | Item[] | items, |
| boolean | success ) |
The method executed upon harvest of the items.
| items | the items being harvested. |
| success | determines if the harvest was successful or not. |
Definition at line 74 of file HarvestingSkillAction.java.
Referenced by onExecute().
| boolean com.runehive.content.skill.impl.HarvestingSkillAction.prioritized | ( | ) |
Determines if this action is prioritized.
When making an action prioritized, the next action will be ignored if not queued.
true if this action is prioritized, false otherwise. Reimplemented from com.runehive.game.action.Action< T extends Mob >.
Definition at line 173 of file HarvestingSkillAction.java.
|
abstract |
The items to be removed upon a successful harvest.
Referenced by canRun(), and onExecute().
|
abstract |
The success factor for the harvest.
The higher the number means the more frequently harvest will be obtained.
Referenced by onExecute().
|
private |
The random generator instance that will generate random numbers.
Definition at line 43 of file HarvestingSkillAction.java.
Referenced by onExecute().
|
staticprivate |
The factor boost that determines the success rate for harvesting based on skill level.
The higher the number the less frequently harvest will be obtained. A value higher than 99 or lower than 0 will throw an IllegalStateException.
Definition at line 38 of file HarvestingSkillAction.java.
Referenced by onExecute().