Sector simplification
This commit is contained in:
@@ -9,7 +9,7 @@ import static mindustry.Vars.*;
|
||||
|
||||
@Component
|
||||
abstract class ShieldComp implements Healthc, Posc{
|
||||
@Import float health, hitTime, x, y;
|
||||
@Import float health, hitTime, x, y, healthMultiplier;
|
||||
@Import boolean dead;
|
||||
|
||||
/** Absorbs health damage. */
|
||||
@@ -22,6 +22,7 @@ abstract class ShieldComp implements Healthc, Posc{
|
||||
@Replace
|
||||
@Override
|
||||
public void damage(float amount){
|
||||
amount /= healthMultiplier;
|
||||
//apply armor
|
||||
amount = Math.max(amount - armor, minArmorDamage * amount);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
||||
private Seq<StatusEntry> statuses = new Seq<>();
|
||||
private transient Bits applied = new Bits(content.getBy(ContentType.status).size);
|
||||
|
||||
@ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, armorMultiplier = 1, reloadMultiplier = 1;
|
||||
@ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, healthMultiplier = 1, reloadMultiplier = 1;
|
||||
|
||||
@Import UnitType type;
|
||||
|
||||
@@ -104,7 +104,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
||||
}
|
||||
|
||||
applied.clear();
|
||||
speedMultiplier = damageMultiplier = armorMultiplier = reloadMultiplier = 1f;
|
||||
speedMultiplier = damageMultiplier = healthMultiplier = reloadMultiplier = 1f;
|
||||
|
||||
if(statuses.isEmpty()) return;
|
||||
|
||||
@@ -122,7 +122,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
||||
statuses.remove(index);
|
||||
}else{
|
||||
speedMultiplier *= entry.effect.speedMultiplier;
|
||||
armorMultiplier *= entry.effect.armorMultiplier;
|
||||
healthMultiplier *= entry.effect.healthMultiplier;
|
||||
damageMultiplier *= entry.effect.damageMultiplier;
|
||||
reloadMultiplier *= entry.effect.reloadMultiplier;
|
||||
entry.effect.update(self(), entry.time);
|
||||
|
||||
Reference in New Issue
Block a user