mining: update duration to use GAME_TICKS instead of milliseconds

This commit is contained in:
melkypie
2020-02-27 12:42:53 +02:00
parent e77860ab4c
commit 1a388f1765
2 changed files with 24 additions and 23 deletions

View File

@@ -44,8 +44,8 @@ import net.runelite.client.ui.overlay.components.ProgressPieComponent;
class MiningOverlay extends Overlay
{
// Range of Motherlode vein respawn time - not 100% confirmed but based on observation
static final int ORE_VEIN_MAX_RESPAWN_TIME = 166;
private static final int ORE_VEIN_MIN_RESPAWN_TIME = 90;
static final int ORE_VEIN_MAX_RESPAWN_TIME = 277; // Game ticks
private static final int ORE_VEIN_MIN_RESPAWN_TIME = 150; // Game ticks
private static final float ORE_VEIN_RANDOM_PERCENT_THRESHOLD = (float) ORE_VEIN_MIN_RESPAWN_TIME / ORE_VEIN_MAX_RESPAWN_TIME;
private static final Color DARK_GREEN = new Color(0, 100, 0);
private static final int MOTHERLODE_UPPER_FLOOR_HEIGHT = -500;

View File

@@ -30,20 +30,21 @@ import java.util.Map;
import lombok.AccessLevel;
import lombok.Getter;
import static net.runelite.api.ObjectID.*;
import static net.runelite.client.util.RSTimeUnit.*;
enum Rock
{
TIN(Duration.ofMillis(2400), 0, ROCKS_11360, ROCKS_11361),
COPPER(Duration.ofMillis(2400), 0, ROCKS_10943, ROCKS_11161),
IRON(Duration.ofMillis(5400), 0, ROCKS_11364, ROCKS_11365, ROCKS_36203)
TIN(Duration.of(4, GAME_TICKS), 0, ROCKS_11360, ROCKS_11361),
COPPER(Duration.of(4, GAME_TICKS), 0, ROCKS_10943, ROCKS_11161),
IRON(Duration.of(9, GAME_TICKS), 0, ROCKS_11364, ROCKS_11365, ROCKS_36203)
{
@Override
Duration getRespawnTime(int region)
{
return region == MINING_GUILD ? Duration.ofMillis(2400) : super.respawnTime;
return region == MINING_GUILD ? Duration.of(4, GAME_TICKS) : super.respawnTime;
}
},
COAL(Duration.ofMillis(29400), 0, ROCKS_11366, ROCKS_11367, ROCKS_36204)
COAL(Duration.of(49, GAME_TICKS), 0, ROCKS_11366, ROCKS_11367, ROCKS_36204)
{
@Override
Duration getRespawnTime(int region)
@@ -51,46 +52,46 @@ enum Rock
switch (region)
{
case MINING_GUILD:
return Duration.ofMillis(14400);
return Duration.of(24, GAME_TICKS);
case MISCELLANIA:
return Duration.ofMillis(6600);
return Duration.of(11, GAME_TICKS);
default:
return super.respawnTime;
}
}
},
SILVER(Duration.ofMinutes(1), 0, ROCKS_11368, ROCKS_11369, ROCKS_36205),
SANDSTONE(Duration.ofMillis(5400), 0, ROCKS_11386),
GOLD(Duration.ofMinutes(1), 0, ROCKS_11370, ROCKS_11371, ROCKS_36206),
GRANITE(Duration.ofMillis(5400), 0, ROCKS_11387),
MITHRIL(Duration.ofMinutes(2), 0, ROCKS_11372, ROCKS_11373, ROCKS_36207)
SILVER(Duration.of(100, GAME_TICKS), 0, ROCKS_11368, ROCKS_11369, ROCKS_36205),
SANDSTONE(Duration.of(9, GAME_TICKS), 0, ROCKS_11386),
GOLD(Duration.of(100, GAME_TICKS), 0, ROCKS_11370, ROCKS_11371, ROCKS_36206),
GRANITE(Duration.of(9, GAME_TICKS), 0, ROCKS_11387),
MITHRIL(Duration.of(200, GAME_TICKS), 0, ROCKS_11372, ROCKS_11373, ROCKS_36207)
{
@Override
Duration getRespawnTime(int region)
{
return region == MINING_GUILD ? Duration.ofMinutes(1) : super.respawnTime;
return region == MINING_GUILD ? Duration.of(100, GAME_TICKS) : super.respawnTime;
}
},
ADAMANTITE(Duration.ofMinutes(4), 0, ROCKS_11374, ROCKS_11375, ROCKS_36208)
ADAMANTITE(Duration.of(400, GAME_TICKS), 0, ROCKS_11374, ROCKS_11375, ROCKS_36208)
{
@Override
Duration getRespawnTime(int region)
{
return region == MINING_GUILD || region == WILDERNESS_RESOURCE_AREA ? Duration.ofMinutes(2) : super.respawnTime;
return region == MINING_GUILD || region == WILDERNESS_RESOURCE_AREA ? Duration.of(200, GAME_TICKS) : super.respawnTime;
}
},
RUNITE(Duration.ofMinutes(12), 0, ROCKS_11376, ROCKS_11377, ROCKS_36209)
RUNITE(Duration.of(1200, GAME_TICKS), 0, ROCKS_11376, ROCKS_11377, ROCKS_36209)
{
@Override
Duration getRespawnTime(int region)
{
return region == MINING_GUILD ? Duration.ofMinutes(6) : super.respawnTime;
return region == MINING_GUILD ? Duration.of(600, GAME_TICKS) : super.respawnTime;
}
},
ORE_VEIN(Duration.ofSeconds(MiningOverlay.ORE_VEIN_MAX_RESPAWN_TIME), 150),
AMETHYST(Duration.ofSeconds(75), 120),
ASH_VEIN(Duration.ofSeconds(30), 0, ASH_PILE),
GEM_ROCK(Duration.ofMinutes(1), 0, ROCKS_11380, ROCKS_11381);
ORE_VEIN(Duration.of(MiningOverlay.ORE_VEIN_MAX_RESPAWN_TIME, GAME_TICKS), 150),
AMETHYST(Duration.of(125, GAME_TICKS), 120),
ASH_VEIN(Duration.of(50, GAME_TICKS), 0, ASH_PILE),
GEM_ROCK(Duration.of(100, GAME_TICKS), 0, ROCKS_11380, ROCKS_11381);
private static final int WILDERNESS_RESOURCE_AREA = 12605;
private static final int MISCELLANIA = 10044;