mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 09:47:24 +07:00
Modifier reordering
This commit is contained in:
@ -4,6 +4,7 @@ alpha=0
|
|||||||
arkyid=37
|
arkyid=37
|
||||||
atrax=38
|
atrax=38
|
||||||
block=1
|
block=1
|
||||||
|
bryde=40
|
||||||
cix=2
|
cix=2
|
||||||
draug=3
|
draug=3
|
||||||
flare=36
|
flare=36
|
||||||
|
@ -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}]}
|
@ -25,7 +25,7 @@ public class BaseAI{
|
|||||||
private static final float step = 5;
|
private static final float step = 5;
|
||||||
private static final int attempts = 5;
|
private static final int attempts = 5;
|
||||||
private static final float emptyChance = 0.01f;
|
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;
|
private static int correct = 0, incorrect = 0;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import static mindustry.Vars.*;
|
|||||||
/** Class used for indexing special target blocks for AI. */
|
/** Class used for indexing special target blocks for AI. */
|
||||||
public class BlockIndexer{
|
public class BlockIndexer{
|
||||||
/** Size of one quadrant. */
|
/** Size of one quadrant. */
|
||||||
private final static int quadrantSize = 16;
|
private static final int quadrantSize = 16;
|
||||||
|
|
||||||
/** Set of all ores that are being scanned. */
|
/** Set of all ores that are being scanned. */
|
||||||
private final ObjectSet<Item> scanOres = new ObjectSet<>();
|
private final ObjectSet<Item> scanOres = new ObjectSet<>();
|
||||||
|
@ -45,7 +45,10 @@ public class UnitTypes implements ContentList{
|
|||||||
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Trailc.class}) UnitType alpha, beta, gamma;
|
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Trailc.class}) UnitType alpha, beta, gamma;
|
||||||
|
|
||||||
//water
|
//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
|
//special block unit type
|
||||||
public static @EntityDef({Unitc.class, BlockUnitc.class}) UnitType block;
|
public static @EntityDef({Unitc.class, BlockUnitc.class}) UnitType block;
|
||||||
@ -678,6 +681,8 @@ public class UnitTypes implements ContentList{
|
|||||||
immunities = ObjectSet.with(StatusEffects.wet);
|
immunities = ObjectSet.with(StatusEffects.wet);
|
||||||
trailLength = 20;
|
trailLength = 20;
|
||||||
|
|
||||||
|
armor = 2f;
|
||||||
|
|
||||||
weapons.add(new Weapon("mount-weapon"){{
|
weapons.add(new Weapon("mount-weapon"){{
|
||||||
reload = 12f;
|
reload = 12f;
|
||||||
x = 4f;
|
x = 4f;
|
||||||
@ -771,6 +776,7 @@ public class UnitTypes implements ContentList{
|
|||||||
trailX = 7f;
|
trailX = 7f;
|
||||||
trailY = -9f;
|
trailY = -9f;
|
||||||
trailScl = 1.5f;
|
trailScl = 1.5f;
|
||||||
|
payloadCapacity = 4;
|
||||||
|
|
||||||
abilities.add(new HealFieldAbility(22f, 60f * 4, 70f), new ShieldFieldAbility(20f, 40f, 60f * 4, 60f));
|
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;
|
hitEffect = Fx.massiveExplosion;
|
||||||
knockback = 1.5f;
|
knockback = 1.5f;
|
||||||
lifetime = 140f;
|
lifetime = 140f;
|
||||||
height = 17f;
|
height = 15.5f;
|
||||||
width = 15f;
|
width = 15f;
|
||||||
collidesTiles = false;
|
collidesTiles = false;
|
||||||
ammoMultiplier = 4f;
|
ammoMultiplier = 4f;
|
||||||
|
@ -28,8 +28,8 @@ import java.util.zip.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class NetClient implements ApplicationListener{
|
public class NetClient implements ApplicationListener{
|
||||||
private final static float dataTimeout = 60 * 18;
|
private static final float dataTimeout = 60 * 18;
|
||||||
private final static float playerSyncTime = 2;
|
private static final float playerSyncTime = 2;
|
||||||
public final static float viewScale = 2f;
|
public final static float viewScale = 2f;
|
||||||
|
|
||||||
private long ping;
|
private long ping;
|
||||||
|
@ -34,13 +34,13 @@ import static arc.util.Log.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class NetServer implements ApplicationListener{
|
public class NetServer implements ApplicationListener{
|
||||||
private final static int maxSnapshotSize = 430, timerBlockSync = 0;
|
private static final int maxSnapshotSize = 430, timerBlockSync = 0;
|
||||||
private final static float serverSyncTime = 12, blockSyncTime = 60 * 8;
|
private static final float serverSyncTime = 12, blockSyncTime = 60 * 8;
|
||||||
private final static FloatBuffer fbuffer = FloatBuffer.allocate(20);
|
private static final FloatBuffer fbuffer = FloatBuffer.allocate(20);
|
||||||
private final static Vec2 vector = new Vec2();
|
private static final Vec2 vector = new Vec2();
|
||||||
private final static Rect viewport = new Rect();
|
private static final Rect viewport = new Rect();
|
||||||
/** If a player goes away of their server-side coordinates by this distance, they get teleported back. */
|
/** 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 Administration admins = new Administration();
|
||||||
public final CommandHandler clientCommands = new CommandHandler("/");
|
public final CommandHandler clientCommands = new CommandHandler("/");
|
||||||
|
@ -3,7 +3,7 @@ package mindustry.editor;
|
|||||||
import arc.struct.Seq;
|
import arc.struct.Seq;
|
||||||
|
|
||||||
public class OperationStack{
|
public class OperationStack{
|
||||||
private final static int maxSize = 10;
|
private static final int maxSize = 10;
|
||||||
private Seq<DrawOperation> stack = new Seq<>();
|
private Seq<DrawOperation> stack = new Seq<>();
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import static mindustry.Vars.*;
|
|||||||
import static mindustry.game.SpawnGroup.never;
|
import static mindustry.game.SpawnGroup.never;
|
||||||
|
|
||||||
public class WaveInfoDialog extends BaseDialog{
|
public class WaveInfoDialog extends BaseDialog{
|
||||||
private final static int displayed = 20;
|
private static final int displayed = 20;
|
||||||
private Seq<SpawnGroup> groups = new Seq<>();
|
private Seq<SpawnGroup> groups = new Seq<>();
|
||||||
|
|
||||||
private Table table, preview;
|
private Table table, preview;
|
||||||
|
@ -20,9 +20,9 @@ import static arc.Core.camera;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class BlockRenderer implements Disposable{
|
public class BlockRenderer implements Disposable{
|
||||||
private final static int initialRequests = 32 * 32;
|
private static final int initialRequests = 32 * 32;
|
||||||
private final static int expandr = 9;
|
private static final int expandr = 9;
|
||||||
private final static Color shadowColor = new Color(0, 0, 0, 0.71f);
|
private static final Color shadowColor = new Color(0, 0, 0, 0.71f);
|
||||||
|
|
||||||
public final FloorRenderer floor = new FloorRenderer();
|
public final FloorRenderer floor = new FloorRenderer();
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import static mindustry.Vars.*;
|
|||||||
|
|
||||||
public class FloorRenderer implements Disposable{
|
public class FloorRenderer implements Disposable{
|
||||||
//TODO find out number with best performance
|
//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 Chunk[][] cache;
|
||||||
private MultiCacheBatch cbatch;
|
private MultiCacheBatch cbatch;
|
||||||
|
@ -9,7 +9,7 @@ import arc.util.*;
|
|||||||
|
|
||||||
//TODO this class is a trainwreck, remove it
|
//TODO this class is a trainwreck, remove it
|
||||||
public class IndexedRenderer implements Disposable{
|
public class IndexedRenderer implements Disposable{
|
||||||
private final static int vsize = 5;
|
private static final int vsize = 5;
|
||||||
|
|
||||||
private Shader program = new Shader(
|
private Shader program = new Shader(
|
||||||
"attribute vec4 a_position;\n" +
|
"attribute vec4 a_position;\n" +
|
||||||
|
@ -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[] mat1 = {new Vec2(), new Vec2()}, mat2 = {new Vec2(), new Vec2()};
|
||||||
private static final Vec2 temp = new Vec2(), temp2 = new Vec2(), at1 = 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);
|
at1.set(end).rotate(side ? 1 : -1).setLength(lengthA + lengthB).add(end.x / 2f, end.y / 2f);
|
||||||
return solve(lengthA, lengthB, end, at1, result);
|
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();
|
Vec2 axis = mat2[0].set(end).nor();
|
||||||
mat2[1].set(attractor).sub(temp2.set(axis).scl(attractor.dot(axis))).nor();
|
mat2[1].set(attractor).sub(temp2.set(axis).scl(attractor.dot(axis))).nor();
|
||||||
mat1[0].set(mat2[0].x, mat2[1].x);
|
mat1[0].set(mat2[0].x, mat2[1].x);
|
||||||
|
@ -607,7 +607,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
Payloadc pay = (Payloadc)unit;
|
Payloadc pay = (Payloadc)unit;
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.pickupCargo) && pay.payloads().size < unit.type().payloadCapacity){
|
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){
|
if(target != null){
|
||||||
Call.pickupUnitPayload(player, target);
|
Call.pickupUnitPayload(player, target);
|
||||||
}else if(!pay.hasPayload()){
|
}else if(!pay.hasPayload()){
|
||||||
|
@ -113,7 +113,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
|
|
||||||
if(target.isAI() && target.isGrounded() && pay.payloads().size < unit.type().payloadCapacity
|
if(target.isAI() && target.isGrounded() && pay.payloads().size < unit.type().payloadCapacity
|
||||||
&& target.mass() < unit.mass()
|
&& 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);
|
pay.pickup(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ import static mindustry.Vars.*;
|
|||||||
public class BaseGenerator{
|
public class BaseGenerator{
|
||||||
private static final Vec2 axis = new Vec2(), rotator = new Vec2();
|
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 Tiles tiles;
|
||||||
private Team team;
|
private Team team;
|
||||||
|
@ -28,8 +28,8 @@ import java.util.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class BlockInventoryFragment extends Fragment{
|
public class BlockInventoryFragment extends Fragment{
|
||||||
private final static float holdWithdraw = 20f;
|
private static final float holdWithdraw = 20f;
|
||||||
private final static float holdShrink = 120f;
|
private static final float holdShrink = 120f;
|
||||||
|
|
||||||
private Table table = new Table();
|
private Table table = new Table();
|
||||||
private Building tile;
|
private Building tile;
|
||||||
|
@ -21,7 +21,7 @@ import static mindustry.Vars.net;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class ChatFragment extends Table{
|
public class ChatFragment extends Table{
|
||||||
private final static int messagesShown = 10;
|
private static final int messagesShown = 10;
|
||||||
private Seq<ChatMessage> messages = new Seq<>();
|
private Seq<ChatMessage> messages = new Seq<>();
|
||||||
private float fadetime;
|
private float fadetime;
|
||||||
private boolean shown = false;
|
private boolean shown = false;
|
||||||
|
@ -19,7 +19,7 @@ import static arc.Core.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class ScriptConsoleFragment extends Table{
|
public class ScriptConsoleFragment extends Table{
|
||||||
private final static int messagesShown = 30;
|
private static final int messagesShown = 30;
|
||||||
private Seq<String> messages = new Seq<>();
|
private Seq<String> messages = new Seq<>();
|
||||||
private boolean open = false, shown;
|
private boolean open = false, shown;
|
||||||
private TextField chatfield;
|
private TextField chatfield;
|
||||||
|
@ -8,10 +8,10 @@ import mindustry.gen.*;
|
|||||||
import mindustry.world.consumers.*;
|
import mindustry.world.consumers.*;
|
||||||
|
|
||||||
public class PowerGraph{
|
public class PowerGraph{
|
||||||
private final static Queue<Building> queue = new Queue<>();
|
private static final Queue<Building> queue = new Queue<>();
|
||||||
private final static Seq<Building> outArray1 = new Seq<>();
|
private static final Seq<Building> outArray1 = new Seq<>();
|
||||||
private final static Seq<Building> outArray2 = new Seq<>();
|
private static final Seq<Building> outArray2 = new Seq<>();
|
||||||
private final static IntSet closedSet = new IntSet();
|
private static final IntSet closedSet = new IntSet();
|
||||||
|
|
||||||
private final ObjectSet<Building> producers = new ObjectSet<>();
|
private final ObjectSet<Building> producers = new ObjectSet<>();
|
||||||
private final ObjectSet<Building> consumers = new ObjectSet<>();
|
private final ObjectSet<Building> consumers = new ObjectSet<>();
|
||||||
|
Reference in New Issue
Block a user