Fixed armageddon / Removed idle command / Balancing
This commit is contained in:
@@ -45,6 +45,7 @@ public class DebugBlocks extends BlockList implements ContentList{
|
|||||||
{
|
{
|
||||||
powerCapacity = 10000f;
|
powerCapacity = 10000f;
|
||||||
powerSpeed = 100f;
|
powerSpeed = 100f;
|
||||||
|
maxNodes = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
|
|||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
rotateSpeed = 1.4f;
|
rotateSpeed = 1.4f;
|
||||||
|
|
||||||
consumes.power(0.2f);
|
consumes.power(0.15f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
oilextractor = new Fracker("oil-extractor"){{
|
oilextractor = new Fracker("oil-extractor"){{
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import io.anuke.mindustry.type.ItemStack;
|
|||||||
import io.anuke.mindustry.type.Weapon;
|
import io.anuke.mindustry.type.Weapon;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.units.CommandCenter.CommandCenterEntity;
|
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.mindustry.world.meta.BlockFlag;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
@@ -369,13 +368,6 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removed(){
|
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;
|
spawner = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,8 +130,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
|
|||||||
public void onCommand(UnitCommand command){
|
public void onCommand(UnitCommand command){
|
||||||
state.set(command == UnitCommand.retreat ? retreat :
|
state.set(command == UnitCommand.retreat ? retreat :
|
||||||
(command == UnitCommand.attack ? attack :
|
(command == UnitCommand.attack ? attack :
|
||||||
(command == UnitCommand.idle ? idle :
|
(null)));
|
||||||
(null))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -115,8 +115,7 @@ public abstract class GroundUnit extends BaseUnit{
|
|||||||
public void onCommand(UnitCommand command){
|
public void onCommand(UnitCommand command){
|
||||||
state.set(command == UnitCommand.retreat ? retreat :
|
state.set(command == UnitCommand.retreat ? retreat :
|
||||||
(command == UnitCommand.attack ? attack :
|
(command == UnitCommand.attack ? attack :
|
||||||
(command == UnitCommand.idle ? resupply :
|
(null)));
|
||||||
(null))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package io.anuke.mindustry.entities.units;
|
package io.anuke.mindustry.entities.units;
|
||||||
|
|
||||||
public enum UnitCommand{
|
public enum UnitCommand{
|
||||||
attack, retreat, idle
|
attack, retreat
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.badlogic.gdx.math.Vector2;
|
|||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import io.anuke.mindustry.content.Items;
|
import io.anuke.mindustry.content.Items;
|
||||||
import io.anuke.mindustry.content.blocks.Blocks;
|
import io.anuke.mindustry.content.blocks.Blocks;
|
||||||
|
import io.anuke.mindustry.content.blocks.UnitBlocks;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.maps.generation.StructureFormat.StructBlock;
|
import io.anuke.mindustry.maps.generation.StructureFormat.StructBlock;
|
||||||
import io.anuke.mindustry.type.AmmoType;
|
import io.anuke.mindustry.type.AmmoType;
|
||||||
@@ -174,7 +175,8 @@ public class FortressGenerator{
|
|||||||
int wy = y + cy - struct.layout[0].length/2;
|
int wy = y + cy - struct.layout[0].length/2;
|
||||||
StructBlock block = struct.layout[cx][cy];
|
StructBlock block = struct.layout[cx][cy];
|
||||||
Tile tile = world.tile(wx, wy);
|
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.setElevation(elevation);
|
||||||
tile.setRotation(block.rotation);
|
tile.setRotation(block.rotation);
|
||||||
tile.setBlock(block.block, team);
|
tile.setBlock(block.block, team);
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class CommandCenter extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class CommandCenterEntity extends TileEntity{
|
public class CommandCenterEntity extends TileEntity{
|
||||||
public UnitCommand command = UnitCommand.idle;
|
public UnitCommand command = UnitCommand.attack;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(DataOutputStream stream) throws IOException{
|
public void write(DataOutputStream stream) throws IOException{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import io.anuke.annotations.Annotations.Remote;
|
|||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.content.fx.BlockFx;
|
import io.anuke.mindustry.content.fx.BlockFx;
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
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.BaseUnit;
|
||||||
import io.anuke.mindustry.entities.units.UnitType;
|
import io.anuke.mindustry.entities.units.UnitType;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
@@ -136,7 +135,7 @@ public class UnitPad extends Block{
|
|||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
Draw.rect(name, tile.drawx(), tile.drawy());
|
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -145,18 +144,6 @@ public class UnitPad extends Block{
|
|||||||
|
|
||||||
entity.time += Timers.delta() * entity.speedScl;
|
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;
|
boolean isEnemy = tile.getTeam() == Team.red;
|
||||||
|
|
||||||
if(isEnemy){
|
if(isEnemy){
|
||||||
@@ -184,12 +171,11 @@ public class UnitPad extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(entity.buildTime >= produceTime){
|
if(entity.buildTime >= produceTime){
|
||||||
|
entity.buildTime = 0f;
|
||||||
|
|
||||||
Timers.run(openDuration / 1.5f, () -> Call.onUnitFactorySpawn(tile));
|
Call.onUnitFactorySpawn(tile);
|
||||||
useContent(type);
|
useContent(type);
|
||||||
|
|
||||||
entity.openCountdown = openDuration;
|
|
||||||
|
|
||||||
for(ItemStack stack : consumes.items()){
|
for(ItemStack stack : consumes.items()){
|
||||||
entity.items.remove(stack.item, stack.amount);
|
entity.items.remove(stack.item, stack.amount);
|
||||||
}
|
}
|
||||||
@@ -232,7 +218,6 @@ public class UnitPad extends Block{
|
|||||||
|
|
||||||
public static class UnitFactoryEntity extends TileEntity{
|
public static class UnitFactoryEntity extends TileEntity{
|
||||||
public float buildTime;
|
public float buildTime;
|
||||||
public float openCountdown;
|
|
||||||
public float time;
|
public float time;
|
||||||
public float speedScl;
|
public float speedScl;
|
||||||
public float warmup; //only for enemy spawners
|
public float warmup; //only for enemy spawners
|
||||||
|
|||||||
Reference in New Issue
Block a user