1package com.runehive.game.world.entity.combat.strategy.player.special;
3import com.runehive.content.activity.Activity;
4import com.runehive.game.Animation;
5import com.runehive.game.Graphic;
6import com.runehive.game.UpdatePriority;
7import com.runehive.game.world.entity.combat.Combat;
8import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
9import com.runehive.game.world.entity.combat.strategy.player.special.melee.*;
10import com.runehive.game.world.entity.combat.strategy.player.special.range.*;
11import com.runehive.game.world.entity.mob.Mob;
12import com.runehive.game.world.entity.mob.player.Player;
13import com.runehive.game.world.entity.skill.Skill;
14import com.runehive.game.world.items.Item;
15import com.runehive.game.world.items.containers.equipment.Equipment;
16import com.runehive.net.packet.out.*;
18import java.util.Arrays;
19import java.util.Optional;
51 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
55 player.staffOfDeadSpecial.reset();
56 player.animate(1720,
true);
58 player.skills.setLevel(1, 125);
66 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
80 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
87 player.speak(
"Here fishy fishies!");
94 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
100 player.speak(
"Smashing!");
107 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
111 player.speak(
"Raarrrrrgggggghhhhhhh!");
146 if (
player.isSpecialActivated()) {
147 player.getCombat().setCooldown(0);
159 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
163 player.animate(1720,
true);
165 player.skills.setLevel(1, 125);
166 player.staffOfDeadSpecial.reset();
174 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
178 player.animate(1720,
true);
180 player.skills.setLevel(1, 125);
181 player.staffOfDeadSpecial.reset();
189 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
194 player.setSpecialActivated(
true);
200 if (
combat.isAttacking(defender)) {
201 combat.performChecks(defender);
207 public void disable(
Player player,
boolean clicked) {
211 boolean doubleSpec = !player.
attributes.
has(
"granite-maul-spec");
214 if (clicked && doubleSpec && current >= getAmount()) {
218 super.disable(player, clicked);
256 Optional<CombatSpecial>
special = Arrays.stream(
CombatSpecial.values()).filter(c -> Arrays.stream(c.getIds()).anyMatch(id ->
weapon ==
id)).findFirst();
276 player.getSpecialPercentage().decrementAndGet(
amount, 0);
283 player.getSpecialPercentage().decrementAndGet(toDrain, 0);
295 player.getSpecialPercentage().incrementAndGet(
amount, 100);
306 if (
player.getWeapon().getSpecialBar() == -1 ||
player.getWeapon().getSpecialMeter() == -1) {
310 int specialBar =
player.getWeapon().getSpecialMeter();
311 int specialAmount =
player.getSpecialPercentage().get() / 10;
314 for (
int i = 10; i > 0; i--) {
326 if (
player.getCombatSpecial() !=
null) {
330 if (
player.getWeapon().getSpecialBar() == -1) {
331 player.setCombatSpecial(
null);
338 player.setCombatSpecial(
null);
343 Optional<CombatSpecial>
special = Arrays.stream(
CombatSpecial.values()).filter(c -> Arrays.stream(c.getIds()).anyMatch(id -> item.
getId() ==
id)).findFirst();
351 player.setCombatSpecial(
null);
377 if (!
player.isSpecialActivated()) {
378 if (
player.getSpecialPercentage().intValue() <
player.getCombatSpecial().getAmount()) {
384 player.setSpecialActivated(
true);
389 if (
player.isSpecialActivated()) {
391 player.setSpecialActivated(
false);
A Activity object constructs an in-game activity and sequences it through the start() and finish() me...
static boolean evaluate(Mob mob, Predicate< Activity > predicate)
Class that models a single animation used by an entity.
Represents a single graphic that can be used by entities.
Handles the staff of the dead weapon special attack.
static AbyssalBludgen get()
Handles the abyssal whip weapon special attack.
static AbyssalDagger get()
static AbyssalTentacleWhip get()
Handles the abyssal whip weapon special attack.
static AncientGodsword get()
static ArmadylGodsword get()
static BandosGodsword get()
Handles the staff of the dead weapon special attack.
static DefaultMelee get()
static DinhsBulwark get()
static DragonDagger get()
Handles the dragon halbard weapon special attack.
static DragonHaldberd get()
static DragonLongsword get()
static DragonScimitar get()
Handles the dragon spear weapon special attack.
static DragonWarhammer get()
Handles the saradomin sword weapon special attack.
static SaradominGodsword get()
Handles the saradomin sword weapon special attack.
static SaradominSword get()
static VestaLongsword get()
Handles the zamorak sword weapon special attack.
static ZamorakGodsword get()
Handles the magic shortbow weapon special attack.
static ArmadylCrossbow get()
Handles the magic shortbow weapon special attack.
Handles the magic shortbow weapon special attack.
static DragonThrownaxe get()
Handles the magic shortbow weapon special attack.
static MagicShortbow get()
Handles the magic shortbow weapon special attack.
static ZaryteCrossbow get()
final GenericAttributes attributes
This class represents a character controlled by a player.
MutableNumber getSpecialPercentage()
Represents a trainable and usable skill.
static final int WOODCUTTING
The woodcutting skill id.
static final int RANGED
The ranged skill id.
static final int FISHING
The fishing skill id.
static final int DEFENCE
The defence skill id.
static final int MAGIC
The magic skill id.
static final int ATTACK
The attack skill id.
static final int STRENGTH
The strength skill id.
static final int MINING
The mining skill id.
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
The container that manages the equipment for a player.
static final int WEAPON_SLOT
The OutgoingPacket responsible for changing settings on a client.
Shows an itemcontainer inside another itemcontainer.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Handles sending the special attack amount (used for the orb).
public< K > void remove(K key)
Removes a generic attribute.
public< K, E > void set(K key, E attribute)
Sets a generic attribute.
public< K > boolean has(K key)
Checks if a key is in the list of generic attribute.
Represents different priorities for updating.
final CombatStrategy< Player > strategy
The strength bonus added when performing this special attack.
void enable(Player player)
void drain(Player player)
Drains the special bar for player.
static void updateSpecialAmount(Player player)
Updates the special bar with the amount of special energy player has.
final int amount
The amount of special energy drained by this attack.
void disable(Player player, boolean clicked)
static void assign(Player player)
Updates the weapon itemcontainer with a special bar if needed.
static void restore(Player player, int amount)
Restores the special bar for player.
final int[] ids
The identifiers for the weapons that perform this special.
CombatStrategy< Player > getStrategy()
Executes exactly when player activates the special bar.
final int[] getIds()
Gets the identifiers for the weapons that perform this special.
CombatSpecial(int[] ids, int amount, CombatStrategy< Player > strategy)
Creates a new CombatSpecial.
final int getAmount()
Gets the amount of special energy drained by this attack.
static void drain(Player player, int toDrain)
static Optional< CombatSpecial > forId(int weapon)