Skip to content

Commit

Permalink
202402152233
Browse files Browse the repository at this point in the history
  • Loading branch information
PiggyChu620 committed Feb 15, 2024
1 parent b77d756 commit df53b28
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 2 deletions.
Binary file added assets/sprites/blocks/launch-pad-controller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/ec620/content/EC620Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class EC620Blocks {
//Craftings

//Sandbox
public static Block sourceIn,sourceOut;
public static Block sourceIn,sourceOut,launchPadController;

public static void load()
{
Expand Down Expand Up @@ -129,6 +129,7 @@ public static void load()
// //endregion
//
// //region Factories
launchPadController=new EC620Classes.LauchPadController("launch-pad-controller");
// duraluminFactory = new GenericCrafter("duralumin-factory"){{
// requirements(Category.crafting, with(Items.copper, 5, EC620Items.aluminum,95));
// craftEffect = Fx.smeltsmoke;
Expand Down
78 changes: 78 additions & 0 deletions src/ec620/content/EC620Classes.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,45 @@
package ec620.content;

import arc.Core;
import arc.Graphics;
import arc.graphics.g2d.Draw;
import arc.math.Mathf;
import arc.math.geom.Geometry;
import arc.math.geom.Vec2;
import arc.scene.ui.layout.Table;
import arc.struct.EnumSet;
import arc.struct.ObjectMap;
import arc.struct.Seq;
import arc.struct.StringMap;
import arc.util.Log;
import arc.util.io.Reads;
import arc.util.io.Writes;
import mindustry.Vars;
import mindustry.content.Blocks;
import mindustry.content.Fx;
import mindustry.content.Items;
import mindustry.entities.Effect;
import mindustry.game.Schematic;
import mindustry.gen.Building;
import mindustry.gen.Icon;
import mindustry.gen.LaunchPayload;
import mindustry.graphics.Pal;
import mindustry.logic.LAccess;
import mindustry.type.Category;
import mindustry.type.Item;
import mindustry.type.ItemStack;
import mindustry.type.Sector;
import mindustry.ui.Styles;
import mindustry.world.Block;
import mindustry.world.blocks.campaign.LaunchPad;
import mindustry.world.blocks.defense.turrets.Turret;
import mindustry.world.blocks.storage.CoreBlock;
import mindustry.world.meta.BlockFlag;

import java.util.ArrayList;

import static mindustry.type.ItemStack.with;

public class EC620Classes
{
public static class LakeHandler
Expand Down Expand Up @@ -115,4 +141,56 @@ public double DistanceFrom(DVec v)
return Math.sqrt(Math.pow(x-v.x,2)+Math.pow(y-v.y,2));
}
}

public static class LauchPadController extends Block
{
public LauchPadController(String name)
{
super(name);
size=7;
localizedName="Launch Pad Controller";
requirements(Category.crafting, with(Items.copper, 100));
solid = true;
configurable = true;
flags = EnumSet.of(new BlockFlag[]{BlockFlag.launchPad});
}
public class LaunchPadControllerBuild extends Building
{
public float launchCounter;

public LaunchPadControllerBuild()
{

}

public Graphics.Cursor getCursor() {
return (Graphics.Cursor)(Vars.state.isCampaign() && !Vars.net.client() ? super.getCursor() : Graphics.Cursor.SystemCursor.arrow);
}

public void buildConfiguration(Table table)
{
if (Vars.state.isCampaign() && !Vars.net.client())
{
table.button(Icon.upOpen, Styles.cleari, () ->
{
Vars.ui.planet.showSelect(Vars.state.rules.sector, (other) ->
{
if (Vars.state.isCampaign() && other.planet == Vars.state.rules.sector.planet)
{
EC620Planets.ec620.sectors.select(s->s.info.wasCaptured).forEach(s->s.info.destination=other);
//Vars.state.rules.sector.info.destination = other;
}

});
this.deselect();
}).size(40.0F);
}
else
{
this.deselect();
}
}

}
}
}
7 changes: 6 additions & 1 deletion src/ec620/content/EC620TechTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,11 @@ public static void load()
//}
root.planet= EC620Planets.ec620;
root.children.each(c -> c.planet =EC620Planets.ec620);

mergeNode(launchPad,()->
{
node(EC620Blocks.launchPadController);
});
/*mergeNode(Liquids.water, () -> {
node(Liquids.ozone,()->{
node(Liquids.hydrogen);
Expand Down Expand Up @@ -1801,7 +1806,7 @@ private static void mergeNode(UnlockableContent parent, Runnable children)
for(TechNode tn : all.select(t -> t.content == parent))
{
context=tn;
Log.info(context.content.name+" found");
//Log.info(context.content.name+" found");
//Log.info(context().content.name);
children.run();
}
Expand Down

0 comments on commit df53b28

Please sign in to comment.