RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
CombatSkullEffect.java
1package com.osroyale.game.world.entity.combat.effect.impl;
2
3import com.osroyale.game.world.entity.combat.effect.CombatEffect;
4import com.osroyale.game.world.entity.mob.Mob;
5import com.osroyale.game.world.entity.mob.player.Player;
6import com.osroyale.game.world.position.Area;
7
37
38public final class CombatSkullEffect extends CombatEffect {
39
44 super(50);
45 }
46
47 @Override
48 public boolean apply(Mob mob) {
49 if (mob.isPlayer()) {
50 Player player = (Player) mob;
51
52 /* if (Area.inEventArena(mob)) {
53 return false;
54 }*/
55
56 if (!Area.inWilderness(mob)) {
57 return false;
58 }
59
60 if (player.skulling.isSkulled()) {
61 return false;
62 }
63
64 player.skulling.skull();
65 return true;
66 }
67 return false;
68 }
69
70 @Override
71 public boolean removeOn(Mob mob) {
72 if (mob.isPlayer()) {
73 Player player = (Player) mob;
74
75 if (!player.skulling.isSkulled()) {
76 player.skulling.unskull();
77 return true;
78 }
79
80 return false;
81 }
82
83 return true;
84 }
85
86 @Override
87 public void process(Mob mob) {
88 // nothing to process
89 }
90
91 @Override
92 public boolean onLogin(Mob mob) {
93 if (mob.isPlayer()) {
94 Player player = (Player) mob;
95
96 if (player.skulling.isSkulled()) {
97 return true;
98 }
99 }
100 return false;
101 }
102}