stuff
This commit is contained in:
@@ -519,8 +519,8 @@ public class Blocks implements ContentList{
|
||||
|
||||
cryofluidMixer = new GenericCrafter("cryofluidmixer"){{
|
||||
requirements(Category.crafting, ItemStack.with(Items.lead, 130, Items.silicon, 80, Items.thorium, 90));
|
||||
outputLiquid = new LiquidStack(Liquids.cryofluid, 0.6f);
|
||||
craftTime = 5f;
|
||||
outputLiquid = new LiquidStack(Liquids.cryofluid, 7.2f);
|
||||
craftTime = 60f;
|
||||
size = 2;
|
||||
hasPower = true;
|
||||
hasItems = true;
|
||||
@@ -531,7 +531,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
consumes.power(1f);
|
||||
consumes.item(Items.titanium);
|
||||
consumes.liquid(Liquids.water, 0.6f);
|
||||
consumes.liquid(Liquids.water, 7.2f);
|
||||
|
||||
int liquidRegion = reg("-liquid"), topRegion = reg("-top"), bottomRegion = reg("-bottom");
|
||||
|
||||
@@ -1450,12 +1450,12 @@ public class Blocks implements ContentList{
|
||||
Items.surgealloy, Bullets.flakSurge
|
||||
);
|
||||
xRand = 4f;
|
||||
reload = 7f;
|
||||
range = 170f;
|
||||
reload = 6f;
|
||||
range = 190f;
|
||||
size = 3;
|
||||
recoil = 3f;
|
||||
rotatespeed = 10f;
|
||||
inaccuracy = 13f;
|
||||
inaccuracy = 10f;
|
||||
shootCone = 30f;
|
||||
|
||||
health = 145 * size * size;
|
||||
|
||||
@@ -626,7 +626,6 @@ public class Bullets implements ContentList{
|
||||
|
||||
slagShot = new LiquidBulletType(Liquids.slag){{
|
||||
damage = 4;
|
||||
speed = 1.9f;
|
||||
drag = 0.03f;
|
||||
}};
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.anuke.arc.graphics.GL20;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.TextureAtlas;
|
||||
import io.anuke.arc.input.KeyCode;
|
||||
import io.anuke.arc.scene.ui.Dialog;
|
||||
import io.anuke.arc.scene.ui.TextField;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.content.Mechs;
|
||||
@@ -308,7 +309,7 @@ public class Control implements ApplicationListener{
|
||||
Time.update();
|
||||
}
|
||||
|
||||
if(!scene.hasDialog() && Core.input.keyTap(KeyCode.BACK)){
|
||||
if(!scene.hasDialog() && !(scene.root.getChildren().peek() instanceof Dialog) &&Core.input.keyTap(KeyCode.BACK)){
|
||||
Platform.instance.hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ public class NetServer implements ApplicationListener{
|
||||
|
||||
//playing in pvp mode automatically assigns players to teams
|
||||
if(state.rules.pvp){
|
||||
player.setTeam(assignTeam());
|
||||
player.setTeam(assignTeam(playerGroup.all()));
|
||||
Log.info("Auto-assigned player {0} to team {1}.", player.name, player.getTeam());
|
||||
}
|
||||
|
||||
@@ -208,12 +208,12 @@ public class NetServer implements ApplicationListener{
|
||||
});
|
||||
}
|
||||
|
||||
public Team assignTeam(){
|
||||
public Team assignTeam(Iterable<Player> players){
|
||||
//find team with minimum amount of players and auto-assign player to that.
|
||||
return Structs.findMin(Team.all, team -> {
|
||||
if(state.teams.isActive(team)){
|
||||
int count = 0;
|
||||
for(Player other : playerGroup.all()){
|
||||
for(Player other : players){
|
||||
if(other.getTeam() == team){
|
||||
count ++;
|
||||
}
|
||||
|
||||
@@ -135,10 +135,6 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool
|
||||
if(owner instanceof Unit){
|
||||
return ((Unit) owner).getDamageMultipler();
|
||||
}
|
||||
|
||||
if(owner instanceof Lightning && data instanceof Float){
|
||||
return (Float)data;
|
||||
}
|
||||
return 1f;
|
||||
}
|
||||
|
||||
@@ -155,6 +151,9 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool
|
||||
|
||||
@Override
|
||||
public float damage(){
|
||||
if(owner instanceof Lightning && data instanceof Float){
|
||||
return (Float)data;
|
||||
}
|
||||
return type.damage * damageMultiplier();
|
||||
}
|
||||
|
||||
|
||||
@@ -288,6 +288,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
||||
if(block == previous && cons != null){
|
||||
cons.update();
|
||||
}
|
||||
|
||||
if(block == previous && power != null){
|
||||
power.graph.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -96,9 +96,11 @@ public class ForceProjector extends Block {
|
||||
entity.shield.add();
|
||||
}
|
||||
|
||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons.optionalValid()), 0.1f);
|
||||
boolean phaseValid = consumes.get(ConsumeType.item).valid(tile.entity);
|
||||
|
||||
if(entity.cons.optionalValid() && !entity.broken && entity.timer.get(timerUse, phaseUseTime)){
|
||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(phaseValid), 0.1f);
|
||||
|
||||
if(phaseValid && !entity.broken && entity.timer.get(timerUse, phaseUseTime)){
|
||||
entity.cons.trigger();
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public abstract class LiquidTurret extends Turret{
|
||||
|
||||
@Override
|
||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||
return super.acceptLiquid(tile, source, liquid, amount) && ammo.get(liquid) != null
|
||||
return ammo.get(liquid) != null
|
||||
&& (tile.entity.liquids.current() == liquid || (ammo.containsKey(tile.entity.liquids.current()) && tile.entity.liquids.get(tile.entity.liquids.current()) <= ammo.get(tile.entity.liquids.current()).ammoMultiplier + 0.001f));
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,11 @@ public class LiquidExtendingBridge extends ExtendingItemBridge{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||
return tile.entity.liquids.get(liquid) + amount < liquidCapacity && (tile.entity.liquids.current() == liquid || tile.entity.liquids.get(tile.entity.liquids.current()) < 0.2f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
|
||||
ItemBridgeEntity entity = tile.entity();
|
||||
|
||||
@@ -84,8 +84,6 @@ public class ImpactReactor extends PowerGenerator{
|
||||
}
|
||||
|
||||
entity.productionEfficiency = Mathf.pow(entity.warmup, 5f);
|
||||
|
||||
super.update(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -123,18 +123,6 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
||||
entity.productionEfficiency = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
super.update(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||
return hasItems && getItemEfficiency(item) >= minItemEfficiency && tile.entity.items.total() < itemCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||
return hasLiquids && getLiquidEfficiency(liquid) >= minLiquidEfficiency && tile.entity.liquids.get(liquid) < liquidCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -116,8 +116,6 @@ public class NuclearReactor extends PowerGenerator{
|
||||
|
||||
if(entity.heat >= 0.999f){
|
||||
entity.kill();
|
||||
}else{
|
||||
super.update(tile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.anuke.mindustry.world.blocks.power;
|
||||
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.PowerBlock;
|
||||
|
||||
public class PowerDistributor extends PowerBlock{
|
||||
@@ -10,9 +9,4 @@ public class PowerDistributor extends PowerBlock{
|
||||
consumesPower = false;
|
||||
outputsPower = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
tile.entity.power.graph.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ public class ThermalGenerator extends PowerGenerator{
|
||||
if(entity.productionEfficiency > 0.1f && Mathf.chance(0.05 * entity.delta())){
|
||||
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||
}
|
||||
|
||||
super.update(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -125,7 +125,10 @@ public class GenericCrafter extends Block{
|
||||
|
||||
@Override
|
||||
public boolean canProduce(Tile tile){
|
||||
return super.canProduce(tile);
|
||||
if(outputItem != null && tile.entity.items.get(outputItem.item) >= itemCapacity){
|
||||
return false;
|
||||
}
|
||||
return outputLiquid == null || !(tile.entity.liquids.get(outputLiquid.liquid) >= liquidCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user