mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 19:39:04 +07:00
Fixed #3053
This commit is contained in:
parent
87dda1ba4b
commit
a80d0cc457
core
assets/bundles
src/mindustry
content
entities/abilities
logic
maps
type
ui/dialogs
world/meta
@ -640,6 +640,15 @@ stat.speed = Speed
|
|||||||
stat.buildspeed = Build Speed
|
stat.buildspeed = Build Speed
|
||||||
stat.minespeed = Mine Speed
|
stat.minespeed = Mine Speed
|
||||||
stat.minetier = Mine Tier
|
stat.minetier = Mine Tier
|
||||||
|
stat.payloadcapacity = Payload Capacity
|
||||||
|
stat.commandlimit = Command Limit
|
||||||
|
stat.abilities = Abilities
|
||||||
|
|
||||||
|
ability.forcefield = Force Field
|
||||||
|
ability.repairfield = Repair Field
|
||||||
|
ability.statusfield = Status Field
|
||||||
|
ability.unitspawn = {0} Factory
|
||||||
|
ability.shieldregenfield = Shield Regen Field
|
||||||
|
|
||||||
bar.drilltierreq = Better Drill Required
|
bar.drilltierreq = Better Drill Required
|
||||||
bar.noresources = Missing Resources
|
bar.noresources = Missing Resources
|
||||||
@ -680,6 +689,7 @@ bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier
|
|||||||
bullet.reload = [stat]{0}[lightgray]x fire rate
|
bullet.reload = [stat]{0}[lightgray]x fire rate
|
||||||
|
|
||||||
unit.blocks = blocks
|
unit.blocks = blocks
|
||||||
|
unit.blockssquared = blocks²
|
||||||
unit.powersecond = power units/second
|
unit.powersecond = power units/second
|
||||||
unit.liquidsecond = liquid units/second
|
unit.liquidsecond = liquid units/second
|
||||||
unit.itemssecond = items/second
|
unit.itemssecond = items/second
|
||||||
|
@ -276,7 +276,7 @@ public class UnitTypes implements ContentList{
|
|||||||
armor = 1f;
|
armor = 1f;
|
||||||
commandLimit = 8;
|
commandLimit = 8;
|
||||||
|
|
||||||
abilities.add(new HealFieldAbility(10f, 60f * 4, 60f));
|
abilities.add(new RepairFieldAbility(10f, 60f * 4, 60f));
|
||||||
ammoType = AmmoTypes.power;
|
ammoType = AmmoTypes.power;
|
||||||
|
|
||||||
weapons.add(new Weapon("heal-weapon"){{
|
weapons.add(new Weapon("heal-weapon"){{
|
||||||
@ -305,7 +305,7 @@ public class UnitTypes implements ContentList{
|
|||||||
mineSpeed = 5f;
|
mineSpeed = 5f;
|
||||||
commandLimit = 8;
|
commandLimit = 8;
|
||||||
|
|
||||||
abilities.add(new ShieldFieldAbility(20f, 40f, 60f * 5, 60f));
|
abilities.add(new ShieldRegenFieldAbility(20f, 40f, 60f * 5, 60f));
|
||||||
ammoType = AmmoTypes.power;
|
ammoType = AmmoTypes.power;
|
||||||
|
|
||||||
weapons.add(new Weapon("heal-shotgun-weapon"){{
|
weapons.add(new Weapon("heal-shotgun-weapon"){{
|
||||||
@ -1161,7 +1161,7 @@ public class UnitTypes implements ContentList{
|
|||||||
mineTier = 2;
|
mineTier = 2;
|
||||||
mineSpeed = 3.5f;
|
mineSpeed = 3.5f;
|
||||||
|
|
||||||
abilities.add(new HealFieldAbility(5f, 60f * 5, 50f));
|
abilities.add(new RepairFieldAbility(5f, 60f * 5, 50f));
|
||||||
|
|
||||||
weapons.add(new Weapon("heal-weapon-mount"){{
|
weapons.add(new Weapon("heal-weapon-mount"){{
|
||||||
top = false;
|
top = false;
|
||||||
@ -1318,7 +1318,7 @@ public class UnitTypes implements ContentList{
|
|||||||
ammoCapacity = 1300;
|
ammoCapacity = 1300;
|
||||||
ammoResupplyAmount = 20;
|
ammoResupplyAmount = 20;
|
||||||
|
|
||||||
abilities.add(new ForceFieldAbility(140f, 4f, 7000f, 60f * 8), new HealFieldAbility(130f, 60f * 2, 140f));
|
abilities.add(new ForceFieldAbility(140f, 4f, 7000f, 60f * 8), new RepairFieldAbility(130f, 60f * 2, 140f));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
@ -1430,7 +1430,7 @@ public class UnitTypes implements ContentList{
|
|||||||
trailY = -9f;
|
trailY = -9f;
|
||||||
trailScl = 1.5f;
|
trailScl = 1.5f;
|
||||||
|
|
||||||
abilities.add(new ShieldFieldAbility(20f, 40f, 60f * 4, 60f));
|
abilities.add(new ShieldRegenFieldAbility(20f, 40f, 60f * 4, 60f));
|
||||||
|
|
||||||
weapons.add(new Weapon("large-artillery"){{
|
weapons.add(new Weapon("large-artillery"){{
|
||||||
reload = 65f;
|
reload = 65f;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public abstract class Ability implements Cloneable{
|
public abstract class Ability implements Cloneable{
|
||||||
@ -14,4 +15,9 @@ public abstract class Ability implements Cloneable{
|
|||||||
throw new RuntimeException("java sucks", e);
|
throw new RuntimeException("java sucks", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return localized ability name; mods should override this. */
|
||||||
|
public String localized(){
|
||||||
|
return Core.bundle.get("ability." + getClass().getSimpleName().replace("Ability", "").toLowerCase());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import mindustry.content.*;
|
|||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class HealFieldAbility extends Ability{
|
public class RepairFieldAbility extends Ability{
|
||||||
public float amount = 1, reload = 100, range = 60;
|
public float amount = 1, reload = 100, range = 60;
|
||||||
public Effect healEffect = Fx.heal;
|
public Effect healEffect = Fx.heal;
|
||||||
public Effect activeEffect = Fx.healWaveDynamic;
|
public Effect activeEffect = Fx.healWaveDynamic;
|
||||||
@ -13,9 +13,9 @@ public class HealFieldAbility extends Ability{
|
|||||||
protected float timer;
|
protected float timer;
|
||||||
protected boolean wasHealed = false;
|
protected boolean wasHealed = false;
|
||||||
|
|
||||||
HealFieldAbility(){}
|
RepairFieldAbility(){}
|
||||||
|
|
||||||
public HealFieldAbility(float amount, float reload, float range){
|
public RepairFieldAbility(float amount, float reload, float range){
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.reload = reload;
|
this.reload = reload;
|
||||||
this.range = range;
|
this.range = range;
|
@ -5,7 +5,7 @@ import mindustry.content.*;
|
|||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class ShieldFieldAbility 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;
|
||||||
public Effect applyEffect = Fx.shieldApply;
|
public Effect applyEffect = Fx.shieldApply;
|
||||||
public Effect activeEffect = Fx.shieldWave;
|
public Effect activeEffect = Fx.shieldWave;
|
||||||
@ -13,9 +13,9 @@ public class ShieldFieldAbility extends Ability{
|
|||||||
protected float timer;
|
protected float timer;
|
||||||
protected boolean applied = false;
|
protected boolean applied = false;
|
||||||
|
|
||||||
ShieldFieldAbility(){}
|
ShieldRegenFieldAbility(){}
|
||||||
|
|
||||||
public ShieldFieldAbility(float amount, float max, float reload, float range){
|
public ShieldRegenFieldAbility(float amount, float max, float reload, float range){
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.max = max;
|
this.max = max;
|
||||||
this.reload = reload;
|
this.reload = reload;
|
@ -1,5 +1,6 @@
|
|||||||
package mindustry.entities.abilities;
|
package mindustry.entities.abilities;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
@ -56,4 +57,9 @@ public class UnitSpawnAbility extends Ability{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String localized(){
|
||||||
|
return Core.bundle.format("ability.unitspawn", type.localizedName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -437,8 +437,9 @@ public class LExecutor{
|
|||||||
ai.plan.set(x, y, rot, block);
|
ai.plan.set(x, y, rot, block);
|
||||||
ai.plan.config = null;
|
ai.plan.config = null;
|
||||||
|
|
||||||
|
builder.clearBuilding();
|
||||||
|
|
||||||
if(ai.plan.tile() != null){
|
if(ai.plan.tile() != null){
|
||||||
builder.clearBuilding();
|
|
||||||
builder.updateBuilding(true);
|
builder.updateBuilding(true);
|
||||||
builder.addBuild(ai.plan);
|
builder.addBuild(ai.plan);
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ public class SectorDamage{
|
|||||||
|
|
||||||
sumHealth += unit.health*healthMult + unit.shield;
|
sumHealth += unit.health*healthMult + unit.shield;
|
||||||
sumDps += unit.type.dpsEstimate;
|
sumDps += unit.type.dpsEstimate;
|
||||||
if(unit.abilities.find(a -> a instanceof HealFieldAbility) instanceof HealFieldAbility h){
|
if(unit.abilities.find(a -> a instanceof RepairFieldAbility) instanceof RepairFieldAbility h){
|
||||||
sumRps += h.amount / h.reload * 60f;
|
sumRps += h.amount / h.reload * 60f;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
@ -199,13 +199,29 @@ public class UnitType extends UnlockableContent{
|
|||||||
stats.add(Stat.speed, speed);
|
stats.add(Stat.speed, speed);
|
||||||
stats.add(Stat.itemCapacity, health);
|
stats.add(Stat.itemCapacity, health);
|
||||||
stats.add(Stat.range, (int)(maxRange / tilesize), StatUnit.blocks);
|
stats.add(Stat.range, (int)(maxRange / tilesize), StatUnit.blocks);
|
||||||
|
stats.add(Stat.commandLimit, commandLimit);
|
||||||
//TODO abilities, maybe try something like DPS
|
//TODO abilities, maybe try something like DPS
|
||||||
|
|
||||||
|
if(abilities.any()){
|
||||||
|
var unique = new ObjectSet<String>();
|
||||||
|
|
||||||
|
for(Ability a : abilities){
|
||||||
|
if(unique.add(a.localized())){
|
||||||
|
stats.add(Stat.abilities, a.localized());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(inst instanceof Minerc && mineTier >= 1){
|
if(inst instanceof Minerc && mineTier >= 1){
|
||||||
stats.addPercent(Stat.mineSpeed, mineSpeed);
|
stats.addPercent(Stat.mineSpeed, mineSpeed);
|
||||||
stats.add(Stat.mineTier, new BlockFilterValue(b -> b instanceof Floor f && f.itemDrop != null && f.itemDrop.hardness <= mineTier && !f.playerUnmineable));
|
stats.add(Stat.mineTier, new BlockFilterValue(b -> b instanceof Floor f && f.itemDrop != null && f.itemDrop.hardness <= mineTier && !f.playerUnmineable));
|
||||||
}
|
}
|
||||||
if(inst instanceof Builderc) stats.addPercent(Stat.buildSpeed, buildSpeed);
|
if(inst instanceof Builderc){
|
||||||
|
stats.addPercent(Stat.buildSpeed, buildSpeed);
|
||||||
|
}
|
||||||
|
if(inst instanceof Payloadc){
|
||||||
|
stats.add(Stat.payloadCapacity, (payloadCapacity / (tilesize * tilesize)), StatUnit.blocksSquared);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@CallSuper
|
@CallSuper
|
||||||
@ -231,10 +247,17 @@ public class UnitType extends UnlockableContent{
|
|||||||
//set up default range
|
//set up default range
|
||||||
if(range < 0){
|
if(range < 0){
|
||||||
range = Float.MAX_VALUE;
|
range = Float.MAX_VALUE;
|
||||||
maxRange = 0f;
|
|
||||||
for(Weapon weapon : weapons){
|
for(Weapon weapon : weapons){
|
||||||
range = Math.min(range, weapon.bullet.range() + hitSize /2f);
|
range = Math.min(range, weapon.bullet.range() + hitSize / 2f);
|
||||||
maxRange = Math.max(maxRange, weapon.bullet.range() + hitSize /2f);
|
maxRange = Math.max(maxRange, weapon.bullet.range() + hitSize / 2f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(maxRange < 0){
|
||||||
|
maxRange = 0f;
|
||||||
|
|
||||||
|
for(Weapon weapon : weapons){
|
||||||
|
maxRange = Math.max(maxRange, weapon.bullet.range() + hitSize / 2f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
boolean canSelect(Sector sector){
|
boolean canSelect(Sector sector){
|
||||||
if(mode == select) return sector.hasBase();
|
if(mode == select) return sector.hasBase();
|
||||||
|
|
||||||
return sector.near().contains(Sector::hasBase)//(sector.tile.v.within(launchSector.tile.v, (launchRange + 0.5f) * planets.planet.sectorApproxRadius*2) //within range
|
return sector.hasBase() || sector.near().contains(Sector::hasBase)//(sector.tile.v.within(launchSector.tile.v, (launchRange + 0.5f) * planets.planet.sectorApproxRadius*2) //within range
|
||||||
|| (sector.preset != null && sector.preset.unlocked()); //is an unlocked preset
|
|| (sector.preset != null && sector.preset.unlocked()); //is an unlocked preset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,12 @@ public enum Stat{
|
|||||||
buildSpeed,
|
buildSpeed,
|
||||||
mineSpeed,
|
mineSpeed,
|
||||||
mineTier,
|
mineTier,
|
||||||
|
payloadCapacity,
|
||||||
|
commandLimit,
|
||||||
baseDeflectChance,
|
baseDeflectChance,
|
||||||
lightningChance,
|
lightningChance,
|
||||||
lightningDamage,
|
lightningDamage,
|
||||||
|
abilities,
|
||||||
|
|
||||||
itemCapacity(StatCat.items),
|
itemCapacity(StatCat.items),
|
||||||
itemsMoved(StatCat.items),
|
itemsMoved(StatCat.items),
|
||||||
|
@ -9,6 +9,7 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
public enum StatUnit{
|
public enum StatUnit{
|
||||||
blocks,
|
blocks,
|
||||||
|
blocksSquared,
|
||||||
powerSecond,
|
powerSecond,
|
||||||
liquidSecond,
|
liquidSecond,
|
||||||
itemsSecond,
|
itemsSecond,
|
||||||
|
Loading…
Reference in New Issue
Block a user