Fixed power node config

This commit is contained in:
Anuken 2019-09-30 21:08:56 -04:00
parent 62ad78ace9
commit 985918b870
5 changed files with 21 additions and 15 deletions

View File

@ -1646,13 +1646,13 @@ public class Blocks implements ContentList{
}};
phantomFactory = new UnitFactory("phantom-factory"){{
requirements(Category.units, ItemStack.with(Items.titanium, 45, Items.thorium, 40, Items.lead, 55, Items.silicon, 105));
requirements(Category.units, ItemStack.with(Items.titanium, 50, Items.thorium, 60, Items.lead, 65, Items.silicon, 105));
type = UnitTypes.phantom;
produceTime = 3650;
produceTime = 4400;
size = 2;
maxSpawn = 2;
consumes.power(2f);
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 20), new ItemStack(Items.titanium, 10));
maxSpawn = 1;
consumes.power(2.5f);
consumes.items(new ItemStack(Items.silicon, 50), new ItemStack(Items.lead, 30), new ItemStack(Items.titanium, 20));
}};
commandCenter = new CommandCenter("command-center"){{

View File

@ -61,9 +61,8 @@ public class UnitTypes implements ContentList{
maxVelocity = 1.9f;
range = 70f;
itemCapacity = 70;
health = 220;
buildPower = 0.9f;
minePower = 1.1f;
health = 400;
buildPower = 1f;
engineOffset = 6.5f;
toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium);
weapon = new Weapon("heal-blaster"){{

View File

@ -16,6 +16,7 @@ import io.anuke.mindustry.type.*;
import io.anuke.mindustry.world.*;
import io.anuke.mindustry.world.blocks.*;
import io.anuke.mindustry.world.blocks.BuildBlock.*;
import io.anuke.mindustry.world.blocks.power.*;
import static io.anuke.mindustry.Vars.*;
@ -43,8 +44,10 @@ public class Logic implements ApplicationListener{
//blocks that get broken are appended to the team's broken block queue
Tile tile = event.tile;
Block block = tile.block();
if(tile.entity == null) return;
if(block instanceof BuildBlock ){
//skip null entities or nukes, for obvious reasons
if(tile.entity == null || tile.block() instanceof NuclearReactor) return;
if(block instanceof BuildBlock){
BuildEntity entity = tile.entity();

View File

@ -96,9 +96,9 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
incDrones(playerTarget);
TargetTrait prev = target;
target = playerTarget;
float dst = 90f + (id % 4)*30;
float dst = 90f + (id % 10)*3;
float tdst = dst(target);
float scale = (Mathf.lerp(1f, 0.77f, 1f - Mathf.clamp((tdst - dst) / dst)));
float scale = (Mathf.lerp(1f, 0.2f, 1f - Mathf.clamp((tdst - dst) / dst)));
circle(dst);
velocity.scl(scale);
target = prev;
@ -148,8 +148,7 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
}
boolean canRebuild(){
//disabled until further notice, reason being that it's too annoying when playing enemies and too broken for ally use
return timer.get(timerTarget, 80) && Units.closestEnemy(getTeam(), x, y, 100f, u -> !(u instanceof BaseDrone)) == null;
return true;
}
@Override
@ -184,7 +183,7 @@ public class BuilderDrone extends BaseDrone implements BuilderTrait{
}
}
if(canRebuild() && !isBuilding()){
if(timer.get(timerTarget, 80) && Units.closestEnemy(getTeam(), x, y, 100f, u -> !(u instanceof BaseDrone)) == null && !isBuilding()){
TeamData data = Vars.state.teams.get(team);
if(!data.brokenBlocks.isEmpty()){
BrokenBlock block = data.brokenBlocks.removeLast();

View File

@ -105,7 +105,12 @@ public class PowerNode extends PowerBlock{
}
}else if(linkValid(tile, other) && valid && entity.power.links.size < maxNodes){
if(!entity.power.links.contains(other.pos())){
entity.power.links.add(other.pos());
}
if(other.getTeamID() == tile.getTeamID()){
if(!other.entity.power.links.contains(tile.pos())){
other.entity.power.links.add(tile.pos());
}