Modifier reordering

This commit is contained in:
Anuken
2020-07-17 19:00:39 -04:00
parent 521e3c773f
commit 6b3039dba2
20 changed files with 40 additions and 32 deletions

View File

@ -4,6 +4,7 @@ alpha=0
arkyid=37
atrax=38
block=1
bryde=40
cix=2
draug=3
flare=36

View File

@ -0,0 +1 @@
{fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@ -25,7 +25,7 @@ public class BaseAI{
private static final float step = 5;
private static final int attempts = 5;
private static final float emptyChance = 0.01f;
private final static int timerStep = 0, timerSpawn = 1;
private static final int timerStep = 0, timerSpawn = 1;
private static int correct = 0, incorrect = 0;

View File

@ -22,7 +22,7 @@ import static mindustry.Vars.*;
/** Class used for indexing special target blocks for AI. */
public class BlockIndexer{
/** Size of one quadrant. */
private final static int quadrantSize = 16;
private static final int quadrantSize = 16;
/** Set of all ores that are being scanned. */
private final ObjectSet<Item> scanOres = new ObjectSet<>();

View File

@ -45,7 +45,10 @@ public class UnitTypes implements ContentList{
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Trailc.class}) UnitType alpha, beta, gamma;
//water
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType risse, minke, bryde;
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType risse, minke;
//water + payload
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class, Payloadc.class}) UnitType bryde;
//special block unit type
public static @EntityDef({Unitc.class, BlockUnitc.class}) UnitType block;
@ -678,6 +681,8 @@ public class UnitTypes implements ContentList{
immunities = ObjectSet.with(StatusEffects.wet);
trailLength = 20;
armor = 2f;
weapons.add(new Weapon("mount-weapon"){{
reload = 12f;
x = 4f;
@ -771,6 +776,7 @@ public class UnitTypes implements ContentList{
trailX = 7f;
trailY = -9f;
trailScl = 1.5f;
payloadCapacity = 4;
abilities.add(new HealFieldAbility(22f, 60f * 4, 70f), new ShieldFieldAbility(20f, 40f, 60f * 4, 60f));
@ -796,7 +802,7 @@ public class UnitTypes implements ContentList{
hitEffect = Fx.massiveExplosion;
knockback = 1.5f;
lifetime = 140f;
height = 17f;
height = 15.5f;
width = 15f;
collidesTiles = false;
ammoMultiplier = 4f;

View File

@ -28,8 +28,8 @@ import java.util.zip.*;
import static mindustry.Vars.*;
public class NetClient implements ApplicationListener{
private final static float dataTimeout = 60 * 18;
private final static float playerSyncTime = 2;
private static final float dataTimeout = 60 * 18;
private static final float playerSyncTime = 2;
public final static float viewScale = 2f;
private long ping;

View File

@ -34,13 +34,13 @@ import static arc.util.Log.*;
import static mindustry.Vars.*;
public class NetServer implements ApplicationListener{
private final static int maxSnapshotSize = 430, timerBlockSync = 0;
private final static float serverSyncTime = 12, blockSyncTime = 60 * 8;
private final static FloatBuffer fbuffer = FloatBuffer.allocate(20);
private final static Vec2 vector = new Vec2();
private final static Rect viewport = new Rect();
private static final int maxSnapshotSize = 430, timerBlockSync = 0;
private static final float serverSyncTime = 12, blockSyncTime = 60 * 8;
private static final FloatBuffer fbuffer = FloatBuffer.allocate(20);
private static final Vec2 vector = new Vec2();
private static final Rect viewport = new Rect();
/** If a player goes away of their server-side coordinates by this distance, they get teleported back. */
private final static float correctDist = 16f;
private static final float correctDist = 16f;
public final Administration admins = new Administration();
public final CommandHandler clientCommands = new CommandHandler("/");

View File

@ -3,7 +3,7 @@ package mindustry.editor;
import arc.struct.Seq;
public class OperationStack{
private final static int maxSize = 10;
private static final int maxSize = 10;
private Seq<DrawOperation> stack = new Seq<>();
private int index = 0;

View File

@ -25,7 +25,7 @@ import static mindustry.Vars.*;
import static mindustry.game.SpawnGroup.never;
public class WaveInfoDialog extends BaseDialog{
private final static int displayed = 20;
private static final int displayed = 20;
private Seq<SpawnGroup> groups = new Seq<>();
private Table table, preview;

View File

@ -20,9 +20,9 @@ import static arc.Core.camera;
import static mindustry.Vars.*;
public class BlockRenderer implements Disposable{
private final static int initialRequests = 32 * 32;
private final static int expandr = 9;
private final static Color shadowColor = new Color(0, 0, 0, 0.71f);
private static final int initialRequests = 32 * 32;
private static final int expandr = 9;
private static final Color shadowColor = new Color(0, 0, 0, 0.71f);
public final FloorRenderer floor = new FloorRenderer();

View File

@ -18,7 +18,7 @@ import static mindustry.Vars.*;
public class FloorRenderer implements Disposable{
//TODO find out number with best performance
private final static int chunksize = mobile ? 16 : 32;
private static final int chunksize = mobile ? 16 : 32;
private Chunk[][] cache;
private MultiCacheBatch cbatch;

View File

@ -9,7 +9,7 @@ import arc.util.*;
//TODO this class is a trainwreck, remove it
public class IndexedRenderer implements Disposable{
private final static int vsize = 5;
private static final int vsize = 5;
private Shader program = new Shader(
"attribute vec4 a_position;\n" +

View File

@ -7,12 +7,12 @@ public class InverseKinematics{
private static final Vec2[] mat1 = {new Vec2(), new Vec2()}, mat2 = {new Vec2(), new Vec2()};
private static final Vec2 temp = new Vec2(), temp2 = new Vec2(), at1 = new Vec2();
static public boolean solve(float lengthA, float lengthB, Vec2 end, boolean side, Vec2 result){
public static boolean solve(float lengthA, float lengthB, Vec2 end, boolean side, Vec2 result){
at1.set(end).rotate(side ? 1 : -1).setLength(lengthA + lengthB).add(end.x / 2f, end.y / 2f);
return solve(lengthA, lengthB, end, at1, result);
}
static public boolean solve(float lengthA, float lengthB, Vec2 end, Vec2 attractor, Vec2 result){
public static boolean solve(float lengthA, float lengthB, Vec2 end, Vec2 attractor, Vec2 result){
Vec2 axis = mat2[0].set(end).nor();
mat2[1].set(attractor).sub(temp2.set(axis).scl(attractor.dot(axis))).nor();
mat1[0].set(mat2[0].x, mat2[1].x);

View File

@ -607,7 +607,7 @@ public class DesktopInput extends InputHandler{
Payloadc pay = (Payloadc)unit;
if(Core.input.keyTap(Binding.pickupCargo) && pay.payloads().size < unit.type().payloadCapacity){
Unit target = Units.closest(player.team(), pay.x(), pay.y(), unit.type().hitsize * 1.1f, u -> u.isAI() && u.isGrounded() && u.mass() < unit.mass());
Unit target = Units.closest(player.team(), pay.x(), pay.y(), unit.type().hitsize * 2.5f, u -> u.isAI() && u.isGrounded() && u.mass() < unit.mass() && u.within(unit, u.hitSize + unit.hitSize * 1.2f));
if(target != null){
Call.pickupUnitPayload(player, target);
}else if(!pay.hasPayload()){

View File

@ -113,7 +113,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(target.isAI() && target.isGrounded() && pay.payloads().size < unit.type().payloadCapacity
&& target.mass() < unit.mass()
&& target.within(unit, unit.type().hitsize * 1.5f)){
&& target.within(unit, unit.type().hitsize * 1.5f + target.type().hitsize)){
pay.pickup(target);
}
}

View File

@ -21,7 +21,7 @@ import static mindustry.Vars.*;
public class BaseGenerator{
private static final Vec2 axis = new Vec2(), rotator = new Vec2();
private final static int range = 180;
private static final int range = 180;
private Tiles tiles;
private Team team;

View File

@ -28,8 +28,8 @@ import java.util.*;
import static mindustry.Vars.*;
public class BlockInventoryFragment extends Fragment{
private final static float holdWithdraw = 20f;
private final static float holdShrink = 120f;
private static final float holdWithdraw = 20f;
private static final float holdShrink = 120f;
private Table table = new Table();
private Building tile;

View File

@ -21,7 +21,7 @@ import static mindustry.Vars.net;
import static mindustry.Vars.*;
public class ChatFragment extends Table{
private final static int messagesShown = 10;
private static final int messagesShown = 10;
private Seq<ChatMessage> messages = new Seq<>();
private float fadetime;
private boolean shown = false;

View File

@ -19,7 +19,7 @@ import static arc.Core.*;
import static mindustry.Vars.*;
public class ScriptConsoleFragment extends Table{
private final static int messagesShown = 30;
private static final int messagesShown = 30;
private Seq<String> messages = new Seq<>();
private boolean open = false, shown;
private TextField chatfield;

View File

@ -8,10 +8,10 @@ import mindustry.gen.*;
import mindustry.world.consumers.*;
public class PowerGraph{
private final static Queue<Building> queue = new Queue<>();
private final static Seq<Building> outArray1 = new Seq<>();
private final static Seq<Building> outArray2 = new Seq<>();
private final static IntSet closedSet = new IntSet();
private static final Queue<Building> queue = new Queue<>();
private static final Seq<Building> outArray1 = new Seq<>();
private static final Seq<Building> outArray2 = new Seq<>();
private static final IntSet closedSet = new IntSet();
private final ObjectSet<Building> producers = new ObjectSet<>();
private final ObjectSet<Building> consumers = new ObjectSet<>();