Skip to content

Commit

Permalink
Added an option to disable passing hidden abilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasQTruong committed Oct 24, 2023
1 parent 5408e90 commit 1601557
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ public Gender getRandomGender(Pokemon getFor) {
* @return boolean - whether the Cobblemon has a hidden ability or not.
*/
public boolean hasHiddenAbility(Pokemon toCheck) {
// Hidden ability is disabled.
if (VeryScuffedCobblemonBreedingConfig.HIDDEN_ABILITY == 0) {
return false;
}

List<AbilityTemplate> possibleHiddens = new ArrayList<>();

// Get list of hidden abilities.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class VeryScuffedCobblemonBreedingConfig {
public static int VIP_COMMAND_POKEBREED_PERMISSION_LEVEL = 3; // VIP permission level.
public static int COOLDOWN_IN_MINUTES = 5; // Default: 5 minutes cooldown.
public static int VIP_COOLDOWN_IN_MINUTES = 3; // VIP breeding cooldown, default: 3.

public static int DITTO_BREEDING = 1; // Whether breeding with a ditto is allowed or not, default: 1 (true).
public static int HIDDEN_ABILITY = 1; // Whether passing down hidden abilities is enabled: 1 (true).

public VeryScuffedCobblemonBreedingConfig() {
init();
Expand Down Expand Up @@ -58,6 +58,7 @@ public void init() {
JsonObject otherFeatures = obj.get("otherFeatures").getAsJsonObject();
HashMap<String, Integer> otherFeaturesMap = GSON.fromJson(otherFeatures, type);
DITTO_BREEDING = otherFeaturesMap.getOrDefault("ditto.breeding", 1);
HIDDEN_ABILITY = otherFeaturesMap.getOrDefault("hidden.ability", 1);

} catch (Exception e) {
throw new RuntimeException(e);
Expand Down Expand Up @@ -88,6 +89,8 @@ private void createConfig(File configFolder) {
.beginObject()
.name("ditto.breeding")
.value(DITTO_BREEDING)
.name("hidden.ability")
.value(HIDDEN_ABILITY)
.endObject()
.endObject()
.flush();
Expand Down

0 comments on commit 1601557

Please sign in to comment.