mining: add Lovakite rocks
This commit is contained in:
@@ -45,6 +45,11 @@ class MiningOverlay extends Overlay
|
|||||||
static final int ORE_VEIN_MAX_RESPAWN_TIME = 277; // Game ticks
|
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 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 float ORE_VEIN_RANDOM_PERCENT_THRESHOLD = (float) ORE_VEIN_MIN_RESPAWN_TIME / ORE_VEIN_MAX_RESPAWN_TIME;
|
||||||
|
|
||||||
|
static final int LOVAKITE_ORE_MAX_RESPAWN_TIME = 65; // Game ticks
|
||||||
|
private static final int LOVAKITE_ORE_MIN_RESPAWN_TIME = 50; // Game ticks
|
||||||
|
private static final float LOVAKITE_ORE_RANDOM_PERCENT_THRESHOLD = (float) LOVAKITE_ORE_MIN_RESPAWN_TIME / LOVAKITE_ORE_MAX_RESPAWN_TIME;
|
||||||
|
|
||||||
private static final Color DARK_GREEN = new Color(0, 100, 0);
|
private static final Color DARK_GREEN = new Color(0, 100, 0);
|
||||||
private static final int MOTHERLODE_UPPER_FLOOR_HEIGHT = -500;
|
private static final int MOTHERLODE_UPPER_FLOOR_HEIGHT = -500;
|
||||||
|
|
||||||
@@ -97,8 +102,9 @@ class MiningOverlay extends Overlay
|
|||||||
Color pieFillColor = Color.YELLOW;
|
Color pieFillColor = Color.YELLOW;
|
||||||
Color pieBorderColor = Color.ORANGE;
|
Color pieBorderColor = Color.ORANGE;
|
||||||
|
|
||||||
// Recolour pie on motherlode veins during the portion of the timer where they may respawn
|
// Recolour pie on motherlode veins or Lovakite ore during the portion of the timer where they may respawn
|
||||||
if (rock == Rock.ORE_VEIN && percent > ORE_VEIN_RANDOM_PERCENT_THRESHOLD)
|
if ((rock == Rock.ORE_VEIN && percent > ORE_VEIN_RANDOM_PERCENT_THRESHOLD)
|
||||||
|
|| (rock == Rock.LOVAKITE && percent > LOVAKITE_ORE_RANDOM_PERCENT_THRESHOLD))
|
||||||
{
|
{
|
||||||
pieFillColor = Color.GREEN;
|
pieFillColor = Color.GREEN;
|
||||||
pieBorderColor = DARK_GREEN;
|
pieBorderColor = DARK_GREEN;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import static net.runelite.api.ObjectID.ORE_VEIN_26664;
|
|||||||
import net.runelite.api.WallObject;
|
import net.runelite.api.WallObject;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.GameObjectDespawned;
|
import net.runelite.api.events.GameObjectDespawned;
|
||||||
|
import net.runelite.api.events.GameObjectSpawned;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.events.WallObjectSpawned;
|
import net.runelite.api.events.WallObjectSpawned;
|
||||||
@@ -132,6 +133,24 @@ public class MiningPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||||
|
{
|
||||||
|
if (client.getGameState() != GameState.LOGGED_IN)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GameObject object = event.getGameObject();
|
||||||
|
|
||||||
|
// If the Lovakite ore respawns before the timer is up, remove it
|
||||||
|
if (Rock.getRock(object.getId()) == Rock.LOVAKITE)
|
||||||
|
{
|
||||||
|
final WorldPoint point = object.getWorldLocation();
|
||||||
|
respawns.removeIf(rockRespawn -> rockRespawn.getWorldPoint().equals(point));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onWallObjectSpawned(WallObjectSpawned event)
|
public void onWallObjectSpawned(WallObjectSpawned event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ enum Rock
|
|||||||
return region == MINING_GUILD ? Duration.of(100, GAME_TICKS) : super.respawnTime;
|
return region == MINING_GUILD ? Duration.of(100, GAME_TICKS) : super.respawnTime;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
LOVAKITE(Duration.of(MiningOverlay.LOVAKITE_ORE_MAX_RESPAWN_TIME, GAME_TICKS), 0, ROCKS_28596, ROCKS_28597),
|
||||||
ADAMANTITE(Duration.of(400, GAME_TICKS), 0, ROCKS_11374, ROCKS_11375, ROCKS_36208)
|
ADAMANTITE(Duration.of(400, GAME_TICKS), 0, ROCKS_11374, ROCKS_11375, ROCKS_36208)
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user