stuff
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 505 B |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 244 KiB |
|
Before Width: | Height: | Size: 277 KiB After Width: | Height: | Size: 283 KiB |
|
Before Width: | Height: | Size: 542 KiB After Width: | Height: | Size: 535 KiB |
@@ -519,8 +519,8 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
cryofluidMixer = new GenericCrafter("cryofluidmixer"){{
|
cryofluidMixer = new GenericCrafter("cryofluidmixer"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.lead, 130, Items.silicon, 80, Items.thorium, 90));
|
requirements(Category.crafting, ItemStack.with(Items.lead, 130, Items.silicon, 80, Items.thorium, 90));
|
||||||
outputLiquid = new LiquidStack(Liquids.cryofluid, 0.6f);
|
outputLiquid = new LiquidStack(Liquids.cryofluid, 7.2f);
|
||||||
craftTime = 5f;
|
craftTime = 60f;
|
||||||
size = 2;
|
size = 2;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
@@ -531,7 +531,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
consumes.power(1f);
|
consumes.power(1f);
|
||||||
consumes.item(Items.titanium);
|
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");
|
int liquidRegion = reg("-liquid"), topRegion = reg("-top"), bottomRegion = reg("-bottom");
|
||||||
|
|
||||||
@@ -1450,12 +1450,12 @@ public class Blocks implements ContentList{
|
|||||||
Items.surgealloy, Bullets.flakSurge
|
Items.surgealloy, Bullets.flakSurge
|
||||||
);
|
);
|
||||||
xRand = 4f;
|
xRand = 4f;
|
||||||
reload = 7f;
|
reload = 6f;
|
||||||
range = 170f;
|
range = 190f;
|
||||||
size = 3;
|
size = 3;
|
||||||
recoil = 3f;
|
recoil = 3f;
|
||||||
rotatespeed = 10f;
|
rotatespeed = 10f;
|
||||||
inaccuracy = 13f;
|
inaccuracy = 10f;
|
||||||
shootCone = 30f;
|
shootCone = 30f;
|
||||||
|
|
||||||
health = 145 * size * size;
|
health = 145 * size * size;
|
||||||
|
|||||||
@@ -626,7 +626,6 @@ public class Bullets implements ContentList{
|
|||||||
|
|
||||||
slagShot = new LiquidBulletType(Liquids.slag){{
|
slagShot = new LiquidBulletType(Liquids.slag){{
|
||||||
damage = 4;
|
damage = 4;
|
||||||
speed = 1.9f;
|
|
||||||
drag = 0.03f;
|
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.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.TextureAtlas;
|
import io.anuke.arc.graphics.g2d.TextureAtlas;
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.KeyCode;
|
||||||
|
import io.anuke.arc.scene.ui.Dialog;
|
||||||
import io.anuke.arc.scene.ui.TextField;
|
import io.anuke.arc.scene.ui.TextField;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.content.Mechs;
|
import io.anuke.mindustry.content.Mechs;
|
||||||
@@ -308,7 +309,7 @@ public class Control implements ApplicationListener{
|
|||||||
Time.update();
|
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();
|
Platform.instance.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class NetServer implements ApplicationListener{
|
|||||||
|
|
||||||
//playing in pvp mode automatically assigns players to teams
|
//playing in pvp mode automatically assigns players to teams
|
||||||
if(state.rules.pvp){
|
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());
|
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.
|
//find team with minimum amount of players and auto-assign player to that.
|
||||||
return Structs.findMin(Team.all, team -> {
|
return Structs.findMin(Team.all, team -> {
|
||||||
if(state.teams.isActive(team)){
|
if(state.teams.isActive(team)){
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(Player other : playerGroup.all()){
|
for(Player other : players){
|
||||||
if(other.getTeam() == team){
|
if(other.getTeam() == team){
|
||||||
count ++;
|
count ++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,10 +135,6 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool
|
|||||||
if(owner instanceof Unit){
|
if(owner instanceof Unit){
|
||||||
return ((Unit) owner).getDamageMultipler();
|
return ((Unit) owner).getDamageMultipler();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(owner instanceof Lightning && data instanceof Float){
|
|
||||||
return (Float)data;
|
|
||||||
}
|
|
||||||
return 1f;
|
return 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +151,9 @@ public class Bullet extends SolidEntity implements DamageTrait, ScaleTrait, Pool
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float damage(){
|
public float damage(){
|
||||||
|
if(owner instanceof Lightning && data instanceof Float){
|
||||||
|
return (Float)data;
|
||||||
|
}
|
||||||
return type.damage * damageMultiplier();
|
return type.damage * damageMultiplier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -288,6 +288,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
if(block == previous && cons != null){
|
if(block == previous && cons != null){
|
||||||
cons.update();
|
cons.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(block == previous && power != null){
|
||||||
|
power.graph.update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -96,9 +96,11 @@ public class ForceProjector extends Block {
|
|||||||
entity.shield.add();
|
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();
|
entity.cons.trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public abstract class LiquidTurret extends Turret{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
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));
|
&& (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;
|
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
|
@Override
|
||||||
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
|
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
|
||||||
ItemBridgeEntity entity = tile.entity();
|
ItemBridgeEntity entity = tile.entity();
|
||||||
|
|||||||
@@ -84,8 +84,6 @@ public class ImpactReactor extends PowerGenerator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
entity.productionEfficiency = Mathf.pow(entity.warmup, 5f);
|
entity.productionEfficiency = Mathf.pow(entity.warmup, 5f);
|
||||||
|
|
||||||
super.update(tile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -123,18 +123,6 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
|||||||
entity.productionEfficiency = 0.0f;
|
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
|
@Override
|
||||||
|
|||||||
@@ -116,8 +116,6 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
|
|
||||||
if(entity.heat >= 0.999f){
|
if(entity.heat >= 0.999f){
|
||||||
entity.kill();
|
entity.kill();
|
||||||
}else{
|
|
||||||
super.update(tile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package io.anuke.mindustry.world.blocks.power;
|
package io.anuke.mindustry.world.blocks.power;
|
||||||
|
|
||||||
import io.anuke.mindustry.world.Tile;
|
|
||||||
import io.anuke.mindustry.world.blocks.PowerBlock;
|
import io.anuke.mindustry.world.blocks.PowerBlock;
|
||||||
|
|
||||||
public class PowerDistributor extends PowerBlock{
|
public class PowerDistributor extends PowerBlock{
|
||||||
@@ -10,9 +9,4 @@ public class PowerDistributor extends PowerBlock{
|
|||||||
consumesPower = false;
|
consumesPower = false;
|
||||||
outputsPower = true;
|
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())){
|
if(entity.productionEfficiency > 0.1f && Mathf.chance(0.05 * entity.delta())){
|
||||||
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||||
}
|
}
|
||||||
|
|
||||||
super.update(tile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -125,7 +125,10 @@ public class GenericCrafter extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canProduce(Tile tile){
|
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
|
@Override
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import io.anuke.arc.ApplicationListener;
|
|||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.Events;
|
import io.anuke.arc.Events;
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
|
import io.anuke.arc.collection.Array.ArrayIterable;
|
||||||
import io.anuke.arc.collection.ObjectSet;
|
import io.anuke.arc.collection.ObjectSet;
|
||||||
import io.anuke.arc.files.FileHandle;
|
import io.anuke.arc.files.FileHandle;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
@@ -663,7 +664,7 @@ public class ServerControl implements ApplicationListener{
|
|||||||
for(Player p : players){
|
for(Player p : players){
|
||||||
p.reset();
|
p.reset();
|
||||||
if(state.rules.pvp){
|
if(state.rules.pvp){
|
||||||
p.setTeam(netServer.assignTeam());
|
p.setTeam(netServer.assignTeam(new ArrayIterable<>(players)));
|
||||||
}
|
}
|
||||||
netServer.sendWorldData(p, p.con.id);
|
netServer.sendWorldData(p, p.con.id);
|
||||||
}
|
}
|
||||||
|
|||||||