Better pad animations / Balancing
BIN
core/assets-raw/sprites/blocks/storage/launch-pad-light.png
Normal file
After Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 723 B |
Before Width: | Height: | Size: 711 KiB After Width: | Height: | Size: 723 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 837 KiB After Width: | Height: | Size: 837 KiB |
@ -1320,18 +1320,18 @@ public class Blocks implements ContentList{
|
||||
requirements(Category.effect, BuildVisibility.campaignOnly, ItemStack.with(Items.copper, 250, Items.silicon, 75, Items.lead, 100));
|
||||
size = 3;
|
||||
itemCapacity = 100;
|
||||
launchTime = 60f * 16;
|
||||
launchTime = 60f * 15;
|
||||
hasPower = true;
|
||||
consumes.power(1f);
|
||||
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 = 250;
|
||||
launchTime = 60f * 14;
|
||||
itemCapacity = 300;
|
||||
launchTime = 60f * 25;
|
||||
hasPower = true;
|
||||
consumes.power(2f);
|
||||
consumes.power(6f);
|
||||
}};
|
||||
|
||||
|
||||
|
@ -56,6 +56,7 @@ public class Pal{
|
||||
accent = Color.valueOf("ffd37f"),
|
||||
stat = Color.valueOf("ffd37f"),
|
||||
gray = Color.valueOf("454545"),
|
||||
metalGrayDark = Color.valueOf("6e7080"),
|
||||
accentBack = Color.valueOf("d4816b"),
|
||||
place = Color.valueOf("6335f8"),
|
||||
remove = Color.valueOf("e55454"),
|
||||
|
@ -1,8 +1,10 @@
|
||||
package mindustry.world.blocks.storage;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
@ -21,6 +23,10 @@ public class LaunchPad extends Block{
|
||||
/** Time inbetween launches. */
|
||||
public float launchTime;
|
||||
|
||||
public @Load("@-light") TextureRegion lightRegion;
|
||||
public @Load("launchpod") TextureRegion podRegion;
|
||||
public Color lightColor = Color.valueOf("eab678");
|
||||
|
||||
public LaunchPad(String name){
|
||||
super(name);
|
||||
hasItems = true;
|
||||
@ -47,7 +53,32 @@ public class LaunchPad extends Block{
|
||||
public void draw(){
|
||||
super.draw();
|
||||
|
||||
Draw.rect("launchpod", x, y);
|
||||
if(lightRegion.found()){
|
||||
Draw.color(lightColor);
|
||||
float progress = Math.min((float)items.total() / itemCapacity, timer.getTime(timerLaunch) / launchTime);
|
||||
int steps = 3;
|
||||
float step = 1f;
|
||||
|
||||
for(int i = 0; i < 4; i++){
|
||||
for(int j = 0; j < steps; j++){
|
||||
float alpha = Mathf.curve(progress, (float)j / steps, (j+1f) / steps);
|
||||
float offset = -(j - 1f) * step;
|
||||
|
||||
Draw.color(Pal.metalGrayDark, lightColor, alpha);
|
||||
Draw.rect(lightRegion, x + Geometry.d8edge(i).x * offset, y + Geometry.d8edge(i).y * offset, i * 90);
|
||||
}
|
||||
}
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
float cooldown = Mathf.clamp(timer.getTime(timerLaunch) / launchTime);
|
||||
|
||||
Draw.mixcol(lightColor, 1f - cooldown);
|
||||
|
||||
Draw.rect(podRegion, x, y);
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -58,8 +89,8 @@ public class LaunchPad extends Block{
|
||||
@Override
|
||||
public void updateTile(){
|
||||
|
||||
//launch when full
|
||||
if(items.total() >= itemCapacity){
|
||||
//launch when full and base conditions are met
|
||||
if(items.total() >= itemCapacity && efficiency() >= 1f && timer(timerLaunch, launchTime)){
|
||||
LaunchPayloadc entity = LaunchPayloadEntity.create();
|
||||
items.each((item, amount) -> entity.stacks().add(new ItemStack(item, amount)));
|
||||
entity.set(this);
|
||||
|
@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=23565d2b458dbdccd676a9094538bc784e076cca
|
||||
archash=c496b5b876547c615031fc28f28c013281940826
|
||||
|
@ -32,6 +32,7 @@ def transformColors = { List<List<String>> list ->
|
||||
}
|
||||
|
||||
|
||||
//d4816b
|
||||
transformColors([["6e7080", "989aa4", "b0bac0"], ["bc5452", "ea8878", "feb380"], ["de9458", "f8c266", "ffe18f"], ["feb380", "ea8878", "bc5452"]])
|
||||
|
||||
def antialias = { File file ->
|
||||
|