Misc bugfixes
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 492 B |
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -2568,14 +2568,6 @@ public class UnitTypes{
|
|||||||
Lines.line(e.x, e.y, v.x, v.y);
|
Lines.line(e.x, e.y, v.x, v.y);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
pointEffectSpace = 8f;
|
|
||||||
|
|
||||||
if(false)
|
|
||||||
pointEffect = new Effect(20, e -> {
|
|
||||||
color(e.color);
|
|
||||||
Fill.poly(e.x, e.y, 3, 4f * e.fout(), e.rotation);
|
|
||||||
}).layer(Layer.bullet - 0.001f);
|
|
||||||
}};
|
}};
|
||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
@@ -2588,7 +2580,7 @@ public class UnitTypes{
|
|||||||
health = 4500;
|
health = 4500;
|
||||||
armor = 10f;
|
armor = 10f;
|
||||||
itemCapacity = 0;
|
itemCapacity = 0;
|
||||||
treadRects = new Rect[]{new Rect(16 - 60f, 38 - 60f, 30, 75), new Rect(44 - 60f, 7 - 60f, 17, 60)};
|
treadRects = new Rect[]{new Rect(16 - 60f, 48 - 70f, 30, 75), new Rect(44 - 60f, 17 - 70f, 17, 60)};
|
||||||
researchCostMultiplier = 0f;
|
researchCostMultiplier = 0f;
|
||||||
|
|
||||||
weapons.add(new Weapon("precept-weapon"){{
|
weapons.add(new Weapon("precept-weapon"){{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
transient Tile tile;
|
transient Tile tile;
|
||||||
transient Block block;
|
transient Block block;
|
||||||
transient Seq<Building> proximity = new Seq<>(6);
|
transient Seq<Building> proximity = new Seq<>(6);
|
||||||
transient byte cdump;
|
transient int cdump;
|
||||||
transient int rotation;
|
transient int rotation;
|
||||||
transient float payloadRotation;
|
transient float payloadRotation;
|
||||||
transient String lastAccessed;
|
transient String lastAccessed;
|
||||||
@@ -992,7 +992,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void incrementDump(int prox){
|
public void incrementDump(int prox){
|
||||||
cdump = (byte)((cdump + 1) % prox);
|
cdump = ((cdump + 1) % prox);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Used for dumping items. */
|
/** Used for dumping items. */
|
||||||
|
|||||||
@@ -448,6 +448,7 @@ public class Block extends UnlockableContent implements Senseable{
|
|||||||
/** Drawn when placing and when hovering over. */
|
/** Drawn when placing and when hovering over. */
|
||||||
public void drawOverlay(float x, float y, int rotation){
|
public void drawOverlay(float x, float y, int rotation){
|
||||||
}
|
}
|
||||||
|
|
||||||
public float sumAttribute(@Nullable Attribute attr, int x, int y){
|
public float sumAttribute(@Nullable Attribute attr, int x, int y){
|
||||||
if(attr == null) return 0;
|
if(attr == null) return 0;
|
||||||
Tile tile = world.tile(x, y);
|
Tile tile = world.tile(x, y);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class DuctRouter extends Block{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(Stat.itemsMoved, 60f / speed, StatUnit.itemsSecond);
|
stats.add(Stat.itemsMoved, 60f / speed * itemCapacity, StatUnit.itemsSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -78,6 +78,8 @@ public class DuctRouter extends Block{
|
|||||||
public float progress;
|
public float progress;
|
||||||
public @Nullable Item current;
|
public @Nullable Item current;
|
||||||
|
|
||||||
|
protected int acceptors;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
Draw.rect(region, x, y);
|
Draw.rect(region, x, y);
|
||||||
@@ -99,8 +101,7 @@ public class DuctRouter extends Block{
|
|||||||
var target = target();
|
var target = target();
|
||||||
if(target != null){
|
if(target != null){
|
||||||
target.handleItem(this, current);
|
target.handleItem(this, current);
|
||||||
int mod = sortItem != null && current != sortItem ? 2 : 3;
|
cdump = ((cdump + 1) % acceptors);
|
||||||
cdump = (byte)((cdump + 1) % mod);
|
|
||||||
items.remove(current, 1);
|
items.remove(current, 1);
|
||||||
current = null;
|
current = null;
|
||||||
progress %= (1f - 1f/speed);
|
progress %= (1f - 1f/speed);
|
||||||
@@ -124,6 +125,18 @@ public class DuctRouter extends Block{
|
|||||||
public Building target(){
|
public Building target(){
|
||||||
if(current == null) return null;
|
if(current == null) return null;
|
||||||
|
|
||||||
|
acceptors = 0;
|
||||||
|
|
||||||
|
//TODO this is horrible.
|
||||||
|
for(int i = -1; i <= 1; i++){
|
||||||
|
int dir = Mathf.mod(rotation + i, 4);
|
||||||
|
if(sortItem != null && (current == sortItem) != (dir == rotation)) continue;
|
||||||
|
Building other = nearby(dir);
|
||||||
|
if(other != null && other.team == team && other.acceptItem(this, current)){
|
||||||
|
acceptors ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = -1; i <= 1; i++){
|
for(int i = -1; i <= 1; i++){
|
||||||
int dir = Mathf.mod(rotation + (((i + cdump + 1) % 3) - 1), 4);
|
int dir = Mathf.mod(rotation + (((i + cdump + 1) % 3) - 1), 4);
|
||||||
if(sortItem != null && (current == sortItem) != (dir == rotation)) continue;
|
if(sortItem != null && (current == sortItem) != (dir == rotation)) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user