Re-implemented some units / Bugfixes

This commit is contained in:
Anuken
2020-05-19 14:58:04 -04:00
parent 8c6e8d8bcb
commit 77c0163a79
39 changed files with 924 additions and 834 deletions

View File

@@ -1233,7 +1233,7 @@ public class Blocks implements ContentList{
waterExtractor = new SolidPump("water-extractor"){{
requirements(Category.production, ItemStack.with(Items.copper, 25, Items.graphite, 25, Items.lead, 20));
result = Liquids.water;
pumpAmount = 0.13f;
pumpAmount = 0.11f;
size = 2;
liquidCapacity = 30f;
rotateSpeed = 1.4f;

View File

@@ -563,6 +563,7 @@ public class Bullets implements ContentList{
damage = 2;
speed = 2.1f;
drag = 0.02f;
shootEffect = Fx.shootSmall;
}};
oilShot = new LiquidBulletType(Liquids.oil){{

View File

@@ -33,7 +33,7 @@ public class SectorPresets implements ContentList{
conditionWave = 10;
launchPeriod = 5;
requirements = with(
new ZoneWave(groundZero, 60),
new SectorWave(groundZero, 60),
//new Unlock(Blocks.daggerFactory),
//new Unlock(Blocks.draugFactory),
new Unlock(Blocks.door),
@@ -46,7 +46,7 @@ public class SectorPresets implements ContentList{
startingItems = list(copper, 250);
conditionWave = 10;
requirements = with(
new ZoneWave(groundZero, 10),
new SectorWave(groundZero, 10),
new Unlock(Blocks.junction),
new Unlock(Blocks.router)
);
@@ -56,7 +56,7 @@ public class SectorPresets implements ContentList{
startingItems = list(copper, 100);
conditionWave = 10;
requirements = with(
new ZoneWave(frozenForest, 10),
new SectorWave(frozenForest, 10),
new Unlock(Blocks.mender),
new Unlock(Blocks.combustionGenerator)
);
@@ -68,8 +68,8 @@ public class SectorPresets implements ContentList{
conditionWave = 20;
launchPeriod = 20;
requirements = with(
new ZoneWave(groundZero, 20),
new ZoneWave(craters, 15),
new SectorWave(groundZero, 20),
new SectorWave(craters, 15),
new Unlock(Blocks.graphitePress),
new Unlock(Blocks.combustionGenerator),
new Unlock(Blocks.kiln),
@@ -83,7 +83,7 @@ public class SectorPresets implements ContentList{
conditionWave = 10;
launchPeriod = 10;
requirements = with(
new ZoneWave(frozenForest, 15),
new SectorWave(frozenForest, 15),
new Unlock(Blocks.pneumaticDrill),
new Unlock(Blocks.powerNode),
new Unlock(Blocks.turbineGenerator)
@@ -93,7 +93,7 @@ public class SectorPresets implements ContentList{
fungalPass = new SectorPreset("fungalPass", starter, 21){{
startingItems = list(copper, 250, lead, 250, Items.metaglass, 100, Items.graphite, 100);
requirements = with(
new ZoneWave(stainedMountains, 15),
new SectorWave(stainedMountains, 15),
//new Unlock(Blocks.daggerFactory),
//new Unlock(Blocks.crawlerFactory),
new Unlock(Blocks.door),
@@ -107,7 +107,7 @@ public class SectorPresets implements ContentList{
launchPeriod = 4;
loadout = Loadouts.basicNucleus;
requirements = with(
new ZoneWave(craters, 40),
new SectorWave(craters, 40),
new Launched(fungalPass),
new Unlock(Blocks.cultivator),
new Unlock(Blocks.sporePress)
@@ -122,7 +122,7 @@ public class SectorPresets implements ContentList{
conditionWave = 15;
launchPeriod = 10;
requirements = with(
new ZoneWave(ruinousShores, 20),
new SectorWave(ruinousShores, 20),
new Unlock(Blocks.coalCentrifuge),
new Unlock(Blocks.conduit),
new Unlock(Blocks.wave)
@@ -135,7 +135,7 @@ public class SectorPresets implements ContentList{
conditionWave = 3;
launchPeriod = 2;
requirements = with(
new ZoneWave(tarFields, 20),
new SectorWave(tarFields, 20),
new Unlock(Blocks.thermalGenerator),
new Unlock(Blocks.thoriumReactor)
);

View File

@@ -3,6 +3,7 @@ package mindustry.content;
import arc.math.*;
import arc.struct.*;
import mindustry.ctype.*;
import mindustry.game.Objectives.*;
import mindustry.type.*;
import mindustry.world.*;
@@ -336,7 +337,7 @@ public class TechTree implements ContentList{
requirements = new ItemStack[block.requirements.length];
for(int i = 0; i < requirements.length; i++){
requirements[i] = new ItemStack(block.requirements[i].item, 40 + Mathf.round(Mathf.pow(block.requirements[i].amount, 1.25f) * 6, 10));
requirements[i] = new ItemStack(block.requirements[i].item, 40 + Mathf.round(Mathf.pow(block.requirements[i].amount, 1.25f) * 20, 10));
}
}else{
requirements = ItemStack.empty;
@@ -355,11 +356,20 @@ public class TechTree implements ContentList{
}
public static class TechNode{
static TechNode context;
private static TechNode context;
/** Requirement node. */
public TechNode parent;
public final UnlockableContent content;
public final ItemStack[] requirements;
/** Content to be researched. */
public UnlockableContent content;
/** Item requirements for this content. */
public ItemStack[] requirements;
/** Extra objectives needed to research this. TODO implement */
public Objective[] objectives = {};
/** Turns required to research this content. */
//TODO keep track of turns that have been used so far
public int turns = 1;
/** Nodes that depend on this node. */
public final Array<TechNode> children = new Array<>();
TechNode(TechNode ccontext, UnlockableContent content, ItemStack[] requirements, Runnable children){

View File

@@ -3,6 +3,7 @@ package mindustry.content;
import arc.struct.*;
import mindustry.annotations.Annotations.*;
import mindustry.ctype.*;
import mindustry.entities.bullet.*;
import mindustry.gen.*;
import mindustry.type.*;
@@ -63,6 +64,72 @@ public class UnitTypes implements ContentList{
}};
crawler = new UnitType("crawler"){{
speed = 0.65f;
drag = 0.3f;
hitsize = 8f;
mass = 1.75f;
health = 120;
weapons.add(new Weapon(){{
reload = 12f;
shootCone = 180f;
ejectEffect = Fx.none;
shootSound = Sounds.explosion;
bullet = new BombBulletType(2f, 3f, "clear"){{
hitEffect = Fx.pulverize;
lifetime = 30f;
speed = 1.1f;
splashDamageRadius = 55f;
instantDisappear = true;
splashDamage = 30f;
killShooter = true;
}};
}});
}};
fortress = new UnitType("fortress"){{
speed = 0.38f;
speed = 0.15f;
drag = 0.4f;
mass = 5f;
hitsize = 10f;
rotateSpeed = 3f;
targetAir = false;
health = 750;
weapons.add(new Weapon("artillery"){{
y = 1f;
x = 9f;
reload = 60f;
alternate = true;
recoil = 4f;
shake = 2f;
ejectEffect = Fx.shellEjectMedium;
bullet = Bullets.artilleryUnit;
shootSound = Sounds.artillery;
}});
}};
eruptor = new UnitType("eruptor"){{
speed = 0.4f;
drag = 0.4f;
mass = 5f;
hitsize = 9f;
rotateSpeed = 3f;
targetAir = false;
health = 600;
immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting);
weapons.add(new Weapon("eruption"){{
shootY = 3f;
reload = 10f;
alternate = true;
ejectEffect = Fx.none;
bullet = Bullets.eruptorShot;
recoil = 1f;
x = 7f;
shootSound = Sounds.flame;
}});
}};
wraith = new UnitType("wraith"){{
speed = 3f;
accel = 0.08f;
@@ -152,6 +219,7 @@ public class UnitTypes implements ContentList{
recoil = 2f;
bullet = Bullets.healBulletBig;
shootSound = Sounds.pew;
}});
}};
@@ -171,49 +239,6 @@ public class UnitTypes implements ContentList{
}};
/*
crawler = new UnitType("crawler", GroundUnit::new){{
maxVelocity = 1.27f;
speed = 0.285f;
drag = 0.4f;
hitsize = 8f;
mass = 1.75f;
health = 120;
weapons.add(new Weapon(){{
reload = 12f;
ejectEffect = Fx.none;
shootSound = Sounds.explosion;
bullet = new BombBulletType(2f, 3f, "clear"){{
hitEffect = Fx.pulverize;
lifetime = 30f;
speed = 1.1f;
splashDamageRadius = 55f;
instantDisappear = true;
splashDamage = 30f;
killShooter = true;
}};
}});
}};
titan = new UnitType("titan", GroundUnit::new){{
maxVelocity = 0.8f;
speed = 0.22f;
drag = 0.4f;
mass = 3.5f;
hitsize = 9f;
range = 10f;
rotatespeed = 0.1f;
health = 460;
immunities.add(StatusEffects.burning);
weapons.add(new Weapon("flamethrower"){{
shootSound = Sounds.flame;
length = 1f;
reload = 14f;
alternate = true;
recoil = 1f;
ejectEffect = Fx.none;
bullet = Bullets.basicFlame;
}});
}};
fortress = new UnitType("fortress", GroundUnit::new){{
maxVelocity = 0.78f;