too many things to list

This commit is contained in:
Anuken
2020-10-15 13:44:20 -04:00
parent fb0179da95
commit 86c2fe8805
52 changed files with 665 additions and 117 deletions

View File

@@ -290,7 +290,7 @@ public class DefaultWaves{
begin = f;
end = f + next >= cap ? never : f + next;
max = 14;
unitScaling = rand.random(1f, 2f);
unitScaling = rand.random(1f, 3f);
shields = shieldAmount;
shieldScaling = shieldsPerWave;
spacing = space;
@@ -329,7 +329,7 @@ public class DefaultWaves{
while(step <= cap){
createProgression.get(step);
step += (int)(rand.random(12, 25) * Mathf.lerp(1f, 0.4f, difficulty));
step += (int)(rand.random(13, 25) * Mathf.lerp(1f, 0.5f, difficulty));
}
int bossWave = (int)(rand.random(30, 60) * Mathf.lerp(1f, 0.7f, difficulty));

View File

@@ -82,6 +82,8 @@ public class Rules{
public Seq<WeatherEntry> weather = new Seq<>(1);
/** Blocks that cannot be placed. */
public ObjectSet<Block> bannedBlocks = new ObjectSet<>();
/** Unlocked content names. Only used in multiplayer when the campaign is enabled. */
public ObjectSet<String> researched = new ObjectSet<>();
/** Whether ambient lighting is enabled. */
public boolean lighting = false;
/** Whether enemy lighting is visible.

View File

@@ -5,6 +5,7 @@ import arc.struct.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.ctype.*;
import mindustry.maps.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.storage.CoreBlock.*;
@@ -38,6 +39,10 @@ public class SectorInfo{
public @Nullable Sector destination;
/** Resources known to occur at this sector. */
public Seq<UnlockableContent> resources = new Seq<>();
/** Special variables for simulation. */
public float sumHealth, sumRps, sumDps, waveHealthBase, waveHealthSlope, waveDpsBase, waveDpsSlope;
/** Time spent at this sector. Do not use unless you know what you're doing. */
public transient float internalTimeSpent;
@@ -99,6 +104,9 @@ public class SectorInfo{
//update sector's internal time spent counter
state.rules.sector.setTimeSpent(internalTimeSpent);
state.rules.sector.setUnderAttack(state.rules.waves);
SectorDamage.writeParameters(this);
}
/** Update averages of various stats, updates some special sector logic.

View File

@@ -52,8 +52,8 @@ public class SpawnGroup implements Serializable{
//serialization use only
}
/** Returns the amount of units spawned on a specific wave. */
public int getUnitsSpawned(int wave){
/** @return amount of units spawned on a specific wave. */
public int getSpawned(int wave){
if(spacing == 0) spacing = 1;
if(wave < begin || wave > end || (wave - begin) % spacing != 0){
return 0;
@@ -61,6 +61,11 @@ public class SpawnGroup implements Serializable{
return Math.min(unitAmount + (int)(((wave - begin) / spacing) / unitScaling), max);
}
/** @return amount of shields each unit has at a specific wave. */
public float getShield(int wave){
return Math.max(shields + shieldScaling*(wave - begin), 0);
}
/**
* Creates a unit, and assigns correct values based on this group's data.
* This method does not add() the unit.
@@ -76,7 +81,7 @@ public class SpawnGroup implements Serializable{
unit.addItem(items.item, items.amount);
}
unit.shield(Math.max(shields + shieldScaling*(wave - begin), 0));
unit.shield = getShield(wave);
return unit;
}

View File

@@ -31,9 +31,9 @@ public class Team implements Comparable<Team>{
Color.valueOf("ffd37f"), Color.valueOf("eab678"), Color.valueOf("d4816b")),
crux = new Team(2, "crux", Color.valueOf("f25555"),
Color.valueOf("fc8e6c"), Color.valueOf("f25555"), Color.valueOf("a04553")),
green = new Team(3, "green", Color.valueOf("4dd98b")),
purple = new Team(4, "purple", Color.valueOf("9a4bdf")),
blue = new Team(5, "blue", Color.royal.cpy());
green = new Team(3, "green", Color.valueOf("54d67d")),
purple = new Team(4, "purple", Color.valueOf("995bb0")),
blue = new Team(5, "blue", Color.valueOf("5a4deb"));
static{
Mathf.rand.setSeed(8);

View File

@@ -6,6 +6,7 @@ import arc.struct.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.game.EventType.*;
import mindustry.maps.*;
import mindustry.type.*;
import mindustry.world.blocks.storage.*;
@@ -55,7 +56,7 @@ public class Universe{
/** @return sectors attacked on the current planet, minus the ones that are being played on right now. */
public Seq<Sector> getAttacked(Planet planet){
return planet.sectors.select(s -> s.hasWaves() && s.hasBase() && !s.isBeingPlayed() && s.getSecondsPassed() > 1);
return planet.sectors.select(s -> s.isUnderAttack() && s.hasBase() && !s.isBeingPlayed() && s.getWavesPassed() > 0);
}
/** Update planet rotations, global time and relevant state. */
@@ -138,11 +139,23 @@ public class Universe{
//increment seconds passed for this sector by the time that just passed with this turn
if(!sector.isBeingPlayed()){
sector.setSecondsPassed(sector.getSecondsPassed() + actuallyPassed);
int secPassed = sector.getSecondsPassed() + actuallyPassed;
sector.setSecondsPassed(secPassed);
boolean attacked = sector.isUnderAttack();
int wavesPassed = (int)(secPassed*60f / sector.save.meta.rules.waveSpacing);
float damage = attacked ? SectorDamage.getDamage(sector.save.meta.secinfo, sector.save.meta.rules.waveSpacing, sector.save.meta.wave, wavesPassed) : 0f;
if(attacked){
sector.setWavesPassed(wavesPassed);
}
sector.setDamage(damage);
//TODO sector damage disabled for now
//check if the sector has been attacked too many times...
/*if(sector.hasBase() && sector.hasWaves() && sector.getSecondsPassed() * 60f > turnDuration * sectorDestructionTurns){
if(attacked && damage >= 0.999f){
//fire event for losing the sector
Events.fire(new SectorLoseEvent(sector));
@@ -152,7 +165,14 @@ public class Universe{
//clear recieved
sector.setExtraItems(new ItemSeq());
sector.save = null;
}*/
sector.setDamage(0f);
}else if(attacked && wavesPassed > 0 && sector.save.meta.wave + wavesPassed >= sector.save.meta.rules.winWave && !sector.hasEnemyBase()){
//autocapture the sector
sector.setUnderAttack(false);
//fire the event
Events.fire(new SectorCaptureEvent(state.rules.sector));
}
}
//export to another sector