Fixed armageddon / Removed idle command / Balancing

This commit is contained in:
Anuken 2018-08-06 19:04:07 -04:00
parent aaec04d04a
commit a5fd0aebe6
9 changed files with 12 additions and 34 deletions

View File

@ -45,6 +45,7 @@ public class DebugBlocks extends BlockList implements ContentList{
{
powerCapacity = 10000f;
powerSpeed = 100f;
maxNodes = 100;
}
@Override

View File

@ -76,7 +76,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
liquidCapacity = 30f;
rotateSpeed = 1.4f;
consumes.power(0.2f);
consumes.power(0.15f);
}};
oilextractor = new Fracker("oil-extractor"){{

View File

@ -24,7 +24,6 @@ import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.Weapon;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.units.CommandCenter.CommandCenterEntity;
import io.anuke.mindustry.world.blocks.units.UnitPad.UnitFactoryEntity;
import io.anuke.mindustry.world.meta.BlockFlag;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
@ -369,13 +368,6 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
@Override
public void removed(){
Tile tile = world.tile(spawner);
if(tile != null && tile.entity instanceof UnitFactoryEntity){
UnitFactoryEntity factory = (UnitFactoryEntity) tile.entity;
factory.hasSpawned = false;
}
spawner = -1;
}

View File

@ -130,8 +130,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
public void onCommand(UnitCommand command){
state.set(command == UnitCommand.retreat ? retreat :
(command == UnitCommand.attack ? attack :
(command == UnitCommand.idle ? idle :
(null))));
(null)));
}
@Override

View File

@ -115,8 +115,7 @@ public abstract class GroundUnit extends BaseUnit{
public void onCommand(UnitCommand command){
state.set(command == UnitCommand.retreat ? retreat :
(command == UnitCommand.attack ? attack :
(command == UnitCommand.idle ? resupply :
(null))));
(null)));
}
@Override

View File

@ -1,5 +1,5 @@
package io.anuke.mindustry.entities.units;
public enum UnitCommand{
attack, retreat, idle
attack, retreat
}

View File

@ -5,6 +5,7 @@ import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.content.blocks.UnitBlocks;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.maps.generation.StructureFormat.StructBlock;
import io.anuke.mindustry.type.AmmoType;
@ -174,7 +175,8 @@ public class FortressGenerator{
int wy = y + cy - struct.layout[0].length/2;
StructBlock block = struct.layout[cx][cy];
Tile tile = world.tile(wx, wy);
if(block.block != Blocks.air && tile.block().alwaysReplace){
//resupply points should not be placed anymore, they confuse units
if(block.block != Blocks.air && tile.block().alwaysReplace && block.block != UnitBlocks.resupplyPoint){
tile.setElevation(elevation);
tile.setRotation(block.rotation);
tile.setBlock(block.block, team);

View File

@ -109,7 +109,7 @@ public class CommandCenter extends Block{
}
public class CommandCenterEntity extends TileEntity{
public UnitCommand command = UnitCommand.idle;
public UnitCommand command = UnitCommand.attack;
@Override
public void write(DataOutputStream stream) throws IOException{

View File

@ -6,7 +6,6 @@ import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.fx.BlockFx;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.units.BaseUnit;
import io.anuke.mindustry.entities.units.UnitType;
import io.anuke.mindustry.game.Team;
@ -136,7 +135,7 @@ public class UnitPad extends Block{
Draw.reset();
Draw.rect(name, tile.drawx(), tile.drawy());
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
}
@Override
@ -145,18 +144,6 @@ public class UnitPad extends Block{
entity.time += Timers.delta() * entity.speedScl;
if(entity.openCountdown > 0){
if(entity.openCountdown > Timers.delta()){
entity.openCountdown -= Timers.delta();
}else{
if(type.isFlying || !Units.anyEntities(tile)){
entity.openCountdown = -1;
}else{
entity.speedScl = Mathf.lerpDelta(entity.speedScl, 0f, 0.1f);
}
}
}
boolean isEnemy = tile.getTeam() == Team.red;
if(isEnemy){
@ -184,12 +171,11 @@ public class UnitPad extends Block{
}
if(entity.buildTime >= produceTime){
entity.buildTime = 0f;
Timers.run(openDuration / 1.5f, () -> Call.onUnitFactorySpawn(tile));
Call.onUnitFactorySpawn(tile);
useContent(type);
entity.openCountdown = openDuration;
for(ItemStack stack : consumes.items()){
entity.items.remove(stack.item, stack.amount);
}
@ -232,7 +218,6 @@ public class UnitPad extends Block{
public static class UnitFactoryEntity extends TileEntity{
public float buildTime;
public float openCountdown;
public float time;
public float speedScl;
public float warmup; //only for enemy spawners