mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-02 04:13:44 +07:00
Better Ability Stats (#9654)
* Fix armor plate multiplier + change Math.round to Strings.autoFixed * Missing ability name bundles * Center ability name * SuppressionFieldAbility stats * Is two per row is acceptable? I can revert this commit if not. * LiquidExplodeAbility stat display * MoveLightningAbility stat display * Better SpawnDeathAbility display * Fix multiplier coloring inconsistencies Some had [lightgray] before %/x, some had it after * Consistent content name display Match with bullet status effects * Consistent stat formatting Convert from some being "stat: #" and some being "# stat" to all being "# stat" * Re-order stats * Optimize Imports * Add ability descriptions * Apparently I forgot LiquidRegenAbility * Mention healing allies if displayHeal = true
This commit is contained in:
parent
d8c1ea17e1
commit
2fb5bc56c6
@ -998,17 +998,47 @@ stat.immunities = Immunities
|
|||||||
stat.healing = Healing
|
stat.healing = Healing
|
||||||
|
|
||||||
ability.forcefield = Force Field
|
ability.forcefield = Force Field
|
||||||
|
ability.forcefield.description = Projects a force shield that absorbs bullets
|
||||||
ability.repairfield = Repair Field
|
ability.repairfield = Repair Field
|
||||||
|
ability.repairfield.description = Repairs nearby units
|
||||||
ability.statusfield = Status Field
|
ability.statusfield = Status Field
|
||||||
|
ability.statusfield.description = Applies a status effect to nearby units
|
||||||
ability.unitspawn = Factory
|
ability.unitspawn = Factory
|
||||||
|
ability.unitspawn.description = Constructs units
|
||||||
ability.shieldregenfield = Shield Regen Field
|
ability.shieldregenfield = Shield Regen Field
|
||||||
|
ability.shieldregenfield.description = Regenerates shields of nearby units
|
||||||
ability.movelightning = Movement Lightning
|
ability.movelightning = Movement Lightning
|
||||||
|
ability.movelightning.description = Releases lightning while moving
|
||||||
|
ability.armorplate = Armor Plate
|
||||||
|
ability.armorplate.description = Reduces damage taken while shooting
|
||||||
ability.shieldarc = Shield Arc
|
ability.shieldarc = Shield Arc
|
||||||
|
ability.shieldarc.description = Projects a force shield in an arc that absorbs bullets
|
||||||
ability.suppressionfield = Repair Suppression
|
ability.suppressionfield = Repair Suppression
|
||||||
|
ability.suppressionfield.description = Stops nearby repair buildings
|
||||||
ability.energyfield = Energy Field
|
ability.energyfield = Energy Field
|
||||||
ability.energyfield.sametypehealmultiplier = [lightgray]Same Type Healing: [white]{0}%
|
ability.energyfield.description = Zaps nearby enemies
|
||||||
ability.energyfield.maxtargets = [lightgray]Max Targets: [white]{0}
|
ability.energyfield.healdescription = Zaps nearby enemies and heals allies
|
||||||
ability.regen = Regeneration
|
ability.regen = Self Regeneration
|
||||||
|
ability.regen.description = Regenerates own health over time
|
||||||
|
ability.liquidregen = Liquid Absorption
|
||||||
|
ability.liquidregen.description = Absorbs liquid to heal itself
|
||||||
|
ability.spawndeath = Death Spawns
|
||||||
|
ability.spawndeath.description = Releases units on death
|
||||||
|
ability.liquidexplode = Death Spillage
|
||||||
|
ability.liquidexplode.description = Spills liquid on death
|
||||||
|
|
||||||
|
ability.stat.firingrate = [stat]{0}/sec[lightgray] firing rate
|
||||||
|
ability.stat.regen = [stat]{0}[lightgray] health/sec
|
||||||
|
ability.stat.shield = [stat]{0}[lightgray] shield
|
||||||
|
ability.stat.repairspeed = [stat]{0}/sec[lightgray] repair speed
|
||||||
|
ability.stat.slurpheal = [stat]{0}[lightgray] health/liquid unit
|
||||||
|
ability.stat.cooldown = [stat]{0} sec[lightgray] cooldown
|
||||||
|
ability.stat.maxtargets = [stat]{0}[lightgray] max targets
|
||||||
|
ability.stat.sametypehealmultiplier = [stat]{0}%[lightgray] same type repair amount
|
||||||
|
ability.stat.damagereduction = [stat]{0}%[lightgray] damage reduction
|
||||||
|
ability.stat.minspeed = [stat]{0} tiles/sec[lightgray] min speed
|
||||||
|
ability.stat.duration = [stat]{0} sec[lightgray] duration
|
||||||
|
ability.stat.buildtime = [stat]{0} sec[lightgray] build time
|
||||||
|
|
||||||
bar.onlycoredeposit = Only Core Depositing Allowed
|
bar.onlycoredeposit = Only Core Depositing Allowed
|
||||||
bar.drilltierreq = Better Drill Required
|
bar.drilltierreq = Better Drill Required
|
||||||
@ -1051,15 +1081,15 @@ bullet.armorpierce = [stat]armor piercing
|
|||||||
bullet.maxdamagefraction = [stat]{0}%[lightgray] damage limit
|
bullet.maxdamagefraction = [stat]{0}%[lightgray] damage limit
|
||||||
bullet.suppression = [stat]{0}[lightgray] seconds of repair suppression ~ [stat]{1}[lightgray] tiles
|
bullet.suppression = [stat]{0}[lightgray] seconds of repair suppression ~ [stat]{1}[lightgray] tiles
|
||||||
bullet.interval = [stat]{0}/sec[lightgray] interval bullets:
|
bullet.interval = [stat]{0}/sec[lightgray] interval bullets:
|
||||||
bullet.frags = [stat]{0}[lightgray]x frag bullets:
|
bullet.frags = [stat]{0}x[lightgray] frag bullets:
|
||||||
bullet.lightning = [stat]{0}[lightgray]x lightning ~ [stat]{1}[lightgray] damage
|
bullet.lightning = [stat]{0}x[lightgray] lightning ~ [stat]{1}[lightgray] damage
|
||||||
bullet.buildingdamage = [stat]{0}%[lightgray] building damage
|
bullet.buildingdamage = [stat]{0}%[lightgray] building damage
|
||||||
bullet.knockback = [stat]{0}[lightgray] knockback
|
bullet.knockback = [stat]{0}[lightgray] knockback
|
||||||
bullet.pierce = [stat]{0}[lightgray]x pierce
|
bullet.pierce = [stat]{0}x[lightgray] pierce
|
||||||
bullet.infinitepierce = [stat]pierce
|
bullet.infinitepierce = [stat]pierce
|
||||||
bullet.healpercent = [stat]{0}[lightgray]% repair
|
bullet.healpercent = [stat]{0}%[lightgray] repair
|
||||||
bullet.healamount = [stat]{0}[lightgray] direct repair
|
bullet.healamount = [stat]{0}[lightgray] direct repair
|
||||||
bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier
|
bullet.multiplier = [stat]{0}x[lightgray] ammo multiplier
|
||||||
bullet.reload = [stat]{0}%[lightgray] fire rate
|
bullet.reload = [stat]{0}%[lightgray] fire rate
|
||||||
bullet.range = [stat]{0}[lightgray] tiles range
|
bullet.range = [stat]{0}[lightgray] tiles range
|
||||||
|
|
||||||
|
@ -3895,7 +3895,7 @@ public class UnitTypes{
|
|||||||
x = 43f * i / 4f;
|
x = 43f * i / 4f;
|
||||||
particles = parts;
|
particles = parts;
|
||||||
//visual only, the middle one does the actual suppressing
|
//visual only, the middle one does the actual suppressing
|
||||||
display = active = false;
|
active = false;
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import mindustry.gen.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
public abstract class Ability implements Cloneable{
|
public abstract class Ability implements Cloneable{
|
||||||
|
protected static final float descriptionWidth = 350f;
|
||||||
/** If false, this ability does not show in unit stats. */
|
/** If false, this ability does not show in unit stats. */
|
||||||
public boolean display = true;
|
public boolean display = true;
|
||||||
//the one and only data variable that is synced.
|
//the one and only data variable that is synced.
|
||||||
@ -16,7 +17,16 @@ public abstract class Ability implements Cloneable{
|
|||||||
public void death(Unit unit){}
|
public void death(Unit unit){}
|
||||||
public void init(UnitType type){}
|
public void init(UnitType type){}
|
||||||
public void displayBars(Unit unit, Table bars){}
|
public void displayBars(Unit unit, Table bars){}
|
||||||
public void addStats(Table t){}
|
public void addStats(Table t){
|
||||||
|
if(Core.bundle.has(getBundle() + ".description")){
|
||||||
|
t.add(Core.bundle.get(getBundle() + ".description")).wrap().width(descriptionWidth);
|
||||||
|
t.row();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String abilityStat(String stat, Object... values){
|
||||||
|
return Core.bundle.format("ability.stat." + stat, values);
|
||||||
|
}
|
||||||
|
|
||||||
public Ability copy(){
|
public Ability copy(){
|
||||||
try{
|
try{
|
||||||
@ -29,7 +39,11 @@ public abstract class Ability implements Cloneable{
|
|||||||
|
|
||||||
/** @return localized ability name; mods should override this. */
|
/** @return localized ability name; mods should override this. */
|
||||||
public String localized(){
|
public String localized(){
|
||||||
|
return Core.bundle.get(getBundle());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBundle(){
|
||||||
var type = getClass();
|
var type = getClass();
|
||||||
return Core.bundle.get("ability." + (type.isAnonymousClass() ? type.getSuperclass() : type).getSimpleName().replace("Ability", "").toLowerCase());
|
return "ability." + (type.isAnonymousClass() ? type.getSuperclass() : type).getSimpleName().replace("Ability", "").toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,10 @@ import arc.*;
|
|||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.scene.ui.layout.Table;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
public class ArmorPlateAbility extends Ability{
|
public class ArmorPlateAbility extends Ability{
|
||||||
public TextureRegion plateRegion;
|
public TextureRegion plateRegion;
|
||||||
@ -39,7 +38,8 @@ public class ArmorPlateAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add("[lightgray]" + Stat.healthMultiplier.localized() + ": [white]" + Math.round(healthMultiplier * 100f) + 100 + "%");
|
super.addStats(t);
|
||||||
|
t.add(abilityStat("damagereduction", Strings.autoFixed(-healthMultiplier * 100f, 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,7 +14,6 @@ import mindustry.game.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@ -53,23 +52,29 @@ public class EnergyFieldAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add(Core.bundle.format("bullet.damage", damage));
|
if(displayHeal){
|
||||||
|
t.add(Core.bundle.get(getBundle() + ".healdescription")).wrap().width(descriptionWidth);
|
||||||
|
}else{
|
||||||
|
t.add(Core.bundle.get(getBundle() + ".description")).wrap().width(descriptionWidth);
|
||||||
|
}
|
||||||
t.row();
|
t.row();
|
||||||
t.add("[lightgray]" + Stat.reload.localized() + ": [white]" + Strings.autoFixed(60f / reload, 2) + " " + StatUnit.perSecond.localized());
|
|
||||||
t.row();
|
|
||||||
t.add("[lightgray]" + Stat.shootRange.localized() + ": [white]" + Strings.autoFixed(range / tilesize, 2) + " " + StatUnit.blocks.localized());
|
|
||||||
t.row();
|
|
||||||
t.add(Core.bundle.format("ability.energyfield.maxtargets", maxTargets));
|
|
||||||
|
|
||||||
|
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
|
||||||
|
t.row();
|
||||||
|
t.add(abilityStat("firingrate", Strings.autoFixed(60f / reload, 2)));
|
||||||
|
t.row();
|
||||||
|
t.add(abilityStat("maxtargets", maxTargets));
|
||||||
|
t.row();
|
||||||
|
t.add(Core.bundle.format("bullet.damage", damage));
|
||||||
|
if(status != StatusEffects.none){
|
||||||
|
t.row();
|
||||||
|
t.add((status.hasEmoji() ? status.emoji() : "") + "[stat]" + status.localizedName);
|
||||||
|
}
|
||||||
if(displayHeal){
|
if(displayHeal){
|
||||||
t.row();
|
t.row();
|
||||||
t.add(Core.bundle.format("bullet.healpercent", Strings.autoFixed(healPercent, 2)));
|
t.add(Core.bundle.format("bullet.healpercent", Strings.autoFixed(healPercent, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add(Core.bundle.format("ability.energyfield.sametypehealmultiplier", Math.round(sameTypeHealMult * 100f)));
|
t.add(abilityStat("sametypehealmultiplier", (sameTypeHealMult < 1f ? "[negstat]" : "") + Strings.autoFixed(sameTypeHealMult * 100f, 2)));
|
||||||
}
|
|
||||||
if(status != StatusEffects.none){
|
|
||||||
t.row();
|
|
||||||
t.add(status.emoji() + " " + status.localizedName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
@ -12,7 +13,6 @@ import mindustry.content.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@ -73,14 +73,14 @@ public class ForceFieldAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add("[lightgray]" + Stat.health.localized() + ": [white]" + Math.round(max));
|
super.addStats(t);
|
||||||
|
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(radius / tilesize, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add("[lightgray]" + Stat.shootRange.localized() + ": [white]" + Strings.autoFixed(radius / tilesize, 2) + " " + StatUnit.blocks.localized());
|
t.add(abilityStat("shield", Strings.autoFixed(max, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add("[lightgray]" + Stat.repairSpeed.localized() + ": [white]" + Strings.autoFixed(regen * 60f, 2) + StatUnit.perSecond.localized());
|
t.add(abilityStat("repairspeed", Strings.autoFixed(regen * 60f, 2)));
|
||||||
t.row();
|
|
||||||
t.add("[lightgray]" + Stat.cooldownTime.localized() + ": [white]" + Strings.autoFixed(cooldown / 60f, 2) + " " + StatUnit.seconds.localized());
|
|
||||||
t.row();
|
t.row();
|
||||||
|
t.add(abilityStat("cooldown", Strings.autoFixed(cooldown / 60f, 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.noise.*;
|
import arc.util.noise.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
@ -16,6 +17,12 @@ public class LiquidExplodeAbility extends Ability{
|
|||||||
public float radAmountScale = 5f, radScale = 1f;
|
public float radAmountScale = 5f, radScale = 1f;
|
||||||
public float noiseMag = 6.5f, noiseScl = 5f;
|
public float noiseMag = 6.5f, noiseScl = 5f;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addStats(Table t){
|
||||||
|
super.addStats(t);
|
||||||
|
t.add((liquid.hasEmoji() ? liquid.emoji() : "") + "[stat]" + liquid.localizedName);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void death(Unit unit){
|
public void death(Unit unit){
|
||||||
//TODO what if noise is radial, so it looks like a splat?
|
//TODO what if noise is radial, so it looks like a splat?
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
@ -17,6 +18,14 @@ public class LiquidRegenAbility extends Ability{
|
|||||||
public float slurpEffectChance = 0.4f;
|
public float slurpEffectChance = 0.4f;
|
||||||
public Effect slurpEffect = Fx.heal;
|
public Effect slurpEffect = Fx.heal;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addStats(Table t){
|
||||||
|
super.addStats(t);
|
||||||
|
t.add((liquid.hasEmoji() ? liquid.emoji() : "") + "[stat]" + liquid.localizedName);
|
||||||
|
t.row();
|
||||||
|
t.add(abilityStat("slurpheal", Strings.autoFixed(regenPerSlurp, 2)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
//TODO timer?
|
//TODO timer?
|
||||||
|
@ -5,12 +5,15 @@ import arc.audio.*;
|
|||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.entities.bullet.*;
|
import mindustry.entities.bullet.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class MoveLightningAbility extends Ability{
|
public class MoveLightningAbility extends Ability{
|
||||||
/** Lightning damage */
|
/** Lightning damage */
|
||||||
public float damage = 35f;
|
public float damage = 35f;
|
||||||
@ -63,7 +66,15 @@ public class MoveLightningAbility extends Ability{
|
|||||||
this.maxSpeed = maxSpeed;
|
this.maxSpeed = maxSpeed;
|
||||||
this.color = color;
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addStats(Table t){
|
||||||
|
super.addStats(t);
|
||||||
|
t.add(abilityStat("minspeed", Strings.autoFixed(minSpeed * 60f / tilesize, 2)));
|
||||||
|
t.row();
|
||||||
|
t.add(Core.bundle.format("bullet.damage", damage));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
import arc.Core;
|
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
public class RegenAbility extends Ability{
|
public class RegenAbility extends Ability{
|
||||||
/** Amount healed as percent per tick. */
|
/** Amount healed as percent per tick. */
|
||||||
@ -14,13 +12,16 @@ public class RegenAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
if(amount > 0.01f){
|
super.addStats(t);
|
||||||
t.add("[lightgray]" + Stat.repairSpeed.localized() + ": [white]" + Strings.autoFixed(amount * 60f, 2) + StatUnit.perSecond.localized());
|
|
||||||
t.row();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(percentAmount > 0.01f){
|
boolean flat = amount >= 0.001f;
|
||||||
t.add(Core.bundle.format("bullet.healpercent", Strings.autoFixed(percentAmount * 60f, 2)) + StatUnit.perSecond.localized()); //stupid but works
|
boolean percent = percentAmount >= 0.001f;
|
||||||
|
|
||||||
|
if(flat || percent){
|
||||||
|
t.add(abilityStat("regen",
|
||||||
|
(flat ? Strings.autoFixed(amount * 60f, 2) + (percent ? " [lightgray]+[stat] " : "") : "")
|
||||||
|
+ (percent ? Strings.autoFixed(percentAmount * 60f, 2) + "%" : "")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.tilesize;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class RepairFieldAbility extends Ability{
|
public class RepairFieldAbility extends Ability{
|
||||||
public float amount = 1, reload = 100, range = 60;
|
public float amount = 1, reload = 100, range = 60;
|
||||||
@ -28,9 +28,10 @@ public class RepairFieldAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add("[lightgray]" + Stat.repairSpeed.localized() + ": [white]" + Strings.autoFixed(amount * 60f / reload, 2) + StatUnit.perSecond.localized());
|
super.addStats(t);
|
||||||
|
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add("[lightgray]" + Stat.shootRange.localized() + ": [white]" + Strings.autoFixed(range / tilesize, 2) + " " + StatUnit.blocks.localized());
|
t.add(abilityStat("repairspeed", Strings.autoFixed(amount * 60f / reload, 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,7 +13,6 @@ import mindustry.gen.*;
|
|||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
public class ShieldArcAbility extends Ability{
|
public class ShieldArcAbility extends Ability{
|
||||||
private static Unit paramUnit;
|
private static Unit paramUnit;
|
||||||
@ -69,12 +68,12 @@ public class ShieldArcAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add("[lightgray]" + Stat.health.localized() + ": [white]" + Math.round(max));
|
super.addStats(t);
|
||||||
|
t.add(abilityStat("shield", Strings.autoFixed(max, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add("[lightgray]" + Stat.repairSpeed.localized() + ": [white]" + Strings.autoFixed(regen * 60f, 2) + StatUnit.perSecond.localized());
|
t.add(abilityStat("repairspeed", Strings.autoFixed(regen * 60f, 2)));
|
||||||
t.row();
|
|
||||||
t.add("[lightgray]" + Stat.cooldownTime.localized() + ": [white]" + Strings.autoFixed(cooldown / 60f, 2) + " " + StatUnit.seconds.localized());
|
|
||||||
t.row();
|
t.row();
|
||||||
|
t.add(abilityStat("cooldown", Strings.autoFixed(cooldown / 60f, 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
import arc.Core;
|
import arc.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.tilesize;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class ShieldRegenFieldAbility extends Ability{
|
public class ShieldRegenFieldAbility extends Ability{
|
||||||
public float amount = 1, max = 100f, reload = 100, range = 60;
|
public float amount = 1, max = 100f, reload = 100, range = 60;
|
||||||
@ -30,12 +29,12 @@ public class ShieldRegenFieldAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add("[lightgray]" + Core.bundle.get("waves.shields") + ": [white]" + Math.round(max)); //extremely stupid usage
|
super.addStats(t);
|
||||||
|
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add("[lightgray]" + Stat.shootRange.localized() + ": [white]" + Strings.autoFixed(range / tilesize, 2) + " " + StatUnit.blocks.localized());
|
t.add(abilityStat("firingrate", Strings.autoFixed(60f / reload, 2)));
|
||||||
t.row();
|
|
||||||
t.add("[lightgray]" + Stat.reload.localized() + ": [white]" + Strings.autoFixed(60f / reload, 2) + " " + StatUnit.perSecond.localized());
|
|
||||||
t.row();
|
t.row();
|
||||||
|
t.add(abilityStat("shield", Strings.autoFixed(max, 2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -27,7 +27,8 @@ public class SpawnDeathAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add((randAmount > 0 ? amount + "-" + (amount + randAmount) : amount) + " " + unit.emoji() + " " + unit.localizedName);
|
super.addStats(t);
|
||||||
|
t.add("[stat]" + (randAmount > 0 ? amount + "x-" + (amount + randAmount) : amount) + "x[] " + (unit.hasEmoji() ? unit.emoji() : "") + "[stat]" + unit.localizedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.scene.ui.layout.Table;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.tilesize;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class StatusFieldAbility extends Ability{
|
public class StatusFieldAbility extends Ability{
|
||||||
public StatusEffect effect;
|
public StatusEffect effect;
|
||||||
@ -33,11 +33,12 @@ public class StatusFieldAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add("[lightgray]" + Stat.reload.localized() + ": [white]" + Strings.autoFixed(60f / reload, 2) + " " + StatUnit.perSecond.localized());
|
super.addStats(t);
|
||||||
|
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add("[lightgray]" + Stat.shootRange.localized() + ": [white]" + Strings.autoFixed(range / tilesize, 2) + " " + StatUnit.blocks.localized());
|
t.add(abilityStat("firingrate", Strings.autoFixed(60f / reload, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add(effect.emoji() + " " + effect.localizedName);
|
t.add((effect.hasEmoji() ? effect.emoji() : "") + "[stat]" + effect.localizedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
|
import mindustry.type.*;
|
||||||
|
|
||||||
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class SuppressionFieldAbility extends Ability{
|
public class SuppressionFieldAbility extends Ability{
|
||||||
protected static Rand rand = new Rand();
|
protected static Rand rand = new Rand();
|
||||||
@ -33,6 +38,19 @@ public class SuppressionFieldAbility extends Ability{
|
|||||||
|
|
||||||
protected float timer;
|
protected float timer;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(UnitType type){
|
||||||
|
if(!active) display = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addStats(Table t){
|
||||||
|
super.addStats(t);
|
||||||
|
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
|
||||||
|
t.row();
|
||||||
|
t.add(abilityStat("duration", Strings.autoFixed(reload / 60f, 2)));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
if(!active) return;
|
if(!active) return;
|
||||||
|
@ -12,7 +12,6 @@ import mindustry.game.EventType.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@ -36,9 +35,10 @@ public class UnitSpawnAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
t.add("[lightgray]" + Stat.buildTime.localized() + ": [white]" + Strings.autoFixed(spawnTime / 60f, 2) + " " + StatUnit.seconds.localized());
|
super.addStats(t);
|
||||||
|
t.add(abilityStat("buildtime", Strings.autoFixed(spawnTime / 60f, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add(unit.emoji() + " " + unit.localizedName);
|
t.add((unit.hasEmoji() ? unit.emoji() : "") + "[stat]" + unit.localizedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -374,17 +374,23 @@ public class StatValues{
|
|||||||
public static StatValue abilities(Seq<Ability> abilities){
|
public static StatValue abilities(Seq<Ability> abilities){
|
||||||
return table -> {
|
return table -> {
|
||||||
table.row();
|
table.row();
|
||||||
table.table(t -> abilities.each(ability -> {
|
table.table(t -> {
|
||||||
if(ability.display){
|
int count = 0;
|
||||||
t.row();
|
for(Ability ability : abilities){
|
||||||
t.table(Styles.grayPanel, a -> {
|
if(ability.display){
|
||||||
a.add("[accent]" + ability.localized()).padBottom(4);
|
t.table(Styles.grayPanel, a -> {
|
||||||
a.row();
|
a.add("[accent]" + ability.localized()).padBottom(4).center().top().expandX();
|
||||||
a.left().top().defaults().left();
|
a.row();
|
||||||
ability.addStats(a);
|
a.left().top().defaults().left();
|
||||||
}).pad(5).margin(10).growX();
|
ability.addStats(a);
|
||||||
}
|
}).pad(5).margin(10).growX().top().uniformX();
|
||||||
}));
|
if((++count) == 2){
|
||||||
|
count = 0;
|
||||||
|
t.row();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,7 +502,7 @@ public class StatValues{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(type.status != StatusEffects.none){
|
if(type.status != StatusEffects.none){
|
||||||
sep(bt, (type.status.minfo.mod == null ? type.status.emoji() : "") + "[stat]" + type.status.localizedName + (type.status.reactive ? "" : "[lightgray] ~ [stat]" + ((int)(type.statusDuration / 60f)) + "[lightgray] " + Core.bundle.get("unit.seconds")));
|
sep(bt, (type.status.hasEmoji() ? type.status.emoji() : "") + "[stat]" + type.status.localizedName + (type.status.reactive ? "" : "[lightgray] ~ [stat]" + ((int)(type.statusDuration / 60f)) + "[lightgray] " + Core.bundle.get("unit.seconds")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(type.intervalBullet != null){
|
if(type.intervalBullet != null){
|
||||||
@ -554,4 +560,4 @@ public class StatValues{
|
|||||||
private static TextureRegion icon(UnlockableContent t){
|
private static TextureRegion icon(UnlockableContent t){
|
||||||
return t.uiIcon;
|
return t.uiIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user