This commit is contained in:
Anuken 2020-10-02 09:54:08 -04:00
parent 215cfaa42f
commit 138434d029
14 changed files with 15 additions and 22 deletions

Binary file not shown.

View File

@ -51,7 +51,7 @@ public class Pathfinder implements Runnable{
(PathTile.solid(tile) ? 5 : 0),
//water
(team, tile) -> PathTile.solid(tile) || !PathTile.liquid(tile) ? 200 : 2 + //TODO cannot go through blocks - pathfinding isn't great
(team, tile) -> PathTile.solid(tile) || !PathTile.liquid(tile) ? 200 : 2 +
(PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) +
(PathTile.deep(tile) ? -1 : 0) +
(PathTile.damages(tile) ? 35 : 0)

View File

@ -184,7 +184,6 @@ public class Damage{
Building tile = world.build(cx, cy);
if(tile != null && tile.team != hitter.team){
tmpBuilding = tile;
//TODO return tile
return true;
}
return false;

View File

@ -215,12 +215,12 @@ public class Units{
cdist = 0f;
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> {
if(e.dead() || !predicate.get(e)) return;
if(e.dead() || !predicate.get(e) || !e.within(x, y, range)) return;
float dst2 = sort.cost(e, x, y);
if(dst2 < range*range && (result == null || dst2 < cdist)){
float cost = sort.cost(e, x, y);
if(result == null || cost < cdist){
result = e;
cdist = dst2;
cdist = cost;
}
});

View File

@ -27,8 +27,8 @@ public class ForceFieldAbility extends Ability{
private static float realRad;
private static Unit paramUnit;
private static ForceFieldAbility paramField;
private static final Cons<Shielderc> shieldConsumer = trait -> {
if(trait.team() != paramUnit.team && Intersector.isInsideHexagon(paramUnit.x, paramUnit.y, realRad * 2f, trait.x(), trait.y()) && paramUnit.shield > 0){
private static final Cons<Bullet> shieldConsumer = trait -> {
if(trait.team != paramUnit.team && trait.type.absorbable && Intersector.isInsideHexagon(paramUnit.x, paramUnit.y, realRad * 2f, trait.x(), trait.y()) && paramUnit.shield > 0){
trait.absorb();
Fx.absorb.at(trait);

View File

@ -71,6 +71,8 @@ public abstract class BulletType extends Content{
public boolean hittable = true;
/** Whether this bullet can be reflected. */
public boolean reflectable = true;
/** Whether this projectile can be absorbed by shields. */
public boolean absorbable = true;
/** Whether to move the bullet back depending on delta to fix some delta-time realted issues.
* Do not change unless you know what you're doing. */
public boolean backMove = true;

View File

@ -37,6 +37,7 @@ public class ContinuousLaserBulletType extends BulletType{
incendSpread = 5;
incendChance = 0.4f;
lightColor = Color.orange;
absorbable = false;
}
protected ContinuousLaserBulletType(){

View File

@ -23,7 +23,6 @@ abstract class ShieldComp implements Healthc, Posc{
@Override
public void damage(float amount){
//apply armor
//TODO balancing of armor stats & minArmorDamage
amount = Math.max(amount - armor, minArmorDamage * amount);
hitTime = 1f;

View File

@ -170,7 +170,6 @@ public class Universe{
}
}
}
//TODO events
Events.fire(new TurnEvent());

View File

@ -7,7 +7,6 @@ import arc.graphics.gl.*;
import arc.math.*;
import arc.util.*;
//TODO this class is a trainwreck, remove it
public class IndexedRenderer implements Disposable{
private static final int vsize = 5;

View File

@ -880,16 +880,10 @@ public class MobileInput extends InputHandler implements GestureListener{
}else{
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
if(!movement.isZero() && legs){
unit.vel.rotateTo(movement.angle(), type.rotateSpeed * Time.delta);
unit.vel.rotateTo(movement.angle(), type.rotateSpeed);
}
}
if(flying){
//hovering effect
unit.x += Mathf.sin(Time.time(), 25f, 0.08f);
unit.y += Mathf.cos(Time.time(), 25f, 0.08f);
}
//update shooting if not building + not mining
if(!player.builder().isBuilding() && player.miner().mineTile() == null){

View File

@ -33,8 +33,8 @@ public class ForceProjector extends Block{
public @Load("@-top") TextureRegion topRegion;
static ForceBuild paramEntity;
static final Cons<Shielderc> shieldConsumer = trait -> {
if(trait.team() != paramEntity.team && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, trait.x(), trait.y())){
static final Cons<Bullet> shieldConsumer = trait -> {
if(trait.team != paramEntity.team && trait.type.absorbable && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, trait.x(), trait.y())){
trait.absorb();
Fx.absorb.at(trait);
paramEntity.hit = 1f;

View File

@ -105,7 +105,7 @@ public class Separator extends Block{
int count = 0;
Item item = null;
//TODO guaranteed desync since items are random
//guaranteed desync since items are random - won't be fixed and probably isn't too important
for(ItemStack stack : results){
if(i >= count && i < count + stack.amount){
item = stack.item;

View File

@ -70,7 +70,7 @@ public class RepairPoint extends Block{
Draw.rect(baseRegion, x, y);
Draw.z(Layer.turret);
Drawf.shadow(region, x - (size / 2), y - (size / 2), rotation - 90);
Drawf.shadow(region, x - (size / 2f), y - (size / 2f), rotation - 90);
Draw.rect(region, x, y, rotation - 90);
if(target != null && Angles.angleDist(angleTo(target), rotation) < 30f){