Awful enemy base generation

This commit is contained in:
Anuken
2020-06-02 22:09:41 -04:00
parent 789cc3cdb9
commit 5e7d9f8119
16 changed files with 528 additions and 176 deletions
@@ -1,5 +1,7 @@
package mindustry.world.blocks.campaign;
import arc.Graphics.*;
import arc.Graphics.Cursor.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
@@ -11,7 +13,7 @@ import mindustry.graphics.*;
import mindustry.ui.*;
import mindustry.world.*;
import static mindustry.Vars.state;
import static mindustry.Vars.*;
public class CoreLauncher extends Block{
public int range = 1;
@@ -38,18 +40,23 @@ public class CoreLauncher extends Block{
if(state.isCampaign() && consValid()){
Vars.ui.planet.show(state.rules.sector, range, this);
cons.trigger();
}
return false;
}
@Override
public Cursor getCursor(){
return consValid() ? SystemCursor.hand : SystemCursor.arrow;
}
public void launch(){
LaunchCorec ent = LaunchCoreEntity.create();
ent.set(this);
ent.block(Blocks.coreShard);
ent.lifetime(Vars.launchDuration);
ent.add();
cons.trigger();
}
}
@@ -116,11 +123,5 @@ public class CoreLauncher extends Block{
Fx.rocketSmokeLarge.at(cx() + Mathf.range(r), cy() + Mathf.range(r), fin());
}
}
@Override
public void remove(){
//TODO something
}
}
}
@@ -124,26 +124,7 @@ public class BlockForge extends PayloadAcceptor{
Draw.rect(outRegion, x, y, rotdeg());
if(recipe != null){
Draw.draw(Layer.blockOver, () -> {
TextureRegion region = recipe.icon(Cicon.full);
Shaders.build.region = region;
Shaders.build.progress = progress / recipe.buildCost;
Shaders.build.color.set(Pal.accent);
Shaders.build.color.a = heat;
Shaders.build.time = -time / 20f;
Draw.shader(Shaders.build);
Draw.rect(region, x, y);
Draw.shader();
Draw.color(Pal.accent);
Draw.alpha(heat);
Lines.lineAngleCenter(x + Mathf.sin(time, 20f, Vars.tilesize / 2f * size - 2f), y, 90, size * Vars.tilesize - 4f);
Draw.reset();
});
Draw.draw(Layer.blockOver, () -> Drawf.construct(this, recipe, 0, progress / recipe.buildCost, heat, time));
}
drawPayload();