Ban/Unban Blocks & Units with World Processors (#9052)
* uh * mmmmmm * hhhhhh * i * indicate
This commit is contained in:
@@ -1450,6 +1450,22 @@ public class LExecutor{
|
|||||||
}
|
}
|
||||||
case ambientLight -> state.rules.ambientLight.fromDouble(exec.num(value));
|
case ambientLight -> state.rules.ambientLight.fromDouble(exec.num(value));
|
||||||
case solarMultiplier -> state.rules.solarMultiplier = Math.max(exec.numf(value), 0f);
|
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 -> {
|
case unitHealth, unitBuildSpeed, unitCost, unitDamage, blockHealth, blockDamage, buildSpeed, rtsMinSquad, rtsMinWeight -> {
|
||||||
Team team = exec.team(p1);
|
Team team = exec.team(p1);
|
||||||
if(team != null){
|
if(team != null){
|
||||||
|
|||||||
@@ -1392,6 +1392,11 @@ public class LStatements{
|
|||||||
row(table);
|
row(table);
|
||||||
field(table, value, s -> value = s);
|
field(table, value, s -> value = s);
|
||||||
}
|
}
|
||||||
|
case ban, unban -> {
|
||||||
|
table.add(" block/unit ");
|
||||||
|
|
||||||
|
field(table, value, s -> value = s);
|
||||||
|
}
|
||||||
default -> {
|
default -> {
|
||||||
table.add(" = ");
|
table.add(" = ");
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public enum LogicRule{
|
|||||||
lighting,
|
lighting,
|
||||||
ambientLight,
|
ambientLight,
|
||||||
solarMultiplier,
|
solarMultiplier,
|
||||||
|
ban,
|
||||||
|
unban,
|
||||||
|
|
||||||
//team specific
|
//team specific
|
||||||
buildSpeed,
|
buildSpeed,
|
||||||
|
|||||||
Reference in New Issue
Block a user