1package com.osroyale.game.world.entity.combat.strategy.player.special.range;
3import com.osroyale.game.Animation;
4import com.osroyale.game.Projectile;
5import com.osroyale.game.world.entity.combat.CombatType;
6import com.osroyale.game.world.entity.combat.attack.FightType;
7import com.osroyale.game.world.entity.combat.hit.CombatHit;
8import com.osroyale.game.world.entity.combat.hit.Hit;
9import com.osroyale.game.world.entity.combat.strategy.basic.RangedStrategy;
10import com.osroyale.game.world.entity.combat.strategy.player.custom.ToxicBlowpipeStrategy;
11import com.osroyale.game.world.entity.mob.Mob;
12import com.osroyale.game.world.entity.mob.player.Player;
13import com.osroyale.game.world.entity.mob.player.PlayerRight;
16 private static final Blowpipe INSTANCE =
new Blowpipe();
17 private static final Projectile SPECIAL_PROJ =
new Projectile(1043);
20 public boolean canAttack(Player attacker, Mob defender) {
21 return ToxicBlowpipeStrategy.get().canAttack(attacker, defender);
25 public void start(Player attacker, Mob defender, Hit[] hits) {
26 attacker.animate(getAttackAnimation(attacker, defender),
true);
27 SPECIAL_PROJ.send(attacker, defender);
29 if (!defender.isPlayer() || !PlayerRight.isIronman(attacker)) {
30 addCombatExperience(attacker, hits);
33 attacker.getCombatSpecial().drain(attacker);
34 for (Hit
hit : hits) {
35 attacker.heal((
int) Math.floor(
hit.getDamage() / 2));
40 public void attack(Player attacker, Mob defender, Hit
hit) {
41 ToxicBlowpipeStrategy.get().attack(attacker, defender,
hit);
45 public Animation getAttackAnimation(Player attacker, Mob defender) {
46 return ToxicBlowpipeStrategy.get().getAttackAnimation(attacker, defender);
50 public int getAttackDelay(Player attacker, Mob defender, FightType fightType) {
51 return ToxicBlowpipeStrategy.get().getAttackDelay(attacker, defender, fightType);
55 public int getAttackDistance(Player attacker, FightType fightType) {
56 return ToxicBlowpipeStrategy.get().getAttackDistance(attacker, fightType);
60 public CombatHit[] getHits(Player attacker, Mob defender) {
61 return new CombatHit[]{nextRangedHit(attacker, defender)};
65 public CombatType getCombatType() {
66 return CombatType.RANGED;
69 public static Blowpipe
get() {
void hit(T attacker, Mob defender, Hit hit)