Random assorted changes (#11338)
* shield stat changes * shield stats + leg crush stats + apply floormultiplier to comp
This commit is contained in:
@@ -1031,6 +1031,8 @@ stat.frequency = Frequency
|
|||||||
stat.targetsair = Targets Air
|
stat.targetsair = Targets Air
|
||||||
stat.targetsground = Targets Ground
|
stat.targetsground = Targets Ground
|
||||||
stat.crushdamage = Crush Damage
|
stat.crushdamage = Crush Damage
|
||||||
|
stat.legsplashdamage = Leg Splash Damage
|
||||||
|
stat.legsplashrange = Leg Splash Range
|
||||||
stat.itemsmoved = Move Speed
|
stat.itemsmoved = Move Speed
|
||||||
stat.launchtime = Time Between Launches
|
stat.launchtime = Time Between Launches
|
||||||
stat.shootrange = Range
|
stat.shootrange = Range
|
||||||
@@ -1070,6 +1072,7 @@ stat.reload = Firing Rate
|
|||||||
stat.ammo = Ammo
|
stat.ammo = Ammo
|
||||||
stat.shieldhealth = Shield Health
|
stat.shieldhealth = Shield Health
|
||||||
stat.cooldowntime = Cooldown Time
|
stat.cooldowntime = Cooldown Time
|
||||||
|
stat.regenerationrate = Regeneration Rate
|
||||||
stat.explosiveness = Explosiveness
|
stat.explosiveness = Explosiveness
|
||||||
stat.basedeflectchance = Base Deflect Chance
|
stat.basedeflectchance = Base Deflect Chance
|
||||||
stat.lightningchance = Lightning Chance
|
stat.lightningchance = Lightning Chance
|
||||||
@@ -1179,6 +1182,7 @@ bar.launchcooldown = Launch Cooldown
|
|||||||
bar.input = Input
|
bar.input = Input
|
||||||
bar.output = Output
|
bar.output = Output
|
||||||
bar.strength = [stat]{0}[lightgray]x strength
|
bar.strength = [stat]{0}[lightgray]x strength
|
||||||
|
bar.regenerationrate = [stat]{0}/sec[lightgray] regen rate
|
||||||
|
|
||||||
units.processorcontrol = [lightgray]Processor Controlled
|
units.processorcontrol = [lightgray]Processor Controlled
|
||||||
|
|
||||||
@@ -1229,6 +1233,7 @@ unit.millions = mil
|
|||||||
unit.billions = b
|
unit.billions = b
|
||||||
unit.shots = shots
|
unit.shots = shots
|
||||||
unit.pershot = /shot
|
unit.pershot = /shot
|
||||||
|
unit.perleg = per leg
|
||||||
category.purpose = Purpose
|
category.purpose = Purpose
|
||||||
category.general = General
|
category.general = General
|
||||||
category.power = Power
|
category.power = Power
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import mindustry.gen.*;
|
|||||||
import static mindustry.Vars.*;
|
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, healPercent = 0f;
|
||||||
public Effect healEffect = Fx.heal;
|
public Effect healEffect = Fx.heal;
|
||||||
public Effect activeEffect = Fx.healWaveDynamic;
|
public Effect activeEffect = Fx.healWaveDynamic;
|
||||||
public boolean parentizeEffects = false;
|
public boolean parentizeEffects = false;
|
||||||
@@ -27,6 +27,12 @@ public class RepairFieldAbility extends Ability{
|
|||||||
this.reload = reload;
|
this.reload = reload;
|
||||||
this.range = range;
|
this.range = range;
|
||||||
}
|
}
|
||||||
|
public RepairFieldAbility(float amount, float reload, float range, float healPercent){
|
||||||
|
this.amount = amount;
|
||||||
|
this.reload = reload;
|
||||||
|
this.range = range;
|
||||||
|
this.healPercent = healPercent;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addStats(Table t){
|
public void addStats(Table t){
|
||||||
@@ -34,6 +40,11 @@ public class RepairFieldAbility extends Ability{
|
|||||||
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
|
t.add(Core.bundle.format("bullet.range", Strings.autoFixed(range / tilesize, 2)));
|
||||||
t.row();
|
t.row();
|
||||||
t.add(abilityStat("repairspeed", Strings.autoFixed(amount * 60f / reload, 2)));
|
t.add(abilityStat("repairspeed", Strings.autoFixed(amount * 60f / reload, 2)));
|
||||||
|
t.row();
|
||||||
|
if(healPercent > 0f){
|
||||||
|
t.row();
|
||||||
|
t.add(Core.bundle.format("bullet.healpercent", Strings.autoFixed(healPercent, 2)));
|
||||||
|
}
|
||||||
if(sameTypeHealMult != 1f){
|
if(sameTypeHealMult != 1f){
|
||||||
t.row();
|
t.row();
|
||||||
t.add(abilityStat("sametypehealmultiplier", (sameTypeHealMult < 1f ? "[negstat]" : "") + Strings.autoFixed(sameTypeHealMult * 100f, 2)));
|
t.add(abilityStat("sametypehealmultiplier", (sameTypeHealMult < 1f ? "[negstat]" : "") + Strings.autoFixed(sameTypeHealMult * 100f, 2)));
|
||||||
@@ -53,7 +64,7 @@ public class RepairFieldAbility extends Ability{
|
|||||||
wasHealed = true;
|
wasHealed = true;
|
||||||
}
|
}
|
||||||
float healMult = unit.type == other.type ? sameTypeHealMult : 1f;
|
float healMult = unit.type == other.type ? sameTypeHealMult : 1f;
|
||||||
other.heal(amount * healMult);
|
other.heal((amount + healPercent / 100f * other.maxHealth()) * healMult);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(wasHealed){
|
if(wasHealed){
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ abstract class CrawlComp implements Posc, Rotc, Hitboxc, Unitc{
|
|||||||
public float floorSpeedMultiplier(){
|
public float floorSpeedMultiplier(){
|
||||||
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
||||||
//TODO take into account extra blocks
|
//TODO take into account extra blocks
|
||||||
return (on.isDeep() ? 0.45f : on.speedMultiplier) * speedMultiplier * lastCrawlSlowdown;
|
return ((float)Math.pow(on.isDeep() ? 0.45f : on.speedMultiplier, type.floorMultiplier)) * speedMultiplier * lastCrawlSlowdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
public float floorSpeedMultiplier(){
|
public float floorSpeedMultiplier(){
|
||||||
Floor on = isFlying() || type.hovering ? Blocks.air.asFloor() : floorOn();
|
Floor on = isFlying() || type.hovering ? Blocks.air.asFloor() : floorOn();
|
||||||
return on.speedMultiplier * speedMultiplier;
|
return (float)Math.pow(on.speedMultiplier, type.floorMultiplier) * speedMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when this unit was unloaded from a factory or spawn point. */
|
/** Called when this unit was unloaded from a factory or spawn point. */
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||||||
public float speed = 1.1f,
|
public float speed = 1.1f,
|
||||||
/** multiplier for speed when boosting */
|
/** multiplier for speed when boosting */
|
||||||
boostMultiplier = 1f,
|
boostMultiplier = 1f,
|
||||||
|
/** how affected this unit is by terrain */
|
||||||
|
floorMultiplier = 1f,
|
||||||
/** body rotation speed in degrees/t */
|
/** body rotation speed in degrees/t */
|
||||||
rotateSpeed = 5f,
|
rotateSpeed = 5f,
|
||||||
/** mech base rotation speed in degrees/t*/
|
/** mech base rotation speed in degrees/t*/
|
||||||
@@ -439,8 +441,6 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||||||
public int treadFrames = 18;
|
public int treadFrames = 18;
|
||||||
/** how much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected for */
|
/** how much of a top part of a tread sprite is "cut off" relative to the pattern; this is corrected for */
|
||||||
public int treadPullOffset = 0;
|
public int treadPullOffset = 0;
|
||||||
/** how affected this unit is by terrain */
|
|
||||||
public float floorMultiplier = 1f;
|
|
||||||
|
|
||||||
//SEGMENTED / CRAWL UNITS (this is WIP content!)
|
//SEGMENTED / CRAWL UNITS (this is WIP content!)
|
||||||
|
|
||||||
@@ -750,6 +750,11 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||||||
stats.add(Stat.crushDamage, crushDamage * 60f * 5f, StatUnit.perSecond);
|
stats.add(Stat.crushDamage, crushDamage * 60f * 5f, StatUnit.perSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(legSplashDamage > 0 && legSplashRange > 0){
|
||||||
|
stats.add(Stat.legSplashDamage, legSplashDamage, StatUnit.perLeg);
|
||||||
|
stats.add(Stat.legSplashRange, Strings.autoFixed(legSplashRange / tilesize, 1), StatUnit.blocks);
|
||||||
|
}
|
||||||
|
|
||||||
stats.add(Stat.targetsAir, targetAir);
|
stats.add(Stat.targetsAir, targetAir);
|
||||||
stats.add(Stat.targetsGround, targetGround);
|
stats.add(Stat.targetsGround, targetGround);
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import mindustry.game.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.logic.*;
|
import mindustry.logic.*;
|
||||||
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
import mindustry.world.blocks.*;
|
import mindustry.world.blocks.*;
|
||||||
@@ -101,12 +102,40 @@ public class ForceProjector extends Block{
|
|||||||
if(consItems) stats.timePeriod = phaseUseTime;
|
if(consItems) stats.timePeriod = phaseUseTime;
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.add(Stat.shieldHealth, shieldHealth, StatUnit.none);
|
stats.add(Stat.shieldHealth, shieldHealth, StatUnit.none);
|
||||||
|
stats.add(Stat.regenerationRate, cooldownNormal * 60f, StatUnit.perSecond);
|
||||||
stats.add(Stat.cooldownTime, (int) (shieldHealth / cooldownBrokenBase / 60f), StatUnit.seconds);
|
stats.add(Stat.cooldownTime, (int) (shieldHealth / cooldownBrokenBase / 60f), StatUnit.seconds);
|
||||||
|
|
||||||
if(consItems && itemConsumer instanceof ConsumeItems coni){
|
if(consItems && itemConsumer instanceof ConsumeItems coni){
|
||||||
stats.remove(Stat.booster);
|
stats.remove(Stat.booster);
|
||||||
stats.add(Stat.booster, StatValues.itemBoosters("+{0} " + StatUnit.shieldHealth.localized(), stats.timePeriod, phaseShieldBoost, phaseRadiusBoost, coni.items));
|
stats.add(Stat.booster, StatValues.itemBoosters("+{0} " + StatUnit.shieldHealth.localized(), stats.timePeriod, phaseShieldBoost, phaseRadiusBoost, coni.items));
|
||||||
stats.add(Stat.booster, StatValues.speedBoosters("", coolantConsumption, Float.MAX_VALUE, true, this::consumesLiquid));
|
|
||||||
|
stats.add(Stat.booster, (table) -> {
|
||||||
|
table.row();
|
||||||
|
table.table(c -> {
|
||||||
|
for(Liquid liquid : content.liquids()){
|
||||||
|
if(!consumesLiquid(liquid)) continue;
|
||||||
|
|
||||||
|
c.table(Styles.grayPanel, b -> {
|
||||||
|
b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit).with(i -> StatValues.withTooltip(i, liquid, false));
|
||||||
|
b.table(info -> {
|
||||||
|
info.add(liquid.localizedName).left().row();
|
||||||
|
info.add(Strings.autoFixed(coolantConsumption * 60f, 2) + StatUnit.perSecond.localized()).left().color(Color.lightGray);
|
||||||
|
});
|
||||||
|
|
||||||
|
float liquidHeat = (1f + (liquid.heatCapacity - 0.4f) * 0.9f);
|
||||||
|
float regenBoost = ((cooldownNormal * (cooldownLiquid * liquidHeat)) - cooldownNormal) * 60f;
|
||||||
|
float cooldownBoost = (shieldHealth / (cooldownBrokenBase * (cooldownLiquid * liquidHeat)) - shieldHealth / cooldownBrokenBase) / 60f;
|
||||||
|
|
||||||
|
b.table(bt -> {
|
||||||
|
bt.right().defaults().padRight(3).left();
|
||||||
|
bt.add("[lightgray]+" + Core.bundle.format("bar.regenerationrate", Strings.autoFixed(regenBoost, 2))).pad(5).row();
|
||||||
|
bt.add(Core.bundle.format("ability.stat.cooldown", Strings.autoFixed(cooldownBoost, 2))).pad(5);
|
||||||
|
}).right().grow().pad(10f).padRight(15f);
|
||||||
|
}).growX().pad(5).row();
|
||||||
|
}
|
||||||
|
}).growX().colspan(table.getColumns());
|
||||||
|
table.row();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ public class Stat implements Comparable<Stat>{
|
|||||||
shots = new Stat("shots", StatCat.function),
|
shots = new Stat("shots", StatCat.function),
|
||||||
reload = new Stat("reload", StatCat.function),
|
reload = new Stat("reload", StatCat.function),
|
||||||
crushDamage = new Stat("crushDamage", StatCat.function),
|
crushDamage = new Stat("crushDamage", StatCat.function),
|
||||||
|
legSplashDamage = new Stat("legSplashDamage", StatCat.function),
|
||||||
|
legSplashRange = new Stat("legSplashRange", StatCat.function),
|
||||||
targetsAir = new Stat("targetsAir", StatCat.function),
|
targetsAir = new Stat("targetsAir", StatCat.function),
|
||||||
targetsGround = new Stat("targetsGround", StatCat.function),
|
targetsGround = new Stat("targetsGround", StatCat.function),
|
||||||
damage = new Stat("damage", StatCat.function),
|
damage = new Stat("damage", StatCat.function),
|
||||||
@@ -92,6 +94,7 @@ public class Stat implements Comparable<Stat>{
|
|||||||
ammoUse = new Stat("ammoUse", StatCat.function),
|
ammoUse = new Stat("ammoUse", StatCat.function),
|
||||||
shieldHealth = new Stat("shieldHealth", StatCat.function),
|
shieldHealth = new Stat("shieldHealth", StatCat.function),
|
||||||
cooldownTime = new Stat("cooldownTime", StatCat.function),
|
cooldownTime = new Stat("cooldownTime", StatCat.function),
|
||||||
|
regenerationRate = new Stat("regenerationRate", StatCat.function),
|
||||||
moduleTier = new Stat("moduletier", StatCat.function),
|
moduleTier = new Stat("moduletier", StatCat.function),
|
||||||
unitType = new Stat("unittype", StatCat.function),
|
unitType = new Stat("unittype", StatCat.function),
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class StatUnit{
|
|||||||
perSecond = new StatUnit("perSecond", false),
|
perSecond = new StatUnit("perSecond", false),
|
||||||
perMinute = new StatUnit("perMinute", false),
|
perMinute = new StatUnit("perMinute", false),
|
||||||
perShot = new StatUnit("perShot", false),
|
perShot = new StatUnit("perShot", false),
|
||||||
|
perLeg = new StatUnit("perLeg"),
|
||||||
timesSpeed = new StatUnit("timesSpeed", false),
|
timesSpeed = new StatUnit("timesSpeed", false),
|
||||||
multiplier = new StatUnit("multiplier", false),
|
multiplier = new StatUnit("multiplier", false),
|
||||||
percent = new StatUnit("percent", false),
|
percent = new StatUnit("percent", false),
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ public class StatValues{
|
|||||||
if(!filter.get(liquid)) continue;
|
if(!filter.get(liquid)) continue;
|
||||||
|
|
||||||
c.table(Styles.grayPanel, b -> {
|
c.table(Styles.grayPanel, b -> {
|
||||||
b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit).with(i -> withTooltip(i, liquid, false));;
|
b.image(liquid.uiIcon).size(40).pad(10f).left().scaling(Scaling.fit).with(i -> withTooltip(i, liquid, false));
|
||||||
b.table(info -> {
|
b.table(info -> {
|
||||||
info.add(liquid.localizedName).left().row();
|
info.add(liquid.localizedName).left().row();
|
||||||
info.add(Strings.autoFixed(amount * 60f, 2) + StatUnit.perSecond.localized()).left().color(Color.lightGray);
|
info.add(Strings.autoFixed(amount * 60f, 2) + StatUnit.perSecond.localized()).left().color(Color.lightGray);
|
||||||
|
|||||||
Reference in New Issue
Block a user