Balancing / Reconstructors require power

This commit is contained in:
Anuken
2018-08-25 10:37:05 -04:00
parent 86a7f837cd
commit f60ba8587f
8 changed files with 47 additions and 21 deletions

View File

@@ -312,16 +312,23 @@ public class Mechs implements ContentList{
}
};
trident = new Mech("trident-ship", true){{
drillPower = 2;
speed = 0.12f;
maxSpeed = 3.4f;
drag = 0.035f;
turnCursor = false;
armor = 20f;
trailColor = Color.valueOf("84f491");
weapon = Weapons.bomberTrident;
}};
trident = new Mech("trident-ship", true){
{
drillPower = 2;
speed = 0.12f;
maxSpeed = 3.4f;
drag = 0.035f;
turnCursor = false;
armor = 20f;
trailColor = Color.valueOf("84f491");
weapon = Weapons.bomberTrident;
}
@Override
public boolean canShoot(Player player){
return player.getVelocity().len() > 1.2f;
}
};
halberd = new Mech("halberd-ship", true){
{

View File

@@ -12,36 +12,43 @@ public class UpgradeBlocks extends BlockList{
deltaFactory = new MechFactory("delta-mech-factory"){{
mech = Mechs.delta;
size = 2;
powerCapacity = 70f;
}};
tauFactory = new MechFactory("tau-mech-factory"){{
mech = Mechs.tau;
size = 2;
powerCapacity = 100f;
}};
omegaFactory = new MechFactory("omega-mech-factory"){{
mech = Mechs.omega;
size = 3;
powerCapacity = 120f;
}};
dartFactory = new MechFactory("dart-ship-factory"){{
mech = Mechs.dart;
size = 2;
powerCapacity = 50f;
}};
javelinFactory = new MechFactory("javelin-ship-factory"){{
mech = Mechs.javelin;
size = 2;
powerCapacity = 80f;
}};
tridentFactory = new MechFactory("trident-ship-factory"){{
mech = Mechs.trident;
size = 2;
powerCapacity = 100f;
}};
halberdFactory = new MechFactory("halberd-ship-factory"){{
mech = Mechs.halberd;
size = 3;
powerCapacity = 120f;
}};
}
}

View File

@@ -597,7 +597,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
}
protected void updateShooting(){
if(isShooting()){
if(isShooting() && mech.canShoot(this)){
mech.weapon.update(this, pointerX, pointerY);
}
}

View File

@@ -25,9 +25,7 @@ public class BasicBulletType extends BulletType{
public float fragVelocityMin = 0.2f, fragVelocityMax = 1f;
public BulletType fragBullet = null;
/**
* Use a negative value to disable splash damage.
*/
/**Use a negative value to disable splash damage.*/
public float splashDamageRadius = -1f;
public float splashDamage = 6f;

View File

@@ -83,6 +83,10 @@ public class Mech implements UnlockableContent{
public float getRotationAlpha(Player player){return 1f;}
public boolean canShoot(Player player){
return true;
}
@Override
public boolean isHidden() {
return !flying && mobile;

View File

@@ -34,11 +34,9 @@ public class BlockConsumeFragment extends Fragment{
ObjectSet<Consume> consumers = new ObjectSet<>();
TileEntity entity = tile.entity;
Block block = tile.block();
Consume[] lastCurrent = {null};
table.clearChildren();
//table.background("clear");
rebuild(block, entity);
visible = true;

View File

@@ -193,7 +193,7 @@ public class MassDriver extends Block{
Draw.color(Palette.accent);
Lines.stroke(1f);
Lines.circle(tile.drawx(), tile.drawy(), (tile.block().size/2f+1) * tilesize + sin);
Lines.poly(tile.drawx(), tile.drawy(), 20, (tile.block().size/2f+1) * tilesize + sin);
MassDriverEntity entity = tile.entity();
@@ -201,7 +201,7 @@ public class MassDriver extends Block{
Tile target = world.tile(entity.link);
Draw.color(Palette.place);
Lines.circle(target.drawx(), target.drawy(), (target.block().size/2f+1) * tilesize + sin);
Lines.poly(target.drawx(), target.drawy(), 20, (target.block().size/2f+1) * tilesize + sin);
Draw.reset();
}

View File

@@ -41,8 +41,19 @@ public class MechFactory extends Block{
public MechFactory(String name){
super(name);
update = true;
consumesTap = true;
solidifes = true;
hasPower = true;
}
@Override
public void init(){
consumes.power(powerCapacity * 0.8f);
super.init();
}
@Override
public boolean shouldConsume(Tile tile){
return false;
}
@Remote(targets = Loc.both, called = Loc.server)
@@ -50,6 +61,7 @@ public class MechFactory extends Block{
if(player == null || !checkValidTap(tile, player)) return;
MechFactoryEntity entity = tile.entity();
entity.power.amount = 0f;
player.beginRespawning(entity);
}
@@ -80,7 +92,7 @@ public class MechFactory extends Block{
protected static boolean checkValidTap(Tile tile, Player player){
MechFactoryEntity entity = tile.entity();
return Math.abs(player.x - tile.drawx()) <= tile.block().size * tilesize / 2f &&
Math.abs(player.y - tile.drawy()) <= tile.block().size * tilesize / 2f && entity.player == null;
Math.abs(player.y - tile.drawy()) <= tile.block().size * tilesize / 2f && entity.cons.valid() && entity.player == null;
}
@Override
@@ -173,7 +185,7 @@ public class MechFactory extends Block{
Call.onMechFactoryDone(tile);
}
}else{
if(Units.anyEntities(tile, 4f, unit -> unit.getTeam() == entity.getTeam() && unit instanceof Player)){
if(entity.cons.valid() && Units.anyEntities(tile, 4f, unit -> unit.getTeam() == entity.getTeam() && unit instanceof Player)){
entity.open = true;
}