|
RuneHive-Game
|
Handles the crafting skill. More...
Public Member Functions | |
| boolean | craft (Player player, int index, int amount) |
| Crafting (int level, double experience) | |
| boolean | start (Player player, Craftable craftable, int index, int amount) |
| Public Member Functions inherited from com.runehive.game.world.entity.skill.Skill | |
| double | addExperience (double amount) |
| Adds experiences to this skill by the given amount. | |
| void | addLevel (int amount) |
| Adds levels to this skill by the given amount. | |
| void | divideExperience (double amount) |
| Divides the current experience of this skill by a given amount. | |
| void | divideLevel (double amount) |
| Divides the current level of this skill by a given amount. | |
| double | getExperience () |
| Gets the skill experience. | |
| int | getLevel () |
| Gets the current skill level. | |
| int | getMaxLevel () |
| Gets the maximum skill level. | |
| int | getRoundedExperience () |
Gets the floor experience. | |
| int | getSkill () |
| Gets the skill id. | |
| boolean | isDoingSkill () |
| double | modifyExperience (Function< Double, Double > function) |
| Modifies the current experience with a given function. | |
| double | modifyExperience (Function< Double, Double > function, int lowerBounds, int upperBounds) |
| Modifies the current experience with a given function. | |
| void | modifyLevel (Function< Integer, Integer > function) |
| Modifies the current level with a given function. | |
| void | modifyLevel (Function< Integer, Integer > function, int lowerBounds, int upperBounds) |
| Modifies the current level with a given function. | |
| void | multiplyExperience (double amount) |
| Multiplies the current experience of this skill by a given amount. | |
| void | multiplyLevel (double amount) |
| Multiplies the current level of this skill by a given amount. | |
| boolean | onEvent (Player player, InteractionEvent interactionEvent) |
| void | removeExperience (double amount) |
| Removes experiences from this skill by the given amount. | |
| void | removeLevel (int amount) |
| Removes levels from this skill by the given amount. | |
| boolean | reqLevel (int level) |
Determines if your level is greater than or equal to level. | |
| void | setDoingSkill (boolean doingSkill) |
| void | setExperience (double experience) |
| Sets the experience for this skill. | |
| void | setLevel (int level) |
| Sets the level for this skill. | |
| void | setMaxLevel (int maxLevel) |
| Sets the maximum level for this skill. | |
| Skill (int skill, int level, double experience) | |
Constructs a new Skill. | |
| String | toString () |
Static Public Member Functions | |
| static void | addCraftable (Craftable craftable) |
| Static Public Member Functions inherited from com.runehive.game.world.entity.skill.Skill | |
| static Function< Integer, Integer > | add (int amount) |
| Creates a function that adds a number by an amount. | |
| static Function< Integer, Integer > | divide (double amount) |
| Creates a function that divides a number by an amount. | |
| static final int | getExperienceForLevel (int level) |
| Gets the experience for a given level. | |
| static final byte | getLevelForExperience (double experience) |
| Gets the level for a given experience amount. | |
| static String | getName (int skill) |
| Gets the name for a skill id. | |
| static Function< Integer, Integer > | multiply (double amount) |
| Creates a function that multiplies a number by an amount. | |
| static Function< Integer, Integer > | subtract (int amount) |
| Creates a function that subtracts a number by an amount. | |
Protected Member Functions | |
| boolean | clickButton (Player player, ClickButtonInteractionEvent event) |
| boolean | clickNpc (Player player, NpcInteractionEvent event) |
| boolean | clickObject (Player player, ObjectInteractionEvent event) |
| boolean | useItem (Player player, ItemOnItemInteractionEvent event) |
| boolean | useItem (Player player, ItemOnObjectInteractionEvent event) |
| Protected Member Functions inherited from com.runehive.game.world.entity.skill.Skill | |
| boolean | clickItem (Player player, ItemInteractionEvent event) |
| boolean | itemContainerAction (Player player, ItemContainerInteractionEvent event) |
| double | modifier () |
Private Member Functions | |
| Action< Player > | craft (Player player, Craftable craftable, CraftableItem item, int index, int amount) |
Static Private Member Functions | |
| static Craftable | getCraftable (int use, int with) |
Static Private Attributes | |
| static final String | CRAFTABLE_KEY = "CRAFTABLE_KEY" |
| The craftable key. | |
| static final HashMap< Integer, Craftable > | CRAFTABLES = new HashMap<>() |
| The craftable map. | |
| static final Object[][] | LEATHER_ARMOR_IDS |
| The leather armour data. | |
Additional Inherited Members | |
| Public Attributes inherited from com.runehive.game.world.entity.skill.Skill | |
| transient final Stopwatch | stopwatch = Stopwatch.start() |
| Static Public Attributes inherited from com.runehive.game.world.entity.skill.Skill | |
| static final int | AGILITY = 16 |
| The agility skill id. | |
| static final int | ATTACK = 0 |
| The attack skill id. | |
| static final int | CONSTRUCTION = 21 |
| The construction skill id. | |
| static final int | COOKING = 7 |
| The cooking skill id. | |
| static final int | CRAFTING = 12 |
| The crafting skill id. | |
| static final int | DEFENCE = 1 |
| The defence skill id. | |
| static final int | FARMING = 19 |
| The farming skill id. | |
| static final int | FIREMAKING = 11 |
| The firemaking skill id. | |
| static final int | FISHING = 10 |
| The fishing skill id. | |
| static final int | FLETCHING = 9 |
| The fletching skill id. | |
| static final int | HERBLORE = 15 |
| The herblore skill id. | |
| static final int | HITPOINTS = 3 |
| The hitpoints skill id. | |
| static final int | HUNTER = 22 |
| The hunter skill id. | |
| static final int[][] | INTERFACE_DATA |
| Skill tab string data. | |
| static final int | MAGIC = 6 |
| The magic skill id. | |
| static final int | MINING = 14 |
| The mining skill id. | |
| static final int | PRAYER = 5 |
| The prayer skill id. | |
| static final int | RANGED = 4 |
| The ranged skill id. | |
| static final int | RUNECRAFTING = 20 |
| The runecrafting skill id. | |
| static final int | SKILL_COUNT = 23 |
| The amount of available skills. | |
| static final int | SLAYER = 18 |
| The slayer skill id. | |
| static final int | SMITHING = 13 |
| The smithing skill id. | |
| static final int | STRENGTH = 2 |
| The strength skill id. | |
| static final int | THIEVING = 17 |
| The thieving skill id. | |
| static final int | TOTAL_SKILL_LEVEL = 99 * SKILL_COUNT |
| The total skill amount. | |
| static final int | WOODCUTTING = 8 |
| The woodcutting skill id. | |
Handles the crafting skill.
Definition at line 30 of file Crafting.java.
| com.runehive.content.skill.impl.crafting.Crafting.Crafting | ( | int | level, |
| double | experience ) |
Definition at line 49 of file Crafting.java.
References com.runehive.game.world.entity.skill.Skill.experience, com.runehive.game.world.entity.skill.Skill.level, and com.runehive.game.world.entity.skill.Skill.Skill().
|
static |
Definition at line 53 of file Crafting.java.
References CRAFTABLES, com.runehive.game.world.items.Item.getId(), com.runehive.content.skill.impl.crafting.Craftable.getName(), and com.runehive.content.skill.impl.crafting.Craftable.getWith().
Referenced by com.runehive.content.skill.impl.crafting.impl.Gem.load(), and com.runehive.content.skill.impl.crafting.impl.Hide.load().
|
protected |
Reimplemented from com.runehive.game.world.entity.skill.Skill.
Definition at line 195 of file Crafting.java.
References com.runehive.game.world.entity.mob.Mob.attributes, com.runehive.content.skill.impl.crafting.impl.Glass.click(), com.runehive.content.skill.impl.crafting.impl.Tanning.click(), com.runehive.game.world.entity.mob.player.InterfaceManager.close(), com.runehive.game.world.items.containers.ItemContainer.computeAmountForId(), CRAFTABLE_KEY, com.runehive.util.generic.GenericAttributes.get(), com.runehive.game.world.items.Item.getId(), com.runehive.util.generic.GenericAttributes.getObject(), com.runehive.content.skill.impl.crafting.Craftable.getWith(), com.runehive.util.generic.GenericAttributes.has(), com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.Player.inventory, LEATHER_ARMOR_IDS, com.runehive.game.world.entity.mob.player.Player.send(), and start().
|
protected |
Reimplemented from com.runehive.game.world.entity.skill.Skill.
Definition at line 79 of file Crafting.java.
References com.runehive.content.skill.impl.crafting.impl.Tanning.open(), and com.runehive.content.store.Store.STORES.
|
protected |
Reimplemented from com.runehive.game.world.entity.skill.Skill.
Definition at line 64 of file Crafting.java.
References com.runehive.content.skill.impl.crafting.impl.Jewellery.open(), and com.runehive.content.skill.impl.crafting.impl.Spinning.open().
|
private |
Definition at line 418 of file Crafting.java.
References com.runehive.game.world.entity.mob.player.PlayerAssistant.activateSkilling(), com.runehive.game.world.entity.skill.SkillManager.addExperience(), com.runehive.game.world.items.containers.inventory.Inventory.addOrDrop(), com.runehive.game.world.entity.mob.Mob.animate(), com.runehive.game.world.items.containers.ItemContainer.containsAll(), com.runehive.content.skillcape.SkillCape.CRAFTING, com.runehive.Config.CRAFTING_MODIFICATION, com.runehive.content.skill.impl.crafting.Craftable.getAnimation(), com.runehive.content.skill.impl.crafting.CraftableItem.getExperience(), com.runehive.content.skill.impl.crafting.Craftable.getIngredients(), com.runehive.game.world.entity.skill.Skill.getName(), com.runehive.content.skill.impl.crafting.CraftableItem.getProduct(), com.runehive.content.skill.impl.crafting.Craftable.getProductionMessage(), com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.content.skillcape.SkillCape.isEquipped(), com.runehive.game.action.policy.WalkablePolicy.NON_WALKABLE, com.runehive.game.world.entity.mob.player.Player.playerAssistant, com.runehive.util.Utility.random(), com.runehive.game.world.items.containers.ItemContainer.removeAll(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.game.world.entity.skill.Skill.Skill(), com.runehive.game.world.entity.mob.Mob.skills, and com.runehive.content.activity.randomevent.RandomEventHandler.trigger().
| boolean com.runehive.content.skill.impl.crafting.Crafting.craft | ( | Player | player, |
| int | index, | ||
| int | amount ) |
Definition at line 378 of file Crafting.java.
References com.runehive.game.world.entity.mob.Mob.attributes, CRAFTABLE_KEY, com.runehive.util.generic.GenericAttributes.get(), and start().
Referenced by start().
|
staticprivate |
Definition at line 59 of file Crafting.java.
References CRAFTABLES.
Referenced by useItem().
| boolean com.runehive.content.skill.impl.crafting.Crafting.start | ( | Player | player, |
| Craftable | craftable, | ||
| int | index, | ||
| int | amount ) |
Definition at line 383 of file Crafting.java.
References com.runehive.game.world.entity.mob.Mob.action, com.runehive.game.world.entity.mob.Mob.attributes, com.runehive.game.world.entity.mob.player.InterfaceManager.close(), com.runehive.game.world.items.containers.ItemContainer.containsAll(), craft(), CRAFTABLE_KEY, com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), com.runehive.game.action.ActionManager.execute(), com.runehive.game.world.items.Item.getAmount(), com.runehive.util.Utility.getAOrAn(), com.runehive.content.skill.impl.crafting.Craftable.getCraftableItems(), com.runehive.content.skill.impl.crafting.Craftable.getIngredients(), com.runehive.content.skill.impl.crafting.CraftableItem.getLevel(), com.runehive.game.world.entity.skill.SkillManager.getLevel(), com.runehive.game.world.items.Item.getName(), com.runehive.content.skill.impl.crafting.CraftableItem.getProduct(), com.runehive.content.skill.impl.crafting.CraftableItem.getRequiredItem(), com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.util.generic.GenericAttributes.remove(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.content.dialogue.DialogueFactory.sendStatement(), com.runehive.game.world.entity.skill.Skill.Skill(), and com.runehive.game.world.entity.mob.Mob.skills.
Referenced by clickButton(), and craft().
|
protected |
Reimplemented from com.runehive.game.world.entity.skill.Skill.
Definition at line 106 of file Crafting.java.
References com.runehive.game.world.entity.mob.Mob.attributes, CRAFTABLE_KEY, com.runehive.game.world.items.Item.equalIds(), com.runehive.util.Utility.getAOrAn(), getCraftable(), com.runehive.content.skill.impl.crafting.Craftable.getCraftableItems(), com.runehive.game.world.items.Item.getId(), com.runehive.game.world.items.Item.getName(), com.runehive.content.skill.impl.crafting.CraftableItem.getProduct(), com.runehive.content.skill.impl.crafting.Craftable.getUse(), com.runehive.game.world.entity.mob.player.Player.interfaceManager, com.runehive.game.world.entity.mob.player.Player.message(), com.runehive.content.skill.impl.crafting.impl.Glass.open(), com.runehive.game.world.entity.mob.player.InterfaceManager.open(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.util.generic.GenericAttributes.set(), and com.runehive.content.skill.impl.crafting.impl.Stringing.useItem().
|
protected |
Reimplemented from com.runehive.game.world.entity.skill.Skill.
Definition at line 93 of file Crafting.java.
References com.runehive.content.skill.impl.crafting.impl.Glass.craft(), com.runehive.game.world.items.Item.getId(), and com.runehive.content.skill.impl.crafting.impl.Glass.GlassData.MOLTEN_GLASS.
|
staticprivate |
The craftable key.
Definition at line 33 of file Crafting.java.
Referenced by clickButton(), craft(), start(), and useItem().
|
staticprivate |
The craftable map.
Definition at line 36 of file Crafting.java.
Referenced by addCraftable(), and getCraftable().
|
staticprivate |
The leather armour data.
Definition at line 39 of file Crafting.java.
Referenced by clickButton().