Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -7,6 +7,8 @@ import arc.graphics.*;
|
|||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.audio.*;
|
import mindustry.audio.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
@@ -15,6 +17,7 @@ import mindustry.entities.bullet.*;
|
|||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -119,6 +122,17 @@ public class Weapon implements Cloneable{
|
|||||||
this("");
|
this("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addStats(UnitType u, Table t){
|
||||||
|
if(inaccuracy > 0){
|
||||||
|
t.row();
|
||||||
|
t.add("[lightgray]" + Stat.inaccuracy.localized() + ": [white]" + (int)inaccuracy + " " + StatUnit.degrees.localized());
|
||||||
|
}
|
||||||
|
t.row();
|
||||||
|
t.add("[lightgray]" + Stat.reload.localized() + ": " + (mirror ? "2x " : "") + "[white]" + Strings.autoFixed(60f / reload * shots, 2));
|
||||||
|
|
||||||
|
StatValues.ammo(ObjectMap.of(u, bullet)).display(t);
|
||||||
|
}
|
||||||
|
|
||||||
public float dps(){
|
public float dps(){
|
||||||
return (bullet.estimateDPS() / reload) * shots * 60f;
|
return (bullet.estimateDPS() / reload) * shots * 60f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ import arc.graphics.*;
|
|||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.blocks.units.*;
|
import mindustry.world.blocks.units.*;
|
||||||
|
import mindustry.world.meta.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note that this weapon requires a bullet with a positive maxRange.
|
* Note that this weapon requires a bullet with a positive maxRange.
|
||||||
@@ -47,6 +49,12 @@ public class RepairBeamWeapon extends Weapon{
|
|||||||
recoil = 0f;
|
recoil = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addStats(UnitType u, Table w){
|
||||||
|
w.row();
|
||||||
|
w.add("[lightgray]" + Stat.repairSpeed.localized() + ": " + (mirror ? "2x " : "") + "[white]" + (int)(repairSpeed * 60) + " " + StatUnit.perSecond.localized());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float dps(){
|
public float dps(){
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|||||||
@@ -198,15 +198,10 @@ public class StatValues{
|
|||||||
|
|
||||||
table.image(region).size(60).scaling(Scaling.bounded).right().top();
|
table.image(region).size(60).scaling(Scaling.bounded).right().top();
|
||||||
|
|
||||||
table.table(Tex.underline, w -> {
|
table.table(Tex.underline, w -> {
|
||||||
w.left().defaults().padRight(3).left();
|
w.left().defaults().padRight(3).left();
|
||||||
|
|
||||||
if(weapon.inaccuracy > 0){
|
weapon.addStats(unit, w);
|
||||||
sep(w, "[lightgray]" + Stat.inaccuracy.localized() + ": [white]" + (int)weapon.inaccuracy + " " + StatUnit.degrees.localized());
|
|
||||||
}
|
|
||||||
sep(w, "[lightgray]" + Stat.reload.localized() + ": " + (weapon.mirror ? "2x " : "") + "[white]" + Strings.autoFixed(60f / weapon.reload * weapon.shots, 2));
|
|
||||||
|
|
||||||
ammo(ObjectMap.of(unit, weapon.bullet)).display(w);
|
|
||||||
}).padTop(-9).left();
|
}).padTop(-9).left();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
@@ -298,7 +293,6 @@ public class StatValues{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//for AmmoListValue
|
//for AmmoListValue
|
||||||
|
|
||||||
private static void sep(Table table, String text){
|
private static void sep(Table table, String text){
|
||||||
table.row();
|
table.row();
|
||||||
table.add(text);
|
table.add(text);
|
||||||
|
|||||||
Reference in New Issue
Block a user