mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-05-10 22:41:10 -07:00
Erekir nano rebalance: avert dont melt unit armor or be weak against building armor (#11917)
* wip stats for now * should be it
This commit is contained in:
parent
347ca2ffcb
commit
e56f9fbfff
5 changed files with 32 additions and 13 deletions
|
|
@ -1237,6 +1237,9 @@ bullet.armorpierce = [stat]armor piercing
|
|||
bullet.armorweakness = [red]{0}x[lightgray] armor weakness
|
||||
bullet.partialarmorpierce = [stat]{0}%[lightgray] armor pierce
|
||||
bullet.antiarmor = [stat]{0}x[lightgray] anti-armor
|
||||
bullet.blockarmorweakness = [red]{0}x[lightgray] building armor weakness
|
||||
bullet.blockpartialarmorpierce = [stat]{0}%[lightgray] building armor pierce
|
||||
bullet.blockantiarmor = [stat]{0}x[lightgray] building anti-armor
|
||||
bullet.maxdamagefraction = [stat]{0}%[lightgray] damage limit
|
||||
bullet.suppression = [stat]{0}[lightgray] seconds of repair suppression ~ [stat]{1}[lightgray] tiles
|
||||
bullet.empradius = [stat]{0}[lightgray] tiles EMP radius
|
||||
|
|
|
|||
|
|
@ -3915,12 +3915,13 @@ public class UnitTypes{
|
|||
mirror = false;
|
||||
shoot = new ShootHelix();
|
||||
|
||||
bullet = new BasicBulletType(5f, 34){{
|
||||
bullet = new BasicBulletType(5f, 22f / 0.75f){{
|
||||
width = 7f;
|
||||
height = 12f;
|
||||
lifetime = 18f;
|
||||
//floating point inaccuracy makes 0.6f show as -39%
|
||||
buildingDamageMultiplier = 0.599999f;
|
||||
blockArmorMultiplier = 0.5f;
|
||||
shootEffect = Fx.sparkShoot;
|
||||
smokeEffect = Fx.shootBigSmoke;
|
||||
hitColor = backColor = trailColor = Pal.suppress;
|
||||
|
|
@ -3931,13 +3932,12 @@ public class UnitTypes{
|
|||
|
||||
fragOnDespawn = false;
|
||||
fragBullets = 2;
|
||||
fragBullet = new BasicBulletType(3f, 15){{
|
||||
fragBullet = new BasicBulletType(3f, 10){{
|
||||
width = 5f;
|
||||
height = 8f;
|
||||
lifetime = 14f;
|
||||
fragVelocityMax = 1f;
|
||||
fragVelocityMin = 0.7f;
|
||||
buildingDamageMultiplier = 0.5f;
|
||||
hitColor = backColor = trailColor = Pal.suppress;
|
||||
frontColor = Color.white;
|
||||
trailWidth = 1.2f;
|
||||
|
|
|
|||
|
|
@ -185,8 +185,10 @@ public class BulletType extends Content implements Cloneable{
|
|||
public boolean fragOnAbsorb = true;
|
||||
/** If true, unit armor is ignored in damage calculations. */
|
||||
public boolean pierceArmor = false;
|
||||
/** Multiplies the unit armor used in damage calculations. Used for armor weakness, armor piercing, and anti-armor. */
|
||||
/** Multiplies the unit/building armor used in damage calculations. Used for armor weakness, armor piercing, and anti-armor. */
|
||||
public float armorMultiplier = 1f;
|
||||
/** Multiplies only the building armor used in damage calculations. */
|
||||
public float blockArmorMultiplier = 1f;
|
||||
/** If true, the bullet will "stick" to enemies and get deactivated on collision. */
|
||||
public boolean sticky = false;
|
||||
/** Extra time added to bullet when it sticks to something. */
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import mindustry.core.*;
|
|||
import mindustry.ctype.*;
|
||||
import mindustry.editor.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.game.Teams.*;
|
||||
|
|
@ -1729,10 +1730,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||
* @return whether the bullet should be removed. */
|
||||
public boolean collision(Bullet other){
|
||||
boolean wasDead = health <= 0;
|
||||
BulletType t = other.type;
|
||||
|
||||
float damage = other.type.buildingDamage(other);
|
||||
if(!other.type.pierceArmor){
|
||||
damage = Damage.applyArmor(damage, block.armor * other.type.armorMultiplier);
|
||||
if(!t.pierceArmor){
|
||||
damage = Damage.applyArmor(damage, block.armor * t.armorMultiplier * t.blockArmorMultiplier);
|
||||
}
|
||||
|
||||
damage(other, other.team, damage);
|
||||
|
|
|
|||
|
|
@ -733,13 +733,25 @@ public class StatValues{
|
|||
sep(bt, "@bullet.armorpierce");
|
||||
}
|
||||
|
||||
if(type.armorMultiplier != 1f && !type.pierceArmor){
|
||||
if(type.armorMultiplier > 1f){
|
||||
sep(bt, Core.bundle.format("bullet.armorweakness", (type.armorMultiplier)));
|
||||
}else if(Mathf.sign(type.armorMultiplier) == 1){
|
||||
sep(bt, Core.bundle.format("bullet.partialarmorpierce", (int)((1 - type.armorMultiplier) * 100)));
|
||||
}else{
|
||||
sep(bt, Core.bundle.format("bullet.antiarmor", (-type.armorMultiplier)));
|
||||
if(!type.pierceArmor){
|
||||
if(type.armorMultiplier != 1f){
|
||||
if(type.armorMultiplier > 1f){
|
||||
sep(bt, Core.bundle.format("bullet.armorweakness", (type.armorMultiplier)));
|
||||
}else if(Mathf.sign(type.armorMultiplier) == 1){
|
||||
sep(bt, Core.bundle.format("bullet.partialarmorpierce", (int)((1 - type.armorMultiplier) * 100)));
|
||||
}else{
|
||||
sep(bt, Core.bundle.format("bullet.antiarmor", (-type.armorMultiplier)));
|
||||
}
|
||||
}
|
||||
|
||||
if(type.blockArmorMultiplier != 1f){
|
||||
if(type.blockArmorMultiplier > 1f){
|
||||
sep(bt, Core.bundle.format("bullet.blockarmorweakness", (type.blockArmorMultiplier)));
|
||||
}else if(Mathf.sign(type.blockArmorMultiplier) == 1){
|
||||
sep(bt, Core.bundle.format("bullet.blockpartialarmorpierce", (int)((1 - type.blockArmorMultiplier) * 100)));
|
||||
}else{
|
||||
sep(bt, Core.bundle.format("bullet.blockantiarmor", (-type.blockArmorMultiplier)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue