Disable world processor rule

This commit is contained in:
Anuken 2022-05-05 20:36:11 -04:00
parent 60fb2e537f
commit f7175540f8
4 changed files with 6 additions and 0 deletions

View File

@ -1082,6 +1082,7 @@ rules.infiniteresources = Infinite Resources
rules.onlydepositcore = Only Allow Core Depositing
rules.reactorexplosions = Reactor Explosions
rules.coreincinerates = Core Incinerates Overflow
rules.disableworldprocessors = Disable World Processors
rules.schematic = Schematics Allowed
rules.wavetimer = Wave Timer
rules.waves = Waves

View File

@ -62,6 +62,8 @@ public class Rules{
public float unitDamageMultiplier = 1f;
/** Whether to allow units to build with logic. */
public boolean logicUnitBuild = true;
/** If true, world processors no longer update. Used for testing. */
public boolean disableWorldProcessors = false;
/** How much health blocks start with. */
public float blockHealthMultiplier = 1f;
/** How much damage blocks (turrets) deal. */

View File

@ -155,6 +155,7 @@ public class CustomRulesDialog extends BaseDialog{
check("@rules.schematic", b -> rules.schematicsAllowed = b, () -> rules.schematicsAllowed);
check("@rules.coreincinerates", b -> rules.coreIncinerates = b, () -> rules.coreIncinerates);
check("@rules.cleanupdeadteams", b -> rules.cleanupDeadTeams = b, () -> rules.cleanupDeadTeams, () -> rules.pvp);
check("@rules.disableworldprocessors", b -> rules.disableWorldProcessors = b, () -> rules.disableWorldProcessors);
number("@rules.buildcostmultiplier", false, f -> rules.buildCostMultiplier = f, () -> rules.buildCostMultiplier, () -> !rules.infiniteResources);
number("@rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier, 0.001f, 50f);
number("@rules.deconstructrefundmultiplier", false, f -> rules.deconstructRefundMultiplier = f, () -> rules.deconstructRefundMultiplier, () -> !rules.infiniteResources);

View File

@ -494,6 +494,8 @@ public class LogicBlock extends Block{
ipt = instructionsPerTick;
}
if(state.rules.disableWorldProcessors && privileged) return;
if(enabled && executor.initialized()){
accumulator += edelta() * ipt * efficiency;