BaseShield for testing
|
After Width: | Height: | Size: 751 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 379 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -526,3 +526,4 @@
|
|||||||
63177=yellow-stone-vent|block-yellow-stone-vent-ui
|
63177=yellow-stone-vent|block-yellow-stone-vent-ui
|
||||||
63176=red-stone-vent|block-red-stone-vent-ui
|
63176=red-stone-vent|block-red-stone-vent-ui
|
||||||
63175=carbon-vent|block-carbon-vent-ui
|
63175=carbon-vent|block-carbon-vent-ui
|
||||||
|
63174=shield-projector|block-shield-projector-ui
|
||||||
|
|||||||
@@ -65,8 +65,6 @@ public class Vars implements Loadable{
|
|||||||
public static final String ghApi = "https://api.github.com";
|
public static final String ghApi = "https://api.github.com";
|
||||||
/** URL for discord invite. */
|
/** URL for discord invite. */
|
||||||
public static final String discordURL = "https://discord.gg/mindustry";
|
public static final String discordURL = "https://discord.gg/mindustry";
|
||||||
/** URL for sending crash reports to. Currently offline. */
|
|
||||||
public static final String crashReportURL = "http://192.99.169.18/report";
|
|
||||||
/** URL the links to the wiki's modding guide.*/
|
/** URL the links to the wiki's modding guide.*/
|
||||||
public static final String modGuideURL = "https://mindustrygame.github.io/wiki/modding/1-modding/";
|
public static final String modGuideURL = "https://mindustrygame.github.io/wiki/modding/1-modding/";
|
||||||
/** URL to the JSON file containing all the BE servers. Only queried in BE. */
|
/** URL to the JSON file containing all the BE servers. Only queried in BE. */
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ public class Blocks{
|
|||||||
//defense - erekir
|
//defense - erekir
|
||||||
buildTower,
|
buildTower,
|
||||||
regenProjector, barrierProjector,
|
regenProjector, barrierProjector,
|
||||||
|
//campaign only
|
||||||
|
shieldProjector,
|
||||||
|
|
||||||
//transport
|
//transport
|
||||||
conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router,
|
conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router,
|
||||||
@@ -1713,8 +1715,9 @@ public class Blocks{
|
|||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//TODO implement
|
||||||
|
if(false)
|
||||||
barrierProjector = new DirectionalForceProjector("barrier-projector"){{
|
barrierProjector = new DirectionalForceProjector("barrier-projector"){{
|
||||||
//TODO
|
|
||||||
requirements(Category.effect, with(Items.surgeAlloy, 100, Items.silicon, 125));
|
requirements(Category.effect, with(Items.surgeAlloy, 100, Items.silicon, 125));
|
||||||
size = 3;
|
size = 3;
|
||||||
width = 50f;
|
width = 50f;
|
||||||
@@ -1726,6 +1729,16 @@ public class Blocks{
|
|||||||
consumes.power(4f);
|
consumes.power(4f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//TODO 5x5??
|
||||||
|
shieldProjector = new BaseShield("shield-projector"){{
|
||||||
|
category = Category.effect;
|
||||||
|
buildVisibility = BuildVisibility.editorOnly;
|
||||||
|
|
||||||
|
size = 3;
|
||||||
|
|
||||||
|
consumes.power(5f);
|
||||||
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
//region distribution
|
//region distribution
|
||||||
|
|
||||||
@@ -2231,7 +2244,7 @@ public class Blocks{
|
|||||||
//TODO rename
|
//TODO rename
|
||||||
chemicalCombustionChamber = new ConsumeGenerator("chemical-combustion-chamber"){{
|
chemicalCombustionChamber = new ConsumeGenerator("chemical-combustion-chamber"){{
|
||||||
requirements(Category.power, with(Items.graphite, 40, Items.tungsten, 40, Items.oxide, 40f, Items.silicon, 30));
|
requirements(Category.power, with(Items.graphite, 40, Items.tungsten, 40, Items.oxide, 40f, Items.silicon, 30));
|
||||||
powerProduction = 8f;
|
powerProduction = 9f;
|
||||||
consumes.liquids(LiquidStack.with(Liquids.ozone, 1f / 60f, Liquids.arkycite, 20f / 60f));
|
consumes.liquids(LiquidStack.with(Liquids.ozone, 1f / 60f, Liquids.arkycite, 20f / 60f));
|
||||||
size = 3;
|
size = 3;
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawPistons(){{
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawPistons(){{
|
||||||
@@ -2255,7 +2268,7 @@ public class Blocks{
|
|||||||
pyrolysisGenerator = new ConsumeGenerator("pyrolysis-generator"){{
|
pyrolysisGenerator = new ConsumeGenerator("pyrolysis-generator"){{
|
||||||
//TODO requirements
|
//TODO requirements
|
||||||
requirements(Category.power, with(Items.graphite, 50, Items.carbide, 50, Items.oxide, 60f, Items.silicon, 50));
|
requirements(Category.power, with(Items.graphite, 50, Items.carbide, 50, Items.oxide, 60f, Items.silicon, 50));
|
||||||
powerProduction = 16f;
|
powerProduction = 18f;
|
||||||
|
|
||||||
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawPistons(){{
|
drawer = new DrawMulti(new DrawRegion("-bottom"), new DrawPistons(){{
|
||||||
sinMag = 2.75f;
|
sinMag = 2.75f;
|
||||||
|
|||||||
@@ -1553,6 +1553,15 @@ public class Fx{
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
circleColorSpark = new Effect(21f, e -> {
|
||||||
|
color(Color.white, e.color, e.fin());
|
||||||
|
stroke(e.fout() * 1.1f + 0.5f);
|
||||||
|
|
||||||
|
randLenVectors(e.id, 9, 27f * e.fin(), 9f, (x, y) -> {
|
||||||
|
lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f);
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
|
||||||
colorSpark = new Effect(21f, e -> {
|
colorSpark = new Effect(21f, e -> {
|
||||||
color(Color.white, e.color, e.fin());
|
color(Color.white, e.color, e.fin());
|
||||||
stroke(e.fout() * 1.1f + 0.5f);
|
stroke(e.fout() * 1.1f + 0.5f);
|
||||||
|
|||||||
@@ -3185,54 +3185,51 @@ public class UnitTypes{
|
|||||||
envDisabled = 0;
|
envDisabled = 0;
|
||||||
|
|
||||||
lowAltitude = false;
|
lowAltitude = false;
|
||||||
flying = true;
|
|
||||||
mineWalls = true;
|
mineWalls = true;
|
||||||
targetAir = false;
|
|
||||||
mineFloor = false;
|
mineFloor = false;
|
||||||
mineHardnessScaling = false;
|
mineHardnessScaling = false;
|
||||||
mineSpeed = 5f;
|
flying = true;
|
||||||
|
mineSpeed = 4f;
|
||||||
mineTier = 4;
|
mineTier = 4;
|
||||||
buildSpeed = 1.4f;
|
buildSpeed = 1.1f;
|
||||||
drag = 0.06f;
|
drag = 0.08f;
|
||||||
speed = 2.8f;
|
speed = 6.5f;
|
||||||
rotateSpeed = 5f;
|
rotateSpeed = 8f;
|
||||||
accel = 0.11f;
|
accel = 0.09f;
|
||||||
itemCapacity = 90;
|
itemCapacity = 90;
|
||||||
health = 600f;
|
health = 500f;
|
||||||
armor = 2f;
|
armor = 2f;
|
||||||
hitSize = 18f;
|
hitSize = 11f;
|
||||||
buildBeamOffset = 10f;
|
|
||||||
engineSize = 0;
|
engineOffset = 15 / 4f;
|
||||||
payloadCapacity = Mathf.sqr(2f) * tilePayload;
|
engineSize = 4;
|
||||||
|
|
||||||
setEnginesMirror(
|
setEnginesMirror(
|
||||||
new UnitEngine(34 / 4f, 31 / 4f, 3f, 45f),
|
new UnitEngine(23 / 4f, 4 / 4f, 2.4f, 315f)
|
||||||
new UnitEngine(35 / 4f, -38 / 4f, 3f, 315f)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
weapons.add(new Weapon("incite-weapon"){{
|
weapons.add(new RepairBeamWeapon(){{
|
||||||
reload = 30f;
|
reload = 25f;
|
||||||
x = 4f;
|
x = 0f;
|
||||||
y = 6.25f;
|
y = 6.5f;
|
||||||
shootY = 5.75f;
|
|
||||||
recoil = 2f;
|
|
||||||
top = false;
|
|
||||||
layerOffset = -0.01f;
|
|
||||||
rotate = false;
|
rotate = false;
|
||||||
|
shootY = 0f;
|
||||||
|
beamWidth = 0.7f;
|
||||||
|
repairSpeed = 0.3f;
|
||||||
|
aimDst = 0f;
|
||||||
|
shootCone = 15f;
|
||||||
|
fractionRepair = true;
|
||||||
|
mirror = false;
|
||||||
|
|
||||||
bullet = new BasicBulletType(5f, 15){{
|
targetUnits = false;
|
||||||
width = 7f;
|
targetBuildings = true;
|
||||||
height = 12f;
|
autoTarget = false;
|
||||||
shootEffect = Fx.sparkShoot;
|
controllable = true;
|
||||||
smokeEffect = Fx.shootBigSmoke;
|
laserColor = Pal.accent;
|
||||||
pierceCap = 2;
|
healColor = Pal.accent;
|
||||||
pierce = true;
|
|
||||||
pierceBuilding = true;
|
bullet = new BulletType(){{
|
||||||
hitColor = backColor = trailColor = Pal.bulletYellowBack;
|
maxRange = 60f;
|
||||||
frontColor = Color.white;
|
|
||||||
trailWidth = 1.5f;
|
|
||||||
trailLength = 7;
|
|
||||||
hitEffect = despawnEffect = Fx.hitBulletColor;
|
|
||||||
}};
|
}};
|
||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -30,7 +30,10 @@ public class BaseGenerator{
|
|||||||
private Seq<Tile> cores;
|
private Seq<Tile> cores;
|
||||||
|
|
||||||
public static Block getDifficultyWall(int size, float difficulty){
|
public static Block getDifficultyWall(int size, float difficulty){
|
||||||
Seq<Block> wallsSmall = content.blocks().select(b -> b instanceof Wall && b.size == size && !b.insulated && b.buildVisibility == BuildVisibility.shown && !(b instanceof Door));
|
Seq<Block> wallsSmall = content.blocks().select(b -> b instanceof Wall && b.size == size
|
||||||
|
&& !b.insulated && b.buildVisibility == BuildVisibility.shown
|
||||||
|
&& !(b instanceof Door)
|
||||||
|
&& !(Structs.contains(b.requirements, i -> state.rules.hiddenBuildItems.contains(i.item))));
|
||||||
wallsSmall.sort(b -> b.buildCost);
|
wallsSmall.sort(b -> b.buildCost);
|
||||||
return wallsSmall.getFrac(difficulty * 0.91f);
|
return wallsSmall.getFrac(difficulty * 0.91f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import arc.graphics.*;
|
|||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
@@ -15,7 +15,7 @@ import static mindustry.Vars.*;
|
|||||||
|
|
||||||
public class BaseShield extends Block{
|
public class BaseShield extends Block{
|
||||||
//TODO game rule? or field? should vary by base.
|
//TODO game rule? or field? should vary by base.
|
||||||
//public float radius = 400f;
|
public float radius = 200f;
|
||||||
|
|
||||||
protected static BaseShieldBuild paramBuild;
|
protected static BaseShieldBuild paramBuild;
|
||||||
//protected static Effect paramEffect;
|
//protected static Effect paramEffect;
|
||||||
@@ -35,20 +35,41 @@ public class BaseShield extends Block{
|
|||||||
float overlapDst = (unit.hitSize/2f + paramBuild.radius()) - unit.dst(paramBuild);
|
float overlapDst = (unit.hitSize/2f + paramBuild.radius()) - unit.dst(paramBuild);
|
||||||
|
|
||||||
if(overlapDst > 0){
|
if(overlapDst > 0){
|
||||||
if(overlapDst > unit.hitSize){
|
if(overlapDst > unit.hitSize * 1.5f){
|
||||||
//instakill units that are stuck inside the shield (TODO or maybe damage them instead?)
|
//instakill units that are stuck inside the shield (TODO or maybe damage them instead?)
|
||||||
unit.kill();
|
unit.kill();
|
||||||
}else{
|
}else{
|
||||||
unit.move(Tmp.v1.set(unit).sub(paramBuild).setLength(overlapDst));
|
//stop
|
||||||
|
unit.vel.setZero();
|
||||||
|
//get out
|
||||||
|
unit.move(Tmp.v1.set(unit).sub(paramBuild).setLength(overlapDst + 0.01f));
|
||||||
|
|
||||||
|
if(Mathf.chanceDelta(0.12f * Time.delta)){
|
||||||
|
Fx.circleColorSpark.at(unit.x, unit.y, paramBuild.team.color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
public BaseShield(String name){
|
public BaseShield(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
update = solid = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(){
|
||||||
|
super.init();
|
||||||
|
|
||||||
|
clipSize = Math.max(clipSize, radius * 2f + 8f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
|
super.drawPlace(x, y, rotation, valid);
|
||||||
|
|
||||||
|
Drawf.dashCircle(x * tilesize + offset, y * tilesize + offset, radius, player.team().color);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BaseShieldBuild extends Building{
|
public class BaseShieldBuild extends Building{
|
||||||
@@ -60,17 +81,26 @@ public class BaseShield extends Block{
|
|||||||
//TODO smooth radius
|
//TODO smooth radius
|
||||||
float radius = radius();
|
float radius = radius();
|
||||||
|
|
||||||
|
broken = efficiency() <= 0.0001f;
|
||||||
|
|
||||||
if(radius > 0 && !broken){
|
if(radius > 0 && !broken){
|
||||||
paramBuild = this;
|
paramBuild = this;
|
||||||
//paramEffect = absorbEffect;
|
//paramEffect = absorbEffect;
|
||||||
Groups.bullet.intersect(x - radius, y - radius, radius * 2f, radius * 2f, bulletConsumer);
|
Groups.bullet.intersect(x - radius, y - radius, radius * 2f, radius * 2f, bulletConsumer);
|
||||||
Units.nearbyEnemies(team,x ,y, radius, unitConsumer);
|
Units.nearbyEnemies(team, x, y, radius + 10f, unitConsumer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float radius(){
|
public float radius(){
|
||||||
//TODO bad rule?
|
//TODO bad rule?
|
||||||
return Vars.state.rules.enemyCoreBuildRadius;
|
return radius * efficiency();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawSelect(){
|
||||||
|
super.drawSelect();
|
||||||
|
|
||||||
|
Drawf.dashCircle(x, y, radius, team.color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -446,7 +446,6 @@ public class UnitAssembler extends PayloadBlock{
|
|||||||
|
|
||||||
public boolean checkSolid(Vec2 v, boolean same){
|
public boolean checkSolid(Vec2 v, boolean same){
|
||||||
var output = unit();
|
var output = unit();
|
||||||
//TODO CHECK TO MAKE SURE IT'S NOT THE SAME UNIT
|
|
||||||
float hsize = output.hitSize * 1.4f;
|
float hsize = output.hitSize * 1.4f;
|
||||||
return !output.flying && (collisions.overlapsTile(Tmp.r1.setCentered(v.x, v.y, output.hitSize), EntityCollisions::solid) ||
|
return !output.flying && (collisions.overlapsTile(Tmp.r1.setCentered(v.x, v.y, output.hitSize), EntityCollisions::solid) ||
|
||||||
(!same ? Units.anyEntities(v.x, v.y, hsize) : Units.anyEntities(v.x - hsize/2f, v.y - hsize/2f, hsize, hsize, u -> u.type != output && u.isGrounded())));
|
(!same ? Units.anyEntities(v.x, v.y, hsize) : Units.anyEntities(v.x - hsize/2f, v.y - hsize/2f, hsize, hsize, u -> u.type != output && u.isGrounded())));
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ android.useAndroidX=true
|
|||||||
#used for slow jitpack builds; TODO see if this actually works
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
archash=31e09b436b
|
archash=3ad7f0345b
|
||||||
|
|||||||