Ban/Unban Blocks & Units with World Processors (#9052)

* uh

* mmmmmm

* hhhhhh

* i

* indicate
This commit is contained in:
Mythril382
2023-09-13 01:56:16 +08:00
committed by GitHub
parent 34ba2cfd41
commit be525df065
3 changed files with 23 additions and 0 deletions

View File

@@ -1450,6 +1450,22 @@ public class LExecutor{
}
case ambientLight -> state.rules.ambientLight.fromDouble(exec.num(value));
case solarMultiplier -> state.rules.solarMultiplier = Math.max(exec.numf(value), 0f);
case ban -> {
Object cont = exec.obj(value);
if(cont instanceof Block b){
state.rules.bannedBlocks.add(b);
}else if(cont instanceof UnitType u){
state.rules.bannedUnits.add(u);
}
}
case unban -> {
Object cont = exec.obj(value);
if(cont instanceof Block b){
state.rules.bannedBlocks.remove(b);
}else if(cont instanceof UnitType u){
state.rules.bannedUnits.remove(u);
}
}
case unitHealth, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
Team team = exec.team(p1);
if(team != null){

View File

@@ -1392,6 +1392,11 @@ public class LStatements{
row(table);
field(table, value, s -> value = s);
}
case ban, unban -> {
table.add(" block/unit ");
field(table, value, s -> value = s);
}
default -> {
table.add(" = ");

View File

@@ -15,6 +15,8 @@ public enum LogicRule{
lighting,
ambientLight,
solarMultiplier,
ban,
unban,
//team specific
buildSpeed,