diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 1a764e51c4..09ed769a42 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -27,9 +27,9 @@ const val kotlinVersion = "1.3.50" object ProjectVersions { const val launcherVersion = "2.0.4" - const val rlVersion = "1.5.41-SNAPSHOT" + const val rlVersion = "1.5.41" - const val openosrsVersion = "2.1.13.0-SNAPSHOT" + const val openosrsVersion = "2.1.13.0" const val rsversion = 185 const val cacheversion = 165 diff --git a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreEndpoint.java b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreEndpoint.java index a88f2e208e..8e5a97dfb3 100644 --- a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreEndpoint.java +++ b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreEndpoint.java @@ -35,8 +35,7 @@ public enum HiscoreEndpoint HARDCORE_IRONMAN("Hardcore Ironman", "https://services.runescape.com/m=hiscore_oldschool_hardcore_ironman/index_lite.ws"), ULTIMATE_IRONMAN("Ultimate Ironman", "https://services.runescape.com/m=hiscore_oldschool_ultimate/index_lite.ws"), DEADMAN("Deadman", "https://services.runescape.com/m=hiscore_oldschool_deadman/index_lite.ws"), - SEASONAL_DEADMAN("Seasonal Deadman", "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws"), - DEADMAN_TOURNAMENT("Deadman Tournament", "https://services.runescape.com/m=hiscore_oldschool_tournament/index_lite.ws"); + LEAGUE("Twisted League", "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws"); private final String name; private final HttpUrl hiscoreURL; diff --git a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java index 9af6f6e4b9..57f29c2910 100644 --- a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java +++ b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResult.java @@ -54,6 +54,7 @@ public class HiscoreResult private Skill runecraft; private Skill hunter; private Skill construction; + private Skill leaguePoints; private Skill bountyHunterHunter; private Skill bountyHunterRogue; private Skill clueScrollAll; @@ -115,6 +116,8 @@ public class HiscoreResult return getHunter(); case CONSTRUCTION: return getConstruction(); + case LEAGUE_POINTS: + return getLeaguePoints(); case OVERALL: return getOverall(); case BOUNTY_HUNTER_HUNTER: diff --git a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java index a6117160a4..10394b4919 100644 --- a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java +++ b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreResultBuilder.java @@ -26,8 +26,6 @@ package net.runelite.http.api.hiscore; import java.util.ArrayList; import java.util.List; -import net.runelite.http.api.hiscore.HiscoreResult; -import net.runelite.http.api.hiscore.Skill; public class HiscoreResultBuilder { @@ -77,9 +75,9 @@ public class HiscoreResultBuilder hiscoreResult.setRunecraft(skills.get(21)); hiscoreResult.setHunter(skills.get(22)); hiscoreResult.setConstruction(skills.get(23)); - hiscoreResult.setBountyHunterHunter(skills.get(24)); - hiscoreResult.setBountyHunterRogue(skills.get(25)); - hiscoreResult.setLastManStanding(skills.get(26)); + hiscoreResult.setLeaguePoints(skills.get(24)); + hiscoreResult.setBountyHunterHunter(skills.get(25)); + hiscoreResult.setBountyHunterRogue(skills.get(26)); hiscoreResult.setClueScrollAll(skills.get(27)); hiscoreResult.setClueScrollBeginner(skills.get(28)); hiscoreResult.setClueScrollEasy(skills.get(29)); @@ -87,6 +85,7 @@ public class HiscoreResultBuilder hiscoreResult.setClueScrollHard(skills.get(31)); hiscoreResult.setClueScrollElite(skills.get(32)); hiscoreResult.setClueScrollMaster(skills.get(33)); + hiscoreResult.setLastManStanding(skills.get(34)); return hiscoreResult; } } diff --git a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java index db043dfcfb..f0864a9424 100644 --- a/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java +++ b/http-api/src/main/java/net/runelite/http/api/hiscore/HiscoreSkill.java @@ -50,16 +50,17 @@ public enum HiscoreSkill RUNECRAFT("Runecraft"), HUNTER("Hunter"), CONSTRUCTION("Construction"), + LEAGUE_POINTS("League Points"), BOUNTY_HUNTER_HUNTER("Bounty Hunter - Hunter"), BOUNTY_HUNTER_ROGUE("Bounty Hunter - Rogue"), - LAST_MAN_STANDING("Last Man Standing"), CLUE_SCROLL_ALL("Clue Scrolls (all)"), CLUE_SCROLL_BEGINNER("Clue Scrolls (beginner)"), CLUE_SCROLL_EASY("Clue Scrolls (easy)"), CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"), CLUE_SCROLL_HARD("Clue Scrolls (hard)"), CLUE_SCROLL_ELITE("Clue Scrolls (elite)"), - CLUE_SCROLL_MASTER("Clue Scrolls (master)"); + CLUE_SCROLL_MASTER("Clue Scrolls (master)"), + LAST_MAN_STANDING("Last Man Standing"); private final String name; diff --git a/http-api/src/main/java/net/runelite/http/api/worlds/WorldType.java b/http-api/src/main/java/net/runelite/http/api/worlds/WorldType.java index c94a7c70e6..af543b7383 100644 --- a/http-api/src/main/java/net/runelite/http/api/worlds/WorldType.java +++ b/http-api/src/main/java/net/runelite/http/api/worlds/WorldType.java @@ -34,6 +34,5 @@ public enum WorldType LAST_MAN_STANDING, TOURNAMENT, DEADMAN, - SEASONAL_DEADMAN, - DEADMAN_TOURNAMENT + LEAGUE; } diff --git a/http-service/src/main/java/net/runelite/http/service/worlds/ServiceWorldType.java b/http-service/src/main/java/net/runelite/http/service/worlds/ServiceWorldType.java index c6aa598321..896f152752 100644 --- a/http-service/src/main/java/net/runelite/http/service/worlds/ServiceWorldType.java +++ b/http-service/src/main/java/net/runelite/http/service/worlds/ServiceWorldType.java @@ -35,9 +35,8 @@ enum ServiceWorldType HIGH_RISK(WorldType.HIGH_RISK, 1 << 10), LAST_MAN_STANDING(WorldType.LAST_MAN_STANDING, 1 << 14), TOURNAMENT(WorldType.TOURNAMENT, 1 << 25), - DEADMAN_TOURNAMENT(WorldType.DEADMAN_TOURNAMENT, 1 << 26), DEADMAN(WorldType.DEADMAN, 1 << 29), - SEASONAL_DEADMAN(WorldType.SEASONAL_DEADMAN, 1 << 30); + LEAGUE(WorldType.LEAGUE, 1 << 30); private final WorldType apiType; private final int mask; diff --git a/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java b/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java index 4224205c91..e6c9f287aa 100644 --- a/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java +++ b/http-service/src/test/java/net/runelite/http/service/hiscore/HiscoreServiceTest.java @@ -60,16 +60,17 @@ public class HiscoreServiceTest + "638177,1,0\n" + "516239,9,1000\n" + "492790,1,0\n" + + "2,2460\n" // leagues + "-1,-1\n" + "73,1738\n" - + "-1,-1\n" + "531,1432\n" + "324,212\n" + "8008,131\n" + "1337,911\n" + "42,14113\n" + "1,777\n" - + "254,92\n"; + + "254,92\n" + + "-1,-1\n"; // lms private final MockWebServer server = new MockWebServer(); @@ -105,6 +106,7 @@ public class HiscoreServiceTest Assert.assertEquals(777, result.getClueScrollElite().getLevel()); Assert.assertEquals(254, result.getClueScrollMaster().getRank()); Assert.assertEquals(-1, result.getLastManStanding().getLevel()); + Assert.assertEquals(2460, result.getLeaguePoints().getLevel()); } } diff --git a/runelite-api/src/main/java/net/runelite/api/Varbits.java b/runelite-api/src/main/java/net/runelite/api/Varbits.java index 6b09685e1a..2aa98cb117 100644 --- a/runelite-api/src/main/java/net/runelite/api/Varbits.java +++ b/runelite-api/src/main/java/net/runelite/api/Varbits.java @@ -698,7 +698,16 @@ public enum Varbits WITHDRAW_X_AMOUNT(3960), - IN_PVP_AREA(8121); + IN_PVP_AREA(8121), + + /** + * Twisted league + */ + TWISTED_LEAGUE_RELIC_1(10049), + TWISTED_LEAGUE_RELIC_2(10050), + TWISTED_LEAGUE_RELIC_3(10051), + TWISTED_LEAGUE_RELIC_4(10052), + TWISTED_LEAGUE_RELIC_5(10053); /** * The raw varbit ID. diff --git a/runelite-api/src/main/java/net/runelite/api/WorldType.java b/runelite-api/src/main/java/net/runelite/api/WorldType.java index ec44fedd09..bb895ad504 100644 --- a/runelite-api/src/main/java/net/runelite/api/WorldType.java +++ b/runelite-api/src/main/java/net/runelite/api/WorldType.java @@ -1,3 +1,27 @@ +/* + * Copyright (c) 2018, Tomas Slusny + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ package net.runelite.api; import java.util.Collection; @@ -36,18 +60,14 @@ public enum WorldType * Tournament world type. */ TOURNAMENT(1 << 25), - /** - * Deadman Tournament world type. - */ - DEADMAN_TOURNAMENT(1 << 26), /** * Deadman world type. */ DEADMAN(1 << 29), /** - * Seasonal deadman world type. + * League world type */ - SEASONAL_DEADMAN(1 << 30); + LEAGUE(1 << 30); private final int mask; @@ -58,44 +78,34 @@ public enum WorldType private static final EnumSet PVP_WORLD_TYPES = EnumSet.of( DEADMAN, - DEADMAN_TOURNAMENT, - PVP, - SEASONAL_DEADMAN + PVP ); - + private static final EnumSet DEADMAN_WORLD_TYPES = EnumSet.of( - DEADMAN, - DEADMAN_TOURNAMENT, - SEASONAL_DEADMAN + DEADMAN ); private static final EnumSet HIGHRISK_WORLD_TYPES = EnumSet.of( HIGH_RISK ); - + private static final EnumSet ALL_HIGHRISK_WORLD_TYPES = EnumSet.of( HIGH_RISK, - DEADMAN, - DEADMAN_TOURNAMENT, - SEASONAL_DEADMAN + DEADMAN ); private static final EnumSet ALL_PVP_WORLD_TYPES = EnumSet.of( HIGH_RISK, DEADMAN, - DEADMAN_TOURNAMENT, - PVP, - SEASONAL_DEADMAN + PVP ); private static final EnumSet ALL_PK_WORLD_TYPES = EnumSet.of( HIGH_RISK, DEADMAN, - DEADMAN_TOURNAMENT, PVP, - SEASONAL_DEADMAN, BOUNTY - ); + ); /** * Create enum set of world types from mask. @@ -137,10 +147,10 @@ public enum WorldType } /** - * Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP/DEADMAN/HIGHRISK world. + * Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP world. * * @param worldTypes A {@link Collection} of {@link WorldType}s describing the given world. - * @return True if the given worldtypes of the world are a PVP/DEADMAN/HIGHRISK world, false otherwise. + * @return True if the given worldtypes of the world are a PVP world, false otherwise. * @see Client#getWorldType() */ public static boolean isPvpWorld(final Collection worldTypes) @@ -157,19 +167,19 @@ public enum WorldType { return worldTypes.stream().anyMatch(HIGHRISK_WORLD_TYPES::contains); } - + public static boolean isAllHighRiskWorld(final Collection worldTypes) { return worldTypes.stream().anyMatch(ALL_HIGHRISK_WORLD_TYPES::contains); } - + public static boolean isAllPvpWorld(final Collection worldTypes) { return worldTypes.stream().anyMatch(ALL_PVP_WORLD_TYPES::contains); } - + public static boolean isAllPKWorld(final Collection worldTypes) { return worldTypes.stream().anyMatch(ALL_PK_WORLD_TYPES::contains); } -} +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/Notifier.java b/runelite-client/src/main/java/net/runelite/client/Notifier.java index ee4fff642f..ea52314b89 100644 --- a/runelite-client/src/main/java/net/runelite/client/Notifier.java +++ b/runelite-client/src/main/java/net/runelite/client/Notifier.java @@ -192,9 +192,9 @@ public class Notifier case SOLID_UNTIL_CANCELLED: case FLASH_UNTIL_CANCELLED: // Any interaction with the client since the notification started will cancel it after the minimum duration - if (client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS + if ((client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS || client.getKeyboardIdleTicks() < MINIMUM_FLASH_DURATION_TICKS - || client.getMouseLastPressedMillis() > mouseLastPressedMillis) + || client.getMouseLastPressedMillis() > mouseLastPressedMillis) && clientUI.isFocused()) { flashStart = null; } diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index bb4e20affd..029e97adbb 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -87,6 +87,7 @@ import org.slf4j.LoggerFactory; public class RuneLite { public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite"); + public static final File CACHE_DIR = new File(RUNELITE_DIR, "cache"); public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles"); public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins"); public static final File SCREENSHOT_DIR = new File(RUNELITE_DIR, "screenshots"); diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java b/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java index 4b6fe543ab..964708fefb 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java @@ -75,7 +75,7 @@ public class RuneLiteModule extends AbstractModule bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode); bind(ScheduledExecutorService.class).toInstance(new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor())); bind(OkHttpClient.class).toInstance(RuneLiteAPI.CLIENT.newBuilder() - .cache(new Cache(new File(RuneLite.RUNELITE_DIR, "cache" + File.separator + "okhttp"), MAX_OKHTTP_CACHE_SIZE)) + .cache(new Cache(new File(RuneLite.CACHE_DIR, "okhttp"), MAX_OKHTTP_CACHE_SIZE)) .build()); bind(MenuManager.class); bind(ChatMessageManager.class); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/attackstyles/AttackStylesPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/attackstyles/AttackStylesPlugin.java index e9797c5657..e32be3082b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/attackstyles/AttackStylesPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/attackstyles/AttackStylesPlugin.java @@ -108,7 +108,7 @@ public class AttackStylesPlugin extends Plugin private boolean warnForRanged; private boolean warnForMagic; private boolean hideAutoRetaliate; - private boolean removeWarnedStyles; + boolean removeWarnedStyles; @Override protected void startUp() throws Exception @@ -170,7 +170,7 @@ public class AttackStylesPlugin extends Plugin return warnedSkillSelected; } - private void onWidgetHiddenChanged(WidgetHiddenChanged event) + void onWidgetHiddenChanged(WidgetHiddenChanged event) { if (event.getWidget().isSelfHidden() || TO_GROUP(event.getWidget().getId()) != COMBAT_GROUP_ID) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 4d3a1e522c..353127f59c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -28,6 +28,7 @@ package net.runelite.client.plugins.chatcommands; import com.google.inject.Provides; import io.reactivex.schedulers.Schedulers; import java.io.IOException; +import java.util.EnumSet; import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.regex.Matcher; @@ -42,8 +43,10 @@ import net.runelite.api.Experience; import net.runelite.api.IconID; import net.runelite.api.ItemDefinition; import net.runelite.api.MessageNode; +import net.runelite.api.Player; import net.runelite.api.VarPlayer; import net.runelite.api.Varbits; +import net.runelite.api.WorldType; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameTick; import net.runelite.api.events.VarbitChanged; @@ -1157,31 +1160,28 @@ public class ChatCommandsPlugin extends Plugin */ private HiscoreLookup getCorrectLookupFor(final ChatMessage chatMessage) { - final String player; - final HiscoreEndpoint ironmanStatus; + Player localPlayer = client.getLocalPlayer(); + final String player = sanitize(chatMessage.getName()); - if (chatMessage.getType().equals(ChatMessageType.PRIVATECHATOUT)) + // If we are sending the message then just use the local hiscore endpoint for the world + if (chatMessage.getType().equals(ChatMessageType.PRIVATECHATOUT) + || player.equals(localPlayer.getName())) { - player = client.getLocalPlayer().getName(); - ironmanStatus = hiscoreEndpoint; + return new HiscoreLookup(localPlayer.getName(), hiscoreEndpoint); } - else - { - player = sanitize(chatMessage.getName()); - if (player.equals(client.getLocalPlayer().getName())) + // Public chat on a leagues world is always league hiscores, regardless of icon + if (chatMessage.getType() == ChatMessageType.PUBLICCHAT || chatMessage.getType() == ChatMessageType.MODCHAT) + { + if (client.getWorldType().contains(WorldType.LEAGUE)) { - // Get ironman status from for the local player - ironmanStatus = hiscoreEndpoint; - } - else - { - // Get ironman status from their icon in chat - ironmanStatus = getHiscoreEndpointByName(chatMessage.getName()); + return new HiscoreLookup(player, HiscoreEndpoint.LEAGUE); } } - return new HiscoreLookup(player, ironmanStatus); + // Get ironman status from their icon in chat + HiscoreEndpoint endpoint = getHiscoreEndpointByName(chatMessage.getName()); + return new HiscoreLookup(player, endpoint); } /** @@ -1220,6 +1220,12 @@ public class ChatCommandsPlugin extends Plugin */ private HiscoreEndpoint getLocalHiscoreEndpointType() { + EnumSet worldType = client.getWorldType(); + if (worldType.contains(WorldType.LEAGUE)) + { + return HiscoreEndpoint.LEAGUE; + } + return toEndPoint(client.getAccountType()); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java index f88a428caa..95be35bf54 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/HotColdClue.java @@ -68,6 +68,10 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat "Jorral", "Speak to Jorral to receive a strange device.", new WorldPoint(2436, 3347, 0)); + private static final HotColdClue MASTER_CLUE_LEAGUE = new HotColdClue("Buried beneath the ground, who knows where it's found. Lucky for you, A man called Watson may have a clue.", + "Watson", + "Speak to Watson to receive a strange device.", + new WorldPoint(1645, 3572, 0)); private final String text; private final String npc; @@ -89,6 +93,11 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat MASTER_CLUE.reset(); return MASTER_CLUE; } + else if (MASTER_CLUE_LEAGUE.text.equalsIgnoreCase(text)) + { + MASTER_CLUE_LEAGUE.reset(); + return MASTER_CLUE_LEAGUE; + } return null; } @@ -272,11 +281,11 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat final Set temperatureSet; - if (this.equals(BEGINNER_CLUE)) + if (this == BEGINNER_CLUE) { temperatureSet = HotColdTemperature.BEGINNER_HOT_COLD_TEMPERATURES; } - else if (this.equals(MASTER_CLUE)) + else if (this == MASTER_CLUE || this == MASTER_CLUE_LEAGUE) { temperatureSet = HotColdTemperature.MASTER_HOT_COLD_TEMPERATURES; } @@ -300,8 +309,9 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat return false; } - if ((this.equals(BEGINNER_CLUE) && temperature == HotColdTemperature.BEGINNER_VISIBLY_SHAKING) - || (this.equals(MASTER_CLUE) && temperature == HotColdTemperature.MASTER_VISIBLY_SHAKING)) + boolean master = this == MASTER_CLUE || this == MASTER_CLUE_LEAGUE; + if ((this == BEGINNER_CLUE && temperature == HotColdTemperature.BEGINNER_VISIBLY_SHAKING) + || (master && temperature == HotColdTemperature.MASTER_VISIBLY_SHAKING)) { markFinalSpot(localWorld); } @@ -327,11 +337,11 @@ public class HotColdClue extends ClueScroll implements LocationClueScroll, Locat { final boolean isBeginner; - if (this.equals(BEGINNER_CLUE)) + if (this == BEGINNER_CLUE) { isBeginner = true; } - else if (this.equals(MASTER_CLUE)) + else if (this == MASTER_CLUE || this == MASTER_CLUE_LEAGUE) { isBeginner = false; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java index 439141d708..b1f2cfb0a3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java @@ -79,6 +79,7 @@ public class DeathIndicatorPlugin extends Plugin static final int HIJACKED_ITEMID = 0x69696969; private static final Set RESPAWN_REGIONS = ImmutableSet.of( + 6457, // Kourend 12850, // Lumbridge 11828, // Falador 12342, // Edgeville diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java index b0ab7c0c94..dabafe40f2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java @@ -82,6 +82,7 @@ import static net.runelite.http.api.hiscore.HiscoreSkill.HERBLORE; import static net.runelite.http.api.hiscore.HiscoreSkill.HITPOINTS; import static net.runelite.http.api.hiscore.HiscoreSkill.HUNTER; import static net.runelite.http.api.hiscore.HiscoreSkill.LAST_MAN_STANDING; +import static net.runelite.http.api.hiscore.HiscoreSkill.LEAGUE_POINTS; import static net.runelite.http.api.hiscore.HiscoreSkill.MAGIC; import static net.runelite.http.api.hiscore.HiscoreSkill.MINING; import static net.runelite.http.api.hiscore.HiscoreSkill.OVERALL; @@ -275,6 +276,7 @@ public class HiscorePanel extends PluginPanel minigamePanel.setBackground(ColorScheme.DARKER_GRAY_COLOR); minigamePanel.add(makeSkillPanel(CLUE_SCROLL_ALL)); + minigamePanel.add(makeSkillPanel(LEAGUE_POINTS)); minigamePanel.add(makeSkillPanel(LAST_MAN_STANDING)); minigamePanel.add(makeSkillPanel(BOUNTY_HUNTER_ROGUE)); minigamePanel.add(makeSkillPanel(BOUNTY_HUNTER_HUNTER)); @@ -470,15 +472,17 @@ public class HiscorePanel extends PluginPanel case 0: return null; case 1: - return HiscoreSkill.OVERALL; + return OVERALL; case 2: - return HiscoreSkill.CLUE_SCROLL_ALL; + return CLUE_SCROLL_ALL; case 3: - return HiscoreSkill.LAST_MAN_STANDING; + return LEAGUE_POINTS; case 4: - return HiscoreSkill.BOUNTY_HUNTER_ROGUE; + return LAST_MAN_STANDING; case 5: - return HiscoreSkill.BOUNTY_HUNTER_HUNTER; + return BOUNTY_HUNTER_ROGUE; + case 6: + return BOUNTY_HUNTER_HUNTER; } return null; @@ -562,6 +566,12 @@ public class HiscorePanel extends PluginPanel content += "

Rank: " + rank + "

"; break; } + case LEAGUE_POINTS: + { + String rank = (result.getLeaguePoints().getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(result.getLeaguePoints().getRank()); + content += "

Rank: " + rank + "

"; + break; + } case OVERALL: { Skill requestedSkill = result.getSkill(skill); @@ -651,18 +661,14 @@ public class HiscorePanel extends PluginPanel { EnumSet wTypes = client.getWorldType(); - if (wTypes.contains(WorldType.DEADMAN_TOURNAMENT)) - { - return HiscoreEndpoint.DEADMAN_TOURNAMENT; - } - else if (wTypes.contains(WorldType.SEASONAL_DEADMAN)) - { - return HiscoreEndpoint.SEASONAL_DEADMAN; - } - else if (wTypes.contains(WorldType.DEADMAN)) + if (wTypes.contains(WorldType.DEADMAN)) { return HiscoreEndpoint.DEADMAN; } + else if (wTypes.contains(WorldType.LEAGUE)) + { + return HiscoreEndpoint.LEAGUE; + } } return HiscoreEndpoint.NORMAL; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java index 1d6203b8fa..fc2c1adbf0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java @@ -950,7 +950,7 @@ public class IdleNotifierPlugin extends Plugin final Player local = client.getLocalPlayer(); SkullIcon currentTickSkull = local.getSkullIcon(); EnumSet worldTypes = client.getWorldType(); - if (!(worldTypes.contains(WorldType.DEADMAN) || worldTypes.contains(WorldType.SEASONAL_DEADMAN))) + if (!(worldTypes.contains(WorldType.DEADMAN))) { if (!isFirstTick) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java index d4770dd3d7..c3e2411fbb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/multiindicators/MultiIndicatorsPlugin.java @@ -279,7 +279,7 @@ public class MultiIndicatorsPlugin extends Plugin private void findLinesInScene() { inDeadman = client.getWorldType().stream().anyMatch(x -> - x == WorldType.DEADMAN || x == WorldType.SEASONAL_DEADMAN); + x == WorldType.DEADMAN); inPvp = client.getWorldType().stream().anyMatch(x -> x == WorldType.PVP || x == WorldType.HIGH_RISK); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java index 5db7532ebd..d49d02a935 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java @@ -184,18 +184,14 @@ public class OpponentInfoPlugin extends Plugin } final EnumSet worldType = client.getWorldType(); - if (worldType.contains(WorldType.DEADMAN_TOURNAMENT)) - { - hiscoreEndpoint = HiscoreEndpoint.DEADMAN_TOURNAMENT; - } - else if (worldType.contains(WorldType.SEASONAL_DEADMAN)) - { - hiscoreEndpoint = HiscoreEndpoint.SEASONAL_DEADMAN; - } - else if (worldType.contains(WorldType.DEADMAN)) + if (worldType.contains(WorldType.DEADMAN)) { hiscoreEndpoint = HiscoreEndpoint.DEADMAN; } + else if (worldType.contains(WorldType.LEAGUE)) + { + hiscoreEndpoint = HiscoreEndpoint.LEAGUE; + } else { hiscoreEndpoint = HiscoreEndpoint.NORMAL; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java index 5280371903..e8d8a564aa 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java @@ -709,16 +709,16 @@ public class ScreenshotPlugin extends Plugin if (client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null) { final EnumSet worldTypes = client.getWorldType(); - final boolean dmm = worldTypes.contains(WorldType.DEADMAN); - final boolean sdmm = worldTypes.contains(WorldType.SEASONAL_DEADMAN); - final boolean dmmt = worldTypes.contains(WorldType.DEADMAN_TOURNAMENT); - final boolean isDmmWorld = dmm || sdmm || dmmt; String playerDir = client.getLocalPlayer().getName(); - if (isDmmWorld) + if (worldTypes.contains(WorldType.DEADMAN)) { playerDir += "-Deadman"; } + else if (worldTypes.contains(WorldType.LEAGUE)) + { + playerDir += "-League"; + } playerFolder = new File(SCREENSHOT_DIR, playerDir); } else diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsPlugin.java index af4d6617d6..9282858695 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusorbs/StatusOrbsPlugin.java @@ -80,6 +80,7 @@ public class StatusOrbsPlugin extends Plugin private static final int SPEC_REGEN_TICKS = 50; private static final int NORMAL_HP_REGEN_TICKS = 100; + private static final int TWISTED_LEAGUE_ENDLESS_ENDURANCE_RELIC = 2; @Inject private Client client; @@ -258,6 +259,12 @@ public class StatusOrbsPlugin extends Plugin hpPerMs *= 2; } + if (client.getVar(Varbits.TWISTED_LEAGUE_RELIC_1) == TWISTED_LEAGUE_ENDLESS_ENDURANCE_RELIC) + { + ticksPerHPRegen /= 4; + hpPerMs *= 4; + } + ticksSinceHPRegen = (ticksSinceHPRegen + 1) % ticksPerHPRegen; hitpointsPercentage = ticksSinceHPRegen / (double) ticksPerHPRegen; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index ef97cf3174..935ac29c11 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -582,9 +582,7 @@ public class TimersPlugin extends Plugin } else if (HALF_TELEBLOCK_PATTERN.matcher(event.getMessage()).find()) { - if (client.getWorldType().contains(WorldType.DEADMAN) - && !client.getWorldType().contains(WorldType.SEASONAL_DEADMAN) - && !client.getWorldType().contains(WorldType.DEADMAN_TOURNAMENT)) + if (client.getWorldType().contains(WorldType.DEADMAN)) { createGameTimer(DMM_FULLTB); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java index cad6358120..cb740b1984 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java @@ -64,6 +64,7 @@ class WorldTableRow extends JPanel private static final Color TOURNAMENT_WORLD = new Color(79, 145, 255); private static final Color MEMBERS_WORLD = new Color(210, 193, 53); private static final Color FREE_WORLD = new Color(200, 200, 200); + private static final Color LEAGUE_WORLD = new Color(157, 237, 1); static { @@ -247,11 +248,14 @@ class WorldTableRow extends JPanel } else if (world.getTypes().contains(WorldType.PVP) || world.getTypes().contains(WorldType.HIGH_RISK) - || world.getTypes().contains(WorldType.DEADMAN) - || world.getTypes().contains(WorldType.SEASONAL_DEADMAN)) + || world.getTypes().contains(WorldType.DEADMAN)) { activityField.setForeground(DANGEROUS_WORLD); } + else if (world.getTypes().contains(WorldType.LEAGUE)) + { + activityField.setForeground(LEAGUE_WORLD); + } else if (world.getTypes().contains(WorldType.TOURNAMENT)) { activityField.setForeground(TOURNAMENT_WORLD); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpWorldType.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpWorldType.java index a907381347..b998a2f8b0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpWorldType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpWorldType.java @@ -31,8 +31,7 @@ enum XpWorldType NORMAL, TOURNEY, DMM, - SDMM, - DMMT; + LEAGUE; static XpWorldType of(WorldType type) { @@ -42,10 +41,8 @@ enum XpWorldType return TOURNEY; case DEADMAN: return DMM; - case SEASONAL_DEADMAN: - return SDMM; - case DEADMAN_TOURNAMENT: - return DMMT; + case LEAGUE: + return LEAGUE; default: return NORMAL; } diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/deadman_tournament.png b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/deadman_tournament.png deleted file mode 100644 index e74b1d940b..0000000000 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/deadman_tournament.png and /dev/null differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/league.png b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/league.png new file mode 100644 index 0000000000..b9473db512 Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/league.png differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/seasonal_deadman.png b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/seasonal_deadman.png deleted file mode 100644 index d3632e62db..0000000000 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/seasonal_deadman.png and /dev/null differ diff --git a/runelite-client/src/main/resources/skill_icons_small/league points.png b/runelite-client/src/main/resources/skill_icons_small/league points.png new file mode 100644 index 0000000000..1b976d526c Binary files /dev/null and b/runelite-client/src/main/resources/skill_icons_small/league points.png differ diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/attackstyles/AttackStylesPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/attackstyles/AttackStylesPluginTest.java index 893a88771b..e6daeb70c8 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/attackstyles/AttackStylesPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/attackstyles/AttackStylesPluginTest.java @@ -33,6 +33,7 @@ import net.runelite.api.Client; import net.runelite.api.Skill; import net.runelite.api.VarPlayer; import net.runelite.api.Varbits; +import net.runelite.api.events.WidgetHiddenChanged; import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.VarbitChanged; import net.runelite.api.widgets.Widget; @@ -44,8 +45,11 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; +import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.mockito.junit.MockitoJUnitRunner; @@ -174,6 +178,61 @@ public class AttackStylesPluginTest WidgetInfo.COMBAT_STYLE_THREE)); } + /* + * Verify that the defensive style is hidden when switching from bludgeon to bow + */ + @Test + public void testHiddenLongrange() + { + final ArgumentCaptor captor = ArgumentCaptor.forClass(Boolean.class); + final ConfigChanged warnForAttackEvent = new ConfigChanged(); + warnForAttackEvent.setGroup("attackIndicator"); + warnForAttackEvent.setKey("warnForDefensive"); + warnForAttackEvent.setNewValue("true"); + attackPlugin.onConfigChanged(warnForAttackEvent); + + // verify there is a warned skill + Set warnedSkills = attackPlugin.getWarnedSkills(); + assertTrue(warnedSkills.contains(Skill.DEFENCE)); + + // Set up mock widget for strength and longrange + final Widget widget = mock(Widget.class); + when(client.getWidget(WidgetInfo.COMBAT_STYLE_FOUR)).thenReturn(widget); + + // Set up hidden changed event + final WidgetHiddenChanged widgetHiddenChanged = new WidgetHiddenChanged(); + widgetHiddenChanged.setWidget(widget); + when(widget.getId()).thenReturn(WidgetInfo.COMBAT_STYLE_FOUR.getPackedId()); + + // Enable hiding widgets + final ConfigChanged hideWidgetEvent = new ConfigChanged(); + hideWidgetEvent.setGroup("attackIndicator"); + hideWidgetEvent.setKey("removeWarnedStyles"); + hideWidgetEvent.setNewValue("true"); + attackPlugin.onConfigChanged(hideWidgetEvent); + attackPlugin.removeWarnedStyles = true; + + // equip bludgeon on player + when(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_26.ordinal()); + attackPlugin.onVarbitChanged(new VarbitChanged()); + attackPlugin.onWidgetHiddenChanged(widgetHiddenChanged); + + // verify that the agressive style style widget is showing + verify(widget, atLeastOnce()).setHidden(captor.capture()); + assertFalse(captor.getValue()); + + // equip bow on player + // the equipped weaopn varbit will change after the hiddenChanged event has been dispatched + attackPlugin.onWidgetHiddenChanged(widgetHiddenChanged); + when(client.getVar(Varbits.EQUIPPED_WEAPON_TYPE)).thenReturn(WeaponType.TYPE_3.ordinal()); + attackPlugin.onVarbitChanged(new VarbitChanged()); + + // verify that the longrange attack style widget is now hidden + verify(widget, atLeastOnce()).setHidden(captor.capture()); + System.out.println(captor.getValue()); + assertTrue(captor.getValue()); + } + private boolean isAtkHidden() { if (attackPlugin.getHiddenWidgets().size() == 0)