diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 72533e3a3f..ec291c3e34 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -695,12 +695,14 @@ units.processorcontrol = [lightgray]Processor Controlled bullet.damage = [stat]{0}[lightgray] damage bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles bullet.incendiary = [stat]incendiary +bullet.sapping = [stat]sapping bullet.homing = [stat]homing bullet.shock = [stat]shock bullet.frag = [stat]frag bullet.knockback = [stat]{0}[lightgray] knockback bullet.pierce = [stat]{0}[lightgray]x pierce bullet.infinitepierce = [stat]pierce +bullet.healpercent = [stat]{0}[lightgray]% healing bullet.freezing = [stat]freezing bullet.tarred = [stat]tarred bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index c32d4113ed..11c45f097d 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -336,6 +336,8 @@ public class UnitTypes implements ContentList{ lightningLength = 7; lightningLengthRand = 7; shootEffect = Fx.shootHeal; + //Does not actually do anything; Just here to make stats work + healPercent = 2f; lightningType = new BulletType(0.0001f, 0f){{ lifetime = Fx.lightning.lifetime; diff --git a/core/src/mindustry/world/meta/values/AmmoListValue.java b/core/src/mindustry/world/meta/values/AmmoListValue.java index 3900b238bb..a0635e7650 100644 --- a/core/src/mindustry/world/meta/values/AmmoListValue.java +++ b/core/src/mindustry/world/meta/values/AmmoListValue.java @@ -53,10 +53,15 @@ public class AmmoListValue implements StatValue{ sep(bt, Core.bundle.format("bullet.knockback", Strings.fixed(type.knockback, 1))); } - if(type.pierce || type.pierceCap != -1){ + //sap bullets don't really have pierce + if((type.pierce || type.pierceCap != -1) && !(type instanceof SapBulletType)){ sep(bt, type.pierceCap == -1 ? "@bullet.infinitepierce" : Core.bundle.format("bullet.pierce", type.pierceCap)); } + if((type.healPercent > 0f)){ + sep(bt, Core.bundle.format("bullet.healpercent", (int)type.healPercent)); + } + if((type.status == StatusEffects.burning || type.status == StatusEffects.melting) || type.incendAmount > 0){ sep(bt, "@bullet.incendiary"); } @@ -69,6 +74,10 @@ public class AmmoListValue implements StatValue{ sep(bt, "@bullet.tarred"); } + if(type.status == StatusEffects.sapped){ + sep(bt, "@bullet.sapping"); + } + if(type.homingPower > 0.01f){ sep(bt, "@bullet.homing"); } diff --git a/core/src/mindustry/world/meta/values/WeaponListValue.java b/core/src/mindustry/world/meta/values/WeaponListValue.java index 5c89deb649..40272a2390 100644 --- a/core/src/mindustry/world/meta/values/WeaponListValue.java +++ b/core/src/mindustry/world/meta/values/WeaponListValue.java @@ -34,15 +34,11 @@ public class WeaponListValue implements StatValue{ Weapon weapon = weapons.get(i); if(weapon.flipSprite){ + //fliped weapons are not given stats continue; } - if(weapon.outlineRegion.found()){ - table.image(Core.atlas.find(unit.name + "-weapon" + i)).size(15 * 8).right().top(); - }else{ - table.image(unit.icon(Cicon.full)).size(15 * 8).right().top(); - } - + table.image(Core.atlas.find(unit.name + "-weapon" + i)).size(15 * 8).right().top(); table.table(Tex.underline, w -> { w.left().defaults().padRight(3).left(); diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index e28d11fff8..b4ee8a340b 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -506,30 +506,35 @@ public class Generators{ } //generate weapon stat UI - //TODO: optimize - Image base = new Image(image.width, image.height); + + //largest side calculated here to prevent sprite squishing + int largestSide = Math.max(image.width, image.height); + Image base = new Image(largestSide, largestSide); image.each((x, y) -> { + int newX = x - image.width/2 + base.width/2; + int newY = y - image.height/2 + base.height/2; Color c = image.getColor(x, y); - base.draw(x, y, c.set(c.r, c.g, c.b, c.a * 0.2f)); + base.draw(newX, newY, c.set(c.r, c.g, c.b, c.a * 0.2f)); }); for(int i = 0;i < type.weapons.size;i ++){ Weapon weapon = type.weapons.get(i); if(weapon.flipSprite){ + //fliped weapons are not given stats continue; } weapon.load(); - Image finalBase = base.copy(); + Image baseWithWeapon = base.copy(); - finalBase.draw(outline.get(ImagePacker.get(weapon.region)), + baseWithWeapon.draw(outline.get(ImagePacker.get(weapon.region)), (int)(weapon.x / Draw.scl + base.width / 2f - weapon.region.width / 2f), (int)(-weapon.y / Draw.scl + base.height / 2f - weapon.region.height / 2f), weapon.flipSprite, false); - finalBase.save(type.name + "-weapon" + i); + baseWithWeapon.save(type.name + "-weapon" + i); } }catch(IllegalArgumentException e){ Log.err("WARNING: Skipping unit @: @", type.name, e.getMessage());