Enum SpecialWeapon
- java.lang.Object
-
- java.lang.Enum<SpecialWeapon>
-
- net.runelite.client.plugins.specialcounter.SpecialWeapon
-
- All Implemented Interfaces:
Serializable
,Comparable<SpecialWeapon>
public enum SpecialWeapon extends Enum<SpecialWeapon>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACCURSED_SCEPTRE
ARCLIGHT
BANDOS_GODSWORD
BARRELCHEST_ANCHOR
BONE_DAGGER
BULWARK
DARKLIGHT
DORGESHUUN_CROSSBOW
DRAGON_WARHAMMER
ELDER_MAUL
EMBERLIGHT
SEERCULL
TONALZTICS_OF_RALOS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float
computeDrainPercent(int hit, NPC target)
int
computeHit(int hit, NPC target)
Function<Integer,Integer>
getClientCycleHitDelay()
Accepts an int representing distance in tiles to the target, and returns an int representing client cycles of delay until the hitsplat is applied.int
getHitDelay(int distance)
Gets the server cycle delay between special attack energy dropping and a hitsplat being applied to the target.int[]
getItemID()
String
getName()
Function<SpecialCounterConfig,Integer>
getThreshold()
boolean
isDamage()
static SpecialWeapon
valueOf(String name)
Returns the enum constant of this type with the specified name.static SpecialWeapon[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DRAGON_WARHAMMER
public static final SpecialWeapon DRAGON_WARHAMMER
-
ARCLIGHT
public static final SpecialWeapon ARCLIGHT
-
DARKLIGHT
public static final SpecialWeapon DARKLIGHT
-
BANDOS_GODSWORD
public static final SpecialWeapon BANDOS_GODSWORD
-
BARRELCHEST_ANCHOR
public static final SpecialWeapon BARRELCHEST_ANCHOR
-
BONE_DAGGER
public static final SpecialWeapon BONE_DAGGER
-
DORGESHUUN_CROSSBOW
public static final SpecialWeapon DORGESHUUN_CROSSBOW
-
BULWARK
public static final SpecialWeapon BULWARK
-
ACCURSED_SCEPTRE
public static final SpecialWeapon ACCURSED_SCEPTRE
-
TONALZTICS_OF_RALOS
public static final SpecialWeapon TONALZTICS_OF_RALOS
-
ELDER_MAUL
public static final SpecialWeapon ELDER_MAUL
-
SEERCULL
public static final SpecialWeapon SEERCULL
-
EMBERLIGHT
public static final SpecialWeapon EMBERLIGHT
-
-
Method Detail
-
values
public static SpecialWeapon[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SpecialWeapon c : SpecialWeapon.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SpecialWeapon valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getHitDelay
public int getHitDelay(int distance)
Gets the server cycle delay between special attack energy dropping and a hitsplat being applied to the target. This will be1
for all melee weapons.- Parameters:
distance
- Distance from the target in tiles- Returns:
- Number of server cycles (game ticks) delay for the special attack hitsplat to be applied
-
computeDrainPercent
public float computeDrainPercent(int hit, @Nullable NPC target)
-
computeHit
public int computeHit(int hit, @Nullable NPC target)
-
getName
public String getName()
-
getItemID
public int[] getItemID()
-
isDamage
public boolean isDamage()
-
getClientCycleHitDelay
public Function<Integer,Integer> getClientCycleHitDelay()
Accepts an int representing distance in tiles to the target, and returns an int representing client cycles of delay until the hitsplat is applied.For melee weapons, the returned value is always
0
, as they have no delay. Calculating this delay can be done by extrapolating the difference between the cycle the projectile is created and the cycle it ends for various distances. In practice, projectiles are created at the same time special attack energy is drained for special attacks, so the difference can be taken between the cycle a player's special attack drains and the end cycle of the created projectile.For example, a dorgeshuun crossbow will have its projectile end 63 cycles after a spec at distance 1, 66 at distance 2, etc. Hence, we can extrapolate its formula to be
int cycles = 60 + distance * 3
.
-
getThreshold
public Function<SpecialCounterConfig,Integer> getThreshold()
-
-