Add separate color for superior slayer monsters
This commit is contained in:
@@ -101,6 +101,16 @@ public interface SlayerConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 7,
|
position = 7,
|
||||||
|
keyName = "superiorColor",
|
||||||
|
name = "Superior Color",
|
||||||
|
description = "Color of the highlighted superior slayer creatures"
|
||||||
|
)
|
||||||
|
default Color getSuperiorColor() {
|
||||||
|
return Color.MAGENTA;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 8,
|
||||||
keyName = "weaknessPrompt",
|
keyName = "weaknessPrompt",
|
||||||
name = "Show Monster Weakness",
|
name = "Show Monster Weakness",
|
||||||
description = "Show an overlay on a monster when it is weak enough to finish off (Only Lizards, Gargoyles & Rockslugs)"
|
description = "Show an overlay on a monster when it is weak enough to finish off (Only Lizards, Gargoyles & Rockslugs)"
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import java.util.List;
|
|||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import joptsimple.internal.Strings;
|
import joptsimple.internal.Strings;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
@@ -52,6 +53,7 @@ import net.runelite.api.MessageNode;
|
|||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.NPCComposition;
|
import net.runelite.api.NPCComposition;
|
||||||
import static net.runelite.api.Skill.SLAYER;
|
import static net.runelite.api.Skill.SLAYER;
|
||||||
|
import net.runelite.api.NpcID;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
@@ -125,6 +127,36 @@ public class SlayerPlugin extends Plugin
|
|||||||
private static final Pattern TASK_STRING_VALIDATION = Pattern.compile("[^a-zA-Z0-9' -]");
|
private static final Pattern TASK_STRING_VALIDATION = Pattern.compile("[^a-zA-Z0-9' -]");
|
||||||
private static final int TASK_STRING_MAX_LENGTH = 50;
|
private static final int TASK_STRING_MAX_LENGTH = 50;
|
||||||
|
|
||||||
|
// Superiors
|
||||||
|
private static List<String> SUPERIOR_SLAYER_MONSTERS = Arrays.asList(
|
||||||
|
"Crushing hand",
|
||||||
|
"Chasm crawler",
|
||||||
|
"Screaming banshee",
|
||||||
|
"Screaming twisted banshee",
|
||||||
|
"Giant rockslug",
|
||||||
|
"Cockathrice",
|
||||||
|
"Flaming pyrelord",
|
||||||
|
"Monstrous basilisk",
|
||||||
|
"Malevolent mage",
|
||||||
|
"Insatiable bloodveld",
|
||||||
|
"Insatiable mutated bloodveld",
|
||||||
|
"Vitreous jelly",
|
||||||
|
"Vitreous warped jelly",
|
||||||
|
"Cave abomination",
|
||||||
|
"Abhorrent spectre",
|
||||||
|
"Repugnant spectre",
|
||||||
|
"Choke devil",
|
||||||
|
"King kurask",
|
||||||
|
"Marble gargoyle",
|
||||||
|
"Nechryarch",
|
||||||
|
"Greater abyssal demon",
|
||||||
|
"Night beast",
|
||||||
|
"Nuclear smoke devil");
|
||||||
|
|
||||||
|
static {
|
||||||
|
SUPERIOR_SLAYER_MONSTERS = SUPERIOR_SLAYER_MONSTERS.stream().map(name -> name.toLowerCase()).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@@ -539,6 +571,10 @@ public class SlayerPlugin extends Plugin
|
|||||||
cachedXp = slayerExp;
|
cachedXp = slayerExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isSuperior(String name) {
|
||||||
|
return SUPERIOR_SLAYER_MONSTERS.contains(name.toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
private void onConfigChanged(ConfigChanged event)
|
private void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,12 @@ public class TargetClickboxOverlay extends Overlay
|
|||||||
List<NPC> targets = plugin.getHighlightedTargets();
|
List<NPC> targets = plugin.getHighlightedTargets();
|
||||||
for (NPC target : targets)
|
for (NPC target : targets)
|
||||||
{
|
{
|
||||||
renderTargetOverlay(graphics, target, config.getTargetColor());
|
Color coloration = config.getTargetColor();
|
||||||
|
if (plugin.isSuperior(target.getName())) {
|
||||||
|
coloration = config.getSuperiorColor();
|
||||||
|
}
|
||||||
|
|
||||||
|
renderTargetOverlay(graphics, target, coloration);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user