RuneHive-Game
Loading...
Searching...
No Matches
PestControlListener.java
Go to the documentation of this file.
1package com.runehive.content.activity.impl.pestcontrol;
2
3import com.runehive.content.activity.ActivityListener;
4import com.runehive.game.world.entity.combat.hit.Hit;
5import com.runehive.game.world.entity.mob.Mob;
6
7public class PestControlListener extends ActivityListener<PestControlGame> {
8
12
13 @Override
14 public boolean canAttack(Mob attacker, Mob defender) {
15 return !attacker.isPlayer() || defender.id != 1756;
16 }
17
18 @Override
19 public void hitsplat(Mob attacker, Mob defender, Hit hit) {
20 if (!attacker.isPlayer())
21 return;
22
24 node.damage += hit.getDamage();
25 }
26
27}
void hit(Mob attacker, Mob defender, Hit hit)
ActivityListener(T activity)
Constructs a new ActivityListener for a activity.
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
Handles the mob class.
Definition Mob.java:66
final boolean isPlayer()
Check if an entity is a player.
Definition Mob.java:564