Skip to content

Commit

Permalink
clues: add Jardric anagram clue
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Nov 29, 2024
1 parent 9614d39 commit 7865b5e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
5 changes: 5 additions & 0 deletions runelite-api/src/main/java/net/runelite/api/Varbits.java
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,11 @@ public final class Varbits
*/
public static final int QUEST_THE_HAND_IN_THE_SAND = 1527;

/**
* Dragon slayer 2 quest status
*/
public static final int QUEST_DS2 = 6104;

/**
* Daily Tasks =Collection availability)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
import java.awt.Color;
import java.awt.Graphics2D;
import java.util.List;
import java.util.function.Function;
import javax.annotation.Nullable;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import net.runelite.api.NPC;
import net.runelite.api.ObjectID;
import net.runelite.api.TileObject;
import net.runelite.api.Varbits;
import net.runelite.api.coords.WorldPoint;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
Expand All @@ -48,7 +50,6 @@
import net.runelite.client.ui.overlay.components.TitleComponent;

@Getter
@Builder
public class AnagramClue extends ClueScroll implements NpcClueScroll, ObjectClueScroll
{
private static final String ANAGRAM_TEXT = "This anagram reveals who to speak to next: ";
Expand Down Expand Up @@ -775,25 +776,59 @@ public class AnagramClue extends ClueScroll implements NpcClueScroll, ObjectClue
.npc("Metla")
.location(new WorldPoint(1742, 2977, 0))
.area("Stonecutter Outpost")
.build(),
AnagramClue.builder()
.text("CIRR JAD")
.npc("Jardric")
.locationProvider(plugin ->
{
int q = plugin.getClient().getVarbitValue(Varbits.QUEST_DS2);
return q <= 60 ?
new WorldPoint(3719, 3810, 0) : // Museum camp
new WorldPoint(3661, 3849, 0); // West side of Fossil Island
})
.area("Fossil Island")
.question("What is 3 to the power of 0?")
.answer("1")
.build()
);

private final String text;
private final String npc;
@Getter(AccessLevel.PRIVATE)
private final WorldPoint location;
private final Function<ClueScrollPlugin, WorldPoint> locationProvider;
private final String area;
@Nullable
private final String question;
@Nullable
private final String answer;
@Builder.Default
private final int objectId = -1;
private final int objectId;

@Builder
private AnagramClue(
String text,
String npc,
@Nullable WorldPoint location,
@Nullable Function<ClueScrollPlugin, WorldPoint> locationProvider,
String area,
@Nullable String question,
@Nullable String answer,
@Nullable Integer objectId
)
{
this.text = text;
this.npc = npc;
this.locationProvider = locationProvider != null ? locationProvider : (location != null ? (plugin) -> location : null);
this.area = area;
this.question = question;
this.answer = answer;
this.objectId = objectId != null ? objectId : -1;
}

@Override
public WorldPoint getLocation(ClueScrollPlugin plugin)
{
return location;
return locationProvider == null ? null : locationProvider.apply(plugin);
}

@Override
Expand Down

0 comments on commit 7865b5e

Please sign in to comment.