Moved some blocks around

This commit is contained in:
Anuken 2020-05-31 14:39:10 -04:00
parent 0842c3f0a0
commit bd349803d3
15 changed files with 852 additions and 799 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 KiB

After

Width:  |  Height:  |  Size: 829 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

@ -14,7 +14,7 @@ import mindustry.graphics.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.world.*; import mindustry.world.*;
import mindustry.world.blocks.*; import mindustry.world.blocks.*;
import mindustry.world.blocks.campaign.LaunchPad; import mindustry.world.blocks.campaign.*;
import mindustry.world.blocks.defense.*; import mindustry.world.blocks.defense.*;
import mindustry.world.blocks.defense.turrets.*; import mindustry.world.blocks.defense.turrets.*;
import mindustry.world.blocks.distribution.*; import mindustry.world.blocks.distribution.*;
@ -71,7 +71,7 @@ public class Blocks implements ContentList{
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator, mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator,
//storage //storage
coreShard, coreFoundation, coreNucleus, vault, container, unloader, launchPad, launchPadLarge, coreShard, coreFoundation, coreNucleus, vault, container, unloader,
//turrets //turrets
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown,
@ -79,8 +79,10 @@ public class Blocks implements ContentList{
//units //units
groundFactory, airFactory, navalFactory, basicReconstructor, repairPoint, groundFactory, airFactory, navalFactory, basicReconstructor, repairPoint,
//misc experimental //campaign
launchPad, launchPadLarge, coreSilo, dataProcessor,
//misc experimental
blockForge, blockLauncher, blockLoader, blockUnloader; blockForge, blockLauncher, blockLoader, blockUnloader;
@Override @Override
@ -1316,25 +1318,6 @@ public class Blocks implements ContentList{
speed = 7f; speed = 7f;
}}; }};
launchPad = new mindustry.world.blocks.campaign.LaunchPad("launch-pad"){{
requirements(Category.effect, BuildVisibility.campaignOnly, ItemStack.with(Items.copper, 350, Items.silicon, 140, Items.lead, 200, Items.titanium, 150));
size = 3;
itemCapacity = 100;
launchTime = 60f * 20;
hasPower = true;
consumes.power(4f);
}};
launchPadLarge = new LaunchPad("launch-pad-large"){{
requirements(Category.effect, BuildVisibility.campaignOnly, ItemStack.with(Items.titanium, 200, Items.silicon, 150, Items.lead, 250, Items.plastanium, 75));
size = 4;
itemCapacity = 300;
launchTime = 60f * 35;
hasPower = true;
consumes.power(6f);
}};
//endregion //endregion
//region turrets //region turrets
@ -1780,6 +1763,41 @@ public class Blocks implements ContentList{
new LegacyCommandCenter("legacy-command-center"); new LegacyCommandCenter("legacy-command-center");
//endregion //endregion
//region campaign
launchPad = new LaunchPad("launch-pad"){{
requirements(Category.effect, BuildVisibility.campaignOnly, ItemStack.with(Items.copper, 350, Items.silicon, 140, Items.lead, 200, Items.titanium, 150));
size = 3;
itemCapacity = 100;
launchTime = 60f * 20;
hasPower = true;
consumes.power(4f);
}};
launchPadLarge = new LaunchPad("launch-pad-large"){{
requirements(Category.effect, BuildVisibility.campaignOnly, ItemStack.with(Items.titanium, 200, Items.silicon, 150, Items.lead, 250, Items.plastanium, 75));
size = 4;
itemCapacity = 300;
launchTime = 60f * 35;
hasPower = true;
consumes.power(6f);
}};
coreSilo = new CoreLauncher("core-silo"){{
requirements(Category.effect, BuildVisibility.campaignOnly, ItemStack.with(Items.copper, 350, Items.silicon, 140, Items.lead, 200, Items.titanium, 150));
size = 5;
itemCapacity = 1000;
hasPower = true;
consumes.power(4f);
}};
dataProcessor = new ResearchBlock("data-processor"){{
requirements(Category.effect, BuildVisibility.campaignOnly, ItemStack.with(Items.copper, 350, Items.silicon, 140, Items.lead, 200, Items.titanium, 150));
size = 3;
}};
//endregion campaign
//region experimental //region experimental
blockForge = new BlockForge("block-forge"){{ blockForge = new BlockForge("block-forge"){{

View File

@ -2,11 +2,12 @@ package mindustry.game;
import arc.*; import arc.*;
import arc.math.*; import arc.math.*;
import arc.struct.ObjectFloatMap.*; import arc.struct.*;
import arc.util.*; import arc.util.*;
import mindustry.*; import mindustry.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.game.EventType.*; import mindustry.game.EventType.*;
import mindustry.game.SectorInfo.*;
import mindustry.io.*; import mindustry.io.*;
import mindustry.type.*; import mindustry.type.*;
@ -80,9 +81,9 @@ public class Universe{
if(sector.hasBase() && !sector.isBeingPlayed()){ if(sector.hasBase() && !sector.isBeingPlayed()){
SaveMeta meta = sector.save.meta; SaveMeta meta = sector.save.meta;
for(Entry<Item> entry : meta.exportRates){ for(ObjectMap.Entry<Item, ExportStat> entry : meta.secinfo.export){
//total is calculated by items/sec (value) * turn duration in seconds //total is calculated by items/sec (value) * turn duration in seconds
int total = (int)(entry.value * turnDuration / 60f); int total = (int)(entry.value.mean * turnDuration / 60f);
exports[entry.key.id] += total; exports[entry.key.id] += total;
} }

View File

@ -272,25 +272,6 @@ public class MobileInput extends InputHandler implements GestureListener{
}); });
} }
@Override
protected int schemOriginX(){
Tmp.v1.setZero();
selectRequests.each(r -> Tmp.v1.add(r.drawx(), r.drawy()));
return world.toTile(Tmp.v1.scl(1f / selectRequests.size).x);
}
@Override
protected int schemOriginY(){
Tmp.v1.setZero();
selectRequests.each(r -> Tmp.v1.add(r.drawx(), r.drawy()));
return world.toTile(Tmp.v1.scl(1f / selectRequests.size).y);
}
@Override
public boolean isPlacing(){
return super.isPlacing() && mode == placing;
}
@Override @Override
public void drawBottom(){ public void drawBottom(){
Lines.stroke(1f); Lines.stroke(1f);
@ -409,7 +390,26 @@ public class MobileInput extends InputHandler implements GestureListener{
} }
//endregion //endregion
//region input events //region input events, overrides
@Override
protected int schemOriginX(){
Tmp.v1.setZero();
selectRequests.each(r -> Tmp.v1.add(r.drawx(), r.drawy()));
return world.toTile(Tmp.v1.scl(1f / selectRequests.size).x);
}
@Override
protected int schemOriginY(){
Tmp.v1.setZero();
selectRequests.each(r -> Tmp.v1.add(r.drawx(), r.drawy()));
return world.toTile(Tmp.v1.scl(1f / selectRequests.size).y);
}
@Override
public boolean isPlacing(){
return super.isPlacing() && mode == placing;
}
@Override @Override
public boolean isBreaking(){ public boolean isBreaking(){

View File

@ -11,6 +11,7 @@ public class CoreLauncher extends Block{
hasItems = true; hasItems = true;
configurable = true; configurable = true;
update = true;
} }
public class CoreLauncherEntity extends TileEntity{ public class CoreLauncherEntity extends TileEntity{

View File

@ -34,6 +34,14 @@ public class ResearchBlock extends Block{
} }
@Override
public boolean configTapped(){
//TODO select target
Vars.ui.tech.show();
return false;
}
@Override @Override
public void write(Writes write){ public void write(Writes write){
super.write(write); super.write(write);

View File

@ -11,7 +11,7 @@ import java.awt.image.BufferedImage
import java.util.List import java.util.List
import java.util.concurrent.ExecutorService import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
def genFolder = "../core/assets-raw/sprites_out/generated/" def genFolder = "../core/assets-raw/sprites_out/generated/"
def doAntialias = !project.hasProperty("disableAntialias") def doAntialias = !project.hasProperty("disableAntialias")
@ -33,7 +33,7 @@ def transformColors = { List<List<String>> list ->
//d4816b //d4816b
transformColors([["6e7080", "989aa4", "b0bac0"], ["bc5452", "ea8878", "feb380"], ["de9458", "f8c266", "ffe18f"], ["feb380", "ea8878", "bc5452"]]) transformColors([["a387ea", "8a73c6", "5c5e9f"], ["6e7080", "989aa4", "b0bac0"], ["bc5452", "ea8878", "feb380"], ["de9458", "f8c266", "ffe18f"], ["feb380", "ea8878", "bc5452"]])
def antialias = { File file -> def antialias = { File file ->
if(!doAntialias) return if(!doAntialias) return
@ -189,6 +189,17 @@ def scaleImage = { File file ->
def tileImage = { File file -> def tileImage = { File file ->
def image = ImageIO.read(file) def image = ImageIO.read(file)
for(x in 0..image.width-1){
for(y in 0..image.height-1){
if(x > (image.height - 1 - y)){
def rx = image.height - 1 - y
def ry = x
image.setRGB(x, y, image.getRGB(rx, image.height - 1 - ry))
}
}
}
def result = new BufferedImage(image.width * 2, image.height * 2, image.getType()) def result = new BufferedImage(image.width * 2, image.height * 2, image.getType())
Graphics2D graphics = result.createGraphics() Graphics2D graphics = result.createGraphics()
graphics.drawImage(image, image.width, 0, -image.width, image.height, null) graphics.drawImage(image, image.width, 0, -image.width, image.height, null)