Binary file not shown.
@@ -51,7 +51,7 @@ public class Pathfinder implements Runnable{
|
|||||||
(PathTile.solid(tile) ? 5 : 0),
|
(PathTile.solid(tile) ? 5 : 0),
|
||||||
|
|
||||||
//water
|
//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.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) +
|
||||||
(PathTile.deep(tile) ? -1 : 0) +
|
(PathTile.deep(tile) ? -1 : 0) +
|
||||||
(PathTile.damages(tile) ? 35 : 0)
|
(PathTile.damages(tile) ? 35 : 0)
|
||||||
|
|||||||
@@ -184,7 +184,6 @@ public class Damage{
|
|||||||
Building tile = world.build(cx, cy);
|
Building tile = world.build(cx, cy);
|
||||||
if(tile != null && tile.team != hitter.team){
|
if(tile != null && tile.team != hitter.team){
|
||||||
tmpBuilding = tile;
|
tmpBuilding = tile;
|
||||||
//TODO return tile
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -215,12 +215,12 @@ public class Units{
|
|||||||
cdist = 0f;
|
cdist = 0f;
|
||||||
|
|
||||||
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> {
|
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);
|
float cost = sort.cost(e, x, y);
|
||||||
if(dst2 < range*range && (result == null || dst2 < cdist)){
|
if(result == null || cost < cdist){
|
||||||
result = e;
|
result = e;
|
||||||
cdist = dst2;
|
cdist = cost;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ public class ForceFieldAbility extends Ability{
|
|||||||
private static float realRad;
|
private static float realRad;
|
||||||
private static Unit paramUnit;
|
private static Unit paramUnit;
|
||||||
private static ForceFieldAbility paramField;
|
private static ForceFieldAbility paramField;
|
||||||
private static final Cons<Shielderc> shieldConsumer = trait -> {
|
private static final Cons<Bullet> shieldConsumer = trait -> {
|
||||||
if(trait.team() != paramUnit.team && Intersector.isInsideHexagon(paramUnit.x, paramUnit.y, realRad * 2f, trait.x(), trait.y()) && paramUnit.shield > 0){
|
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();
|
trait.absorb();
|
||||||
Fx.absorb.at(trait);
|
Fx.absorb.at(trait);
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ public abstract class BulletType extends Content{
|
|||||||
public boolean hittable = true;
|
public boolean hittable = true;
|
||||||
/** Whether this bullet can be reflected. */
|
/** Whether this bullet can be reflected. */
|
||||||
public boolean reflectable = true;
|
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.
|
/** 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. */
|
* Do not change unless you know what you're doing. */
|
||||||
public boolean backMove = true;
|
public boolean backMove = true;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class ContinuousLaserBulletType extends BulletType{
|
|||||||
incendSpread = 5;
|
incendSpread = 5;
|
||||||
incendChance = 0.4f;
|
incendChance = 0.4f;
|
||||||
lightColor = Color.orange;
|
lightColor = Color.orange;
|
||||||
|
absorbable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ContinuousLaserBulletType(){
|
protected ContinuousLaserBulletType(){
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ abstract class ShieldComp implements Healthc, Posc{
|
|||||||
@Override
|
@Override
|
||||||
public void damage(float amount){
|
public void damage(float amount){
|
||||||
//apply armor
|
//apply armor
|
||||||
//TODO balancing of armor stats & minArmorDamage
|
|
||||||
amount = Math.max(amount - armor, minArmorDamage * amount);
|
amount = Math.max(amount - armor, minArmorDamage * amount);
|
||||||
|
|
||||||
hitTime = 1f;
|
hitTime = 1f;
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ public class Universe{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO events
|
|
||||||
|
|
||||||
Events.fire(new TurnEvent());
|
Events.fire(new TurnEvent());
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import arc.graphics.gl.*;
|
|||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
|
||||||
//TODO this class is a trainwreck, remove it
|
|
||||||
public class IndexedRenderer implements Disposable{
|
public class IndexedRenderer implements Disposable{
|
||||||
private static final int vsize = 5;
|
private static final int vsize = 5;
|
||||||
|
|
||||||
|
|||||||
@@ -880,16 +880,10 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
}else{
|
}else{
|
||||||
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
|
unit.moveAt(Tmp.v2.trns(unit.rotation, movement.len()));
|
||||||
if(!movement.isZero() && legs){
|
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
|
//update shooting if not building + not mining
|
||||||
if(!player.builder().isBuilding() && player.miner().mineTile() == null){
|
if(!player.builder().isBuilding() && player.miner().mineTile() == null){
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ public class ForceProjector extends Block{
|
|||||||
public @Load("@-top") TextureRegion topRegion;
|
public @Load("@-top") TextureRegion topRegion;
|
||||||
|
|
||||||
static ForceBuild paramEntity;
|
static ForceBuild paramEntity;
|
||||||
static final Cons<Shielderc> shieldConsumer = trait -> {
|
static final Cons<Bullet> shieldConsumer = trait -> {
|
||||||
if(trait.team() != paramEntity.team && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, trait.x(), trait.y())){
|
if(trait.team != paramEntity.team && trait.type.absorbable && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, trait.x(), trait.y())){
|
||||||
trait.absorb();
|
trait.absorb();
|
||||||
Fx.absorb.at(trait);
|
Fx.absorb.at(trait);
|
||||||
paramEntity.hit = 1f;
|
paramEntity.hit = 1f;
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ public class Separator extends Block{
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
Item item = null;
|
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){
|
for(ItemStack stack : results){
|
||||||
if(i >= count && i < count + stack.amount){
|
if(i >= count && i < count + stack.amount){
|
||||||
item = stack.item;
|
item = stack.item;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class RepairPoint extends Block{
|
|||||||
Draw.rect(baseRegion, x, y);
|
Draw.rect(baseRegion, x, y);
|
||||||
|
|
||||||
Draw.z(Layer.turret);
|
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);
|
Draw.rect(region, x, y, rotation - 90);
|
||||||
|
|
||||||
if(target != null && Angles.angleDist(angleTo(target), rotation) < 30f){
|
if(target != null && Angles.angleDist(angleTo(target), rotation) < 30f){
|
||||||
|
|||||||
Reference in New Issue
Block a user