Sector simplification
This commit is contained in:
@@ -291,6 +291,8 @@ waiting = [lightgray]Waiting...
|
|||||||
waiting.players = Waiting for players...
|
waiting.players = Waiting for players...
|
||||||
wave.enemies = [lightgray]{0} Enemies Remaining
|
wave.enemies = [lightgray]{0} Enemies Remaining
|
||||||
wave.enemy = [lightgray]{0} Enemy Remaining
|
wave.enemy = [lightgray]{0} Enemy Remaining
|
||||||
|
wave.guardianwarn = Guardian approaching in [accent]{0}[] waves.
|
||||||
|
wave.guardianwarn.one = Guardian approaching in [accent]{0}[] wave.
|
||||||
loadimage = Load Image
|
loadimage = Load Image
|
||||||
saveimage = Save Image
|
saveimage = Save Image
|
||||||
unknown = Unknown
|
unknown = Unknown
|
||||||
|
|||||||
Binary file not shown.
@@ -85,7 +85,7 @@ public class Vars implements Loadable{
|
|||||||
/** range for moving items for logic units */
|
/** range for moving items for logic units */
|
||||||
public static final float logicItemTransferRange = 45f;
|
public static final float logicItemTransferRange = 45f;
|
||||||
/** duration of time between turns in ticks */
|
/** duration of time between turns in ticks */
|
||||||
public static final float turnDuration = 20 * Time.toMinutes;
|
public static final float turnDuration = 2 * Time.toMinutes;
|
||||||
/** turns needed to destroy a sector completely */
|
/** turns needed to destroy a sector completely */
|
||||||
public static final float sectorDestructionTurns = 2f;
|
public static final float sectorDestructionTurns = 2f;
|
||||||
/** min armor fraction damage; e.g. 0.05 = at least 5% damage */
|
/** min armor fraction damage; e.g. 0.05 = at least 5% damage */
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class StatusEffects implements ContentList{
|
|||||||
|
|
||||||
freezing = new StatusEffect("freezing"){{
|
freezing = new StatusEffect("freezing"){{
|
||||||
speedMultiplier = 0.6f;
|
speedMultiplier = 0.6f;
|
||||||
armorMultiplier = 0.8f;
|
healthMultiplier = 0.8f;
|
||||||
effect = Fx.freezing;
|
effect = Fx.freezing;
|
||||||
|
|
||||||
init(() -> {
|
init(() -> {
|
||||||
@@ -81,7 +81,7 @@ public class StatusEffects implements ContentList{
|
|||||||
|
|
||||||
melting = new StatusEffect("melting"){{
|
melting = new StatusEffect("melting"){{
|
||||||
speedMultiplier = 0.8f;
|
speedMultiplier = 0.8f;
|
||||||
armorMultiplier = 0.8f;
|
healthMultiplier = 0.8f;
|
||||||
damage = 0.3f;
|
damage = 0.3f;
|
||||||
effect = Fx.melting;
|
effect = Fx.melting;
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ public class StatusEffects implements ContentList{
|
|||||||
|
|
||||||
sapped = new StatusEffect("sapped"){{
|
sapped = new StatusEffect("sapped"){{
|
||||||
speedMultiplier = 0.7f;
|
speedMultiplier = 0.7f;
|
||||||
armorMultiplier = 0.8f;
|
healthMultiplier = 0.8f;
|
||||||
effect = Fx.sapped;
|
effect = Fx.sapped;
|
||||||
effectChance = 0.1f;
|
effectChance = 0.1f;
|
||||||
}};
|
}};
|
||||||
@@ -115,7 +115,7 @@ public class StatusEffects implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
overdrive = new StatusEffect("overdrive"){{
|
overdrive = new StatusEffect("overdrive"){{
|
||||||
armorMultiplier = 0.95f;
|
healthMultiplier = 0.95f;
|
||||||
speedMultiplier = 1.15f;
|
speedMultiplier = 1.15f;
|
||||||
damageMultiplier = 1.4f;
|
damageMultiplier = 1.4f;
|
||||||
damage = -0.01f;
|
damage = -0.01f;
|
||||||
@@ -132,13 +132,13 @@ public class StatusEffects implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
shielded = new StatusEffect("shielded"){{
|
shielded = new StatusEffect("shielded"){{
|
||||||
armorMultiplier = 3f;
|
healthMultiplier = 3f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
boss = new StatusEffect("boss"){{
|
boss = new StatusEffect("boss"){{
|
||||||
permanent = true;
|
permanent = true;
|
||||||
damageMultiplier = 1.5f;
|
damageMultiplier = 2f;
|
||||||
armorMultiplier = 1.5f;
|
healthMultiplier = 2f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
shocked = new StatusEffect("shocked");
|
shocked = new StatusEffect("shocked");
|
||||||
|
|||||||
@@ -197,6 +197,8 @@ public class Logic implements ApplicationListener{
|
|||||||
state.rules.waves = false;
|
state.rules.waves = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO capturing is disabled
|
||||||
|
/*
|
||||||
//if there's a "win" wave and no enemies are present, win automatically
|
//if there's a "win" wave and no enemies are present, win automatically
|
||||||
if(state.rules.waves && state.enemies == 0 && state.rules.winWave > 0 && state.wave >= state.rules.winWave && !spawner.isSpawning()){
|
if(state.rules.waves && state.enemies == 0 && state.rules.winWave > 0 && state.wave >= state.rules.winWave && !spawner.isSpawning()){
|
||||||
//the sector has been conquered - waves get disabled
|
//the sector has been conquered - waves get disabled
|
||||||
@@ -209,7 +211,7 @@ public class Logic implements ApplicationListener{
|
|||||||
if(!headless){
|
if(!headless){
|
||||||
control.saves.saveSector(state.rules.sector);
|
control.saves.saveSector(state.rules.sector);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}else{
|
}else{
|
||||||
if(!state.rules.attackMode && state.teams.playerCores().size == 0 && !state.gameOver){
|
if(!state.rules.attackMode && state.teams.playerCores().size == 0 && !state.gameOver){
|
||||||
state.gameOver = true;
|
state.gameOver = true;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import static mindustry.Vars.*;
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
abstract class ShieldComp implements Healthc, Posc{
|
abstract class ShieldComp implements Healthc, Posc{
|
||||||
@Import float health, hitTime, x, y;
|
@Import float health, hitTime, x, y, healthMultiplier;
|
||||||
@Import boolean dead;
|
@Import boolean dead;
|
||||||
|
|
||||||
/** Absorbs health damage. */
|
/** Absorbs health damage. */
|
||||||
@@ -22,6 +22,7 @@ abstract class ShieldComp implements Healthc, Posc{
|
|||||||
@Replace
|
@Replace
|
||||||
@Override
|
@Override
|
||||||
public void damage(float amount){
|
public void damage(float amount){
|
||||||
|
amount /= healthMultiplier;
|
||||||
//apply armor
|
//apply armor
|
||||||
amount = Math.max(amount - armor, minArmorDamage * amount);
|
amount = Math.max(amount - armor, minArmorDamage * amount);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
|||||||
private Seq<StatusEntry> statuses = new Seq<>();
|
private Seq<StatusEntry> statuses = new Seq<>();
|
||||||
private transient Bits applied = new Bits(content.getBy(ContentType.status).size);
|
private transient Bits applied = new Bits(content.getBy(ContentType.status).size);
|
||||||
|
|
||||||
@ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, armorMultiplier = 1, reloadMultiplier = 1;
|
@ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, healthMultiplier = 1, reloadMultiplier = 1;
|
||||||
|
|
||||||
@Import UnitType type;
|
@Import UnitType type;
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
applied.clear();
|
applied.clear();
|
||||||
speedMultiplier = damageMultiplier = armorMultiplier = reloadMultiplier = 1f;
|
speedMultiplier = damageMultiplier = healthMultiplier = reloadMultiplier = 1f;
|
||||||
|
|
||||||
if(statuses.isEmpty()) return;
|
if(statuses.isEmpty()) return;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
|||||||
statuses.remove(index);
|
statuses.remove(index);
|
||||||
}else{
|
}else{
|
||||||
speedMultiplier *= entry.effect.speedMultiplier;
|
speedMultiplier *= entry.effect.speedMultiplier;
|
||||||
armorMultiplier *= entry.effect.armorMultiplier;
|
healthMultiplier *= entry.effect.healthMultiplier;
|
||||||
damageMultiplier *= entry.effect.damageMultiplier;
|
damageMultiplier *= entry.effect.damageMultiplier;
|
||||||
reloadMultiplier *= entry.effect.reloadMultiplier;
|
reloadMultiplier *= entry.effect.reloadMultiplier;
|
||||||
entry.effect.update(self(), entry.time);
|
entry.effect.update(self(), entry.time);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class Objectives{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO fix
|
||||||
public static class SectorComplete extends SectorObjective{
|
public static class SectorComplete extends SectorObjective{
|
||||||
|
|
||||||
public SectorComplete(SectorPreset zone){
|
public SectorComplete(SectorPreset zone){
|
||||||
@@ -38,12 +39,12 @@ public class Objectives{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean complete(){
|
public boolean complete(){
|
||||||
return preset.sector.isCaptured();
|
return preset.sector.save != null && preset.sector.save.meta.wave >= preset.sector.save.meta.rules.winWave;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String display(){
|
public String display(){
|
||||||
return Core.bundle.format("requirement.capture", preset.localizedName);
|
return Core.bundle.format("requirement.wave", preset.sector.save == null ? "<unknown>" : preset.sector.save.meta.rules.winWave, preset.localizedName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class SpawnGroup implements Serializable{
|
|||||||
/** The spacing, in waves, of spawns. For example, 2 = spawns every other wave */
|
/** The spacing, in waves, of spawns. For example, 2 = spawns every other wave */
|
||||||
public int spacing = 1;
|
public int spacing = 1;
|
||||||
/** Maximum amount of units that spawn */
|
/** Maximum amount of units that spawn */
|
||||||
public int max = 100;
|
public int max = 40;
|
||||||
/** How many waves need to pass before the amount of units spawned increases by 1 */
|
/** How many waves need to pass before the amount of units spawned increases by 1 */
|
||||||
public float unitScaling = never;
|
public float unitScaling = never;
|
||||||
/** Shield points that this unit has. */
|
/** Shield points that this unit has. */
|
||||||
@@ -88,7 +88,7 @@ public class SpawnGroup implements Serializable{
|
|||||||
if(begin != 0) json.writeValue("begin", begin);
|
if(begin != 0) json.writeValue("begin", begin);
|
||||||
if(end != never) json.writeValue("end", end);
|
if(end != never) json.writeValue("end", end);
|
||||||
if(spacing != 1) json.writeValue("spacing", spacing);
|
if(spacing != 1) json.writeValue("spacing", spacing);
|
||||||
//if(max != 40) json.writeValue("max", max);
|
if(max != 40) json.writeValue("max", max);
|
||||||
if(unitScaling != never) json.writeValue("scaling", unitScaling);
|
if(unitScaling != never) json.writeValue("scaling", unitScaling);
|
||||||
if(shields != 0) json.writeValue("shields", shields);
|
if(shields != 0) json.writeValue("shields", shields);
|
||||||
if(shieldScaling != 0) json.writeValue("shieldScaling", shieldScaling);
|
if(shieldScaling != 0) json.writeValue("shieldScaling", shieldScaling);
|
||||||
@@ -105,12 +105,18 @@ public class SpawnGroup implements Serializable{
|
|||||||
begin = data.getInt("begin", 0);
|
begin = data.getInt("begin", 0);
|
||||||
end = data.getInt("end", never);
|
end = data.getInt("end", never);
|
||||||
spacing = data.getInt("spacing", 1);
|
spacing = data.getInt("spacing", 1);
|
||||||
//max = data.getInt("max", 40);
|
max = data.getInt("max", 40);
|
||||||
unitScaling = data.getFloat("scaling", never);
|
unitScaling = data.getFloat("scaling", never);
|
||||||
shields = data.getFloat("shields", 0);
|
shields = data.getFloat("shields", 0);
|
||||||
shieldScaling = data.getFloat("shieldScaling", 0);
|
shieldScaling = data.getFloat("shieldScaling", 0);
|
||||||
unitAmount = data.getInt("amount", 1);
|
unitAmount = data.getInt("amount", 1);
|
||||||
effect = content.getByName(ContentType.status, data.hasChild("effect") && data.getChild("effect").isString() ? data.getString("effect", "none") : "none");
|
|
||||||
|
//old boss effect ID
|
||||||
|
if(data.has("effect") && data.get("effect").isNumber() && data.getInt("effect", -1) == 8){
|
||||||
|
effect = StatusEffects.boss;
|
||||||
|
}else{
|
||||||
|
effect = content.getByName(ContentType.status, data.has("effect") && data.get("effect").isString() ? data.getString("effect", "none") : "none");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import mindustry.gen.*;
|
|||||||
public class StatusEffect extends MappableContent{
|
public class StatusEffect extends MappableContent{
|
||||||
/** Damage dealt by the unit with the effect. */
|
/** Damage dealt by the unit with the effect. */
|
||||||
public float damageMultiplier = 1f;
|
public float damageMultiplier = 1f;
|
||||||
/** Unit armor multiplier. */
|
/** Unit health multiplier. */
|
||||||
public float armorMultiplier = 1f;
|
public float healthMultiplier = 1f;
|
||||||
/** Unit speed multiplier */
|
/** Unit speed multiplier */
|
||||||
public float speedMultiplier = 1f;
|
public float speedMultiplier = 1f;
|
||||||
/** Unit speed multiplier */
|
/** Unit speed multiplier */
|
||||||
|
|||||||
@@ -35,10 +35,11 @@ public class PausedDialog extends BaseDialog{
|
|||||||
|
|
||||||
if(!mobile){
|
if(!mobile){
|
||||||
//TODO localize
|
//TODO localize
|
||||||
cont.label(() -> state.getSector() == null ? "" :
|
//TODO capturing is disabled, remove?
|
||||||
("[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining() +
|
//cont.label(() -> state.getSector() == null ? "" :
|
||||||
(state.rules.winWave > 0 && !state.getSector().isCaptured() ? "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture" : "")))
|
//("[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining() +
|
||||||
.visible(() -> state.getSector() != null).colspan(2);
|
// (state.rules.winWave > 0 && !state.getSector().isCaptured() ? "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture" : "")))
|
||||||
|
// .visible(() -> state.getSector() != null).colspan(2);
|
||||||
cont.row();
|
cont.row();
|
||||||
|
|
||||||
float dw = 220f;
|
float dw = 220f;
|
||||||
|
|||||||
@@ -263,9 +263,10 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Table(t -> {
|
new Table(t -> {
|
||||||
|
t.touchable = Touchable.disabled;
|
||||||
//TODO localize
|
//TODO localize
|
||||||
t.top();
|
t.top();
|
||||||
t.label(() -> mode == select ? "@sectors.select" : mode == launch ? "Select Launch Sector" : "Turn " + universe.turn()).style(Styles.outlineLabel).color(Pal.accent);
|
t.label(() -> mode == select ? "@sectors.select" : mode == launch ? "Select Launch Sector" : "").style(Styles.outlineLabel).color(Pal.accent);
|
||||||
})).grow();
|
})).grow();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -338,6 +339,8 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
stable.add("[accent]Difficulty: " + (int)(sector.baseCoverage * 10)).row();
|
stable.add("[accent]Difficulty: " + (int)(sector.baseCoverage * 10)).row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO sector damage is disabled, remove when finalized
|
||||||
|
/*
|
||||||
if(sector.hasBase() && sector.hasWaves()){
|
if(sector.hasBase() && sector.hasWaves()){
|
||||||
//TODO localize when finalized
|
//TODO localize when finalized
|
||||||
//these mechanics are likely to change and as such are not added to the bundle
|
//these mechanics are likely to change and as such are not added to the bundle
|
||||||
@@ -345,7 +348,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
stable.row();
|
stable.row();
|
||||||
stable.add("[accent]" + Mathf.ceil(sectorDestructionTurns - (sector.getSecondsPassed() * 60) / turnDuration) + " turn(s)\nuntil destruction");
|
stable.add("[accent]" + Mathf.ceil(sectorDestructionTurns - (sector.getSecondsPassed() * 60) / turnDuration) + " turn(s)\nuntil destruction");
|
||||||
stable.row();
|
stable.row();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if(sector.save != null){
|
if(sector.save != null){
|
||||||
stable.add("@sectors.resources").row();
|
stable.add("@sectors.resources").row();
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import arc.scene.ui.layout.*;
|
|||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.annotations.Annotations.*;
|
import mindustry.annotations.Annotations.*;
|
||||||
|
import mindustry.content.*;
|
||||||
import mindustry.core.GameState.*;
|
import mindustry.core.GameState.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.ctype.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
@@ -47,6 +48,26 @@ public class HudFragment extends Fragment{
|
|||||||
@Override
|
@Override
|
||||||
public void build(Group parent){
|
public void build(Group parent){
|
||||||
|
|
||||||
|
//warn about guardian/boss waves
|
||||||
|
Events.on(WaveEvent.class, e -> {
|
||||||
|
int max = 10;
|
||||||
|
outer:
|
||||||
|
for(int i = state.wave - 1; i <= state.wave + max; i++){
|
||||||
|
for(SpawnGroup group : state.rules.spawns){
|
||||||
|
if(group.effect == StatusEffects.boss && group.getUnitsSpawned(i) > 0){
|
||||||
|
int diff = (i + 2) - state.wave;
|
||||||
|
|
||||||
|
//increments at which to warn about incoming guardian
|
||||||
|
if(diff == 1 || diff == 2 || diff == 5 || diff == 10){
|
||||||
|
showToast(Icon.warning, Core.bundle.format("wave.guardianwarn" + (diff == 1 ? ".one" : ""), diff));
|
||||||
|
}
|
||||||
|
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//TODO details and stuff
|
//TODO details and stuff
|
||||||
Events.on(SectorCaptureEvent.class, e ->{
|
Events.on(SectorCaptureEvent.class, e ->{
|
||||||
//TODO localize
|
//TODO localize
|
||||||
|
|||||||
Reference in New Issue
Block a user