Cleanup, renaming

This commit is contained in:
Anuken
2020-06-08 21:03:29 -04:00
parent 6dd9369066
commit 6501071510
15 changed files with 571 additions and 605 deletions

View File

@@ -1767,7 +1767,7 @@ public class Blocks implements ContentList{
upgrades = new UnitType[][]{
{UnitTypes.tau, UnitTypes.oculon},
{UnitTypes.dagger, UnitTypes.titan},
{UnitTypes.dagger, UnitTypes.mace},
{UnitTypes.crawler, UnitTypes.eruptor},
{UnitTypes.wraith, UnitTypes.ghoul},
};
@@ -1785,7 +1785,7 @@ public class Blocks implements ContentList{
upgrades = new UnitType[][]{
{UnitTypes.ghoul, UnitTypes.revenant},
{UnitTypes.titan, UnitTypes.fortress},
{UnitTypes.mace, UnitTypes.fortress},
};
}};

View File

@@ -14,7 +14,7 @@ import mindustry.type.*;
public class UnitTypes implements ContentList{
//ground
public static @EntityDef({Unitc.class, Mechc.class}) UnitType titan, dagger, crawler, fortress, chaosArray, eradicator;
public static @EntityDef({Unitc.class, Mechc.class}) UnitType mace, dagger, crawler, fortress, chaosArray, eradicator;
//ground + builder
public static @EntityDef({Unitc.class, Mechc.class, Builderc.class}) UnitType tau;
@@ -76,7 +76,7 @@ public class UnitTypes implements ContentList{
}});
}};
titan = new UnitType("titan"){{
mace = new UnitType("mace"){{
speed = 0.4f;
hitsize = 9f;
range = 10f;

View File

@@ -52,6 +52,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
transient Block block;
transient Seq<Tilec> proximity = new Seq<>(8);
transient boolean updateFlow;
transient byte dump;
PowerModule power;
ItemModule items;
@@ -413,8 +414,6 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
* @return whether the payload was moved successfully
*/
public boolean dumpPayload(@NonNull Payload todump){
int dump = tile.data;
if(proximity.size == 0) return false;
for(int i = 0; i < proximity.size; i++){
@@ -449,8 +448,6 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
}
public void dumpLiquid(Liquid liquid){
int dump = tile.data;
for(int i = 0; i < proximity.size; i++){
incrementDump(proximity.size);
Tilec other = proximity.get((i + dump) % proximity.size);
@@ -549,7 +546,6 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
*/
public void offload(Item item){
Seq<Tilec> proximity = proximity();
int dump = tile.data;
useContent(item);
for(int i = 0; i < proximity.size; i++){
@@ -569,7 +565,6 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
*/
public boolean put(Item item){
Seq<Tilec> proximity = proximity();
int dump = tile.data;
useContent(item);
for(int i = 0; i < proximity.size; i++){
@@ -597,7 +592,6 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
if(!block.hasItems || items.total() == 0 || (todump != null && !items.has(todump))) return false;
Seq<Tilec> proximity = proximity();
int dump = tile.data;
if(proximity.size == 0) return false;
@@ -632,7 +626,7 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
}
public void incrementDump(int prox){
tile.data = (byte)((tile.data + 1) % prox);
dump = (byte)((dump + 1) % prox);
}
/** Used for dumping items. */

View File

@@ -35,7 +35,7 @@ public class DefaultWaves{
max = 4;
}},
new SpawnGroup(UnitTypes.titan){{
new SpawnGroup(UnitTypes.mace){{
begin = 7;
spacing = 3;
unitScaling = 2;
@@ -50,21 +50,21 @@ public class DefaultWaves{
spacing = 2;
}},
new SpawnGroup(UnitTypes.titan){{
new SpawnGroup(UnitTypes.mace){{
begin = 28;
spacing = 3;
unitScaling = 1;
end = 40;
}},
new SpawnGroup(UnitTypes.titan){{
new SpawnGroup(UnitTypes.mace){{
begin = 45;
spacing = 3;
unitScaling = 2;
effect = StatusEffects.overdrive;
}},
new SpawnGroup(UnitTypes.titan){{
new SpawnGroup(UnitTypes.mace){{
begin = 120;
spacing = 2;
unitScaling = 3;

View File

@@ -23,8 +23,6 @@ public class Tile implements Position, QuadTreeObject{
/** Tile entity, usually null. */
public @Nullable Tilec entity;
public short x, y;
/** Extra data. Used for dumping. */
public byte data;
protected @NonNull Block block;
protected @NonNull Floor floor;
protected @NonNull Floor overlay;

View File

@@ -68,8 +68,16 @@ public class PayloadConveyor extends Block{
Tilec accept = nearby(Geometry.d4(rotation()).x * size, Geometry.d4(rotation()).y * size);
//next block must be aligned and of the same size
if(accept != null && accept.block().size == size &&
tileX() + Geometry.d4(rotation()).x * size == accept.tileX() && tileY() + Geometry.d4(rotation()).y * size == accept.tileY()){
if(accept != null && (
//same size
(accept.block().size == size && tileX() + Geometry.d4(rotation()).x * size == accept.tileX() && tileY() + Geometry.d4(rotation()).y * size == accept.tileY()) ||
//differing sizes
(accept.block().size > size &&
(rotation() % 2 == 0 ? //check orientation
Math.abs(accept.y() - y) <= accept.block().size * tilesize - size * tilesize : //check Y alignment
Math.abs(accept.x() - x) <= accept.block().size * tilesize - size * tilesize //check X alignment
)))){
next = accept;
}else{
next = null;