Merge branch '6.0' into crater

# Conflicts:
#	core/assets/icons/icons.properties
#	core/assets/sprites/block_colors.png
#	core/assets/sprites/sprites.atlas
#	core/assets/sprites/sprites.png
#	core/assets/sprites/sprites3.png
#	core/assets/sprites/sprites5.png
#	core/src/mindustry/content/Blocks.java
#	core/src/mindustry/ui/fragments/PlayerListFragment.java
#	core/src/mindustry/world/BlockStorage.java
This commit is contained in:
Patrick 'Quezler' Mounier
2020-04-16 12:39:52 +02:00
610 changed files with 27167 additions and 25697 deletions

View File

@@ -1,7 +1,6 @@
package mindustry.content;
import arc.*;
import arc.struct.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
@@ -10,7 +9,6 @@ import mindustry.*;
import mindustry.ctype.*;
import mindustry.entities.*;
import mindustry.entities.bullet.*;
import mindustry.entities.type.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
@@ -19,6 +17,8 @@ import mindustry.world.blocks.*;
import mindustry.world.blocks.defense.*;
import mindustry.world.blocks.defense.turrets.*;
import mindustry.world.blocks.distribution.*;
import mindustry.world.blocks.environment.*;
import mindustry.world.blocks.legacy.*;
import mindustry.world.blocks.liquid.*;
import mindustry.world.blocks.logic.*;
import mindustry.world.blocks.power.*;
@@ -28,13 +28,12 @@ import mindustry.world.blocks.storage.*;
import mindustry.world.blocks.units.*;
import mindustry.world.consumers.*;
import mindustry.world.meta.*;
import mindustry.world.modules.*;
public class Blocks implements ContentList{
public static Block
//environment
air, spawn, deepwater, water, taintedWater, tar, stone, craters, charr, sand, darksand, ice, snow, darksandTaintedWater,
air, spawn, cliff, deepwater, water, taintedWater, tar, slag, stone, craters, charr, sand, darksand, ice, snow, darksandTaintedWater,
holostone, rocks, sporerocks, icerocks, cliffs, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster,
iceSnow, sandWater, darksandWater, duneRocks, sandRocks, moss, sporeMoss, shale, shaleRocks, shaleBoulder, sandBoulder, grass, salt,
metalFloor, metalFloorDamaged, metalFloor2, metalFloor3, metalFloor5, ignarock, magmarock, hotrock, snowrocks, rock, snowrock, saltRocks,
@@ -57,7 +56,8 @@ public class Blocks implements ContentList{
scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster, //ok, these names are getting ridiculous, but at least I don't have humongous walls yet
//transport
conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router, overflowGate, underflowGate, massDriver,
conveyor, titaniumConveyor, plastaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router,
overflowGate, underflowGate, massDriver, massConveyor,
//liquid
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, platedConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
@@ -76,11 +76,9 @@ public class Blocks implements ContentList{
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown,
//units
commandCenter, draugFactory, spiritFactory, phantomFactory, wraithFactory, ghoulFactory, revenantFactory, daggerFactory, crawlerFactory, titanFactory,
fortressFactory, repairPoint,
groundFactory, repairPoint
//upgrades
dartPad, deltaPad, tauPad, omegaPad, javelinPad, tridentPad, glaivePad;
;
@Override
public void load(){
@@ -92,7 +90,7 @@ public class Blocks implements ContentList{
hasShadow = false;
}
public void draw(Tile tile){}
public void drawBase(Tile tile){}
public void load(){}
public void init(){}
public boolean isHidden(){
@@ -107,23 +105,16 @@ public class Blocks implements ContentList{
}
};
//create special blockpart variants
for(int dx = 0; dx < BlockPart.maxSize; dx++){
for(int dy = 0; dy < BlockPart.maxSize; dy++){
int fx = dx - BlockPart.maxSize/2, fy = dy - BlockPart.maxSize/2;
if(fx != 0 || fy != 0){
new BlockPart(fx, fy);
}
}
}
spawn = new OverlayFloor("spawn"){
{
variants = 0;
}
public void draw(Tile tile){}
@Override
public void drawBase(Tile tile){}
};
cliff = new Cliff("cliff");
//Registers build blocks
//no reference is needed here since they can be looked up by name later
for(int i = 1; i <= BuildBlock.maxSize; i++){
@@ -139,6 +130,7 @@ public class Blocks implements ContentList{
statusDuration = 120f;
drownTime = 140f;
cacheLayer = CacheLayer.water;
albedo = 0.5f;
}};
water = new Floor("water"){{
@@ -149,6 +141,7 @@ public class Blocks implements ContentList{
liquidDrop = Liquids.water;
isLiquid = true;
cacheLayer = CacheLayer.water;
albedo = 0.5f;
}};
taintedWater = new Floor("tainted-water"){{
@@ -160,36 +153,25 @@ public class Blocks implements ContentList{
liquidDrop = Liquids.water;
isLiquid = true;
cacheLayer = CacheLayer.water;
albedo = 0.5f;
}};
darksandTaintedWater = new Floor("darksand-tainted-water"){{
darksandTaintedWater = new ShallowLiquid("darksand-tainted-water"){{
speedMultiplier = 0.75f;
variants = 0;
status = StatusEffects.wet;
statusDuration = 60f;
liquidDrop = Liquids.water;
isLiquid = true;
cacheLayer = CacheLayer.water;
albedo = 0.5f;
}};
sandWater = new Floor("sand-water"){{
sandWater = new ShallowLiquid("sand-water"){{
speedMultiplier = 0.8f;
variants = 0;
status = StatusEffects.wet;
statusDuration = 50f;
liquidDrop = Liquids.water;
isLiquid = true;
cacheLayer = CacheLayer.water;
albedo = 0.5f;
}};
darksandWater = new Floor("darksand-water"){{
darksandWater = new ShallowLiquid("darksand-water"){{
speedMultiplier = 0.8f;
variants = 0;
status = StatusEffects.wet;
statusDuration = 50f;
liquidDrop = Liquids.water;
isLiquid = true;
cacheLayer = CacheLayer.water;
albedo = 0.5f;
}};
tar = new Floor("tar"){{
@@ -203,6 +185,17 @@ public class Blocks implements ContentList{
cacheLayer = CacheLayer.tar;
}};
slag = new Floor("slag"){{
drownTime = 150f;
status = StatusEffects.melting;
statusDuration = 240f;
speedMultiplier = 0.19f;
variants = 0;
liquidDrop = Liquids.slag;
isLiquid = true;
cacheLayer = CacheLayer.slag;
}};
stone = new Floor("stone"){{
}};
@@ -217,16 +210,18 @@ public class Blocks implements ContentList{
}};
ignarock = new Floor("ignarock"){{
attributes.set(Attribute.water, -0.1f);
}};
hotrock = new Floor("hotrock"){{
attributes.set(Attribute.heat, 0.5f);
attributes.set(Attribute.water, -0.2f);
blendGroup = ignarock;
}};
magmarock = new Floor("magmarock"){{
attributes.set(Attribute.heat, 0.75f);
attributes.set(Attribute.water, -0.5f);
updateEffect = Fx.magmasmoke;
blendGroup = ignarock;
}};
@@ -241,6 +236,10 @@ public class Blocks implements ContentList{
playerUnmineable = true;
}};
((ShallowLiquid)darksandTaintedWater).set(Blocks.taintedWater, Blocks.darksand);
((ShallowLiquid)sandWater).set(Blocks.water, Blocks.sand);
((ShallowLiquid)darksandWater).set(Blocks.water, Blocks.darksand);
holostone = new Floor("holostone"){{
}};
@@ -251,6 +250,7 @@ public class Blocks implements ContentList{
salt = new Floor("salt"){{
variants = 0;
attributes.set(Attribute.water, -0.2f);
}};
snow = new Floor("snow"){{
@@ -258,13 +258,13 @@ public class Blocks implements ContentList{
}};
ice = new Floor("ice"){{
//TODO fix drag/speed
dragMultiplier = 1f;
speedMultiplier = 1f;
dragMultiplier = 0.35f;
speedMultiplier = 0.9f;
attributes.set(Attribute.water, 0.4f);
}};
iceSnow = new Floor("ice-snow"){{
dragMultiplier = 0.6f;
variants = 3;
attributes.set(Attribute.water, 0.3f);
}};
@@ -292,6 +292,7 @@ public class Blocks implements ContentList{
icerocks = new StaticWall("icerocks"){{
variants = 2;
iceSnow.asFloor().wall = this;
}};
snowrocks = new StaticWall("snowrocks"){{
@@ -355,11 +356,13 @@ public class Blocks implements ContentList{
moss = new Floor("moss"){{
variants = 3;
attributes.set(Attribute.spores, 0.15f);
wall = sporePine;
}};
sporeMoss = new Floor("spore-moss"){{
variants = 3;
attributes.set(Attribute.spores, 0.3f);
wall = sporerocks;
}};
metalFloor = new Floor("metal-floor"){{
@@ -506,13 +509,10 @@ public class Blocks implements ContentList{
int topRegion = reg("-top");
drawer = tile -> {
Draw.rect(region, tile.drawx(), tile.drawy());
GenericCrafterEntity entity = tile.ent();
drawer = entity -> {
Draw.rect(region, entity.x(), entity.y());
Draw.alpha(Mathf.absin(entity.totalProgress, 3f, 0.9f) * entity.warmup);
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy());
Draw.rect(reg(topRegion), entity.x(), entity.y());
Draw.reset();
};
}};
@@ -533,24 +533,22 @@ public class Blocks implements ContentList{
drawIcons = () -> new TextureRegion[]{Core.atlas.find(name + "-bottom"), Core.atlas.find(name), Core.atlas.find(name + "-weave")};
drawer = tile -> {
GenericCrafterEntity entity = tile.ent();
Draw.rect(reg(bottomRegion), tile.drawx(), tile.drawy());
Draw.rect(reg(weaveRegion), tile.drawx(), tile.drawy(), entity.totalProgress);
drawer = entity -> {
Draw.rect(reg(bottomRegion), entity.x(), entity.y());
Draw.rect(reg(weaveRegion), entity.x(), entity.y(), entity.totalProgress);
Draw.color(Pal.accent);
Draw.alpha(entity.warmup);
Lines.lineAngleCenter(
tile.drawx() + Mathf.sin(entity.totalProgress, 6f, Vars.tilesize / 3f * size),
tile.drawy(),
entity.x() + Mathf.sin(entity.totalProgress, 6f, Vars.tilesize / 3f * size),
entity.y(),
90,
size * Vars.tilesize / 2f);
Draw.reset();
Draw.rect(region, tile.drawx(), tile.drawy());
Draw.rect(region, entity.x(), entity.y());
};
}};
@@ -586,21 +584,19 @@ public class Blocks implements ContentList{
drawIcons = () -> new TextureRegion[]{Core.atlas.find(name + "-bottom"), Core.atlas.find(name + "-top")};
drawer = tile -> {
LiquidModule mod = tile.entity.liquids;
drawer = entity -> {
int rotation = rotate ? entity.rotation() * 90 : 0;
int rotation = rotate ? tile.rotation() * 90 : 0;
Draw.rect(reg(bottomRegion), entity.x(), entity.y(), rotation);
Draw.rect(reg(bottomRegion), tile.drawx(), tile.drawy(), rotation);
if(mod.total() > 0.001f){
if(entity.liquids().total() > 0.001f){
Draw.color(outputLiquid.liquid.color);
Draw.alpha(mod.get(outputLiquid.liquid) / liquidCapacity);
Draw.rect(reg(liquidRegion), tile.drawx(), tile.drawy(), rotation);
Draw.alpha(entity.liquids().get(outputLiquid.liquid) / liquidCapacity);
Draw.rect(reg(liquidRegion), entity.x(), entity.y(), rotation);
Draw.color();
}
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy(), rotation);
Draw.rect(reg(topRegion), entity.x(), entity.y(), rotation);
};
}};
@@ -678,15 +674,13 @@ public class Blocks implements ContentList{
int topRegion = reg("-top");
drawIcons = () -> new TextureRegion[]{Core.atlas.find(name), Core.atlas.find(name + "-top")};
drawer = tile -> {
GenericCrafterEntity entity = tile.ent();
Draw.rect(region, tile.drawx(), tile.drawy());
Draw.rect(reg(frameRegions[(int)Mathf.absin(entity.totalProgress, 5f, 2.999f)]), tile.drawx(), tile.drawy());
Draw.color(Color.clear, tile.entity.liquids.current().color, tile.entity.liquids.total() / liquidCapacity);
Draw.rect(reg(liquidRegion), tile.drawx(), tile.drawy());
drawer = entity -> {
Draw.rect(region, entity.x(), entity.y());
Draw.rect(reg(frameRegions[(int)Mathf.absin(entity.totalProgress, 5f, 2.999f)]), entity.x(), entity.y());
Draw.color(Color.clear, entity.liquids().current().color, entity.liquids().total() / liquidCapacity);
Draw.rect(reg(liquidRegion), entity.x(), entity.y());
Draw.color();
Draw.rect(reg(topRegion), tile.drawx(), tile.drawy());
Draw.rect(reg(topRegion), entity.x(), entity.y());
};
}};
@@ -705,11 +699,9 @@ public class Blocks implements ContentList{
drawIcons = () -> new TextureRegion[]{Core.atlas.find(name), Core.atlas.find(name + "-rotator")};
drawer = tile -> {
GenericCrafterEntity entity = tile.ent();
Draw.rect(region, tile.drawx(), tile.drawy());
Draw.rect(reg(rotatorRegion), tile.drawx(), tile.drawy(), entity.totalProgress * 2f);
drawer = entity -> {
Draw.rect(region, entity.x(), entity.y());
Draw.rect(reg(rotatorRegion), entity.x(), entity.y(), entity.totalProgress * 2f);
};
}};
@@ -990,6 +982,10 @@ public class Blocks implements ContentList{
consumes.power(1.75f);
}};
massConveyor = new MassConveyor("mass-conveyor"){{
requirements(Category.distribution, ItemStack.with(Items.copper, 1));
}};
//endregion
//region liquid
@@ -1040,7 +1036,7 @@ public class Blocks implements ContentList{
liquidCapacity = 20f;
}};
liquidTank = new LiquidTank("liquid-tank"){{
liquidTank = new LiquidRouter("liquid-tank"){{
requirements(Category.liquid, ItemStack.with(Items.titanium, 25, Items.metaglass, 25));
size = 3;
liquidCapacity = 1500f;
@@ -1297,13 +1293,13 @@ public class Blocks implements ContentList{
size = 5;
}};
vault = new Vault("vault"){{
vault = new StorageBlock("vault"){{
requirements(Category.effect, ItemStack.with(Items.titanium, 250, Items.thorium, 125));
size = 3;
itemCapacity = 1000;
}};
container = new Vault("container"){{
container = new StorageBlock("container"){{
requirements(Category.effect, ItemStack.with(Items.titanium, 100));
size = 2;
itemCapacity = 300;
@@ -1336,7 +1332,7 @@ public class Blocks implements ContentList{
//endregion
//region turrets
duo = new DoubleTurret("duo"){{
duo = new ItemTurret("duo"){{
requirements(Category.turret, ItemStack.with(Items.copper, 35), true);
ammo(
Items.copper, Bullets.standardCopper,
@@ -1344,7 +1340,11 @@ public class Blocks implements ContentList{
Items.pyratite, Bullets.standardIncendiary,
Items.silicon, Bullets.standardHoming
);
reload = 20f;
spread = 4f;
shots = 2;
alternate = true;
reloadTime = 20f;
restitution = 0.03f;
range = 100;
shootCone = 15f;
@@ -1361,14 +1361,14 @@ public class Blocks implements ContentList{
Items.lead, Bullets.flakLead,
Items.metaglass, Bullets.flakGlass
);
reload = 18f;
reloadTime = 18f;
range = 170f;
size = 2;
burstSpacing = 5f;
shots = 2;
targetGround = false;
recoil = 2f;
recoilAmount = 2f;
rotatespeed = 15f;
inaccuracy = 17f;
shootCone = 35f;
@@ -1383,8 +1383,8 @@ public class Blocks implements ContentList{
Items.coal, Bullets.basicFlame,
Items.pyratite, Bullets.pyraFlame
);
recoil = 0f;
reload = 5f;
recoilAmount = 0f;
reloadTime = 5f;
coolantMultiplier = 2f;
range = 60f;
shootCone = 50f;
@@ -1401,8 +1401,8 @@ public class Blocks implements ContentList{
Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artilleryIncendiary
);
reload = 60f;
recoil = 2f;
reloadTime = 60f;
recoilAmount = 2f;
range = 230f;
inaccuracy = 1f;
shootCone = 10f;
@@ -1419,8 +1419,8 @@ public class Blocks implements ContentList{
Liquids.oil, Bullets.oilShot
);
size = 2;
recoil = 0f;
reload = 2f;
recoilAmount = 0f;
reloadTime = 2f;
inaccuracy = 5f;
shootCone = 50f;
shootEffect = Fx.shootLiquid;
@@ -1436,8 +1436,8 @@ public class Blocks implements ContentList{
chargeMaxDelay = 30f;
chargeEffects = 7;
shootType = Bullets.lancerLaser;
recoil = 2f;
reload = 90f;
recoilAmount = 2f;
reloadTime = 90f;
cooldown = 0.03f;
powerUse = 2.5f;
shootShake = 2f;
@@ -1455,7 +1455,7 @@ public class Blocks implements ContentList{
arc = new PowerTurret("arc"){{
requirements(Category.turret, ItemStack.with(Items.copper, 35, Items.lead, 50));
shootType = Bullets.arc;
reload = 35f;
reloadTime = 35f;
shootCone = 40f;
rotatespeed = 8f;
powerUse = 1.5f;
@@ -1463,7 +1463,7 @@ public class Blocks implements ContentList{
range = 90f;
shootEffect = Fx.lightningShoot;
heatColor = Color.red;
recoil = 1f;
recoilAmount = 1f;
size = 1;
health = 260;
shootSound = Sounds.spark;
@@ -1476,7 +1476,7 @@ public class Blocks implements ContentList{
Items.pyratite, Bullets.missileIncendiary,
Items.surgealloy, Bullets.missileSurge
);
reload = 40f;
reloadTime = 40f;
shots = 4;
burstSpacing = 5;
inaccuracy = 10f;
@@ -1499,11 +1499,11 @@ public class Blocks implements ContentList{
size = 2;
range = 150f;
reload = 38f;
reloadTime = 38f;
restitution = 0.03f;
ammoEjectBack = 3f;
cooldown = 0.03f;
recoil = 3f;
recoilAmount = 3f;
shootShake = 2f;
burstSpacing = 3f;
shots = 4;
@@ -1515,10 +1515,10 @@ public class Blocks implements ContentList{
fuse = new ItemTurret("fuse"){{
requirements(Category.turret, ItemStack.with(Items.copper, 225, Items.graphite, 225, Items.thorium, 100));
reload = 35f;
reloadTime = 35f;
shootShake = 4f;
range = 90f;
recoil = 5f;
recoilAmount = 5f;
shots = 3;
spread = 20f;
restitution = 0.1f;
@@ -1541,25 +1541,25 @@ public class Blocks implements ContentList{
}
@Override
public void init(mindustry.entities.type.Bullet b){
public void init(Bulletc b){
for(int i = 0; i < rays; i++){
Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), rayLength - Math.abs(i - (rays / 2)) * 20f);
Damage.collideLine(b, b.team(), hitEffect, b.x(), b.y(), b.rotation(), rayLength - Math.abs(i - (rays / 2)) * 20f);
}
}
@Override
public void draw(Bullet b){
public void draw(Bulletc b){
super.draw(b);
Draw.color(Color.white, Pal.lancerLaser, b.fin());
//Draw.alpha(b.fout());
for(int i = 0; i < 7; i++){
Tmp.v1.trns(b.rot(), i * 8f);
Tmp.v1.trns(b.rotation(), i * 8f);
float sl = Mathf.clamp(b.fout() - 0.5f) * (80f - i * 10);
Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() + 90);
Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() - 90);
Drawf.tri(b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 4f, sl, b.rotation() + 90);
Drawf.tri(b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 4f, sl, b.rotation() - 90);
}
Drawf.tri(b.x, b.y, 20f * b.fout(), (rayLength + 50), b.rot());
Drawf.tri(b.x, b.y, 20f * b.fout(), 10f, b.rot() + 180f);
Drawf.tri(b.x(), b.y(), 20f * b.fout(), (rayLength + 50), b.rotation());
Drawf.tri(b.x(), b.y(), 20f * b.fout(), 10f, b.rotation() + 180f);
Draw.reset();
}
});
@@ -1577,13 +1577,13 @@ public class Blocks implements ContentList{
size = 3;
shots = 4;
inaccuracy = 12f;
reload = 60f;
reloadTime = 60f;
ammoEjectBack = 5f;
ammoUseEffect = Fx.shellEjectBig;
cooldown = 0.03f;
velocityInaccuracy = 0.2f;
restitution = 0.02f;
recoil = 6f;
recoilAmount = 6f;
shootShake = 2f;
range = 290f;
@@ -1600,10 +1600,10 @@ public class Blocks implements ContentList{
Items.surgealloy, Bullets.flakSurge
);
xRand = 4f;
reload = 6f;
reloadTime = 6f;
range = 200f;
size = 3;
recoil = 3f;
recoilAmount = 3f;
rotatespeed = 10f;
inaccuracy = 10f;
shootCone = 30f;
@@ -1612,22 +1612,22 @@ public class Blocks implements ContentList{
health = 145 * size * size;
}};
spectre = new DoubleTurret("spectre"){{
spectre = new ItemTurret("spectre"){{
requirements(Category.turret, ItemStack.with(Items.copper, 350, Items.graphite, 300, Items.surgealloy, 250, Items.plastanium, 175, Items.thorium, 250));
ammo(
Items.graphite, Bullets.standardDenseBig,
Items.pyratite, Bullets.standardIncendiaryBig,
Items.thorium, Bullets.standardThoriumBig
);
reload = 6f;
reloadTime = 6f;
coolantMultiplier = 0.5f;
restitution = 0.1f;
ammoUseEffect = Fx.shellEjectBig;
range = 200f;
inaccuracy = 3f;
recoil = 3f;
xRand = 3f;
shotWidth = 4f;
recoilAmount = 3f;
spread = 8f;
alternate = true;
shootShake = 2f;
shots = 2;
size = 4;
@@ -1643,11 +1643,11 @@ public class Blocks implements ContentList{
shootType = Bullets.meltdownLaser;
shootEffect = Fx.shootBigSmoke2;
shootCone = 40f;
recoil = 4f;
recoilAmount = 4f;
size = 4;
shootShake = 2f;
range = 190f;
reload = 80f;
reloadTime = 80f;
firingMoveFract = 0.5f;
shootDuration = 220f;
powerUse = 14f;
@@ -1662,106 +1662,16 @@ public class Blocks implements ContentList{
//endregion
//region units
draugFactory = new UnitFactory("draug-factory"){{
//for testing only.
groundFactory = new UnitFactory("ground-factory"){{
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 70));
unitType = UnitTypes.draug;
produceTime = 2500;
size = 2;
maxSpawn = 1;
consumes.power(1.2f);
consumes.items();
}};
spiritFactory = new UnitFactory("spirit-factory"){{
requirements(Category.units, ItemStack.with(Items.metaglass, 45, Items.lead, 55, Items.silicon, 45));
unitType = UnitTypes.spirit;
produceTime = 4000;
size = 2;
maxSpawn = 1;
consumes.power(1.2f);
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30));
}};
phantomFactory = new UnitFactory("phantom-factory"){{
requirements(Category.units, ItemStack.with(Items.titanium, 50, Items.thorium, 60, Items.lead, 65, Items.silicon, 105));
unitType = UnitTypes.phantom;
produceTime = 4400;
size = 2;
maxSpawn = 1;
consumes.power(2.5f);
consumes.items(new ItemStack(Items.silicon, 50), new ItemStack(Items.lead, 30), new ItemStack(Items.titanium, 20));
}};
commandCenter = new CommandCenter("command-center"){{
requirements(Category.units, ItemStack.with(Items.copper, 200, Items.lead, 250, Items.silicon, 250, Items.graphite, 100));
flags = EnumSet.of(BlockFlag.rally, BlockFlag.comandCenter);
size = 2;
health = size * size * 55;
}};
wraithFactory = new UnitFactory("wraith-factory"){{
requirements(Category.units, ItemStack.with(Items.titanium, 30, Items.lead, 40, Items.silicon, 45));
unitType = UnitTypes.wraith;
produceTime = 700;
size = 2;
consumes.power(0.5f);
consumes.items(new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 5));
}};
ghoulFactory = new UnitFactory("ghoul-factory"){{
requirements(Category.units, ItemStack.with(Items.titanium, 75, Items.lead, 65, Items.silicon, 110));
unitType = UnitTypes.ghoul;
produceTime = 1150;
plans = new UnitPlan[]{
new UnitPlan(UnitTypes.dagger, 60f, ItemStack.with(Items.silicon, 10)),
new UnitPlan(UnitTypes.wraith, 60f, ItemStack.with(Items.silicon, 10)),
};
size = 3;
consumes.power(1.2f);
consumes.items(new ItemStack(Items.silicon, 15), new ItemStack(Items.titanium, 10));
}};
revenantFactory = new UnitFactory("revenant-factory"){{
requirements(Category.units, ItemStack.with(Items.plastanium, 50, Items.titanium, 150, Items.lead, 150, Items.silicon, 200));
unitType = UnitTypes.revenant;
produceTime = 2000;
size = 4;
consumes.power(3f);
consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.titanium, 30));
}};
daggerFactory = new UnitFactory("dagger-factory"){{
requirements(Category.units, ItemStack.with(Items.lead, 55, Items.silicon, 35));
unitType = UnitTypes.dagger;
produceTime = 850;
size = 2;
consumes.power(0.5f);
consumes.items(new ItemStack(Items.silicon, 6));
}};
crawlerFactory = new UnitFactory("crawler-factory"){{
requirements(Category.units, ItemStack.with(Items.lead, 45, Items.silicon, 30));
unitType = UnitTypes.crawler;
produceTime = 300;
size = 2;
maxSpawn = 6;
consumes.power(0.5f);
consumes.items(new ItemStack(Items.coal, 10));
}};
titanFactory = new UnitFactory("titan-factory"){{
requirements(Category.units, ItemStack.with(Items.graphite, 50, Items.lead, 50, Items.silicon, 45));
unitType = UnitTypes.titan;
produceTime = 1050;
size = 3;
consumes.power(0.60f);
consumes.items(new ItemStack(Items.silicon, 12));
}};
fortressFactory = new UnitFactory("fortress-factory"){{
requirements(Category.units, ItemStack.with(Items.thorium, 40, Items.lead, 110, Items.silicon, 75));
unitType = UnitTypes.fortress;
produceTime = 2000;
size = 3;
maxSpawn = 3;
consumes.power(1.4f);
consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.graphite, 10));
consumes.items(new ItemStack(Items.silicon, 10));
}};
repairPoint = new RepairPoint("repair-point"){{
@@ -1771,58 +1681,6 @@ public class Blocks implements ContentList{
powerUse = 1f;
}};
//endregion
//region upgrades
dartPad = new MechPad("dart-mech-pad"){{
requirements(Category.upgrade, ItemStack.with(Items.lead, 100, Items.graphite, 50, Items.copper, 75));
mech = Mechs.alpha;
size = 2;
consumes.power(0.5f);
}};
deltaPad = new MechPad("delta-mech-pad"){{
requirements(Category.upgrade, ItemStack.with(Items.lead, 175, Items.titanium, 175, Items.copper, 200, Items.silicon, 225, Items.thorium, 150));
mech = Mechs.delta;
size = 2;
consumes.power(0.7f);
}};
tauPad = new MechPad("tau-mech-pad"){{
requirements(Category.upgrade, ItemStack.with(Items.lead, 125, Items.titanium, 125, Items.copper, 125, Items.silicon, 125));
mech = Mechs.tau;
size = 2;
consumes.power(1f);
}};
omegaPad = new MechPad("omega-mech-pad"){{
requirements(Category.upgrade, ItemStack.with(Items.lead, 225, Items.graphite, 275, Items.silicon, 325, Items.thorium, 300, Items.surgealloy, 120));
mech = Mechs.omega;
size = 3;
consumes.power(1.2f);
}};
javelinPad = new MechPad("javelin-ship-pad"){{
requirements(Category.upgrade, ItemStack.with(Items.lead, 175, Items.silicon, 225, Items.titanium, 250, Items.plastanium, 200, Items.phasefabric, 100));
mech = Mechs.javelin;
size = 2;
consumes.power(0.8f);
}};
tridentPad = new MechPad("trident-ship-pad"){{
requirements(Category.upgrade, ItemStack.with(Items.lead, 125, Items.copper, 125, Items.silicon, 125, Items.titanium, 150, Items.plastanium, 100));
mech = Mechs.trident;
size = 2;
consumes.power(1f);
}};
glaivePad = new MechPad("glaive-ship-pad"){{
requirements(Category.upgrade, ItemStack.with(Items.lead, 225, Items.silicon, 325, Items.titanium, 350, Items.plastanium, 300, Items.surgealloy, 100));
mech = Mechs.glaive;
size = 3;
consumes.power(1.2f);
}};
//endregion
//region sandbox
@@ -1867,6 +1725,14 @@ public class Blocks implements ContentList{
consumes.power(0.05f);
}};
//endregion
//region legacy
//looked up by name, no ref needed
new LegacyMechPad("legacy-mech-pad");
new LegacyUnitFactory("legacy-unit-factory");
new LegacyCommandCenter("legacy-command-center");
//endregion
}
}

View File

@@ -4,11 +4,10 @@ import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.ctype.ContentList;
import mindustry.ctype.*;
import mindustry.entities.*;
import mindustry.entities.bullet.*;
import mindustry.entities.effect.*;
import mindustry.entities.type.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.world.*;
@@ -384,7 +383,7 @@ public class Bullets implements ContentList{
}};
damageLightning = new BulletType(0.0001f, 0f){{
lifetime = Lightning.lifetime;
lifetime = Fx.lightning.lifetime;
hitEffect = Fx.hitLancer;
despawnEffect = Fx.none;
status = StatusEffects.shocked;
@@ -410,32 +409,32 @@ public class Bullets implements ContentList{
}
@Override
public void init(Bullet b){
b.velocity().setLength(0.6f + Mathf.random(2f));
public void init(Bulletc b){
b.vel().setLength(0.6f + Mathf.random(2f));
}
@Override
public void draw(Bullet b){
public void draw(Bulletc b){
Draw.color(Pal.lightFlame, Pal.darkFlame, Color.gray, b.fin());
Fill.circle(b.x, b.y, 3f * b.fout());
Fill.circle(b.x(), b.y(), 3f * b.fout());
Draw.reset();
}
@Override
public void update(Bullet b){
public void update(Bulletc b){
if(Mathf.chance(0.04 * Time.delta())){
Tile tile = world.tileWorld(b.x, b.y);
Tile tile = world.tileWorld(b.x(), b.y());
if(tile != null){
Fire.create(tile);
Fires.create(tile);
}
}
if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(Fx.fireballsmoke, b.x, b.y);
Fx.fireballsmoke.at(b.x(), b.y());
}
if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(Fx.ballfire, b.x, b.y);
Fx.ballfire.at(b.x(), b.y());
}
}
};
@@ -452,6 +451,7 @@ public class Bullets implements ContentList{
hitEffect = Fx.hitFlameSmall;
despawnEffect = Fx.none;
status = StatusEffects.burning;
keepVelocity = false;
}
@Override
@@ -460,7 +460,7 @@ public class Bullets implements ContentList{
}
@Override
public void draw(Bullet b){
public void draw(Bulletc b){
}
};
@@ -479,50 +479,17 @@ public class Bullets implements ContentList{
}
@Override
public void draw(Bullet b){
public void draw(Bulletc b){
}
};
lancerLaser = new BulletType(0.001f, 140){
Color[] colors = {Pal.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Pal.lancerLaser, Color.white};
float[] tscales = {1f, 0.7f, 0.5f, 0.2f};
float[] lenscales = {1f, 1.1f, 1.13f, 1.14f};
float length = 160f;
{
hitEffect = Fx.hitLancer;
despawnEffect = Fx.none;
hitSize = 4;
lifetime = 16f;
pierce = true;
}
@Override
public float range(){
return length;
}
@Override
public void init(Bullet b){
Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), length);
}
@Override
public void draw(Bullet b){
float f = Mathf.curve(b.fin(), 0f, 0.2f);
float baseLen = length * f;
Lines.lineAngle(b.x, b.y, b.rot(), baseLen);
for(int s = 0; s < 3; s++){
Draw.color(colors[s]);
for(int i = 0; i < tscales.length; i++){
Lines.stroke(7f * b.fout() * (s == 0 ? 1.5f : s == 1 ? 1f : 0.3f) * tscales[i]);
Lines.lineAngle(b.x, b.y, b.rot(), baseLen * lenscales[i]);
}
}
Draw.reset();
}
};
lancerLaser = new LaserBulletType(140){{
colors = new Color[]{Pal.lancerLaser.cpy().mul(1f, 1f, 1f, 0.4f), Pal.lancerLaser, Color.white};
hitEffect = Fx.hitLancer;
despawnEffect = Fx.none;
hitSize = 4;
lifetime = 16f;
}};
meltdownLaser = new BulletType(0.001f, 70){
Color tmpColor = new Color();
@@ -542,32 +509,32 @@ public class Bullets implements ContentList{
}
@Override
public void update(Bullet b){
if(b.timer.get(1, 5f)){
Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), length, true);
public void update(Bulletc b){
if(b.timer(1, 5f)){
Damage.collideLine(b, b.team(), hitEffect, b.x(), b.y(), b.rotation(), length, true);
}
Effects.shake(1f, 1f, b.x, b.y);
Effects.shake(1f, 1f, b.x(), b.y());
}
@Override
public void hit(Bullet b, float hitx, float hity){
Effects.effect(hitEffect, colors[2], hitx, hity);
public void hit(Bulletc b, float hitx, float hity){
hitEffect.at(hitx, hity, colors[2]);
if(Mathf.chance(0.4)){
Fire.create(world.tileWorld(hitx + Mathf.range(5f), hity + Mathf.range(5f)));
Fires.create(world.tileWorld(hitx + Mathf.range(5f), hity + Mathf.range(5f)));
}
}
@Override
public void draw(Bullet b){
public void draw(Bulletc b){
float baseLen = (length) * b.fout();
Lines.lineAngle(b.x, b.y, b.rot(), baseLen);
Lines.lineAngle(b.x(), b.y(), b.rotation(), baseLen);
for(int s = 0; s < colors.length; s++){
Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Time.time(), 1f, 0.1f)));
for(int i = 0; i < tscales.length; i++){
Tmp.v1.trns(b.rot() + 180f, (lenscales[i] - 1f) * 35f);
Tmp.v1.trns(b.rotation() + 180f, (lenscales[i] - 1f) * 35f);
Lines.stroke((9f + Mathf.absin(Time.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]);
Lines.lineAngle(b.x + Tmp.v1.x, b.y + Tmp.v1.y, b.rot(), baseLen * lenscales[i], CapStyle.none);
Lines.lineAngle(b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, b.rotation(), baseLen * lenscales[i], CapStyle.none);
}
}
Draw.reset();
@@ -613,31 +580,20 @@ public class Bullets implements ContentList{
}
@Override
public void draw(Bullet b){
public void draw(Bulletc b){
}
@Override
public void init(Bullet b){
Lightning.create(b.getTeam(), Pal.lancerLaser, damage * (b.getOwner() instanceof Player ? state.rules.playerDamageMultiplier : 1f), b.x, b.y, b.rot(), 30);
public void init(Bulletc b){
//TODO owners are never players...
Lightning.create(b.team(), Pal.lancerLaser, damage * (b.owner() instanceof Playerc ? state.rules.playerDamageMultiplier : 1f), b.x(), b.y(), b.rotation(), 30);
}
};
arc = new BulletType(0.001f, 21){
{
lifetime = 1;
despawnEffect = Fx.none;
hitEffect = Fx.hitLancer;
}
@Override
public void draw(Bullet b){
}
@Override
public void init(Bullet b){
Lightning.create(b.getTeam(), Pal.lancerLaser, damage, b.x, b.y, b.rot(), 25);
}
};
arc = new LightningBulletType(){{
damage = 21;
lightningLength = 25;
}};
driverBolt = new MassDriverBolt();
@@ -678,12 +634,12 @@ public class Bullets implements ContentList{
}
@Override
public void hit(Bullet b, float x, float y){
public void hit(Bulletc b, float x, float y){
super.hit(b, x, y);
for(int i = 0; i < 3; i++){
Tile tile = world.tileWorld(x + Mathf.range(8f), y + Mathf.range(8f));
Puddle.deposit(tile, Liquids.oil, 5f);
Puddles.deposit(tile, Liquids.oil, 5f);
}
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,378 +0,0 @@
package mindustry.content;
import arc.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.*;
import mindustry.ctype.ContentList;
import mindustry.entities.*;
import mindustry.entities.bullet.*;
import mindustry.entities.effect.*;
import mindustry.entities.type.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
public class Mechs implements ContentList{
public static Mech alpha, delta, tau, omega, dart, javelin, trident, glaive;
public static Mech starter;
@Override
public void load(){
alpha = new Mech("alpha-mech", false){
{
drillPower = 1;
mineSpeed = 1.5f;
mass = 1.2f;
speed = 0.5f;
itemCapacity = 40;
boostSpeed = 0.95f;
buildPower = 1.2f;
engineColor = Color.valueOf("ffd37f");
health = 250f;
weapon = new Weapon("blaster"){{
length = 1.5f;
reload = 14f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardMechSmall;
}};
}
@Override
public void updateAlt(Player player){
player.healBy(Time.delta() * 0.09f);
}
};
delta = new Mech("delta-mech", false){
float cooldown = 120;
{
drillPower = -1;
speed = 0.75f;
boostSpeed = 0.95f;
itemCapacity = 15;
mass = 0.9f;
health = 150f;
buildPower = 0.9f;
weaponOffsetX = -1;
weaponOffsetY = -1;
engineColor = Color.valueOf("d3ddff");
weapon = new Weapon("shockgun"){{
shake = 2f;
length = 1f;
reload = 55f;
shotDelay = 3f;
alternate = true;
shots = 2;
inaccuracy = 0f;
ejectEffect = Fx.none;
bullet = Bullets.lightning;
shootSound = Sounds.spark;
}};
}
@Override
public void onLand(Player player){
if(player.timer.get(Player.timerAbility, cooldown)){
Effects.shake(1f, 1f, player);
Effects.effect(Fx.landShock, player);
for(int i = 0; i < 8; i++){
Time.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Pal.lancerLaser, 17f * Vars.state.rules.playerDamageMultiplier, player.x, player.y, Mathf.random(360f), 14));
}
}
}
};
tau = new Mech("tau-mech", false){
float healRange = 60f;
float healAmount = 10f;
float healReload = 160f;
boolean wasHealed;
{
drillPower = 4;
mineSpeed = 3f;
itemCapacity = 70;
weaponOffsetY = -1;
weaponOffsetX = 1;
mass = 1.75f;
speed = 0.44f;
drag = 0.35f;
boostSpeed = 0.8f;
canHeal = true;
health = 200f;
buildPower = 1.6f;
engineColor = Pal.heal;
weapon = new Weapon("heal-blaster"){{
length = 1.5f;
reload = 24f;
alternate = false;
ejectEffect = Fx.none;
recoil = 2f;
bullet = Bullets.healBullet;
shootSound = Sounds.pew;
}};
}
@Override
public void updateAlt(Player player){
if(player.timer.get(Player.timerAbility, healReload)){
wasHealed = false;
Units.nearby(player.getTeam(), player.x, player.y, healRange, unit -> {
if(unit.health < unit.maxHealth()){
Effects.effect(Fx.heal, unit);
wasHealed = true;
}
unit.healBy(healAmount);
});
if(wasHealed){
Effects.effect(Fx.healWave, player);
}
}
}
};
omega = new Mech("omega-mech", false){
protected TextureRegion armorRegion;
{
drillPower = 2;
mineSpeed = 1.5f;
itemCapacity = 80;
speed = 0.36f;
boostSpeed = 0.6f;
mass = 4f;
shake = 4f;
weaponOffsetX = 1;
weaponOffsetY = 0;
engineColor = Color.valueOf("feb380");
health = 350f;
buildPower = 1.5f;
weapon = new Weapon("swarmer"){{
length = 1.5f;
recoil = 4f;
reload = 38f;
shots = 4;
spacing = 8f;
inaccuracy = 8f;
alternate = true;
ejectEffect = Fx.none;
shake = 3f;
bullet = Bullets.missileSwarm;
shootSound = Sounds.shootBig;
}};
}
@Override
public float getRotationAlpha(Player player){
return 0.6f - player.shootHeat * 0.3f;
}
@Override
public float spreadX(Player player){
return player.shootHeat * 2f;
}
@Override
public void load(){
super.load();
armorRegion = Core.atlas.find(name + "-armor");
}
@Override
public void updateAlt(Player player){
float scl = 1f - player.shootHeat / 2f*Time.delta();
player.velocity().scl(scl);
}
@Override
public float getExtraArmor(Player player){
return player.shootHeat * 30f;
}
@Override
public void draw(Player player){
if(player.shootHeat <= 0.01f) return;
Shaders.build.progress = player.shootHeat;
Shaders.build.region = armorRegion;
Shaders.build.time = Time.time() / 10f;
Shaders.build.color.set(Pal.accent).a = player.shootHeat;
Draw.shader(Shaders.build);
Draw.rect(armorRegion, player.x, player.y, player.rotation);
Draw.shader();
}
};
dart = new Mech("dart-ship", true){
{
drillPower = 1;
mineSpeed = 3f;
speed = 0.5f;
drag = 0.09f;
health = 200f;
weaponOffsetX = -1;
weaponOffsetY = -1;
engineColor = Pal.lightTrail;
cellTrnsY = 1f;
buildPower = 1.1f;
weapon = new Weapon("blaster"){{
length = 1.5f;
reload = 15f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
}};
}
@Override
public boolean alwaysUnlocked(){
return true;
}
};
javelin = new Mech("javelin-ship", true){
float minV = 3.6f;
float maxV = 6f;
TextureRegion shield;
{
drillPower = -1;
speed = 0.11f;
drag = 0.01f;
mass = 2f;
health = 170f;
engineColor = Color.valueOf("d3ddff");
cellTrnsY = 1f;
weapon = new Weapon("missiles"){{
length = 1.5f;
reload = 70f;
shots = 4;
inaccuracy = 2f;
alternate = true;
ejectEffect = Fx.none;
velocityRnd = 0.2f;
spacing = 1f;
bullet = Bullets.missileJavelin;
shootSound = Sounds.missile;
}};
}
@Override
public void load(){
super.load();
shield = Core.atlas.find(name + "-shield");
}
@Override
public float getRotationAlpha(Player player){
return 0.5f;
}
@Override
public void updateAlt(Player player){
float scl = scld(player);
if(Mathf.chance(Time.delta() * (0.15 * scl))){
Effects.effect(Fx.hitLancer, Pal.lancerLaser, player.x, player.y);
Lightning.create(player.getTeam(), Pal.lancerLaser, 10f * Vars.state.rules.playerDamageMultiplier,
player.x + player.velocity().x, player.y + player.velocity().y, player.rotation, 14);
}
}
@Override
public void draw(Player player){
float scl = scld(player);
if(scl < 0.01f) return;
Draw.color(Pal.lancerLaser);
Draw.alpha(scl / 2f);
Draw.blend(Blending.additive);
Draw.rect(shield, player.x + Mathf.range(scl / 2f), player.y + Mathf.range(scl / 2f), player.rotation - 90);
Draw.blend();
}
float scld(Player player){
return Mathf.clamp((player.velocity().len() - minV) / (maxV - minV));
}
};
trident = new Mech("trident-ship", true){
{
drillPower = 2;
speed = 0.15f;
drag = 0.034f;
mass = 2.5f;
turnCursor = false;
health = 250f;
itemCapacity = 30;
engineColor = Color.valueOf("84f491");
cellTrnsY = 1f;
buildPower = 2.5f;
weapon = new Weapon("bomber"){{
length = 0f;
width = 2f;
reload = 25f;
shots = 2;
shotDelay = 1f;
shots = 8;
alternate = true;
ejectEffect = Fx.none;
velocityRnd = 1f;
inaccuracy = 20f;
ignoreRotation = true;
bullet = new BombBulletType(16f, 25f, "shell"){{
bulletWidth = 10f;
bulletHeight = 14f;
hitEffect = Fx.flakExplosion;
shootEffect = Fx.none;
smokeEffect = Fx.none;
shootSound = Sounds.artillery;
}};
}};
}
@Override
public boolean canShoot(Player player){
return player.velocity().len() > 1.2f;
}
};
glaive = new Mech("glaive-ship", true){
{
drillPower = 4;
mineSpeed = 1.3f;
speed = 0.32f;
drag = 0.06f;
mass = 3f;
health = 240f;
itemCapacity = 60;
engineColor = Color.valueOf("feb380");
cellTrnsY = 1f;
buildPower = 1.2f;
weapon = new Weapon("bomber"){{
length = 1.5f;
reload = 13f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardGlaive;
shootSound = Sounds.shootSnap;
}};
}
};
starter = dart;
}
}

View File

@@ -0,0 +1,45 @@
package mindustry.content;
import arc.graphics.*;
import mindustry.ctype.*;
import mindustry.graphics.g3d.*;
import mindustry.maps.planet.*;
import mindustry.type.*;
public class Planets implements ContentList{
public static Planet
sun,
starter;
@Override
public void load(){
sun = new Planet("sun", null, 0, 2){{
bloom = true;
//lightColor = Color.valueOf("f4ee8e");
meshLoader = () -> new SunMesh(this, 3){{
setColors(
1.1f,
Color.valueOf("ff7a38"),
Color.valueOf("ff9638"),
Color.valueOf("ffc64c"),
Color.valueOf("ffc64c"),
Color.valueOf("ffe371"),
Color.valueOf("f4ee8e")
);
scale = 1f;
speed = 1000f;
falloff = 0.3f;
octaves = 4;
spread = 1.2f;
magnitude = 0f;
}};
}};
starter = new Planet("TODO", sun, 3, 1){{
generator = new TODOPlanetGenerator();
meshLoader = () -> new HexMesh(this, 6);
atmosphereColor = Color.valueOf("3c1b8f");
}};
}
}

View File

@@ -1,8 +1,8 @@
package mindustry.content;
import arc.*;
import arc.graphics.*;
import arc.math.Mathf;
import mindustry.entities.Effects;
import mindustry.ctype.ContentList;
import mindustry.game.EventType.*;
import mindustry.type.StatusEffect;
@@ -24,7 +24,7 @@ public class StatusEffects implements ContentList{
opposite(wet,freezing);
trans(tarred, ((unit, time, newTime, result) -> {
unit.damage(1f);
Effects.effect(Fx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
Fx.burning.at(unit.x() + Mathf.range(unit.bounds() / 2f), unit.y() + Mathf.range(unit.bounds() / 2f));
result.set(this, Math.min(time + newTime, 300f));
}));
});
@@ -41,13 +41,14 @@ public class StatusEffects implements ContentList{
}};
wet = new StatusEffect("wet"){{
color = Color.royal;
speedMultiplier = 0.9f;
effect = Fx.wet;
init(() -> {
trans(shocked, ((unit, time, newTime, result) -> {
unit.damage(20f);
if(unit.getTeam() == state.rules.waveTeam){
if(unit.team() == state.rules.waveTeam){
Events.fire(Trigger.shock);
}
result.set(this, time);

View File

@@ -280,6 +280,7 @@ public class TechTree implements ContentList{
});
});
/*
node(draugFactory, () -> {
node(spiritFactory, () -> {
node(phantomFactory);
@@ -305,6 +306,7 @@ public class TechTree implements ContentList{
});
});
/*
node(dartPad, () -> {
node(deltaPad, () -> {
@@ -320,7 +322,7 @@ public class TechTree implements ContentList{
});
});
});
});
});*/
});
});
});
@@ -347,6 +349,7 @@ public class TechTree implements ContentList{
public static class TechNode{
static TechNode context;
public TechNode parent;
public final Block block;
public final ItemStack[] requirements;
public final Array<TechNode> children = new Array<>();
@@ -356,6 +359,7 @@ public class TechTree implements ContentList{
ccontext.children.add(this);
}
this.parent = ccontext;
this.block = block;
this.requirements = requirements;

View File

@@ -1,18 +0,0 @@
package mindustry.content;
import mindustry.entities.effect.Fire;
import mindustry.entities.effect.Puddle;
import mindustry.entities.type.Player;
import mindustry.ctype.ContentList;
import mindustry.type.TypeID;
public class TypeIDs implements ContentList{
public static TypeID fire, puddle, player;
@Override
public void load(){
fire = new TypeID("fire", Fire::new);
puddle = new TypeID("puddle", Puddle::new);
player = new TypeID("player", Player::new);
}
}

View File

@@ -1,95 +1,154 @@
package mindustry.content;
import arc.struct.*;
import mindustry.annotations.Annotations.*;
import mindustry.ctype.*;
import mindustry.entities.bullet.*;
import mindustry.entities.type.base.*;
import mindustry.gen.*;
import mindustry.type.*;
public class UnitTypes implements ContentList{
//TODO reimplement - DO NOT USE
public static UnitType
draug, spirit, phantom,
wraith, ghoul, revenant, lich, reaper,
dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator;
ghoul, revenant, lich,
crawler, titan, fortress, eruptor, chaosArray, eradicator;
public static @EntityDef({Unitc.class, Legsc.class}) UnitType dagger;
public static @EntityDef({Unitc.class, WaterMovec.class}) UnitType vanguard;
public static @EntityDef({Unitc.class, Minerc.class}) UnitType draug;
public static @EntityDef({Unitc.class}) UnitType wraith;
public static @EntityDef({Unitc.class}) UnitType reaper;
public static @EntityDef({Unitc.class}) UnitType spirit;
public static @EntityDef({Unitc.class, Builderc.class}) UnitType phantom;
//TODO remove
public static UnitType alpha, delta, tau, omega, dart, javelin, trident, glaive;
public static UnitType starter;
@Override
public void load(){
draug = new UnitType("draug", MinerDrone::new){{
flying = true;
drag = 0.01f;
speed = 0.3f;
maxVelocity = 1.2f;
range = 50f;
health = 80;
minePower = 0.9f;
engineSize = 1.8f;
engineOffset = 5.7f;
weapon = new Weapon("you have incurred my wrath. prepare to die."){{
bullet = Bullets.lancerLaser;
}};
dagger = new UnitType("dagger"){{
speed = 0.5f;
drag = 0.3f;
hitsize = 8f;
mass = 1.75f;
health = 130;
weapons.add(new Weapon("chain-blaster"){{
reload = 14f;
x = 4f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
}});
}};
spirit = new UnitType("spirit", RepairDrone::new){{
wraith = new UnitType("wraith"){{
speed = 3f;
accel = 0.08f;
drag = 0f;
mass = 1.5f;
flying = true;
drag = 0.01f;
speed = 0.42f;
maxVelocity = 1.6f;
health = 75;
engineOffset = 5.5f;
range = 140f;
weapons.add(new Weapon(){{
y = 1.5f;
reload = 28f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
shootSound = Sounds.shoot;
}});
}};
reaper = new UnitType("reaper"){{
speed = 1f;
accel = 0.08f;
drag = 0f;
mass = 2f;
flying = true;
health = 75000;
engineOffset = 40;
engineSize = 7.3f;
weapons.add(new Weapon(){{
y = 1.5f;
reload = 28f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
shootSound = Sounds.shoot;
}});
}};
vanguard = new UnitType("vanguard"){{
speed = 1.3f;
drag = 0.1f;
hitsize = 8f;
mass = 1.75f;
health = 130;
immunities = ObjectSet.with(StatusEffects.wet);
weapons.add(new Weapon("chain-blaster"){{
reload = 10f;
x = 1.25f;
alternate = true;
rotate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
}});
}};
draug = new UnitType("draug"){{
flying = true;
drag = 0.05f;
speed = 2f;
range = 50f;
accel = 0.2f;
health = 80;
mineSpeed = 0.9f;
engineSize = 1.8f;
engineOffset = 5.7f;
drillTier = 1;
}};
spirit = new UnitType("spirit"){{
flying = true;
drag = 0.05f;
accel = 0.2f;
speed = 2f;
range = 50f;
health = 100;
engineSize = 1.8f;
engineOffset = 5.7f;
weapon = new Weapon(){{
length = 1.5f;
weapons.add(new Weapon(){{
y = 1.5f;
reload = 40f;
width = 0.5f;
x = 0.5f;
alternate = true;
ejectEffect = Fx.none;
recoil = 2f;
bullet = Bullets.healBulletBig;
shootSound = Sounds.pew;
}};
}});
}};
phantom = new UnitType("phantom", BuilderDrone::new){{
phantom = new UnitType("phantom"){{
flying = true;
drag = 0.01f;
drag = 0.05f;
mass = 2f;
speed = 0.45f;
maxVelocity = 1.9f;
speed = 4f;
rotateSpeed = 12f;
accel = 0.3f;
range = 70f;
itemCapacity = 70;
health = 400;
buildPower = 0.4f;
buildSpeed = 0.4f;
engineOffset = 6.5f;
toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium);
weapon = new Weapon(){{
length = 1.5f;
reload = 20f;
width = 0.5f;
alternate = true;
ejectEffect = Fx.none;
recoil = 2f;
bullet = Bullets.healBullet;
}};
}};
dagger = new UnitType("dagger", GroundUnit::new){{
maxVelocity = 1.1f;
speed = 0.2f;
drag = 0.4f;
hitsize = 8f;
mass = 1.75f;
health = 130;
weapon = new Weapon("chain-blaster"){{
length = 1.5f;
reload = 28f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
}};
}};
/*
crawler = new UnitType("crawler", GroundUnit::new){{
maxVelocity = 1.27f;
speed = 0.285f;
@@ -97,7 +156,7 @@ public class UnitTypes implements ContentList{
hitsize = 8f;
mass = 1.75f;
health = 120;
weapon = new Weapon(){{
weapons.add(new Weapon(){{
reload = 12f;
ejectEffect = Fx.none;
shootSound = Sounds.explosion;
@@ -110,7 +169,7 @@ public class UnitTypes implements ContentList{
splashDamage = 30f;
killShooter = true;
}};
}};
}});
}};
titan = new UnitType("titan", GroundUnit::new){{
@@ -123,7 +182,7 @@ public class UnitTypes implements ContentList{
rotatespeed = 0.1f;
health = 460;
immunities.add(StatusEffects.burning);
weapon = new Weapon("flamethrower"){{
weapons.add(new Weapon("flamethrower"){{
shootSound = Sounds.flame;
length = 1f;
reload = 14f;
@@ -131,7 +190,7 @@ public class UnitTypes implements ContentList{
recoil = 1f;
ejectEffect = Fx.none;
bullet = Bullets.basicFlame;
}};
}});
}};
fortress = new UnitType("fortress", GroundUnit::new){{
@@ -143,7 +202,7 @@ public class UnitTypes implements ContentList{
rotatespeed = 0.06f;
targetAir = false;
health = 750;
weapon = new Weapon("artillery"){{
weapons.add(new Weapon("artillery"){{
length = 1f;
reload = 60f;
width = 10f;
@@ -153,7 +212,7 @@ public class UnitTypes implements ContentList{
ejectEffect = Fx.shellEjectMedium;
bullet = Bullets.artilleryUnit;
shootSound = Sounds.artillery;
}};
}});
}};
eruptor = new UnitType("eruptor", GroundUnit::new){{
@@ -166,7 +225,7 @@ public class UnitTypes implements ContentList{
targetAir = false;
health = 600;
immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting);
weapon = new Weapon("eruption"){{
weapons.add(new Weapon("eruption"){{
length = 3f;
reload = 10f;
alternate = true;
@@ -175,7 +234,7 @@ public class UnitTypes implements ContentList{
recoil = 1f;
width = 7f;
shootSound = Sounds.flame;
}};
}});
}};
chaosArray = new UnitType("chaos-array", GroundUnit::new){{
@@ -186,7 +245,7 @@ public class UnitTypes implements ContentList{
hitsize = 20f;
rotatespeed = 0.06f;
health = 3000;
weapon = new Weapon("chaos"){{
weapons.add(new Weapon("chaos"){{
length = 8f;
reload = 50f;
width = 17f;
@@ -199,7 +258,7 @@ public class UnitTypes implements ContentList{
ejectEffect = Fx.shellEjectMedium;
bullet = Bullets.flakSurge;
shootSound = Sounds.shootBig;
}};
}});
}};
eradicator = new UnitType("eradicator", GroundUnit::new){{
@@ -210,7 +269,7 @@ public class UnitTypes implements ContentList{
hitsize = 20f;
rotatespeed = 0.06f;
health = 9000;
weapon = new Weapon("eradication"){{
weapons.add(new Weapon("eradication"){{
length = 13f;
reload = 30f;
width = 22f;
@@ -224,7 +283,7 @@ public class UnitTypes implements ContentList{
ejectEffect = Fx.shellEjectMedium;
bullet = Bullets.standardThoriumBig;
shootSound = Sounds.shootBig;
}};
}});
}};
wraith = new UnitType("wraith", FlyingUnit::new){{
@@ -236,14 +295,14 @@ public class UnitTypes implements ContentList{
health = 75;
engineOffset = 5.5f;
range = 140f;
weapon = new Weapon(){{
weapons.add(new Weapon(){{
length = 1.5f;
reload = 28f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
shootSound = Sounds.shoot;
}};
}});
}};
ghoul = new UnitType("ghoul", FlyingUnit::new){{
@@ -256,7 +315,7 @@ public class UnitTypes implements ContentList{
targetAir = false;
engineOffset = 7.8f;
range = 140f;
weapon = new Weapon(){{
weapons.add(new Weapon(){{
length = 0f;
width = 2f;
reload = 12f;
@@ -267,7 +326,7 @@ public class UnitTypes implements ContentList{
ignoreRotation = true;
bullet = Bullets.bombExplosive;
shootSound = Sounds.none;
}};
}});
}};
revenant = new UnitType("revenant", HoverUnit::new){{
@@ -280,13 +339,13 @@ public class UnitTypes implements ContentList{
range = 80f;
shootCone = 40f;
flying = true;
rotateWeapon = true;
//rotateWeapons = true;
engineOffset = 12f;
engineSize = 3f;
rotatespeed = 0.01f;
attackLength = 90f;
baseRotateSpeed = 0.06f;
weapon = new Weapon("revenant-missiles"){{
weapons.add(new Weapon("revenant-missiles"){{
length = 3f;
reload = 70f;
width = 10f;
@@ -298,7 +357,7 @@ public class UnitTypes implements ContentList{
spacing = 1f;
shootSound = Sounds.missile;
bullet = Bullets.missileRevenant;
}};
}});
}};
lich = new UnitType("lich", HoverUnit::new){{
@@ -311,13 +370,13 @@ public class UnitTypes implements ContentList{
range = 80f;
shootCone = 20f;
flying = true;
rotateWeapon = true;
//rotateWeapons = true;
engineOffset = 21;
engineSize = 5.3f;
rotatespeed = 0.01f;
attackLength = 90f;
baseRotateSpeed = 0.04f;
weapon = new Weapon("lich-missiles"){{
weapons.add(new Weapon("lich-missiles"){{
length = 4f;
reload = 160f;
width = 22f;
@@ -331,7 +390,7 @@ public class UnitTypes implements ContentList{
spacing = 1f;
bullet = Bullets.missileRevenant;
shootSound = Sounds.artillery;
}};
}});
}};
reaper = new UnitType("reaper", HoverUnit::new){{
@@ -344,12 +403,12 @@ public class UnitTypes implements ContentList{
range = 80f;
shootCone = 30f;
flying = true;
rotateWeapon = true;
//rotateWeapons = true;
engineOffset = 40;
engineSize = 7.3f;
rotatespeed = 0.01f;
baseRotateSpeed = 0.04f;
weapon = new Weapon("reaper-gun"){{
weapons.add(new Weapon("reaper-gun"){{
length = 3f;
reload = 10f;
width = 32f;
@@ -373,7 +432,442 @@ public class UnitTypes implements ContentList{
}
};
shootSound = Sounds.shootBig;
}};
}});
}};
/*
vanguard = new UnitType("vanguard-ship"){
float healRange = 60f;
float healReload = 200f;
float healPercent = 10f;
{
flying = true;
drillTier = 1;
mineSpeed = 4f;
speed = 0.49f;
drag = 0.09f;
health = 200f;
weaponOffsetX = -1;
engineSize = 2.3f;
weaponOffsetY = -1;
engineColor = Pal.lightTrail;
cellTrnsY = 1f;
buildSpeed = 1.2f;
weapons.add(new Weapon("vanguard-blaster"){{
length = 1.5f;
reload = 30f;
alternate = true;
inaccuracy = 6f;
velocityRnd = 0.1f;
ejectEffect = Fx.none;
bullet = new HealBulletType(){{
healPercent = 3f;
backColor = engineColor;
homingPower = 20f;
bulletHeight = 4f;
bulletWidth = 1.5f;
damage = 3f;
speed = 4f;
lifetime = 40f;
shootEffect = Fx.shootHealYellow;
smokeEffect = hitEffect = despawnEffect = Fx.hitYellowLaser;
}});
}};
}
@Override
public boolean alwaysUnlocked(){
return true;
}
@Override
public void update(Playerc player){
if(player.timer.get(Playerc.timerAbility, healReload)){
if(indexer.eachBlock(player, healRange, other -> other.entity.damaged(), other -> {
other.entity.heal(other.entity.maxHealth() * healPercent / 100f);
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
})){
Fx.healWave.at(player);
}
}
}
};
alpha = new UnitType("alpha-mech", false){
{
drillTier = -1;
speed = 0.5f;
boostSpeed = 0.95f;
itemCapacity = 15;
mass = 0.9f;
health = 150f;
buildSpeed = 0.9f;
weaponOffsetX = 1;
weaponOffsetY = -1;
engineColor = Pal.heal;
weapons.add(new Weapon("shockgun"){{
shake = 2f;
length = 0.5f;
reload = 70f;
alternate = true;
recoil = 4f;
width = 5f;
shootSound = Sounds.laser;
bullet = new LaserBulletType(){{
damage = 20f;
recoil = 1f;
sideAngle = 45f;
sideWidth = 1f;
sideLength = 70f;
colors = new Color[]{Pal.heal.cpy().a(0.4f), Pal.heal, Color.white};
}});
}};
}
@Override
public void update(Playerc player){
player.heal(Time.delta() * 0.09f);
}
};
delta = new UnitType("delta-mech", false){
{
drillPower = 1;
mineSpeed = 1.5f;
mass = 1.2f;
speed = 0.5f;
itemCapacity = 40;
boostSpeed = 0.95f;
buildSpeed = 1.2f;
engineColor = Color.valueOf("ffd37f");
health = 250f;
weaponOffsetX = 4f;
weapons.add(new Weapon("flamethrower"){{
length = 1.5f;
reload = 30f;
width = 4f;
alternate = true;
shots = 3;
inaccuracy = 40f;
shootSound = Sounds.spark;
bullet = new LightningBulletType(){{
damage = 5;
lightningLength = 10;
lightningColor = Pal.lightFlame;
}});
}};
}
};
tau = new UnitType("tau-mech", false){
float healRange = 60f;
float healAmount = 10f;
float healReload = 160f;
boolean wasHealed;
{
drillPower = 4;
mineSpeed = 3f;
itemCapacity = 70;
weaponOffsetY = -1;
weaponOffsetX = 1;
mass = 1.75f;
speed = 0.44f;
drag = 0.35f;
boostSpeed = 0.8f;
canHeal = true;
health = 200f;
buildSpeed = 1.6f;
engineColor = Pal.heal;
weapons.add(new Weapon("heal-blaster"){{
length = 1.5f;
reload = 24f;
alternate = false;
ejectEffect = Fx.none;
recoil = 2f;
bullet = Bullets.healBullet;
shootSound = Sounds.pew;
}};
}
@Override
public void update(Playerc player){
if(player.timer.get(Playerc.timerAbility, healReload)){
wasHealed = false;
Units.nearby(player.team(), player.x, player.y, healRange, unit -> {
if(unit.health < unit.maxHealth()){
Fx.heal.at(unit);
wasHealed = true;
}
unit.heal(healAmount);
});
if(wasHealed){
Fx.healWave.at(player);
}
}
}
};
omega = new UnitType("omega-mech", false){
protected TextureRegion armorRegion;
{
drillPower = 2;
mineSpeed = 1.5f;
itemCapacity = 80;
speed = 0.36f;
boostSpeed = 0.6f;
mass = 4f;
shake = 4f;
weaponOffsetX = 1;
weaponOffsetY = 0;
engineColor = Color.valueOf("feb380");
health = 350f;
buildSpeed = 1.5f;
weapons.add(new Weapon("swarmer"){{
length = 1.5f;
recoil = 4f;
reload = 38f;
shots = 4;
spacing = 8f;
inaccuracy = 8f;
alternate = true;
ejectEffect = Fx.none;
shake = 3f;
bullet = Bullets.missileSwarm;
shootSound = Sounds.shootBig;
}};
}
@Override
public float getRotationAlpha(Playerc player){
return 0.6f - player.shootHeat * 0.3f;
}
@Override
public float spreadX(Playerc player){
return player.shootHeat * 2f;
}
@Override
public void load(){
super.load();
armorRegion = Core.atlas.find(name + "-armor");
}
@Override
public void update(Playerc player){
float scl = 1f - player.shootHeat / 2f*Time.delta();
player.vel().scl(scl);
}
@Override
public float getExtraArmor(Playerc player){
return player.shootHeat * 30f;
}
@Override
public void draw(Playerc player){
if(player.shootHeat <= 0.01f) return;
Shaders.build.progress = player.shootHeat;
Shaders.build.region = armorRegion;
Shaders.build.time = Time.time() / 10f;
Shaders.build.color.set(Pal.accent).a = player.shootHeat;
Draw.shader(Shaders.build);
Draw.rect(armorRegion, player.x, player.y, player.rotation);
Draw.shader();
}
};
dart = new UnitType("dart-ship"){
float effectRange = 60f;
float effectReload = 60f * 5;
float effectDuration = 60f * 10f;
{
flying = true;
drillPower = 1;
mineSpeed = 2f;
speed = 0.5f;
drag = 0.09f;
health = 200f;
weaponOffsetX = -1;
weaponOffsetY = -1;
engineColor = Pal.lightTrail;
cellTrnsY = 1f;
buildSpeed = 1.1f;
weapons.add(new Weapon("blaster"){{
length = 1.5f;
reload = 15f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper;
}};
}
@Override
public void update(Playerc player){
super.update(player);
if(player.timer.get(Playerc.timerAbility, effectReload)){
Units.nearby(player.team(), player.x, player.y, effectRange, unit -> {
//unit.applyEffect(StatusEffects.overdrive, effectDuration);
});
indexer.eachBlock(player, effectRange, other -> other.entity.damaged(), other -> {
other.entity.applyBoost(1.5f, effectDuration);
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
});
Fx.overdriveWave.at(player);
}
}
};
javelin = new UnitType("javelin-ship"){
float minV = 3.6f;
float maxV = 6f;
TextureRegion shield;
{
flying = true;
drillPower = -1;
speed = 0.11f;
drag = 0.01f;
mass = 2f;
health = 170f;
engineColor = Color.valueOf("d3ddff");
cellTrnsY = 1f;
weapons.add(new Weapon("missiles"){{
length = 1.5f;
reload = 70f;
shots = 4;
inaccuracy = 2f;
alternate = true;
ejectEffect = Fx.none;
velocityRnd = 0.2f;
spacing = 1f;
bullet = Bullets.missileJavelin;
shootSound = Sounds.missile;
}};
}
@Override
public void load(){
super.load();
shield = Core.atlas.find(name + "-shield");
}
@Override
public float getRotationAlpha(Playerc player){
return 0.5f;
}
@Override
public void update(Playerc player){
float scl = scld(player);
if(Mathf.chance(Time.delta() * (0.15 * scl))){
Fx.hitLancer.at(Pal.lancerLaser, player.x, player.y);
Lightning.create(player.team(), Pal.lancerLaser, 10f * Vars.state.rules.playerDamageMultiplier,
player.x + player.vel().x, player.y + player.vel().y, player.rotation, 14);
}
}
@Override
public void draw(Playerc player){
float scl = scld(player);
if(scl < 0.01f) return;
Draw.color(Pal.lancerLaser);
Draw.alpha(scl / 2f);
Draw.blend(Blending.additive);
Draw.rect(shield, player.x + Mathf.range(scl / 2f), player.y + Mathf.range(scl / 2f), player.rotation - 90);
Draw.blend();
}
float scld(Playerc player){
return Mathf.clamp((player.vel().len() - minV) / (maxV - minV));
}
};
trident = new UnitType("trident-ship"){
{
flying = true;
drillPower = 2;
speed = 0.15f;
drag = 0.034f;
mass = 2.5f;
turnCursor = false;
health = 250f;
itemCapacity = 30;
engineColor = Color.valueOf("84f491");
cellTrnsY = 1f;
buildSpeed = 2.5f;
weapons.add(new Weapon("bomber"){{
length = 0f;
width = 2f;
reload = 25f;
shots = 2;
shotDelay = 1f;
shots = 8;
alternate = true;
ejectEffect = Fx.none;
velocityRnd = 1f;
inaccuracy = 20f;
ignoreRotation = true;
bullet = new BombBulletType(16f, 25f, "shell"){{
bulletWidth = 10f;
bulletHeight = 14f;
hitEffect = Fx.flakExplosion;
shootEffect = Fx.none;
smokeEffect = Fx.none;
shootSound = Sounds.artillery;
}});
}};
}
@Override
public boolean canShoot(Playerc player){
return player.vel().len() > 1.2f;
}
};
glaive = new UnitType("glaive-ship"){
{
flying = true;
drillPower = 4;
mineSpeed = 1.3f;
speed = 0.32f;
drag = 0.06f;
mass = 3f;
health = 240f;
itemCapacity = 60;
engineColor = Color.valueOf("feb380");
cellTrnsY = 1f;
buildSpeed = 1.2f;
weapons.add(new Weapon("bomber"){{
length = 1.5f;
reload = 13f;
alternate = true;
ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardGlaive;
shootSound = Sounds.shootSnap;
}};
}
};
starter = vanguard;*/
}
}

View File

@@ -0,0 +1,53 @@
package mindustry.content;
import arc.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.ctype.*;
import mindustry.type.*;
import static mindustry.Vars.world;
public class Weathers implements ContentList{
public static Weather
rain,
snow;
@Override
public void load(){
snow = new Weather("snow"){
Rand rand = new Rand();
@Override
public void draw(){
rand.setSeed(0);
float yspeed = 2f, xspeed = 0.25f;
float padding = 16f;
float size = 12f;
Core.camera.bounds(Tmp.r1);
Tmp.r1.grow(padding);
for(int i = 0; i < 100; i++){
float scl = rand.random(0.5f, 1f);
float scl2 = rand.random(0.5f, 1f);
float sscl = rand.random(0.2f, 1f);
float x = (rand.random(0f, world.unitWidth()) + Time.time() * xspeed * scl2);
float y = (rand.random(0f, world.unitHeight()) - Time.time() * yspeed * scl);
x += Mathf.sin(y, rand.random(30f, 80f), rand.random(1f, 7f));
x -= Tmp.r1.x;
y -= Tmp.r1.y;
x = Mathf.mod(x, Tmp.r1.width);
y = Mathf.mod(y, Tmp.r1.height);
x += Tmp.r1.x;
y += Tmp.r1.y;
Draw.rect("circle-shadow", x, y, size * sscl, size * sscl);
}
//TODO
}
};
}
}

View File

@@ -1,19 +1,17 @@
package mindustry.content;
import mindustry.ctype.ContentList;
import mindustry.game.*;
import mindustry.ctype.*;
import mindustry.game.Objectives.*;
import mindustry.maps.generators.*;
import mindustry.maps.generators.MapGenerator.*;
import mindustry.maps.zonegen.*;
import mindustry.type.*;
import static arc.struct.Array.with;
import static mindustry.content.Items.*;
import static mindustry.content.Planets.starter;
import static mindustry.type.ItemStack.list;
public class Zones implements ContentList{
public static Zone
public static SectorPreset
groundZero, desertWastes,
craters, frozenForest, ruinousShores, stainedMountains, tarFields, fungalPass,
saltFlats, overgrowth, impact0078, crags,
@@ -22,7 +20,7 @@ public class Zones implements ContentList{
@Override
public void load(){
groundZero = new Zone("groundZero", new MapGenerator("groundZero", 1)){{
groundZero = new SectorPreset("groundZero", starter, new FileMapGenerator("groundZero")){{
baseLaunchCost = list(copper, -60);
startingItems = list(copper, 60);
alwaysUnlocked = true;
@@ -31,7 +29,9 @@ public class Zones implements ContentList{
resources = with(copper, scrap, lead);
}};
desertWastes = new Zone("desertWastes", new DesertWastesGenerator(260, 260)){{
//TODO remove
/*
desertWastes = new Zone("desertWastes", starter, new FileMapGenerator("groundZero")){{
startingItems = list(copper, 120);
conditionWave = 20;
launchPeriod = 10;
@@ -80,9 +80,9 @@ public class Zones implements ContentList{
new ZoneWave(groundZero, 20),
new Unlock(Blocks.combustionGenerator)
);
}};
}};*/
saltFlats = new Zone("saltFlats", new MapGenerator("saltFlats")){{
saltFlats = new SectorPreset("saltFlats", starter, new FileMapGenerator("saltFlats")){{
startingItems = list(copper, 200, Items.silicon, 200, lead, 200);
loadout = Loadouts.basicFoundation;
conditionWave = 10;
@@ -91,15 +91,14 @@ public class Zones implements ContentList{
resources = with(copper, scrap, lead, coal, sand, titanium);
requirements = with(
new ZoneWave(desertWastes, 60),
new Unlock(Blocks.daggerFactory),
new Unlock(Blocks.draugFactory),
//new Unlock(Blocks.daggerFactory),
//new Unlock(Blocks.draugFactory),
new Unlock(Blocks.door),
new Unlock(Blocks.waterExtractor)
);
}};
frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest", 1)
.decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.02))){{
frozenForest = new SectorPreset("frozenForest", starter, new FileMapGenerator("frozenForest")){{
loadout = Loadouts.basicFoundation;
startingItems = list(copper, 250);
conditionWave = 10;
@@ -111,7 +110,7 @@ public class Zones implements ContentList{
);
}};
craters = new Zone("craters", new MapGenerator("craters", 1).decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.004))){{
craters = new SectorPreset("craters", starter, new FileMapGenerator("craters")){{
startingItems = list(copper, 100);
conditionWave = 10;
resources = with(copper, lead, coal, sand, scrap);
@@ -122,7 +121,7 @@ public class Zones implements ContentList{
);
}};
ruinousShores = new Zone("ruinousShores", new MapGenerator("ruinousShores", 1)){{
ruinousShores = new SectorPreset("ruinousShores", starter, new FileMapGenerator("ruinousShores")){{
loadout = Loadouts.basicFoundation;
startingItems = list(copper, 140, lead, 50);
conditionWave = 20;
@@ -138,8 +137,7 @@ public class Zones implements ContentList{
);
}};
stainedMountains = new Zone("stainedMountains", new MapGenerator("stainedMountains", 2)
.decor(new Decoration(Blocks.shale, Blocks.shaleBoulder, 0.02))){{
stainedMountains = new SectorPreset("stainedMountains", starter, new FileMapGenerator("stainedMountains")){{
loadout = Loadouts.basicFoundation;
startingItems = list(copper, 200, lead, 50);
conditionWave = 10;
@@ -153,20 +151,20 @@ public class Zones implements ContentList{
);
}};
fungalPass = new Zone("fungalPass", new MapGenerator("fungalPass")){{
fungalPass = new SectorPreset("fungalPass", starter, new FileMapGenerator("fungalPass")){{
startingItems = list(copper, 250, lead, 250, Items.metaglass, 100, Items.graphite, 100);
resources = with(copper, lead, coal, titanium, sand);
configureObjective = new Launched(this);
requirements = with(
new ZoneWave(stainedMountains, 15),
new Unlock(Blocks.daggerFactory),
new Unlock(Blocks.crawlerFactory),
//new Unlock(Blocks.daggerFactory),
//new Unlock(Blocks.crawlerFactory),
new Unlock(Blocks.door),
new Unlock(Blocks.siliconSmelter)
);
}};
overgrowth = new Zone("overgrowth", new MapGenerator("overgrowth")){{
overgrowth = new SectorPreset("overgrowth", starter, new FileMapGenerator("overgrowth")){{
startingItems = list(copper, 1500, lead, 1000, Items.silicon, 500, Items.metaglass, 250);
conditionWave = 12;
launchPeriod = 4;
@@ -177,14 +175,13 @@ public class Zones implements ContentList{
new ZoneWave(craters, 40),
new Launched(fungalPass),
new Unlock(Blocks.cultivator),
new Unlock(Blocks.sporePress),
new Unlock(Blocks.titanFactory),
new Unlock(Blocks.wraithFactory)
new Unlock(Blocks.sporePress)
//new Unlock(Blocks.titanFactory),
//new Unlock(Blocks.wraithFactory)
);
}};
tarFields = new Zone("tarFields", new MapGenerator("tarFields")
.decor(new Decoration(Blocks.shale, Blocks.shaleBoulder, 0.02))){{
tarFields = new SectorPreset("tarFields", starter, new FileMapGenerator("tarFields")){{
loadout = Loadouts.basicFoundation;
startingItems = list(copper, 250, lead, 100);
conditionWave = 15;
@@ -198,7 +195,7 @@ public class Zones implements ContentList{
);
}};
desolateRift = new Zone("desolateRift", new MapGenerator("desolateRift")){{
desolateRift = new SectorPreset("desolateRift", starter, new FileMapGenerator("desolateRift")){{
loadout = Loadouts.basicNucleus;
startingItems = list(copper, 1000, lead, 1000, Items.graphite, 250, titanium, 250, Items.silicon, 250);
conditionWave = 3;
@@ -223,8 +220,7 @@ public class Zones implements ContentList{
resources = Array.with(Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand};
}};*/
nuclearComplex = new Zone("nuclearComplex", new MapGenerator("nuclearProductionComplex", 1)
.decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.01))){{
nuclearComplex = new SectorPreset("nuclearComplex", starter, new FileMapGenerator("nuclearProductionComplex")){{
loadout = Loadouts.basicNucleus;
startingItems = list(copper, 1250, lead, 1500, Items.silicon, 400, Items.metaglass, 250);
conditionWave = 30;