Skip to content

Commit

Permalink
feat: AutoBestRocket Added all the rockets (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
dm94 authored Sep 1, 2024
1 parent e9a680c commit e982d13
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import eu.darkbot.api.config.annotations.Configuration;
import eu.darkbot.api.config.annotations.Dropdown;
import eu.darkbot.api.config.annotations.Option;
import eu.darkbot.api.game.items.SelectableItem.Rocket;

@Configuration("best_rocket")
public class BestRocketConfig {
Expand All @@ -15,11 +16,11 @@ public class BestRocketConfig {

@Option("best_rocket.rockets_to_use_npcs")
@Dropdown(multi = true)
public Set<SupportedRockets> rocketsToUseNPCs = EnumSet.noneOf(SupportedRockets.class);
public Set<Rocket> rocketsToUseNPCs = EnumSet.noneOf(Rocket.class);

@Option("best_rocket.rockets_to_use_players")
@Dropdown(multi = true)
public Set<SupportedRockets> rocketsToUsePlayers = EnumSet.allOf(SupportedRockets.class);
public Set<Rocket> rocketsToUsePlayers = EnumSet.allOf(Rocket.class);

@Option("general.tick_stopped")
public boolean tickStopped = false;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.Set;

import com.deeme.behaviours.bestrocket.BestRocketConfig;
import com.deeme.behaviours.bestrocket.SupportedRockets;
import com.deeme.types.SharedFunctions;

import eu.darkbot.api.PluginAPI;
Expand Down Expand Up @@ -34,7 +33,8 @@ public class BestRocketSupplier {
List<SelectableItem> damageOrder = Arrays.asList(Rocket.SP_100X, Rocket.PLT_3030, Rocket.PLT_2021,
Rocket.BDR_1211,
Rocket.PLT_2026,
Rocket.R_310);
Rocket.R_310,
Rocket.WIZ_X);

List<SelectableItem> damageOrderNPCs = Arrays.asList(Rocket.BDR_1211, Rocket.SP_100X,
Rocket.PLT_3030,
Expand Down Expand Up @@ -156,7 +156,7 @@ private boolean ableToUse(SelectableItem rocket, boolean isNpc) {
return ableToUse(rocket, config.rocketsToUsePlayers);
}

private boolean ableToUse(SelectableItem rocket, Set<SupportedRockets> rockets) {
private boolean ableToUse(SelectableItem rocket, Set<Rocket> rockets) {
return rocket != null && rockets.stream().anyMatch(s -> s.getId() != null && s.getId().equals(rocket.getId()))
&& ableToUse(rocket);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "DmPlugin",
"author": "Dm94Dani",
"version": "2.3.0 beta 5",
"version": "2.3.0 beta 6",
"minVersion": "1.131",
"supportedVersion": "1.131.2",
"basePackage": "com.deeme",
Expand Down

0 comments on commit e982d13

Please sign in to comment.