Closes Anuken/Mindustry-Suggestions/issues/4677

This commit is contained in:
Anuken 2023-09-21 12:33:09 -04:00
parent 8f0fe86366
commit 78b4d366cc
3 changed files with 19 additions and 10 deletions

View File

@ -1170,6 +1170,11 @@ keybind.command_mode.name = Command Mode
keybind.command_queue.name = Queue Unit Command
keybind.create_control_group.name = Create Control Group
keybind.cancel_orders.name = Cancel Orders
keybind.unit_stance_1.name = Unit Stance 1
keybind.unit_stance_2.name = Unit Stance 2
keybind.unit_stance_3.name = Unit Stance 3
keybind.unit_stance_4.name = Unit Stance 4
keybind.unit_stance_5.name = Unit Stance 5
keybind.rebuild_select.name = Rebuild Region
keybind.schematic_select.name = Select Region
keybind.schematic_menu.name = Schematic Menu

View File

@ -1613,9 +1613,9 @@ public class LExecutor{
}
public static class ExplosionI implements LInstruction{
public int team, x, y, radius, damage, air, ground, pierce;
public int team, x, y, radius, damage, air, ground, pierce, effect;
public ExplosionI(int team, int x, int y, int radius, int damage, int air, int ground, int pierce){
public ExplosionI(int team, int x, int y, int radius, int damage, int air, int ground, int pierce, int effect){
this.team = team;
this.x = x;
this.y = y;
@ -1635,19 +1635,21 @@ public class LExecutor{
Team t = exec.team(team);
//note that there is a radius cap
Call.logicExplosion(t, World.unconv(exec.numf(x)), World.unconv(exec.numf(y)), World.unconv(Math.min(exec.numf(radius), 100)), exec.numf(damage), exec.bool(air), exec.bool(ground), exec.bool(pierce));
Call.logicExplosion(t, World.unconv(exec.numf(x)), World.unconv(exec.numf(y)), World.unconv(Math.min(exec.numf(radius), 100)), exec.numf(damage), exec.bool(air), exec.bool(ground), exec.bool(pierce), exec.bool(effect));
}
}
@Remote(called = Loc.server, unreliable = true)
public static void logicExplosion(Team team, float x, float y, float radius, float damage, boolean air, boolean ground, boolean pierce){
public static void logicExplosion(Team team, float x, float y, float radius, float damage, boolean air, boolean ground, boolean pierce, boolean effect){
if(damage < 0f) return;
Damage.damage(team, x, y, radius, damage, pierce, air, ground);
if(pierce){
Fx.spawnShockwave.at(x, y, World.conv(radius));
}else{
Fx.dynamicExplosion.at(x, y, World.conv(radius) / 8f);
if(effect){
if(pierce){
Fx.spawnShockwave.at(x, y, World.conv(radius));
}else{
Fx.dynamicExplosion.at(x, y, World.conv(radius) / 8f);
}
}
}

View File

@ -1599,7 +1599,7 @@ public class LStatements{
@RegisterStatement("explosion")
public static class ExplosionStatement extends LStatement{
public String team = "@crux", x = "0", y = "0", radius = "5", damage = "50", air = "true", ground = "true", pierce = "false";
public String team = "@crux", x = "0", y = "0", radius = "5", damage = "50", air = "true", ground = "true", pierce = "false", effect = "true";
@Override
public void build(Table table){
@ -1614,6 +1614,8 @@ public class LStatements{
row(table);
fields(table, "ground", ground, str -> ground = str);
fields(table, "pierce", pierce, str -> pierce = str);
table.row();
fields(table, "effect", effect, str -> effect = str);
}
@Override
@ -1623,7 +1625,7 @@ public class LStatements{
@Override
public LInstruction build(LAssembler b){
return new ExplosionI(b.var(team), b.var(x), b.var(y), b.var(radius), b.var(damage), b.var(air), b.var(ground), b.var(pierce));
return new ExplosionI(b.var(team), b.var(x), b.var(y), b.var(radius), b.var(damage), b.var(air), b.var(ground), b.var(pierce), b.var(effect));
}
@Override