Bugfixes
This commit is contained in:
@@ -60,8 +60,6 @@ public class BuilderAI extends AIController{
|
|||||||
blocks.removeFirst();
|
blocks.removeFirst();
|
||||||
blocks.addLast(block);
|
blocks.addLast(block);
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
//TODO implement AI base building
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,14 @@ public class Weathers implements ContentList{
|
|||||||
region = Core.atlas.find("circle-shadow");
|
region = Core.atlas.find("circle-shadow");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Weatherc state){
|
||||||
|
|
||||||
|
for(Unitc unit : Groups.unit){
|
||||||
|
unit.impulse(force.x * state.intensity(), force.y * state.intensity());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawOver(Weatherc state){
|
public void drawOver(Weatherc state){
|
||||||
rand.setSeed(0);
|
rand.setSeed(0);
|
||||||
@@ -179,10 +187,6 @@ public class Weathers implements ContentList{
|
|||||||
Draw.tint(color);
|
Draw.tint(color);
|
||||||
float baseAlpha = Draw.getColor().a;
|
float baseAlpha = Draw.getColor().a;
|
||||||
|
|
||||||
for(Unitc unit : Groups.unit){
|
|
||||||
unit.impulse(force.x * state.intensity(), force.y * state.intensity());
|
|
||||||
}
|
|
||||||
|
|
||||||
for(int i = 0; i < total; i++){
|
for(int i = 0; i < total; i++){
|
||||||
float scl = rand.random(0.5f, 1f);
|
float scl = rand.random(0.5f, 1f);
|
||||||
float scl2 = rand.random(0.5f, 1f);
|
float scl2 = rand.random(0.5f, 1f);
|
||||||
|
|||||||
@@ -33,13 +33,6 @@ public class Logic implements ApplicationListener{
|
|||||||
|
|
||||||
public Logic(){
|
public Logic(){
|
||||||
|
|
||||||
Events.on(WaveEvent.class, event -> {
|
|
||||||
if(state.isCampaign()){
|
|
||||||
//TODO implement
|
|
||||||
//state.getSector().updateWave(state.wave);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Events.on(BlockDestroyEvent.class, event -> {
|
Events.on(BlockDestroyEvent.class, event -> {
|
||||||
//blocks that get broken are appended to the team's broken block queue
|
//blocks that get broken are appended to the team's broken block queue
|
||||||
Tile tile = event.tile;
|
Tile tile = event.tile;
|
||||||
|
|||||||
@@ -114,12 +114,16 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
|||||||
if(tile == null) return false;
|
if(tile == null) return false;
|
||||||
|
|
||||||
if(tile.collide(this) && type.collides(this, tile) && !tile.dead() && (type.collidesTeam || tile.team() != team())){
|
if(tile.collide(this) && type.collides(this, tile) && !tile.dead() && (type.collidesTeam || tile.team() != team())){
|
||||||
|
boolean remove = false;
|
||||||
|
|
||||||
if(tile.team() != team()){
|
if(tile.team() != team()){
|
||||||
tile.collision(this);
|
remove = tile.collision(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
type.hitTile(this, tile);
|
if(remove){
|
||||||
remove();
|
type.hitTile(this, tile);
|
||||||
|
remove();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1046,8 +1046,12 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void collision(Bulletc other){
|
/** Handle a bullet collision.
|
||||||
|
* @return whether the bullet should be removed. */
|
||||||
|
public boolean collision(Bulletc other){
|
||||||
damage(other.damage() * other.type().tileDamageMultiplier);
|
damage(other.damage() * other.type().tileDamageMultiplier);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeFromProximity(){
|
public void removeFromProximity(){
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ public class AIController implements UnitController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void targetClosest(){
|
protected void targetClosest(){
|
||||||
//TODO optimize!
|
|
||||||
Teamc newTarget = Units.closestTarget(unit.team(), unit.x(), unit.y(), Math.max(unit.range(), unit.type().range), u -> (unit.type().targetAir && u.isFlying()) || (unit.type().targetGround && !u.isFlying()));
|
Teamc newTarget = Units.closestTarget(unit.team(), unit.x(), unit.y(), Math.max(unit.range(), unit.type().range), u -> (unit.type().targetAir && u.isFlying()) || (unit.type().targetGround && !u.isFlying()));
|
||||||
if(newTarget != null){
|
if(newTarget != null){
|
||||||
target = newTarget;
|
target = newTarget;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package mindustry.entities.units;
|
|||||||
|
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
//TODO rename
|
|
||||||
public interface UnitController{
|
public interface UnitController{
|
||||||
void unit(Unitc unit);
|
void unit(Unitc unit);
|
||||||
Unitc unit();
|
Unitc unit();
|
||||||
|
|||||||
@@ -335,7 +335,6 @@ public class Mods implements Loadable{
|
|||||||
for(Fi file : mod.root.list()){
|
for(Fi file : mod.root.list()){
|
||||||
//ignore special folders like bundles or sprites
|
//ignore special folders like bundles or sprites
|
||||||
if(file.isDirectory() && !specialFolders.contains(file.name())){
|
if(file.isDirectory() && !specialFolders.contains(file.name())){
|
||||||
//TODO calling child/parent on these files will give you gibberish; create wrapper class.
|
|
||||||
file.walk(f -> tree.addFile(mod.file.isDirectory() ? f.path().substring(1 + mod.file.path().length()) :
|
file.walk(f -> tree.addFile(mod.file.isDirectory() ? f.path().substring(1 + mod.file.path().length()) :
|
||||||
zipFolder ? f.path().substring(parentName.length() + 1) : f.path(), f));
|
zipFolder ? f.path().substring(parentName.length() + 1) : f.path(), f));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ public class PlayerListFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
table.margin(8);
|
table.margin(8);
|
||||||
//TODO dead players should have no region
|
|
||||||
table.add(new Image(user.icon()).setScaling(Scaling.none)).grow();
|
table.add(new Image(user.icon()).setScaling(Scaling.none)).grow();
|
||||||
|
|
||||||
button.add(table).size(h);
|
button.add(table).size(h);
|
||||||
|
|||||||
@@ -175,7 +175,6 @@ public class Block extends UnlockableContent{
|
|||||||
protected Prov<Tilec> entityType = null; //initialized later
|
protected Prov<Tilec> entityType = null; //initialized later
|
||||||
public ObjectMap<Class<?>, Cons2> configurations = new ObjectMap<>();
|
public ObjectMap<Class<?>, Cons2> configurations = new ObjectMap<>();
|
||||||
|
|
||||||
//TODO move
|
|
||||||
protected TextureRegion[] generatedIcons;
|
protected TextureRegion[] generatedIcons;
|
||||||
protected TextureRegion[] variantRegions, editorVariantRegions;
|
protected TextureRegion[] variantRegions, editorVariantRegions;
|
||||||
|
|
||||||
@@ -183,7 +182,6 @@ public class Block extends UnlockableContent{
|
|||||||
public @Load("@-team") TextureRegion teamRegion;
|
public @Load("@-team") TextureRegion teamRegion;
|
||||||
public TextureRegion[] teamRegions;
|
public TextureRegion[] teamRegions;
|
||||||
|
|
||||||
//TODO move
|
|
||||||
public static TextureRegion[][] cracks;
|
public static TextureRegion[][] cracks;
|
||||||
protected static final Seq<Tile> tempTiles = new Seq<>();
|
protected static final Seq<Tile> tempTiles = new Seq<>();
|
||||||
protected static final Seq<Tilec> tempTileEnts = new Seq<>();
|
protected static final Seq<Tilec> tempTileEnts = new Seq<>();
|
||||||
|
|||||||
@@ -40,23 +40,16 @@ public class DeflectorWall extends Wall{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collision(Bulletc bullet){
|
public boolean collision(Bulletc bullet){
|
||||||
super.collision(bullet);
|
super.collision(bullet);
|
||||||
|
|
||||||
//TODO fix and test
|
|
||||||
//doesn't reflect powerful bullets
|
//doesn't reflect powerful bullets
|
||||||
if(bullet.damage() > maxDamageDeflect) return;
|
if(bullet.damage() > maxDamageDeflect) return true;
|
||||||
|
|
||||||
float penX = Math.abs(getX() - bullet.x()), penY = Math.abs(getY() - bullet.y());
|
//translate bullet back to where it was upon collision
|
||||||
|
bullet.trns(-bullet.vel().x, -bullet.vel().y);
|
||||||
|
|
||||||
bullet.hitbox(rect2);
|
float penX = Math.abs(x - bullet.x()), penY = Math.abs(y - bullet.y());
|
||||||
|
|
||||||
Vec2 position = Geometry.raycastRect(bullet.x() - bullet.vel().x*Time.delta(), bullet.y() - bullet.vel().y*Time.delta(), bullet.x() + bullet.vel().x*Time.delta(), bullet.y() + bullet.vel().y*Time.delta(),
|
|
||||||
rect.setSize(size * tilesize + rect2.width*2 + rect2.height*2).setCenter(getX(), getY()));
|
|
||||||
|
|
||||||
if(position != null){
|
|
||||||
bullet.set(position.x, position.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(penX > penY){
|
if(penX > penY){
|
||||||
bullet.vel().x *= -1;
|
bullet.vel().x *= -1;
|
||||||
@@ -64,14 +57,13 @@ public class DeflectorWall extends Wall{
|
|||||||
bullet.vel().y *= -1;
|
bullet.vel().y *= -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//bullet.updateVelocity();
|
|
||||||
bullet.owner(this);
|
bullet.owner(this);
|
||||||
bullet.team(team());
|
bullet.team(team);
|
||||||
bullet.time(bullet.time() + 1f);
|
bullet.time(bullet.time() + 1f);
|
||||||
//TODO deflect
|
|
||||||
//bullet.deflect();
|
|
||||||
|
|
||||||
hit = 1f;
|
hit = 1f;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,11 +16,13 @@ public class SurgeWall extends Wall{
|
|||||||
|
|
||||||
public class SurgeEntity extends TileEntity{
|
public class SurgeEntity extends TileEntity{
|
||||||
@Override
|
@Override
|
||||||
public void collision(Bulletc bullet){
|
public boolean collision(Bulletc bullet){
|
||||||
super.collision(bullet);
|
super.collision(bullet);
|
||||||
if(Mathf.chance(lightningChance)){
|
if(Mathf.chance(lightningChance)){
|
||||||
Lightning.create(team(), Pal.surge, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength);
|
Lightning.create(team(), Pal.surge, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user