This commit is contained in:
Anuken
2020-09-23 21:46:40 -04:00
parent f9b46fbf18
commit ada664a2ca
24 changed files with 7038 additions and 6903 deletions

View File

@@ -24,7 +24,7 @@ public class SuicideAI extends GroundAI{
Building core = unit.closestEnemyCore();
boolean rotate = false, shoot = false;
boolean rotate = false, shoot = false, moveToTarget = false;
if(!Units.invalidateTarget(target, unit, unit.range())){
rotate = true;
@@ -55,11 +55,14 @@ public class SuicideAI extends GroundAI{
}
if(!blocked){
moveToTarget = true;
//move towards target directly
unit.moveAt(vec.set(target).sub(unit).limit(unit.type().speed));
}
}else{
}
if(!moveToTarget){
if(command() == UnitCommand.rally){
Teamc target = targetFlag(unit.x, unit.y, BlockFlag.rally, false);

View File

@@ -83,7 +83,7 @@ public class Blocks implements ContentList{
repairPoint, resupplyPoint,
//logic
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell,
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank,
//campaign
launchPad, launchPadLarge,
@@ -316,6 +316,7 @@ public class Blocks implements ContentList{
snowBoulder = new Boulder("snow-boulder"){{
variants = 2;
snow.asFloor().decoration = ice.asFloor().decoration = iceSnow.asFloor().decoration = this;
}};
dirtWall = new StaticWall("dirt-wall"){{
@@ -1147,7 +1148,7 @@ public class Blocks implements ContentList{
requirements(Category.power, with(Items.copper, 35, Items.graphite, 25, Items.lead, 40, Items.silicon, 30));
powerProduction = 5.5f;
itemDuration = 90f;
consumes.liquid(Liquids.water, 0.07f);
consumes.liquid(Liquids.water, 0.09f);
hasLiquids = true;
size = 2;
}};
@@ -1499,7 +1500,7 @@ public class Blocks implements ContentList{
reloadTime = 35f;
shootCone = 40f;
rotateSpeed = 8f;
powerUse = 4f;
powerUse = 3f;
targetAir = false;
range = 90f;
shootEffect = Fx.lightningShoot;
@@ -1694,7 +1695,7 @@ public class Blocks implements ContentList{
reloadTime = 90f;
firingMoveFract = 0.5f;
shootDuration = 220f;
powerUse = 14f;
powerUse = 17f;
shootSound = Sounds.laserbig;
activeSound = Sounds.beam;
activeSoundVolume = 2f;
@@ -1963,11 +1964,18 @@ public class Blocks implements ContentList{
}};
memoryCell = new MemoryBlock("memory-cell"){{
requirements(Category.logic, with(Items.graphite, 40, Items.silicon, 40));
requirements(Category.logic, with(Items.graphite, 30, Items.silicon, 30));
memoryCapacity = 64;
}};
memoryBank = new MemoryBlock("memory-bank"){{
requirements(Category.logic, with(Items.graphite, 80, Items.silicon, 80, Items.phasefabric, 30));
memoryCapacity = 512;
size = 2;
}};
logicDisplay = new LogicDisplay("logic-display"){{
requirements(Category.logic, with(Items.lead, 100, Items.silicon, 50, Items.metaglass, 50));

View File

@@ -211,7 +211,9 @@ public class TechTree implements ContentList{
});
node(memoryCell, () -> {
node(memoryBank, () -> {
});
});
});

View File

@@ -46,8 +46,11 @@ public class UnitTypes implements ContentList{
//air + building + mining + payload
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Payloadc.class}) UnitType mega;
//air + building + payload TODO implement
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class}) UnitType quad, oct;
//air + building + payload
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class}) UnitType quad;
//air + building + payload + command
public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class, Commanderc.class}) UnitType oct;
//air + building + mining
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType alpha, beta, gamma;
@@ -341,7 +344,7 @@ public class UnitTypes implements ContentList{
armor = 9f;
landShake = 2f;
commandLimit = 24;
commandLimit = 18;
mechFrontSway = 0.55f;
speed = 0.4f;
@@ -394,7 +397,7 @@ public class UnitTypes implements ContentList{
canBoost = true;
landShake = 4f;
commandLimit = 32;
commandLimit = 20;
weapons.add(new Weapon("vela-weapon"){{
mirror = false;
@@ -444,7 +447,7 @@ public class UnitTypes implements ContentList{
landShake = 1.5f;
rotateSpeed = 1.5f;
commandLimit = 24;
commandLimit = 20;
legCount = 4;
legLength = 14f;
@@ -1292,6 +1295,7 @@ public class UnitTypes implements ContentList{
payloadCapacity = (5.3f * 5.3f) * tilePayload;
buildSpeed = 4f;
drawShields = false;
commandLimit = 25;
abilities.add(new ForceFieldAbility(140f, 4f, 7000f, 60f * 8), new HealFieldAbility(130f, 60f * 2, 140f));
}};

View File

@@ -172,7 +172,7 @@ public class Universe{
}
//export to another sector
if(sector.save.meta.secinfo.destination != null){
if(sector.save != null && sector.save.meta != null && sector.save.meta.secinfo != null && sector.save.meta.secinfo.destination != null){
Sector to = sector.save.meta.secinfo.destination;
if(to.save != null){
ItemSeq items = to.getExtraItems();

View File

@@ -3,6 +3,7 @@ package mindustry.world.blocks.logic;
import arc.util.io.*;
import mindustry.gen.*;
import mindustry.world.*;
import mindustry.world.meta.*;
public class MemoryBlock extends Block{
public int memoryCapacity = 32;
@@ -13,9 +14,22 @@ public class MemoryBlock extends Block{
solid = true;
}
@Override
public void setStats(){
super.setStats();
stats.add(BlockStat.memoryCapacity, memoryCapacity, StatUnit.none);
}
public class MemoryBuild extends Building{
public double[] memory = new double[memoryCapacity];
//massive byte size means picking up causes sync issues
@Override
public boolean canPickup(){
return false;
}
@Override
public void write(Writes write){
super.write(write);
@@ -31,9 +45,9 @@ public class MemoryBlock extends Block{
super.read(read, revision);
int amount = read.i();
memory = memory.length != amount ? new double[amount] : memory;
for(int i = 0; i < amount; i++){
memory[i] = read.d();
double val = read.d();
if(i < memory.length) memory[i] = val;
}
}
}

View File

@@ -11,6 +11,7 @@ public enum BlockStat{
displaySize(StatCategory.general),
buildTime(StatCategory.general),
buildCost(StatCategory.general),
memoryCapacity(StatCategory.general),
itemCapacity(StatCategory.items),
itemsMoved(StatCategory.items),