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
+6 -6
View File
@@ -2825,7 +2825,7 @@ public class Blocks{
width = 6f; width = 6f;
height = 8f; height = 8f;
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
splashDamage = 25f * 1.5f; splashDamage = 30f * 1.5f;
splashDamageRadius = 20f; splashDamageRadius = 20f;
fragBullets = 6; fragBullets = 6;
fragBullet = new BasicBulletType(3f, 5){{ fragBullet = new BasicBulletType(3f, 5){{
@@ -3422,9 +3422,9 @@ public class Blocks{
width = 6f; width = 6f;
height = 8f; height = 8f;
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
splashDamage = 28f * 1.5f; splashDamage = 32f * 1.5f;
splashDamageRadius = 22f; splashDamageRadius = 25f;
fragBullet = new BasicBulletType(3f, 5, "bullet"){{ fragBullet = new BasicBulletType(3f, 8, "bullet"){{
width = 5f; width = 5f;
height = 12f; height = 12f;
shrinkY = 1f; shrinkY = 1f;
@@ -3666,7 +3666,7 @@ public class Blocks{
smokeEffect = Fx.shootBigSmoke; smokeEffect = Fx.shootBigSmoke;
ammoMultiplier = 1; ammoMultiplier = 1;
reloadMultiplier = 1f; reloadMultiplier = 1f;
pierceCap = 2; pierceCap = 3;
pierce = true; pierce = true;
pierceBuilding = true; pierceBuilding = true;
hitColor = backColor = trailColor = Pal.tungstenShot; hitColor = backColor = trailColor = Pal.tungstenShot;
@@ -4488,7 +4488,7 @@ public class Blocks{
forceDark = true; forceDark = true;
privileged = true; privileged = true;
size = 1; size = 1;
maxInstructionsPerTick = 30; maxInstructionsPerTick = 50;
}}; }};
worldCell = new MemoryBlock("world-cell"){{ worldCell = new MemoryBlock("world-cell"){{
+4
View File
@@ -135,6 +135,10 @@ public class Weapon implements Cloneable{
this(""); this("");
} }
public boolean hasStats(UnitType u){
return true;
}
public void addStats(UnitType u, Table t){ public void addStats(UnitType u, Table t){
if(inaccuracy > 0){ if(inaccuracy > 0){
t.row(); t.row();
@@ -1,7 +1,6 @@
package mindustry.type.weapons; package mindustry.type.weapons;
import arc.math.*; import arc.math.*;
import arc.scene.ui.layout.*;
import mindustry.entities.bullet.*; import mindustry.entities.bullet.*;
import mindustry.entities.units.*; import mindustry.entities.units.*;
import mindustry.gen.*; import mindustry.gen.*;
@@ -24,8 +23,8 @@ public class BuildWeapon extends Weapon{
} }
@Override @Override
public void addStats(UnitType u, Table t){ public boolean hasStats(UnitType u){
//no. return false;
} }
@Override @Override
@@ -275,12 +275,12 @@ public class StatValues{
for(int i = 0; i < weapons.size;i ++){ for(int i = 0; i < weapons.size;i ++){
Weapon weapon = weapons.get(i); Weapon weapon = weapons.get(i);
if(weapon.flipSprite){ if(weapon.flipSprite || !weapon.hasStats(unit)){
//flipped weapons are not given stats //flipped weapons are not given stats
continue; 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(); table.image(region).size(60).scaling(Scaling.bounded).right().top();