RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Skulling.java
1
package
com.osroyale.content.combat;
2
3
import
com.osroyale.Config;
4
import
com.osroyale.content.lms.LMSGame;
5
import
com.osroyale.game.task.impl.SkullRemoveTask;
6
import
com.osroyale.game.world.World;
7
import
com.osroyale.game.world.entity.mob.UpdateFlag;
8
import
com.osroyale.game.world.entity.mob.player.Player;
9
10
import
java.util.LinkedList;
11
import
java.util.List;
12
54
55
public
class
Skulling
{
56
58
private
final
List<String> attacked =
new
LinkedList<>();
59
61
private
Player
player;
62
64
private
SkullHeadIconType
icon =
SkullHeadIconType
.NO_SKULL;
65
66
private
SkullRemoveTask
skullRemoveTask;
67
73
public
Skulling
(
Player
player) {
74
this.player = player;
75
this.skullRemoveTask =
new
SkullRemoveTask
(player);
76
}
77
83
public
void
checkForSkulling
(
Player
opponent) {
84
/* if (Area.inEventArena(opponent)) {
85
return;
86
}*/
87
if
(!attacked.contains(opponent.
getName
()) && !opponent.skulling.attacked.contains(player.getName())) {
88
skull(opponent,
SkullHeadIconType
.WHITE_SKULL);
89
}
90
}
91
92
public
void
skull() {
93
skull(player,
SkullHeadIconType
.WHITE_SKULL);
94
}
95
96
public
void
skull(SkullHeadIconType icon) {
97
skull(player, icon);
98
}
99
105
public
void
skull
(
Player
attacking,
SkullHeadIconType
icon) {
106
if
(attacking.inActivity()) {
107
return
;
108
}
109
110
if
(
LMSGame
.
inGameArea
(attacking))
return
;
111
112
if
(attacking != player) {
113
attacked.add(attacking.
getName
());
114
}
115
116
this.icon = icon;
117
player.updateFlags.add(
UpdateFlag
.APPEARANCE);
118
119
if
(!skullRemoveTask.isRunning()) {
120
skullRemoveTask.setSkullTime(skullRemoveTask.getSkullTime() <= 0 ?
Config
.
SKULL_TIME
: skullRemoveTask.getSkullTime());
121
World
.
schedule
(skullRemoveTask);
122
}
123
}
124
125
public
boolean
isSkulled() {
126
return
skullRemoveTask.
isRunning
();
127
}
128
132
public
void
unskull
() {
133
if
(!isSkulled()) {
134
return
;
135
}
136
137
skullRemoveTask.setSkullTime(0);
138
attacked.clear();
139
icon =
SkullHeadIconType
.NO_SKULL;
140
player.updateFlags.add(
UpdateFlag
.APPEARANCE);
141
}
142
143
public
SkullRemoveTask
getSkullRemoveTask() {
144
return
skullRemoveTask;
145
}
146
152
public
SkullHeadIconType
getHeadIconType
() {
153
return
icon;
154
}
155
156
}
com.osroyale.Config
Definition
Config.java:61
com.osroyale.Config.SKULL_TIME
static final int SKULL_TIME
Definition
Config.java:229
com.osroyale.content.combat.Skulling.getHeadIconType
SkullHeadIconType getHeadIconType()
Definition
Skulling.java:152
com.osroyale.content.combat.Skulling.checkForSkulling
void checkForSkulling(Player opponent)
Definition
Skulling.java:83
com.osroyale.content.combat.Skulling.Skulling
Skulling(Player player)
Definition
Skulling.java:73
com.osroyale.content.combat.Skulling.skull
void skull(Player attacking, SkullHeadIconType icon)
Definition
Skulling.java:105
com.osroyale.content.combat.Skulling.unskull
void unskull()
Definition
Skulling.java:132
com.osroyale.content.lms.LMSGame
Definition
LMSGame.java:75
com.osroyale.content.lms.LMSGame.inGameArea
static boolean inGameArea(Player player)
Definition
LMSGame.java:179
com.osroyale.game.task.Task.isRunning
boolean isRunning()
Definition
Task.java:203
com.osroyale.game.task.impl.SkullRemoveTask
Definition
SkullRemoveTask.java:29
com.osroyale.game.world.World
Definition
World.java:83
com.osroyale.game.world.World.schedule
static void schedule(Task task)
Definition
World.java:284
com.osroyale.game.world.entity.mob.player.Player
Definition
Player.java:162
com.osroyale.game.world.entity.mob.player.Player.getName
String getName()
Definition
Player.java:794
com.osroyale.content.combat.SkullHeadIconType
Definition
SkullHeadIconType.java:25
com.osroyale.game.world.entity.mob.UpdateFlag
Definition
UpdateFlag.java:36