Bugfixes
This commit is contained in:
@@ -1520,14 +1520,14 @@ public class Blocks implements ContentList{
|
|||||||
recoil = 4f;
|
recoil = 4f;
|
||||||
size = 4;
|
size = 4;
|
||||||
shootShake = 2f;
|
shootShake = 2f;
|
||||||
powerUsed = 0.5f;
|
|
||||||
consumes.powerBuffered(1200f);
|
|
||||||
range = 190f;
|
range = 190f;
|
||||||
reload = 50f;
|
reload = 50f;
|
||||||
firingMoveFract = 0.5f;
|
firingMoveFract = 0.5f;
|
||||||
shootDuration = 220f;
|
shootDuration = 220f;
|
||||||
|
powerUsed = 1f / 2f;
|
||||||
|
|
||||||
health = 200 * size * size;
|
health = 200 * size * size;
|
||||||
|
consumes.powerBuffered(1200f);
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.5f)).update(false);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class Zones implements ContentList{
|
|||||||
conditionWave = 10;
|
conditionWave = 10;
|
||||||
zoneRequirements = ZoneRequirement.with(groundZero, 10);
|
zoneRequirements = ZoneRequirement.with(groundZero, 10);
|
||||||
blockRequirements = new Block[]{Blocks.router};
|
blockRequirements = new Block[]{Blocks.router};
|
||||||
resources = new Item[]{Items.copper, Items.lead, Items.coal};
|
resources = new Item[]{Items.copper, Items.lead, Items.coal, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = () -> new Rules(){{
|
||||||
waves = true;
|
waves = true;
|
||||||
waveTimer = true;
|
waveTimer = true;
|
||||||
|
|||||||
@@ -638,8 +638,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void updateFlying(){
|
protected void updateFlying(){
|
||||||
if(Units.invalidateTarget(target, this) && !(target instanceof TileEntity && ((TileEntity)target).damaged() && target.getTeam() == team &&
|
if(Units.invalidateTarget(target, this) && !(target instanceof TileEntity && ((TileEntity)target).damaged() && target.isValid() && ((TileEntity)target).isAdded() && target.getTeam() == team && mech.canHeal && dst(target) < getWeapon().bullet.range())){
|
||||||
mech.canHeal && dst(target) < getWeapon().bullet.range())){
|
|
||||||
target = null;
|
target = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ import io.anuke.mindustry.net.Packets.AdminAction;
|
|||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
|
||||||
|
|
||||||
import java.lang.StringBuilder;
|
import java.lang.StringBuilder;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class HudFragment extends Fragment{
|
public class HudFragment extends Fragment{
|
||||||
public final PlacementFragment blockfrag = new PlacementFragment();
|
public final PlacementFragment blockfrag = new PlacementFragment();
|
||||||
|
|
||||||
@@ -480,6 +480,6 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
}).growY().fillX().right().width(40f)
|
}).growY().fillX().right().width(40f)
|
||||||
.visible(() -> state.rules.waves && ((Net.server() || player.isAdmin) || !Net.active()) && state.enemies() == 0
|
.visible(() -> state.rules.waves && ((Net.server() || player.isAdmin) || !Net.active()) && state.enemies() == 0
|
||||||
&& (!world.spawner.isSpawning() || !state.rules.waveTimer));
|
&& !world.spawner.isSpawning());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class PowerGraph{
|
|||||||
|
|
||||||
public void distributePower(float needed, float produced){
|
public void distributePower(float needed, float produced){
|
||||||
//distribute even if not needed. this is because some might be requiring power but not requesting it; it updates consumers
|
//distribute even if not needed. this is because some might be requiring power but not requesting it; it updates consumers
|
||||||
float coverage = Mathf.isZero(needed) ? 1f : Math.min(1, produced / needed);
|
float coverage = Mathf.isZero(needed) && Mathf.isZero(produced) ? 0f : Mathf.isZero(needed) ? 1f : Math.min(1, produced / needed);
|
||||||
for(Tile consumer : consumers){
|
for(Tile consumer : consumers){
|
||||||
Consumers consumes = consumer.block().consumes;
|
Consumers consumes = consumer.block().consumes;
|
||||||
if(consumes.hasPower()){
|
if(consumes.hasPower()){
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import org.junit.jupiter.api.BeforeAll;
|
|
||||||
|
|
||||||
public class MapTests{
|
|
||||||
|
|
||||||
@BeforeAll
|
|
||||||
static void launchApplication(){
|
|
||||||
ApplicationTests.launchApplication();
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO
|
|
||||||
}
|
|
||||||
@@ -42,7 +42,7 @@ public class PowerTests extends PowerTestFixture{
|
|||||||
// That's why we inject the description into the test method for now.
|
// That's why we inject the description into the test method for now.
|
||||||
// Additional Note: If you don't see any labels in front of the values supplied as function parameters, use a better IDE like IntelliJ IDEA.
|
// Additional Note: If you don't see any labels in front of the values supplied as function parameters, use a better IDE like IntelliJ IDEA.
|
||||||
dynamicTest("01", () -> simulateDirectConsumption(0.0f, 1.0f, 0.0f, "0.0 produced, 1.0 consumed (no power available)")),
|
dynamicTest("01", () -> simulateDirectConsumption(0.0f, 1.0f, 0.0f, "0.0 produced, 1.0 consumed (no power available)")),
|
||||||
dynamicTest("02", () -> simulateDirectConsumption(0.0f, 0.0f, 1.0f, "0.0 produced, 0.0 consumed (no power anywhere)")),
|
dynamicTest("02", () -> simulateDirectConsumption(0.0f, 0.0f, 0.0f, "0.0 produced, 0.0 consumed (no power anywhere)")),
|
||||||
dynamicTest("03", () -> simulateDirectConsumption(1.0f, 0.0f, 1.0f, "1.0 produced, 0.0 consumed (no power requested)")),
|
dynamicTest("03", () -> simulateDirectConsumption(1.0f, 0.0f, 1.0f, "1.0 produced, 0.0 consumed (no power requested)")),
|
||||||
dynamicTest("04", () -> simulateDirectConsumption(1.0f, 1.0f, 1.0f, "1.0 produced, 1.0 consumed (stable consumption)")),
|
dynamicTest("04", () -> simulateDirectConsumption(1.0f, 1.0f, 1.0f, "1.0 produced, 1.0 consumed (stable consumption)")),
|
||||||
dynamicTest("05", () -> simulateDirectConsumption(0.5f, 1.0f, 0.5f, "0.5 produced, 1.0 consumed (power shortage)")),
|
dynamicTest("05", () -> simulateDirectConsumption(0.5f, 1.0f, 0.5f, "0.5 produced, 1.0 consumed (power shortage)")),
|
||||||
|
|||||||
Reference in New Issue
Block a user