Weapon display fixes

This commit is contained in:
Anuken
2022-04-10 09:40:41 -04:00
parent a5d974198b
commit 61a11c9f5b
4 changed files with 14 additions and 11 deletions

View File

@@ -2825,7 +2825,7 @@ public class Blocks{
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 25f * 1.5f;
splashDamage = 30f * 1.5f;
splashDamageRadius = 20f;
fragBullets = 6;
fragBullet = new BasicBulletType(3f, 5){{
@@ -3422,9 +3422,9 @@ public class Blocks{
width = 6f;
height = 8f;
hitEffect = Fx.flakExplosion;
splashDamage = 28f * 1.5f;
splashDamageRadius = 22f;
fragBullet = new BasicBulletType(3f, 5, "bullet"){{
splashDamage = 32f * 1.5f;
splashDamageRadius = 25f;
fragBullet = new BasicBulletType(3f, 8, "bullet"){{
width = 5f;
height = 12f;
shrinkY = 1f;
@@ -3666,7 +3666,7 @@ public class Blocks{
smokeEffect = Fx.shootBigSmoke;
ammoMultiplier = 1;
reloadMultiplier = 1f;
pierceCap = 2;
pierceCap = 3;
pierce = true;
pierceBuilding = true;
hitColor = backColor = trailColor = Pal.tungstenShot;
@@ -4488,7 +4488,7 @@ public class Blocks{
forceDark = true;
privileged = true;
size = 1;
maxInstructionsPerTick = 30;
maxInstructionsPerTick = 50;
}};
worldCell = new MemoryBlock("world-cell"){{

View File

@@ -135,6 +135,10 @@ public class Weapon implements Cloneable{
this("");
}
public boolean hasStats(UnitType u){
return true;
}
public void addStats(UnitType u, Table t){
if(inaccuracy > 0){
t.row();

View File

@@ -1,7 +1,6 @@
package mindustry.type.weapons;
import arc.math.*;
import arc.scene.ui.layout.*;
import mindustry.entities.bullet.*;
import mindustry.entities.units.*;
import mindustry.gen.*;
@@ -24,8 +23,8 @@ public class BuildWeapon extends Weapon{
}
@Override
public void addStats(UnitType u, Table t){
//no.
public boolean hasStats(UnitType u){
return false;
}
@Override

View File

@@ -275,12 +275,12 @@ public class StatValues{
for(int i = 0; i < weapons.size;i ++){
Weapon weapon = weapons.get(i);
if(weapon.flipSprite){
if(weapon.flipSprite || !weapon.hasStats(unit)){
//flipped weapons are not given stats
continue;
}
TextureRegion region = !weapon.name.equals("") && weapon.outlineRegion.found() ? weapon.outlineRegion : unit.fullIcon;
TextureRegion region = !weapon.name.equals("") && weapon.region.found() ? weapon.region : Core.atlas.find("clear");
table.image(region).size(60).scaling(Scaling.bounded).right().top();