Campaign fixes & balance

This commit is contained in:
Anuken 2020-11-23 10:36:41 -05:00
parent 075be1a862
commit dcbe06229c
9 changed files with 26 additions and 22 deletions

View File

@ -147,6 +147,7 @@ planetmap = Planet Map
launchcore = Launch Core
filename = File Name:
unlocked = New content unlocked!
available = New research available!
completed = [accent]Completed
techtree = Tech Tree
research.list = [lightgray]Research:

View File

@ -27,7 +27,7 @@ public class SectorPresets implements ContentList{
}};
frozenForest = new SectorPreset("frozenForest", serpulo, 86){{
captureWave = 20;
captureWave = 15;
difficulty = 2;
}};

View File

@ -556,7 +556,7 @@ public class UnitTypes implements ContentList{
range = 40f;
weapons.add(new Weapon(){{
reload = 12f;
reload = 24f;
shootCone = 180f;
ejectEffect = Fx.none;
shootSound = Sounds.explosion;
@ -1321,7 +1321,7 @@ public class UnitTypes implements ContentList{
sprite = "large-bomb";
width = height = 120/4f;
range = 30f;
maxRange = 30f;
ignoreRotation = true;
backColor = Pal.heal;

View File

@ -6,6 +6,7 @@ import arc.audio.*;
import arc.graphics.g2d.*;
import arc.input.*;
import arc.math.*;
import arc.scene.style.*;
import arc.scene.ui.*;
import arc.struct.*;
import arc.util.*;
@ -16,6 +17,7 @@ import mindustry.core.GameState.*;
import mindustry.entities.*;
import mindustry.game.EventType.*;
import mindustry.game.*;
import mindustry.game.Objectives.*;
import mindustry.game.Saves.*;
import mindustry.gen.*;
import mindustry.input.*;
@ -24,6 +26,7 @@ import mindustry.io.SaveIO.*;
import mindustry.maps.Map;
import mindustry.net.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.ui.dialogs.*;
import mindustry.world.*;
@ -124,10 +127,18 @@ public class Control implements ApplicationListener, Loadable{
}
}));
Events.on(UnlockEvent.class, e -> ui.hudfrag.showUnlock(e.content));
Events.on(UnlockEvent.class, e -> {
ui.hudfrag.showUnlock(e.content);
checkAutoUnlocks();
if(e.content instanceof SectorPreset){
for(TechNode node : TechTree.all){
if(!node.content.unlocked() && node.objectives.contains(o -> o instanceof SectorComplete sec && sec.preset == e.content) && !node.objectives.contains(o -> !o.complete())){
ui.hudfrag.showToast(new TextureRegionDrawable(node.content.icon(Cicon.large)), bundle.get("available"));
}
}
}
});
Events.on(SectorCaptureEvent.class, e -> {

View File

@ -78,7 +78,7 @@ public abstract class BulletType extends Content{
* Do not change unless you know what you're doing. */
public boolean backMove = true;
/** Bullet range override. */
public float range = -1f;
public float maxRange = -1f;
/** % of block health healed **/
public float healPercent = 0f;
/** whether to make fire on impact */
@ -154,7 +154,7 @@ public abstract class BulletType extends Content{
/** Returns maximum distance the bullet this bullet type has can travel. */
public float range(){
return Math.max(speed * lifetime * (1f - drag), range);
return Math.max(speed * lifetime * (1f - drag), maxRange);
}
public boolean collides(Bullet bullet, Building tile){

View File

@ -48,7 +48,8 @@ public class Objectives{
}
}
public static class SectorComplete extends SectorObjective{
public static class SectorComplete implements Objective{
public SectorPreset preset;
public SectorComplete(SectorPreset zone){
this.preset = zone;
@ -67,11 +68,6 @@ public class Objectives{
}
}
//TODO merge
public abstract static class SectorObjective implements Objective{
public SectorPreset preset;
}
/** Defines a specific objective for a game. */
public interface Objective{
@ -86,9 +82,5 @@ public class Objectives{
default void build(Table table){
}
default SectorPreset zone(){
return this instanceof SectorObjective ? ((SectorObjective)this).preset : null;
}
}
}

View File

@ -277,7 +277,7 @@ public class Waves{
int cap = 150;
float shieldStart = 30, shieldsPerWave = 20 + difficulty*30f;
float[] scaling = {1, 1, 1.5f, 3f, 4f};
float[] scaling = {1, 1.2f, 1.5f, 3f, 4f};
Intc createProgression = start -> {
//main sequence
@ -298,7 +298,7 @@ public class Waves{
begin = f;
end = f + next >= cap ? never : f + next;
max = 13;
unitScaling = (difficulty < 0.4f ? rand.random(2.5f, 4f) : rand.random(1f, 4f)) * scaling[ctier];
unitScaling = (difficulty < 0.4f ? rand.random(2.5f, 5f) : rand.random(1f, 4f)) * scaling[ctier];
shields = shieldAmount;
shieldScaling = shieldsPerWave;
spacing = space;
@ -310,7 +310,7 @@ public class Waves{
begin = f + next - 1;
end = f + next + rand.random(6, 10);
max = 6;
unitScaling = rand.random(1f, 2f);
unitScaling = rand.random(2f, 4f);
spacing = rand.random(2, 4);
shields = shieldAmount/2f;
shieldScaling = shieldsPerWave;

View File

@ -233,7 +233,7 @@ public class SectorDamage{
//first, calculate the total health of blocks in the path
//radius around the path that gets counted
int radius = 8;
int radius = 9;
IntSet counted = new IntSet();
for(Tile t : sparse2){

View File

@ -328,7 +328,7 @@ public class UnitType extends UnlockableContent{
//suicide enemy
if(weapons.contains(w -> w.bullet.killShooter)){
//scale down DPS to be insignificant
dpsEstimate /= 20f;
dpsEstimate /= 25f;
}
}
}