Fixed tests
This commit is contained in:
@@ -3318,18 +3318,23 @@ public class Blocks{
|
|||||||
disperse = new ItemTurret("disperse"){{
|
disperse = new ItemTurret("disperse"){{
|
||||||
requirements(Category.turret, with(Items.carbide, 250, Items.surgeAlloy, 160, Items.silicon, 300, Items.beryllium, 400));
|
requirements(Category.turret, with(Items.carbide, 250, Items.surgeAlloy, 160, Items.silicon, 300, Items.beryllium, 400));
|
||||||
|
|
||||||
ammo(Items.graphite, new BasicBulletType(){{
|
ammo(Items.scrap, new BasicBulletType(){{
|
||||||
damage = 40;
|
damage = 40;
|
||||||
speed = 7f;
|
speed = 8f;
|
||||||
width = 9f;
|
width = 11f;
|
||||||
height = 15f;
|
height = 16f;
|
||||||
trailColor = Pal.bulletYellowBack;
|
trailColor = Pal.bulletYellowBack;
|
||||||
|
velocityInaccuracy = 0.11f;
|
||||||
|
collidesGround = false;
|
||||||
|
collidesTiles = false;
|
||||||
|
shootEffect = Fx.shootBig2;
|
||||||
|
smokeEffect = Fx.shootBigSmoke2;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
//TODO bullet.
|
//TODO bullet.
|
||||||
|
|
||||||
//recoilAmount = 1f;
|
//recoilAmount = 1f;
|
||||||
reloadTime = 5f;
|
reloadTime = 8f;
|
||||||
shootLength = 15f;
|
shootLength = 15f;
|
||||||
rotateSpeed = 5f;
|
rotateSpeed = 5f;
|
||||||
|
|
||||||
@@ -3343,7 +3348,9 @@ public class Blocks{
|
|||||||
shots = 4;
|
shots = 4;
|
||||||
alternate = true;
|
alternate = true;
|
||||||
widthSpread = true;
|
widthSpread = true;
|
||||||
|
targetGround = false;
|
||||||
spread = 4.6f;
|
spread = 4.6f;
|
||||||
|
inaccuracy = 8f;
|
||||||
|
|
||||||
restitution = 0.1f;
|
restitution = 0.1f;
|
||||||
shootWarmupSpeed = 0.08f;
|
shootWarmupSpeed = 0.08f;
|
||||||
|
|||||||
@@ -60,11 +60,18 @@ public class FogRenderer implements CustomChunk{
|
|||||||
|
|
||||||
public void drawFog(){
|
public void drawFog(){
|
||||||
//resize if world size changes
|
//resize if world size changes
|
||||||
buffer.resize(world.width(), world.height());
|
boolean clear = buffer.resizeCheck(world.width(), world.height());
|
||||||
|
|
||||||
//set projection to whole map
|
//set projection to whole map
|
||||||
Draw.proj(0, 0, buffer.getWidth() * tilesize, buffer.getHeight() * tilesize);
|
Draw.proj(0, 0, buffer.getWidth() * tilesize, buffer.getHeight() * tilesize);
|
||||||
buffer.begin();
|
|
||||||
|
//if the buffer resized, it contains garbage now, clear it.
|
||||||
|
if(clear){
|
||||||
|
buffer.begin(Color.black);
|
||||||
|
}else{
|
||||||
|
buffer.begin();
|
||||||
|
}
|
||||||
|
|
||||||
Gl.blendEquationSeparate(Gl.max, Gl.max);
|
Gl.blendEquationSeparate(Gl.max, Gl.max);
|
||||||
ScissorStack.push(rect.set(1, 1, buffer.getWidth() - 2, buffer.getHeight() - 2));
|
ScissorStack.push(rect.set(1, 1, buffer.getWidth() - 2, buffer.getHeight() - 2));
|
||||||
|
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ public abstract class SaveFileReader{
|
|||||||
public interface CustomChunk{
|
public interface CustomChunk{
|
||||||
void write(DataOutput stream) throws IOException;
|
void write(DataOutput stream) throws IOException;
|
||||||
void read(DataInput stream) throws IOException;
|
void read(DataInput stream) throws IOException;
|
||||||
boolean shouldWrite();
|
default boolean shouldWrite(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package mindustry.io.versions;
|
||||||
|
|
||||||
|
import arc.util.io.*;
|
||||||
|
import mindustry.io.*;
|
||||||
|
import mindustry.world.*;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
|
||||||
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
|
/** This version does not read custom chunk data (<= 6). */
|
||||||
|
public class LegacyRegionSaveVersion extends SaveVersion{
|
||||||
|
|
||||||
|
public LegacyRegionSaveVersion(int version){
|
||||||
|
super(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void read(DataInputStream stream, CounterInputStream counter, WorldContext context) throws IOException{
|
||||||
|
region("meta", stream, counter, this::readMeta);
|
||||||
|
region("content", stream, counter, this::readContentHeader);
|
||||||
|
|
||||||
|
try{
|
||||||
|
region("map", stream, counter, in -> readMap(in, context));
|
||||||
|
region("entities", stream, counter, this::readEntities);
|
||||||
|
}finally{
|
||||||
|
content.setTemporaryMapper(null);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,14 +4,13 @@ import arc.util.*;
|
|||||||
import arc.util.io.*;
|
import arc.util.io.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.io.*;
|
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public abstract class LegacySaveVersion extends SaveVersion{
|
public abstract class LegacySaveVersion extends LegacyRegionSaveVersion{
|
||||||
|
|
||||||
public LegacySaveVersion(int version){
|
public LegacySaveVersion(int version){
|
||||||
super(version);
|
super(version);
|
||||||
|
|||||||
@@ -3,12 +3,11 @@ package mindustry.io.versions;
|
|||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.util.io.*;
|
import arc.util.io.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.io.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
/** This version did not read/write entity IDs to the save. */
|
/** This version did not read/write entity IDs to the save. */
|
||||||
public class LegacySaveVersion2 extends SaveVersion{
|
public class LegacySaveVersion2 extends LegacyRegionSaveVersion{
|
||||||
|
|
||||||
public LegacySaveVersion2(int version){
|
public LegacySaveVersion2(int version){
|
||||||
super(version);
|
super(version);
|
||||||
|
|||||||
@@ -1,31 +1,9 @@
|
|||||||
package mindustry.io.versions;
|
package mindustry.io.versions;
|
||||||
|
|
||||||
import arc.util.io.*;
|
|
||||||
import mindustry.io.*;
|
|
||||||
import mindustry.world.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
|
||||||
|
|
||||||
/** This version does not read custom chunk data. */
|
/** This version does not read custom chunk data. */
|
||||||
public class Save6 extends SaveVersion{
|
public class Save6 extends LegacyRegionSaveVersion{
|
||||||
|
|
||||||
public Save6(){
|
public Save6(){
|
||||||
super(6);
|
super(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void read(DataInputStream stream, CounterInputStream counter, WorldContext context) throws IOException{
|
|
||||||
region("meta", stream, counter, this::readMeta);
|
|
||||||
region("content", stream, counter, this::readContentHeader);
|
|
||||||
|
|
||||||
try{
|
|
||||||
region("map", stream, counter, in -> readMap(in, context));
|
|
||||||
region("entities", stream, counter, this::readEntities);
|
|
||||||
}finally{
|
|
||||||
content.setTemporaryMapper(null);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -553,6 +553,7 @@ public class Turret extends ReloadTurret{
|
|||||||
bulletOffset.trns(rotation - 90, (spread) * i + Mathf.range(xRand), shootLength);
|
bulletOffset.trns(rotation - 90, (spread) * i + Mathf.range(xRand), shootLength);
|
||||||
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy));
|
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy));
|
||||||
shotCounter ++;
|
shotCounter ++;
|
||||||
|
effects();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
bulletOffset.trns(rotation, shootLength, Mathf.range(xRand));
|
bulletOffset.trns(rotation, shootLength, Mathf.range(xRand));
|
||||||
@@ -561,11 +562,11 @@ public class Turret extends ReloadTurret{
|
|||||||
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - (int)(shots / 2f)) * spread);
|
bullet(type, rotation + Mathf.range(inaccuracy + type.inaccuracy) + (i - (int)(shots / 2f)) * spread);
|
||||||
shotCounter ++;
|
shotCounter ++;
|
||||||
}
|
}
|
||||||
|
effects();
|
||||||
}
|
}
|
||||||
|
|
||||||
recoil = recoilAmount;
|
recoil = recoilAmount;
|
||||||
heat = 1f;
|
heat = 1f;
|
||||||
effects();
|
|
||||||
useAmmo();
|
useAmmo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user