RuneHive-Game
Loading...
Searching...
No Matches
ScorpiaOffspring.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.strategy.npc.boss.scorpia;
2
3import com.runehive.game.world.entity.combat.attack.FightType;
4import com.runehive.game.world.entity.combat.hit.Hit;
5import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
6import com.runehive.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
7import com.runehive.game.world.entity.mob.Mob;
8import com.runehive.game.world.entity.mob.npc.Npc;
9import com.runehive.game.world.entity.skill.Skill;
10
11public class ScorpiaOffspring extends NpcRangedStrategy {
12
14 super(CombatProjectile.getDefinition("EMPTY"));
15 }
16
17 @Override
18 public void hit(Npc attacker, Mob defender, Hit hit) {
19 super.hit(attacker, defender, hit);
20 if (hit.getDamage() > 0) {
21 defender.skills.get(Skill.PRAYER).removeLevel(1);
22 defender.skills.refresh(Skill.PRAYER);
23 }
24 }
25
26 @Override
27 public int getAttackDistance(Npc attacker, FightType fightType) {
28 return 5;
29 }
30
31}
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
Handles the mob class.
Definition Mob.java:66
Represents a non-player character in the in-game world.
Definition Npc.java:29
Represents a trainable and usable skill.
Definition Skill.java:18
static final int PRAYER
The prayer skill id.
Definition Skill.java:36
void removeLevel(int amount)
Removes levels from this skill by the given amount.
Definition Skill.java:325
Skill get(int id)
Gets the skill for an id.
void refresh()
Refreshes all the skills for the mob.
The enumerated type whose elements represent the fighting types.