Re-implemented some units / Bugfixes
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 512 B |
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 614 B |
Before Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 500 B |
Before Width: | Height: | Size: 527 B |
Before Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 724 B |
Before Width: | Height: | Size: 735 KiB After Width: | Height: | Size: 740 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 837 KiB After Width: | Height: | Size: 836 KiB |
@ -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;
|
||||
|
@ -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){{
|
||||
|
@ -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)
|
||||
);
|
||||
|
@ -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){
|
||||
|
@ -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;
|
||||
|
@ -175,12 +175,6 @@ public class Control implements ApplicationListener, Loadable{
|
||||
Effects.shake(5f, 5f, core);
|
||||
});
|
||||
});
|
||||
|
||||
Events.on(UnitDestroyEvent.class, e -> {
|
||||
if(state.isCampaign()){
|
||||
data.unlockContent(e.unit.type());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,6 +30,7 @@ public class GameState{
|
||||
/** Current game state. */
|
||||
private State state = State.menu;
|
||||
|
||||
//TODO optimize
|
||||
public Unitc boss(){
|
||||
return Groups.unit.find(u -> u.isBoss() && u.team() == rules.waveTeam);
|
||||
}
|
||||
|
@ -111,6 +111,15 @@ public class Logic implements ApplicationListener{
|
||||
universe.runTurn();
|
||||
}
|
||||
});
|
||||
|
||||
//disable new waves after the boss spawns
|
||||
Events.on(WaveEvent.class, e -> {
|
||||
//only works for preset sectors so far
|
||||
if(state.isCampaign() && state.boss() != null && state.rules.sector.preset != null){
|
||||
state.rules.waitEnemies = true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/** Handles the event of content being used by either the player or some block. */
|
||||
@ -123,7 +132,8 @@ public class Logic implements ApplicationListener{
|
||||
/** Adds starting items, resets wave time, and sets state to playing. */
|
||||
public void play(){
|
||||
state.set(State.playing);
|
||||
state.wavetime = state.rules.waveSpacing * 2; //grace period of 2x wave time before game starts
|
||||
//grace period of 2x wave time before game starts
|
||||
state.wavetime = state.rules.waveSpacing * 2;
|
||||
Events.fire(new PlayEvent());
|
||||
|
||||
//add starting items
|
||||
@ -160,7 +170,7 @@ public class Logic implements ApplicationListener{
|
||||
Events.fire(new WaveEvent());
|
||||
}
|
||||
|
||||
private void checkGameOver(){
|
||||
private void checkGameState(){
|
||||
//campaign maps do not have a 'win' state!
|
||||
if(state.isCampaign()){
|
||||
//gameover only when cores are dead
|
||||
@ -174,6 +184,22 @@ public class Logic implements ApplicationListener{
|
||||
//if yes, waves get disabled
|
||||
state.rules.waves = false;
|
||||
}
|
||||
|
||||
//check if there is a boss present
|
||||
Unitc boss = state.boss();
|
||||
//if this was a boss wave and there is no boss anymore, then it's a victory
|
||||
if(state.rules.sector.preset != null && boss == null && state.rules.waves && state.rules.waitEnemies){
|
||||
//the sector has been conquered - waves get disabled
|
||||
state.rules.waves = false;
|
||||
|
||||
//fire capture event
|
||||
Events.fire(new SectorCaptureEvent(state.rules.sector));
|
||||
|
||||
//save, just in case
|
||||
if(!headless){
|
||||
control.saves.saveSector(state.rules.sector);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(!state.rules.attackMode && state.teams.playerCores().size == 0 && !state.gameOver){
|
||||
state.gameOver = true;
|
||||
@ -233,7 +259,7 @@ public class Logic implements ApplicationListener{
|
||||
|
||||
Sector sector = state.rules.sector;
|
||||
|
||||
//TODO what about containers, do they get launched too?
|
||||
//TODO containers must be launched too
|
||||
Time.runTask(30f, () -> {
|
||||
for(Tilec entity : state.teams.playerCores()){
|
||||
for(Item item : content.items()){
|
||||
@ -252,7 +278,7 @@ public class Logic implements ApplicationListener{
|
||||
//run a turn, since launching takes up a turn
|
||||
universe.runTurn();
|
||||
//TODO needs extra damage to prevent player from landing immediately afterwards
|
||||
sector.setTurnsPassed(sector.getTurnsPassed() + 1);
|
||||
sector.setTurnsPassed(sector.getTurnsPassed() + 3);
|
||||
|
||||
Events.fire(new LaunchEvent());
|
||||
//manually fire game over event now
|
||||
@ -291,7 +317,7 @@ public class Logic implements ApplicationListener{
|
||||
}
|
||||
|
||||
if(state.rules.waves && state.rules.waveTimer && !state.gameOver){
|
||||
if(!state.rules.waitForWaveToEnd || state.enemies == 0){
|
||||
if(!state.rules.waitEnemies || state.enemies == 0){
|
||||
state.wavetime = Math.max(state.wavetime - Time.delta(), 0);
|
||||
}
|
||||
}
|
||||
@ -304,7 +330,7 @@ public class Logic implements ApplicationListener{
|
||||
}
|
||||
|
||||
if(!net.client() && !world.isInvalidMap() && !state.isEditor() && state.rules.canGameOver){
|
||||
checkGameOver();
|
||||
checkGameState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -222,6 +222,9 @@ public class World{
|
||||
}
|
||||
});
|
||||
|
||||
//reset rules
|
||||
setSectorRules(sector);
|
||||
|
||||
if(state.rules.defaultTeam.core() != null){
|
||||
sector.setSpawnPosition(state.rules.defaultTeam.core().pos());
|
||||
}
|
||||
@ -231,6 +234,8 @@ public class World{
|
||||
state.map = new Map(StringMap.of("name", sector.planet.localizedName + "; Sector " + sector.id));
|
||||
state.rules.sector = sector;
|
||||
|
||||
state.rules.weather.clear();
|
||||
|
||||
if(sector.is(SectorAttribute.rainy)){
|
||||
state.rules.weather.add(new WeatherEntry(Weathers.rain));
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
||||
}}).width(390f).growY();
|
||||
|
||||
cont.table(Tex.clear, m -> {
|
||||
m.add("$waves.preview").color(Color.lightGray).growX().center().get().setAlignment(Align.center, Align.center);
|
||||
m.add("$waves.preview").color(Color.lightGray).wrap().growX().center().get().setAlignment(Align.center, Align.center);
|
||||
m.row();
|
||||
m.button("-", () -> {
|
||||
}).update(t -> {
|
||||
|
@ -16,6 +16,6 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc, Unitc, Legsc, Elevati
|
||||
public void update(){
|
||||
float len = vel().len();
|
||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||
walkTime += Time.delta()*len/1f;
|
||||
walkTime += Time.delta()*len*2f;
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
|
||||
float rotation = this.rotation - 90;
|
||||
|
||||
//shoot if applicable
|
||||
if(mount.reload <= 0.0001f && Angles.within(weapon.rotate ? mount.rotation : this.rotation, mount.targetRotation, 1.5f)){
|
||||
if(mount.reload <= 0.0001f && Angles.within(weapon.rotate ? mount.rotation : this.rotation, mount.targetRotation, mount.weapon.shootCone)){
|
||||
for(int i : (weapon.mirror && !weapon.alternate ? Mathf.signs : Mathf.one)){
|
||||
i *= Mathf.sign(weapon.flipped) * (mount.weapon.mirror ? Mathf.sign(mount.side) : 1);
|
||||
|
||||
|
@ -110,6 +110,15 @@ public class EventType{
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when a sector is conquered, e.g. a boss or base is defeated. */
|
||||
public static class SectorCaptureEvent{
|
||||
public final Sector sector;
|
||||
|
||||
public SectorCaptureEvent(Sector sector){
|
||||
this.sector = sector;
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when the player withdraws items from a block. */
|
||||
public static class WithdrawEvent{
|
||||
public final Tilec tile;
|
||||
|
@ -51,15 +51,15 @@ public class Objectives{
|
||||
}
|
||||
}
|
||||
|
||||
public static class ZoneWave extends ZoneObjective{
|
||||
public static class SectorWave extends SectorObjective{
|
||||
public int wave;
|
||||
|
||||
public ZoneWave(SectorPreset zone, int wave){
|
||||
public SectorWave(SectorPreset zone, int wave){
|
||||
this.preset = zone;
|
||||
this.wave = wave;
|
||||
}
|
||||
|
||||
protected ZoneWave(){}
|
||||
protected SectorWave(){}
|
||||
|
||||
@Override
|
||||
public boolean complete(){
|
||||
@ -72,7 +72,7 @@ public class Objectives{
|
||||
}
|
||||
}
|
||||
|
||||
public static class Launched extends ZoneObjective{
|
||||
public static class Launched extends SectorObjective{
|
||||
|
||||
public Launched(SectorPreset zone){
|
||||
this.preset = zone;
|
||||
@ -91,7 +91,7 @@ public class Objectives{
|
||||
}
|
||||
}
|
||||
|
||||
public abstract static class ZoneObjective implements Objective{
|
||||
public abstract static class SectorObjective implements Objective{
|
||||
public @NonNull SectorPreset preset;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ public class Objectives{
|
||||
}
|
||||
|
||||
default SectorPreset zone(){
|
||||
return this instanceof ZoneObjective ? ((ZoneObjective)this).preset : null;
|
||||
return this instanceof SectorObjective ? ((SectorObjective)this).preset : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
package mindustry.game;
|
||||
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import arc.struct.*;
|
||||
import arc.graphics.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.io.*;
|
||||
import mindustry.type.*;
|
||||
@ -67,8 +66,8 @@ public class Rules{
|
||||
public boolean limitedRespawns = false;
|
||||
/** How many times player can respawn during one wave. */
|
||||
public int respawns = 5;
|
||||
/** Hold wave timer until all enemies are destroyed. */
|
||||
public boolean waitForWaveToEnd = false;
|
||||
/** Whether to pause the wave timer until all enemies are destroyed. */
|
||||
public boolean waitEnemies = false;
|
||||
/** Determinates if gamemode is attack mode */
|
||||
public boolean attackMode = false;
|
||||
/** Whether this is the editor gamemode. */
|
||||
|
@ -60,9 +60,9 @@ public class FileMapGenerator implements WorldGenerator{
|
||||
}
|
||||
|
||||
//add random decoration
|
||||
if(Mathf.chance(0.015) && !tile.floor().isLiquid && tile.block() == Blocks.air){
|
||||
tile.setBlock(tile.floor().decoration);
|
||||
}
|
||||
//if(Mathf.chance(0.015) && !tile.floor().isLiquid && tile.block() == Blocks.air){
|
||||
// tile.setBlock(tile.floor().decoration);
|
||||
//}
|
||||
}
|
||||
|
||||
if(!anyCores){
|
||||
|
@ -87,7 +87,7 @@ public class ContentParser{
|
||||
return sound;
|
||||
});
|
||||
put(Objectives.Objective.class, (type, data) -> {
|
||||
Class<? extends Objectives.Objective> oc = data.has("type") ? resolve(data.getString("type"), "mindustry.game.Objectives") : ZoneWave.class;
|
||||
Class<? extends Objectives.Objective> oc = data.has("type") ? resolve(data.getString("type"), "mindustry.game.Objectives") : SectorWave.class;
|
||||
data.remove("type");
|
||||
Objectives.Objective obj = make(oc);
|
||||
readFields(obj, data);
|
||||
|
@ -18,7 +18,7 @@ public class SectorPreset extends UnlockableContent{
|
||||
public @NonNull FileMapGenerator generator;
|
||||
public @NonNull Planet planet;
|
||||
public @NonNull Sector sector;
|
||||
public Array<Objectives.Objective> requirements = new Array<>();
|
||||
public Array<Objective> requirements = new Array<>();
|
||||
|
||||
public Cons<Rules> rules = rules -> {};
|
||||
public boolean alwaysUnlocked;
|
||||
@ -91,13 +91,13 @@ public class SectorPreset extends UnlockableContent{
|
||||
}
|
||||
|
||||
public void updateObjectives(Runnable closure){
|
||||
Array<ZoneObjective> incomplete = content.zones()
|
||||
Array<SectorObjective> incomplete = content.zones()
|
||||
.flatMap(z -> z.requirements)
|
||||
.select(o -> o.zone() == this && !o.complete())
|
||||
.as(ZoneObjective.class);
|
||||
.as(SectorObjective.class);
|
||||
|
||||
closure.run();
|
||||
for(ZoneObjective objective : incomplete){
|
||||
for(SectorObjective objective : incomplete){
|
||||
if(objective.complete()){
|
||||
Events.fire(new ZoneRequireCompleteEvent(objective.preset, content.zones().find(z -> z.requirements.contains(objective)), objective));
|
||||
}
|
||||
|
@ -48,6 +48,8 @@ public class Weapon{
|
||||
public float lengthRand = 0f;
|
||||
/** delay in ticks between shots */
|
||||
public float shotDelay = 0;
|
||||
/** The half-radius of the cone in which shooting will start. */
|
||||
public float shootCone = 1.5f;
|
||||
/** whether shooter rotation is ignored when shooting. */
|
||||
public boolean ignoreRotation = false;
|
||||
/** if turnCursor is false for a mech, how far away will the weapon target. */
|
||||
@ -66,7 +68,7 @@ public class Weapon{
|
||||
}
|
||||
|
||||
public void load(){
|
||||
region = Core.atlas.find(name + "-equip", Core.atlas.find(name, Core.atlas.find("clear")));
|
||||
region = Core.atlas.find(name, Core.atlas.find("clear"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class CustomRulesDialog extends FloatingDialog{
|
||||
title("$rules.title.waves");
|
||||
check("$rules.waves", b -> rules.waves = b, () -> rules.waves);
|
||||
check("$rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer);
|
||||
check("$rules.waitForWaveToEnd", b -> rules.waitForWaveToEnd = b, () -> rules.waitForWaveToEnd);
|
||||
check("$rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies);
|
||||
number("$rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> true);
|
||||
number("$rules.dropzoneradius", false, f -> rules.dropZoneRadius = f * tilesize, () -> rules.dropZoneRadius / tilesize, () -> true);
|
||||
|
||||
|
@ -283,13 +283,14 @@ public class PlanetDialog extends FloatingDialog{
|
||||
|
||||
if(selectAlpha > 0.01f){
|
||||
if(sec.unlocked()){
|
||||
float stroke = 0.026f;
|
||||
if(sec.hasBase()){
|
||||
drawSelection(sec, Tmp.c1.set(Team.sharded.color).mul(0.8f).a(selectAlpha), stroke, -0.005f);
|
||||
}else if(sec.preset != null){
|
||||
drawSelection(sec, Tmp.c1.set(Team.derelict.color).mul(0.8f).a(selectAlpha), stroke, -0.005f);
|
||||
}else if(sec.hasEnemyBase()){
|
||||
drawSelection(sec, Tmp.c1.set(Team.crux.color).mul(0.8f).a(selectAlpha), stroke, -0.005f);
|
||||
Color color =
|
||||
sec.hasBase() ? Team.sharded.color :
|
||||
sec.preset != null ? Team.derelict.color :
|
||||
sec.hasEnemyBase() ? Team.crux.color :
|
||||
null;
|
||||
|
||||
if(color != null){
|
||||
drawSelection(sec, Tmp.c1.set(color).mul(0.8f).a(selectAlpha), 0.026f, -0.001f);
|
||||
}
|
||||
}else{
|
||||
draw(sec, Tmp.c1.set(shadowColor).mul(1, 1, 1, selectAlpha), -0.001f);
|
||||
@ -312,12 +313,9 @@ public class PlanetDialog extends FloatingDialog{
|
||||
//render arcs
|
||||
if(selected != null && selected.preset != null){
|
||||
for(Objective o : selected.preset.requirements){
|
||||
if(o instanceof ZoneObjective){
|
||||
SectorPreset preset = ((ZoneObjective)o).preset;
|
||||
|
||||
if(true){
|
||||
drawArc(planet, selected.tile.v, preset.sector.tile.v);
|
||||
}
|
||||
if(o instanceof SectorObjective){
|
||||
SectorPreset preset = ((SectorObjective)o).preset;
|
||||
drawArc(planet, selected.tile.v, preset.sector.tile.v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,11 @@ public class HudFragment extends Fragment{
|
||||
showToast("New turn: [accent]" + universe.getTurn() + "[]" + (attacked > 0 ? "\n[scarlet]" + Iconc.warning + " " + attacked + " sectors attacked!": ""));
|
||||
});
|
||||
|
||||
//TODO details and stuff
|
||||
Events.on(SectorCaptureEvent.class, e ->{
|
||||
showToast("Sector[accent] captured[]!");
|
||||
});
|
||||
|
||||
//TODO tear this all down
|
||||
//menu at top left
|
||||
parent.fill(cont -> {
|
||||
@ -625,7 +630,7 @@ public class HudFragment extends Fragment{
|
||||
}
|
||||
|
||||
if(state.rules.waveTimer){
|
||||
builder.append((state.rules.waitForWaveToEnd && state.enemies > 0 ? Core.bundle.get("wave.waveInProgress") : ( waitingf.get((int)(state.wavetime/60)))));
|
||||
builder.append((state.rules.waitEnemies && state.enemies > 0 ? Core.bundle.get("wave.waveInProgress") : ( waitingf.get((int)(state.wavetime/60)))));
|
||||
}else if(state.enemies == 0){
|
||||
builder.append(Core.bundle.get("waiting"));
|
||||
}
|
||||
|
@ -246,9 +246,9 @@ public class Generators{
|
||||
Image image = ImagePacker.get(type.region);
|
||||
|
||||
if(type.constructor.get() instanceof Legsc){
|
||||
image.draw(type.baseRegion);
|
||||
image.draw(type.legRegion);
|
||||
image.draw(type.legRegion, true, false);
|
||||
image.drawCenter(type.baseRegion);
|
||||
image.drawCenter(type.legRegion);
|
||||
image.drawCenter(type.legRegion, true, false);
|
||||
}
|
||||
image.draw(type.region);
|
||||
|
||||
|
@ -68,6 +68,7 @@ class Image{
|
||||
graphics.fillRect(x, y, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/** Draws a region at the top left corner. */
|
||||
void draw(TextureRegion region){
|
||||
draw(region, 0, 0, false, false);
|
||||
|