Whitelist Option + Hiding Banned Blocks Rules (#7553)

* Whitelist Option

* Hide banned blocks rule
This commit is contained in:
MEEPofFaith
2022-10-06 11:14:48 -07:00
committed by GitHub
parent 4ac3eb1c9a
commit a7c7238cc8
9 changed files with 27 additions and 8 deletions

View File

@@ -95,6 +95,12 @@ public class Rules{
public boolean onlyDepositCore = false;
/** If true, every enemy block in the radius of the (enemy) core is destroyed upon death. Used for campaign maps. */
public boolean coreDestroyClear = false;
/** If true, banned blocks are hidden from the build menu. */
public boolean hideBannedBlocks = false;
/** If true, bannedBlocks becomes a whitelist. */
public boolean blockWhitelist = false;
/** If true, bannedUnits becomes a whitelist. */
public boolean unitWhitelist = false;
/** Radius around enemy wave drop zones.*/
public float dropZoneRadius = 300f;
/** Time between waves in ticks. */
@@ -228,6 +234,14 @@ public class Rules{
return buildSpeedMultiplier * teams.get(team).buildSpeedMultiplier;
}
public boolean isBanned(Block block){
return blockWhitelist != bannedBlocks.contains(block);
}
public boolean isBanned(UnitType unit){
return unitWhitelist != bannedUnits.contains(unit);
}
/** A team-specific ruleset. */
public static class TeamRule{
/** Whether, when AI is enabled, ships should be spawned from the core. TODO remove / unnecessary? */