Added T3 logic processor
This commit is contained in:
@@ -237,7 +237,7 @@ public abstract class Turret extends Block{
|
||||
canShoot = unit.isShooting();
|
||||
}else if(logicControlled()){ //logic behavior
|
||||
canShoot = logicShooting;
|
||||
}else{ //default AI behavior
|
||||
}else if(peekAmmo() != null){ //default AI behavior
|
||||
BulletType type = peekAmmo();
|
||||
float speed = type.speed;
|
||||
//slow bullets never intersect
|
||||
|
||||
@@ -17,6 +17,7 @@ import mindustry.logic.LExecutor.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.BuildBlock.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.zip.*;
|
||||
@@ -113,6 +114,14 @@ public class LogicBlock extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
|
||||
stats.add(BlockStat.linkRange, range / 8, StatUnit.blocks);
|
||||
stats.add(BlockStat.instructions, instructionsPerTick * 60, StatUnit.perSecond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||
Drawf.circles(x*tilesize + offset, y*tilesize + offset, range);
|
||||
@@ -340,7 +349,7 @@ public class LogicBlock extends Block{
|
||||
updateCode();
|
||||
}
|
||||
|
||||
accumulator += edelta() * instructionsPerTick;
|
||||
accumulator += edelta() * instructionsPerTick * (consValid() ? 1 : 0);
|
||||
|
||||
if(accumulator > maxInstructionScale * instructionsPerTick) accumulator = maxInstructionScale * instructionsPerTick;
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ public enum BlockStat{
|
||||
drillTier(StatCategory.crafting),
|
||||
drillSpeed(StatCategory.crafting),
|
||||
maxUnits(StatCategory.crafting),
|
||||
linkRange(StatCategory.crafting),
|
||||
instructions(StatCategory.crafting),
|
||||
|
||||
speedIncrease(StatCategory.shooting),
|
||||
repairTime(StatCategory.shooting),
|
||||
|
||||
@@ -295,11 +295,11 @@ public class ItemModule extends BlockModule{
|
||||
public void read(Reads read){
|
||||
//just in case, reset items
|
||||
Arrays.fill(items, 0);
|
||||
byte count = read.b();
|
||||
int count = read.ub();
|
||||
total = 0;
|
||||
|
||||
for(int j = 0; j < count; j++){
|
||||
int itemid = read.b();
|
||||
int itemid = read.ub();
|
||||
int itemamount = read.i();
|
||||
items[content.item(itemid).id] = itemamount;
|
||||
total += itemamount;
|
||||
|
||||
Reference in New Issue
Block a user