Fixed poly weapon outline
This commit is contained in:
@@ -1865,16 +1865,15 @@ public class Blocks{
|
||||
//erekir transport blocks
|
||||
|
||||
duct = new Duct("duct"){{
|
||||
requirements(Category.distribution, with(Items.graphite, 1));
|
||||
requirements(Category.distribution, with(Items.beryllium, 1));
|
||||
//TODO bad idea? should this just require 1 beryllium?
|
||||
buildVisibility = BuildVisibility.berylliumOnly;
|
||||
health = 90;
|
||||
speed = 4f;
|
||||
researchCostMultiplier = 1f / 6f;
|
||||
}};
|
||||
|
||||
ductRouter = new DuctRouter("duct-router"){{
|
||||
requirements(Category.distribution, with(Items.graphite, 8, Items.beryllium, 4));
|
||||
requirements(Category.distribution, with(Items.beryllium, 10));
|
||||
health = 90;
|
||||
speed = 4f;
|
||||
regionRotated1 = 1;
|
||||
@@ -1882,6 +1881,7 @@ public class Blocks{
|
||||
}};
|
||||
|
||||
overflowDuct = new OverflowDuct("overflow-duct"){{
|
||||
//TODO should it use beryllium?
|
||||
requirements(Category.distribution, with(Items.graphite, 8, Items.beryllium, 8));
|
||||
health = 90;
|
||||
speed = 4f;
|
||||
@@ -1889,7 +1889,7 @@ public class Blocks{
|
||||
}};
|
||||
|
||||
ductBridge = new DuctBridge("duct-bridge"){{
|
||||
requirements(Category.distribution, with(Items.graphite, 15, Items.beryllium, 10));
|
||||
requirements(Category.distribution, with(Items.beryllium, 20));
|
||||
health = 90;
|
||||
speed = 4f;
|
||||
researchCostMultiplier = 0.3f;
|
||||
@@ -2150,36 +2150,6 @@ public class Blocks{
|
||||
baseExplosiveness = 5f;
|
||||
}};
|
||||
|
||||
beamNode = new BeamNode("beam-node"){{
|
||||
requirements(Category.power, with(Items.graphite, 5, Items.beryllium, 3));
|
||||
consumesPower = outputsPower = true;
|
||||
health = 90;
|
||||
consumePowerBuffered(1000f);
|
||||
range = 10;
|
||||
researchCostMultiplier = 0.2f;
|
||||
}};
|
||||
|
||||
//TODO requirements
|
||||
beamTower = new BeamNode("beam-tower"){{
|
||||
requirements(Category.power, with(Items.beryllium, 30, Items.oxide, 20, Items.silicon, 10));
|
||||
size = 3;
|
||||
consumesPower = outputsPower = true;
|
||||
consumePowerBuffered(40000f);
|
||||
range = 23;
|
||||
scaledHealth = 90;
|
||||
}};
|
||||
|
||||
beamLink = new LongPowerNode("beam-link"){{
|
||||
requirements(Category.power, BuildVisibility.editorOnly, with());
|
||||
size = 3;
|
||||
maxNodes = 1;
|
||||
laserRange = 1000f;
|
||||
autolink = false;
|
||||
laserColor2 = Color.valueOf("ffd9c2");
|
||||
laserScale = 0.8f;
|
||||
scaledHealth = 130;
|
||||
}};
|
||||
|
||||
combustionGenerator = new ConsumeGenerator("combustion-generator"){{
|
||||
requirements(Category.power, with(Items.copper, 25, Items.lead, 15));
|
||||
powerProduction = 1f;
|
||||
@@ -2292,8 +2262,38 @@ public class Blocks{
|
||||
|
||||
//erekir
|
||||
|
||||
beamNode = new BeamNode("beam-node"){{
|
||||
requirements(Category.power, with(Items.beryllium, 8));
|
||||
consumesPower = outputsPower = true;
|
||||
health = 90;
|
||||
consumePowerBuffered(1000f);
|
||||
range = 10;
|
||||
researchCostMultiplier = 0.2f;
|
||||
}};
|
||||
|
||||
//TODO requirements
|
||||
beamTower = new BeamNode("beam-tower"){{
|
||||
requirements(Category.power, with(Items.beryllium, 30, Items.oxide, 20, Items.silicon, 10));
|
||||
size = 3;
|
||||
consumesPower = outputsPower = true;
|
||||
consumePowerBuffered(40000f);
|
||||
range = 23;
|
||||
scaledHealth = 90;
|
||||
}};
|
||||
|
||||
beamLink = new LongPowerNode("beam-link"){{
|
||||
requirements(Category.power, BuildVisibility.editorOnly, with());
|
||||
size = 3;
|
||||
maxNodes = 1;
|
||||
laserRange = 1000f;
|
||||
autolink = false;
|
||||
laserColor2 = Color.valueOf("ffd9c2");
|
||||
laserScale = 0.8f;
|
||||
scaledHealth = 130;
|
||||
}};
|
||||
|
||||
turbineCondenser = new ThermalGenerator("turbine-condenser"){{
|
||||
requirements(Category.power, with(Items.graphite, 40, Items.beryllium, 40));
|
||||
requirements(Category.power, with(Items.beryllium, 60));
|
||||
attribute = Attribute.steam;
|
||||
displayEfficiencyScale = 1f / 9f;
|
||||
minEfficiency = 9f - 0.0001f;
|
||||
@@ -2509,7 +2509,7 @@ public class Blocks{
|
||||
}};
|
||||
|
||||
plasmaBore = new BeamDrill("plasma-bore"){{
|
||||
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 30));
|
||||
requirements(Category.production, with(Items.beryllium, 40));
|
||||
consumePower(0.15f);
|
||||
drillTime = 160f;
|
||||
tier = 3;
|
||||
|
||||
@@ -1270,10 +1270,10 @@ public class UnitTypes{
|
||||
|
||||
abilities.add(new RepairFieldAbility(5f, 60f * 8, 50f));
|
||||
|
||||
weapons.add(new Weapon("heal-weapon-mount"){{
|
||||
weapons.add(new Weapon("poly-weapon"){{
|
||||
top = false;
|
||||
y = -2.5f;
|
||||
x = 3.5f;
|
||||
x = 3.75f;
|
||||
reload = 30f;
|
||||
ejectEffect = Fx.none;
|
||||
recoil = 2f;
|
||||
@@ -2461,7 +2461,7 @@ public class UnitTypes{
|
||||
hitSize = 18f;
|
||||
treadPullOffset = 5;
|
||||
speed = 0.7f;
|
||||
rotateSpeed = 3f;
|
||||
rotateSpeed = 2.6f;
|
||||
health = 800;
|
||||
armor = 7f;
|
||||
areaDamage = 8f;
|
||||
|
||||
@@ -486,7 +486,6 @@ public class Weapon implements Cloneable{
|
||||
cellRegion = Core.atlas.find(name + "-cell");
|
||||
outlineRegion = Core.atlas.find(name + "-outline");
|
||||
|
||||
//TODO outlinedRegions
|
||||
for(var part : parts){
|
||||
part.turretShading = false;
|
||||
part.load(name);
|
||||
|
||||
@@ -13,10 +13,10 @@ public class PowerGraph{
|
||||
private static final IntSet closedSet = new IntSet();
|
||||
|
||||
//do not modify any of these unless you know what you're doing!
|
||||
public final Seq<Building> producers = new Seq<>(false);
|
||||
public final Seq<Building> consumers = new Seq<>(false);
|
||||
public final Seq<Building> batteries = new Seq<>(false);
|
||||
public final Seq<Building> all = new Seq<>(false);
|
||||
public final Seq<Building> producers = new Seq<>(false, 16, Building.class);
|
||||
public final Seq<Building> consumers = new Seq<>(false, 16, Building.class);
|
||||
public final Seq<Building> batteries = new Seq<>(false, 16, Building.class);
|
||||
public final Seq<Building> all = new Seq<>(false, 16, Building.class);
|
||||
|
||||
private final PowerGraphUpdater entity;
|
||||
private final WindowedMean powerBalance = new WindowedMean(60);
|
||||
@@ -86,7 +86,9 @@ public class PowerGraph{
|
||||
|
||||
public float getPowerProduced(){
|
||||
float powerProduced = 0f;
|
||||
for(Building producer : producers){
|
||||
var items = producers.items;
|
||||
for(int i = 0; i < producers.size; i++){
|
||||
var producer = items[i];
|
||||
powerProduced += producer.getPowerProduction() * producer.delta();
|
||||
}
|
||||
return powerProduced;
|
||||
@@ -94,8 +96,10 @@ public class PowerGraph{
|
||||
|
||||
public float getPowerNeeded(){
|
||||
float powerNeeded = 0f;
|
||||
for(Building consumer : consumers){
|
||||
ConsumePower consumePower = consumer.block.consPower;
|
||||
var items = consumers.items;
|
||||
for(int i = 0; i < consumers.size; i++){
|
||||
var consumer = items[i];
|
||||
var consumePower = consumer.block.consPower;
|
||||
if(otherConsumersAreValid(consumer, consumePower)){
|
||||
powerNeeded += consumePower.requestedPower(consumer) * consumer.delta();
|
||||
}
|
||||
@@ -105,7 +109,9 @@ public class PowerGraph{
|
||||
|
||||
public float getBatteryStored(){
|
||||
float totalAccumulator = 0f;
|
||||
for(Building battery : batteries){
|
||||
var items = batteries.items;
|
||||
for(int i = 0; i < batteries.size; i++){
|
||||
var battery = items[i];
|
||||
if(battery.enabled){
|
||||
totalAccumulator += battery.power.status * battery.block.consPower.capacity;
|
||||
}
|
||||
@@ -115,7 +121,9 @@ public class PowerGraph{
|
||||
|
||||
public float getBatteryCapacity(){
|
||||
float totalCapacity = 0f;
|
||||
for(Building battery : batteries){
|
||||
var items = batteries.items;
|
||||
for(int i = 0; i < batteries.size; i++){
|
||||
var battery = items[i];
|
||||
if(battery.enabled){
|
||||
totalCapacity += (1f - battery.power.status) * battery.block.consPower.capacity;
|
||||
}
|
||||
@@ -125,7 +133,9 @@ public class PowerGraph{
|
||||
|
||||
public float getTotalBatteryCapacity(){
|
||||
float totalCapacity = 0f;
|
||||
for(Building battery : batteries){
|
||||
var items = batteries.items;
|
||||
for(int i = 0; i < batteries.size; i++){
|
||||
var battery = items[i];
|
||||
if(battery.enabled){
|
||||
totalCapacity += battery.block.consPower.capacity;
|
||||
}
|
||||
@@ -139,7 +149,9 @@ public class PowerGraph{
|
||||
|
||||
float used = Math.min(stored, needed);
|
||||
float consumedPowerPercentage = Math.min(1.0f, needed / stored);
|
||||
for(Building battery : batteries){
|
||||
var items = batteries.items;
|
||||
for(int i = 0; i < batteries.size; i++){
|
||||
var battery = items[i];
|
||||
if(battery.enabled){
|
||||
battery.power.status *= (1f-consumedPowerPercentage);
|
||||
}
|
||||
@@ -153,7 +165,9 @@ public class PowerGraph{
|
||||
float chargedPercent = Math.min(excess/capacity, 1f);
|
||||
if(Mathf.equal(capacity, 0f)) return 0f;
|
||||
|
||||
for(Building battery : batteries){
|
||||
var items = batteries.items;
|
||||
for(int i = 0; i < batteries.size; i++){
|
||||
var battery = items[i];
|
||||
//TODO why would it be 0
|
||||
if(battery.enabled && battery.block.consPower.capacity > 0f){
|
||||
battery.power.status += (1f - battery.power.status) * chargedPercent;
|
||||
@@ -165,9 +179,11 @@ public class PowerGraph{
|
||||
public void distributePower(float needed, float produced, boolean charged){
|
||||
//distribute even if not needed. this is because some might be requiring power but not using it; it updates consumers
|
||||
float coverage = Mathf.zero(needed) && Mathf.zero(produced) && !charged && Mathf.zero(lastPowerStored) ? 0f : Mathf.zero(needed) ? 1f : Math.min(1, produced / needed);
|
||||
for(Building consumer : consumers){
|
||||
var items = consumers.items;
|
||||
for(int i = 0; i < consumers.size; i++){
|
||||
var consumer = items[i];
|
||||
//TODO how would it even be null
|
||||
ConsumePower cons = consumer.block.consPower;
|
||||
var cons = consumer.block.consPower;
|
||||
if(cons.buffered){
|
||||
if(!Mathf.zero(cons.capacity)){
|
||||
// Add an equal percentage of power to all buffers, based on the global power coverage in this graph
|
||||
|
||||
Reference in New Issue
Block a user