Campaign tweaks
This commit is contained in:
@@ -28,7 +28,7 @@ public class LightningBulletType extends BulletType{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float estimateDPS(){
|
public float estimateDPS(){
|
||||||
return super.estimateDPS() * Math.max(lightningLength / 2f, 1);
|
return super.estimateDPS() * Math.max(lightningLength / 4f, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,37 +22,12 @@ public class GameStats{
|
|||||||
/** Friendly buildings destroyed. */
|
/** Friendly buildings destroyed. */
|
||||||
public int buildingsDestroyed;
|
public int buildingsDestroyed;
|
||||||
|
|
||||||
//TODO fix
|
//unused
|
||||||
public RankResult calculateRank(Sector zone, boolean launched){
|
public RankResult calculateRank(Sector sector){
|
||||||
float score = 0;
|
float score = 0;
|
||||||
|
|
||||||
//TODO implement wave/attack mode based score
|
int rankIndex = Mathf.clamp((int)score, 0, Rank.all.length - 1);
|
||||||
/*
|
Rank rank = Rank.all[rankIndex];
|
||||||
if(launched && zone.getRules().attackMode){
|
|
||||||
score += 3f;
|
|
||||||
}else if(wavesLasted >= zone.conditionWave){
|
|
||||||
//each new launch period adds onto the rank 'points'
|
|
||||||
score += (float)((wavesLasted - zone.conditionWave) / zone.launchPeriod + 1) * 1.2f;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//TODO implement
|
|
||||||
int capacity = 3000;//zone.loadout.findCore().itemCapacity;
|
|
||||||
|
|
||||||
//weigh used fractions
|
|
||||||
float frac = 0f;
|
|
||||||
Seq<Item> obtainable = zone.save == null ? new Seq<>() : zone.info.resources.select(i -> i instanceof Item).as();
|
|
||||||
for(Item item : obtainable){
|
|
||||||
frac += Mathf.clamp((float)itemsDelivered.get(item, 0) / capacity) / (float)obtainable.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
score += frac * 1.6f;
|
|
||||||
|
|
||||||
if(!launched){
|
|
||||||
score *= 0.5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
int rankIndex = Mathf.clamp((int)(score), 0, Rank.values().length - 1);
|
|
||||||
Rank rank = Rank.values()[rankIndex];
|
|
||||||
String sign = Math.abs((rankIndex + 0.5f) - score) < 0.2f || rank.name().contains("S") ? "" : (rankIndex + 0.5f) < score ? "-" : "+";
|
String sign = Math.abs((rankIndex + 0.5f) - score) < 0.2f || rank.name().contains("S") ? "" : (rankIndex + 0.5f) < score ? "-" : "+";
|
||||||
|
|
||||||
return new RankResult(rank, sign);
|
return new RankResult(rank, sign);
|
||||||
@@ -70,6 +45,8 @@ public class GameStats{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum Rank{
|
public enum Rank{
|
||||||
F, D, C, B, A, S, SS
|
F, D, C, B, A, S, SS;
|
||||||
|
|
||||||
|
public static final Rank[] all = values();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
//suicide enemy
|
//suicide enemy
|
||||||
if(weapons.contains(w -> w.bullet.killShooter)){
|
if(weapons.contains(w -> w.bullet.killShooter)){
|
||||||
//scale down DPS to be insignificant
|
//scale down DPS to be insignificant
|
||||||
dpsEstimate /= 40f;
|
dpsEstimate /= 20f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package mindustry.ui.dialogs;
|
|||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.GameStats.*;
|
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
@@ -78,11 +77,6 @@ public class GameOverDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state.hasSector()){
|
|
||||||
RankResult result = state.stats.calculateRank(state.getSector(), true);
|
|
||||||
t.add(Core.bundle.format("stat.rank", result.rank + result.modifier));
|
|
||||||
t.row();
|
|
||||||
}
|
|
||||||
}).pad(12);
|
}).pad(12);
|
||||||
|
|
||||||
if(state.isCampaign()){
|
if(state.isCampaign()){
|
||||||
|
|||||||
@@ -177,11 +177,14 @@ public class MapsDialog extends BaseDialog{
|
|||||||
t.row();
|
t.row();
|
||||||
t.add("@editor.author").padRight(10).color(Color.gray);
|
t.add("@editor.author").padRight(10).color(Color.gray);
|
||||||
t.row();
|
t.row();
|
||||||
t.add(!map.custom && map.author().isEmpty() ? "Anuke" : map.author()).growX().wrap().padTop(2);
|
t.add(!map.custom && map.tags.get("author", "").isEmpty() ? "Anuke" : map.author()).growX().wrap().padTop(2);
|
||||||
t.row();
|
t.row();
|
||||||
t.add("@editor.description").padRight(10).color(Color.gray).top();
|
|
||||||
t.row();
|
if(!map.tags.get("description", "").isEmpty()){
|
||||||
t.add(map.description()).growX().wrap().padTop(2);
|
t.add("@editor.description").padRight(10).color(Color.gray).top();
|
||||||
|
t.row();
|
||||||
|
t.add(map.description()).growX().wrap().padTop(2);
|
||||||
|
}
|
||||||
}).height(mapsize).width(mapsize);
|
}).height(mapsize).width(mapsize);
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|||||||
@@ -617,7 +617,7 @@ public class Block extends UnlockableContent{
|
|||||||
public ItemStack[] researchRequirements(){
|
public ItemStack[] researchRequirements(){
|
||||||
ItemStack[] out = new ItemStack[requirements.length];
|
ItemStack[] out = new ItemStack[requirements.length];
|
||||||
for(int i = 0; i < out.length; i++){
|
for(int i = 0; i < out.length; i++){
|
||||||
int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.15f) * 20 * researchCostMultiplier, 10);
|
int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.12f) * 20 * researchCostMultiplier, 10);
|
||||||
|
|
||||||
out[i] = new ItemStack(requirements[i].item, UI.roundAmount(quantity));
|
out[i] = new ItemStack(requirements[i].item, UI.roundAmount(quantity));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import mindustry.*;
|
|||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.GameStats.*;
|
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
@@ -242,10 +241,6 @@ public class SStats implements SteamUserStatsCallback{
|
|||||||
if(Vars.state.rules.attackMode){
|
if(Vars.state.rules.attackMode){
|
||||||
SStat.attacksWon.add();
|
SStat.attacksWon.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
RankResult result = state.stats.calculateRank(state.getSector(), true);
|
|
||||||
if(result.rank == Rank.S) earnSRank.complete();
|
|
||||||
if(result.rank == Rank.SS) earnSSRank.complete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state.rules.pvp){
|
if(state.rules.pvp){
|
||||||
|
|||||||
Reference in New Issue
Block a user