This commit is contained in:
Anuken
2020-07-08 19:16:01 -04:00
parent c15aec641a
commit b0f69263c7
9 changed files with 30 additions and 13 deletions

View File

@@ -1862,8 +1862,9 @@ public class Blocks implements ContentList{
consumes.power(4f);
}};
//TODO remove
launchPadLarge = new LaunchPad("launch-pad-large"){{
requirements(Category.effect, BuildVisibility.campaignOnly, with(Items.titanium, 200, Items.silicon, 150, Items.lead, 250, Items.plastanium, 75));
//requirements(Category.effect, BuildVisibility.campaignOnly, with(Items.titanium, 200, Items.silicon, 150, Items.lead, 250, Items.plastanium, 75));
size = 4;
itemCapacity = 300;
launchTime = 60f * 35;

View File

@@ -538,7 +538,7 @@ public class UnitTypes implements ContentList{
mineTier = 1;
buildSpeed = 0.5f;
drag = 0.05f;
speed = 2.4f;
speed = 2.6f;
rotateSpeed = 15f;
accel = 0.1f;
range = 70f;
@@ -573,7 +573,7 @@ public class UnitTypes implements ContentList{
mineTier = 1;
buildSpeed = 0.5f;
drag = 0.05f;
speed = 2.4f;
speed = 2.9f;
rotateSpeed = 15f;
accel = 0.1f;
range = 70f;
@@ -608,7 +608,7 @@ public class UnitTypes implements ContentList{
mineTier = 1;
buildSpeed = 0.5f;
drag = 0.05f;
speed = 2.4f;
speed = 3.4f;
rotateSpeed = 15f;
accel = 0.1f;
range = 70f;

View File

@@ -149,7 +149,7 @@ public class Sector{
//TODO this should be stored in a more efficient structure, and be updated each turn
public Seq<ItemStack> getRecievedItems(){
return Core.settings.getJson(key("recieved-items"),Seq.class, ItemStack.class, Seq::new);
return Core.settings.getJson(key("recieved-items"), Seq.class, ItemStack.class, Seq::new);
}
public void setRecievedItems(Seq<ItemStack> stacks){

View File

@@ -194,8 +194,8 @@ public class Styles{
down = flatDown;
up = none;
over = flatOver;
disabled = black8;
imageDisabledColor = Color.lightGray;
disabled = none;
imageDisabledColor = Color.gray;
imageUpColor = Color.white;
}};
clearPartial2i = new ImageButtonStyle(){{

View File

@@ -7,7 +7,6 @@ import arc.math.*;
import arc.math.geom.*;
import arc.struct.*;
import arc.util.*;
import mindustry.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.entities.*;
@@ -19,6 +18,8 @@ import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.meta.*;
import static mindustry.Vars.*;
public class LaunchPad extends Block{
public final int timerLaunch = timers++;
/** Time inbetween launches. */
@@ -54,7 +55,7 @@ public class LaunchPad extends Block{
public void draw(){
super.draw();
if(!Vars.state.isCampaign()) return;
if(!state.isCampaign()) return;
if(lightRegion.found()){
Draw.color(lightColor);
@@ -91,7 +92,7 @@ public class LaunchPad extends Block{
@Override
public void updateTile(){
if(!Vars.state.isCampaign()) return;
if(!state.isCampaign()) return;
//launch when full and base conditions are met
if(items.total() >= itemCapacity && efficiency() >= 1f && timer(timerLaunch, launchTime / timeScale)){
@@ -175,12 +176,23 @@ public class LaunchPad extends Block{
public void remove(){
//actually launch the items upon removal
if(team() == Vars.state.rules.defaultTeam){
if(team() == state.rules.defaultTeam && state.secinfo.origin != null){
Seq<ItemStack> dest = state.secinfo.origin.getRecievedItems();
for(ItemStack stack : stacks){
//TODO where do the items go?
//Vars.data.addItem(stack.item, stack.amount);
ItemStack sto = dest.find(i -> i.item == stack.item);
if(sto != null){
sto.amount += stack.amount;
}else{
dest.add(stack);
}
//update export
state.secinfo.handleItemExport(stack);
Events.fire(new LaunchItemEvent(stack));
}
state.secinfo.origin.setRecievedItems(dest);
}
}
}