Unit control improvements / Larger max map size

This commit is contained in:
Anuken
2022-02-16 00:23:07 -05:00
parent 3dccacae3d
commit fbf0fec135
12 changed files with 74 additions and 55 deletions

View File

@@ -23,6 +23,7 @@ public class BaseTurret extends Block{
/** How much reload is lowered by for each unit of liquid of heat capacity. */
public float coolantMultiplier = 5f;
/** If not null, this consumer will be used for coolant. */
//TODO make automatic for mods?
public @Nullable ConsumeLiquidBase coolant;
public BaseTurret(String name){

View File

@@ -1,6 +1,7 @@
package mindustry.world.blocks.defense.turrets;
import arc.math.*;
import mindustry.world.consumers.*;
import mindustry.world.meta.*;
import static mindustry.Vars.*;
@@ -33,8 +34,9 @@ public class ReloadTurret extends BaseTurret{
protected void updateCooling(){
if(reload < reloadTime && coolant != null && coolant.valid(this)){
float capacity = coolant instanceof ConsumeLiquidFilter filter ? filter.getConsumed(this).heatCapacity : 1f;
coolant.update(this);
reload += coolant.amount * edelta() * (filterConsLiquid == null ? 1f : filterConsLiquid.heatCapacity) * coolantMultiplier;
reload += coolant.amount * edelta() * capacity * coolantMultiplier;
if(Mathf.chance(0.06 * coolant.amount)){
coolEffect.at(x + Mathf.range(size * tilesize / 2f), y + Mathf.range(size * tilesize / 2f));