T4/5 naval / Controversial weapon outlines
|
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 893 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
@@ -876,9 +876,11 @@ liquid.water.name = Water
|
|||||||
liquid.slag.name = Slag
|
liquid.slag.name = Slag
|
||||||
liquid.oil.name = Oil
|
liquid.oil.name = Oil
|
||||||
liquid.cryofluid.name = Cryofluid
|
liquid.cryofluid.name = Cryofluid
|
||||||
|
|
||||||
item.explosiveness = [lightgray]Explosiveness: {0}%
|
item.explosiveness = [lightgray]Explosiveness: {0}%
|
||||||
item.flammability = [lightgray]Flammability: {0}%
|
item.flammability = [lightgray]Flammability: {0}%
|
||||||
item.radioactivity = [lightgray]Radioactivity: {0}%
|
item.radioactivity = [lightgray]Radioactivity: {0}%
|
||||||
|
|
||||||
unit.health = [lightgray]Health: {0}
|
unit.health = [lightgray]Health: {0}
|
||||||
unit.speed = [lightgray]Speed: {0}
|
unit.speed = [lightgray]Speed: {0}
|
||||||
unit.weapon = [lightgray]Weapon: {0}
|
unit.weapon = [lightgray]Weapon: {0}
|
||||||
@@ -914,6 +916,8 @@ unit.mega.name = Mega
|
|||||||
unit.risso.name = Risso
|
unit.risso.name = Risso
|
||||||
unit.minke.name = Minke
|
unit.minke.name = Minke
|
||||||
unit.bryde.name = Bryde
|
unit.bryde.name = Bryde
|
||||||
|
unit.sei.name = Sei
|
||||||
|
unit.omura.name = Omura
|
||||||
unit.alpha.name = Alpha
|
unit.alpha.name = Alpha
|
||||||
unit.beta.name = Beta
|
unit.beta.name = Beta
|
||||||
unit.gamma.name = Gamma
|
unit.gamma.name = Gamma
|
||||||
|
|||||||
@@ -313,3 +313,4 @@
|
|||||||
63431=large-logic-display|block-large-logic-display-medium
|
63431=large-logic-display|block-large-logic-display-medium
|
||||||
63430=omura|unit-omura-medium
|
63430=omura|unit-omura-medium
|
||||||
63429=mud|block-mud-medium
|
63429=mud|block-mud-medium
|
||||||
|
63428=sei|unit-sei-medium
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 609 KiB After Width: | Height: | Size: 624 KiB |
|
Before Width: | Height: | Size: 849 KiB After Width: | Height: | Size: 850 KiB |
|
Before Width: | Height: | Size: 656 KiB After Width: | Height: | Size: 695 KiB |
|
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 416 KiB After Width: | Height: | Size: 416 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 190 KiB |
|
Before Width: | Height: | Size: 420 KiB After Width: | Height: | Size: 420 KiB |
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
@@ -1803,6 +1803,7 @@ public class Blocks implements ContentList{
|
|||||||
{UnitTypes.zenith, UnitTypes.antumbra},
|
{UnitTypes.zenith, UnitTypes.antumbra},
|
||||||
{UnitTypes.spiroct, UnitTypes.arkyid},
|
{UnitTypes.spiroct, UnitTypes.arkyid},
|
||||||
{UnitTypes.fortress, UnitTypes.scepter},
|
{UnitTypes.fortress, UnitTypes.scepter},
|
||||||
|
{UnitTypes.bryde, UnitTypes.sei},
|
||||||
};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1821,6 +1822,7 @@ public class Blocks implements ContentList{
|
|||||||
{UnitTypes.antumbra, UnitTypes.eclipse},
|
{UnitTypes.antumbra, UnitTypes.eclipse},
|
||||||
{UnitTypes.arkyid, UnitTypes.toxopid},
|
{UnitTypes.arkyid, UnitTypes.toxopid},
|
||||||
{UnitTypes.scepter, UnitTypes.reign},
|
{UnitTypes.scepter, UnitTypes.reign},
|
||||||
|
{UnitTypes.sei, UnitTypes.omura}
|
||||||
};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -269,13 +269,13 @@ public class Bullets implements ContentList{
|
|||||||
status = StatusEffects.burning;
|
status = StatusEffects.burning;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
missileSurge = new MissileBulletType(3.7f, 20){{
|
missileSurge = new MissileBulletType(3.7f, 18){{
|
||||||
width = 8f;
|
width = 8f;
|
||||||
height = 8f;
|
height = 8f;
|
||||||
shrinkY = 0f;
|
shrinkY = 0f;
|
||||||
drag = -0.01f;
|
drag = -0.01f;
|
||||||
splashDamageRadius = 28f;
|
splashDamageRadius = 25f;
|
||||||
splashDamage = 35f;
|
splashDamage = 25f;
|
||||||
hitEffect = Fx.blastExplosion;
|
hitEffect = Fx.blastExplosion;
|
||||||
despawnEffect = Fx.blastExplosion;
|
despawnEffect = Fx.blastExplosion;
|
||||||
lightning = 2;
|
lightning = 2;
|
||||||
|
|||||||
@@ -1054,7 +1054,7 @@ public class Fx{
|
|||||||
|
|
||||||
lancerLaserShootSmoke = new Effect(26f, e -> {
|
lancerLaserShootSmoke = new Effect(26f, e -> {
|
||||||
color(Color.white);
|
color(Color.white);
|
||||||
float length = e.data == null ? 70f : (Float)e.data;
|
float length = e.data == null || !(e.data instanceof Float) ? 70f : (Float)e.data;
|
||||||
|
|
||||||
randLenVectors(e.id, 7, length, e.rotation, 0f, (x, y) -> {
|
randLenVectors(e.id, 7, length, e.rotation, 0f, (x, y) -> {
|
||||||
lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f);
|
lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class UnitTypes implements ContentList{
|
|||||||
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType alpha, beta, gamma;
|
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType alpha, beta, gamma;
|
||||||
|
|
||||||
//water + commander
|
//water + commander
|
||||||
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType risso, minke, bryde, omura;
|
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType risso, minke, bryde, sei, omura;
|
||||||
|
|
||||||
//special block unit type
|
//special block unit type
|
||||||
public static @EntityDef({Unitc.class, BlockUnitc.class}) UnitType block;
|
public static @EntityDef({Unitc.class, BlockUnitc.class}) UnitType block;
|
||||||
@@ -275,7 +275,7 @@ public class UnitTypes implements ContentList{
|
|||||||
itemCapacity = 60;
|
itemCapacity = 60;
|
||||||
canBoost = true;
|
canBoost = true;
|
||||||
boostMultiplier = 1.5f;
|
boostMultiplier = 1.5f;
|
||||||
speed = 0.48f;
|
speed = 0.62f;
|
||||||
hitsize = 10f;
|
hitsize = 10f;
|
||||||
health = 320f;
|
health = 320f;
|
||||||
buildSpeed = 0.9f;
|
buildSpeed = 0.9f;
|
||||||
@@ -1254,18 +1254,104 @@ public class UnitTypes implements ContentList{
|
|||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
sei = new UnitType("sei"){{
|
||||||
|
health = 10000;
|
||||||
|
armor = 12f;
|
||||||
|
|
||||||
|
speed = 0.73f;
|
||||||
|
drag = 0.17f;
|
||||||
|
hitsize = 39f;
|
||||||
|
accel = 0.2f;
|
||||||
|
rotateSpeed = 1.3f;
|
||||||
|
immunities = ObjectSet.with(StatusEffects.wet);
|
||||||
|
rotateShooting = false;
|
||||||
|
|
||||||
|
trailLength = 50;
|
||||||
|
trailX = 18f;
|
||||||
|
trailY = -21f;
|
||||||
|
trailScl = 3f;
|
||||||
|
|
||||||
|
weapons.add(new Weapon("sei-launcher"){{
|
||||||
|
|
||||||
|
x = 0f;
|
||||||
|
y = 0f;
|
||||||
|
rotate = true;
|
||||||
|
rotateSpeed = 4f;
|
||||||
|
mirror = false;
|
||||||
|
|
||||||
|
occlusion = 30f;
|
||||||
|
|
||||||
|
shootY = 2f;
|
||||||
|
recoil = 4f;
|
||||||
|
reload = 45f;
|
||||||
|
shots = 6;
|
||||||
|
spacing = 10f;
|
||||||
|
velocityRnd = 0.4f;
|
||||||
|
inaccuracy = 7f;
|
||||||
|
ejectEffect = Fx.none;
|
||||||
|
shake = 3f;
|
||||||
|
shootSound = Sounds.shootBig;
|
||||||
|
xRand = 8f;
|
||||||
|
shotDelay = 1f;
|
||||||
|
|
||||||
|
bullet = new MissileBulletType(4.2f, 25){{
|
||||||
|
homingPower = 0.12f;
|
||||||
|
width = 8f;
|
||||||
|
height = 8f;
|
||||||
|
shrinkX = shrinkY = 0f;
|
||||||
|
drag = -0.003f;
|
||||||
|
homingRange = 80f;
|
||||||
|
keepVelocity = false;
|
||||||
|
splashDamageRadius = 25f;
|
||||||
|
splashDamage = 25f;
|
||||||
|
lifetime = 56f;
|
||||||
|
trailColor = Pal.bulletYellowBack;
|
||||||
|
backColor = Pal.bulletYellowBack;
|
||||||
|
frontColor = Pal.bulletYellow;
|
||||||
|
hitEffect = Fx.blastExplosion;
|
||||||
|
despawnEffect = Fx.blastExplosion;
|
||||||
|
weaveScale = 8f;
|
||||||
|
weaveMag = 2f;
|
||||||
|
}};
|
||||||
|
}});
|
||||||
|
|
||||||
|
weapons.add(new Weapon("large-bullet-mount"){{
|
||||||
|
reload = 80f;
|
||||||
|
cooldownTime = 90f;
|
||||||
|
x = 70f/4f;
|
||||||
|
y = -66f/4f;
|
||||||
|
rotateSpeed = 4f;
|
||||||
|
rotate = true;
|
||||||
|
shootY = 7f;
|
||||||
|
shake = 2f;
|
||||||
|
recoil = 3f;
|
||||||
|
occlusion = 12f;
|
||||||
|
ejectEffect = Fx.shellEjectBig;
|
||||||
|
|
||||||
|
shots = 3;
|
||||||
|
shotDelay = 4f;
|
||||||
|
inaccuracy = 1f;
|
||||||
|
bullet = new BasicBulletType(7f, 50){{
|
||||||
|
width = 13f;
|
||||||
|
height = 19f;
|
||||||
|
shootEffect = Fx.shootBig;
|
||||||
|
lifetime = 30f;
|
||||||
|
}};
|
||||||
|
}});
|
||||||
|
}};
|
||||||
|
|
||||||
omura = new UnitType("omura"){{
|
omura = new UnitType("omura"){{
|
||||||
health = 20000;
|
health = 22000;
|
||||||
speed = 0.62f;
|
speed = 0.62f;
|
||||||
drag = 0.18f;
|
drag = 0.18f;
|
||||||
hitsize = 50f;
|
hitsize = 50f;
|
||||||
armor = 15f;
|
armor = 16f;
|
||||||
accel = 0.19f;
|
accel = 0.19f;
|
||||||
rotateSpeed = 0.9f;
|
rotateSpeed = 0.9f;
|
||||||
immunities = ObjectSet.with(StatusEffects.wet);
|
immunities = ObjectSet.with(StatusEffects.wet);
|
||||||
rotateShooting = false;
|
rotateShooting = false;
|
||||||
|
|
||||||
float spawnTime = 0.75f * Time.toMinutes;
|
float spawnTime = 0.5f * Time.toMinutes;
|
||||||
|
|
||||||
abilities.add(new UnitSpawnAbility(flare, spawnTime, 19.25f, -31.75f), new UnitSpawnAbility(flare, spawnTime, -19.25f, -31.75f));
|
abilities.add(new UnitSpawnAbility(flare, spawnTime, 19.25f, -31.75f), new UnitSpawnAbility(flare, spawnTime, -19.25f, -31.75f));
|
||||||
|
|
||||||
@@ -1285,20 +1371,20 @@ public class UnitTypes implements ContentList{
|
|||||||
shootY = 23f;
|
shootY = 23f;
|
||||||
shake = 6f;
|
shake = 6f;
|
||||||
recoil = 10.5f;
|
recoil = 10.5f;
|
||||||
occlusion = 42f;
|
occlusion = 50f;
|
||||||
|
|
||||||
shots = 1;
|
shots = 1;
|
||||||
ejectEffect = Fx.none;
|
ejectEffect = Fx.none;
|
||||||
|
|
||||||
bullet = new RailBulletType(){{
|
bullet = new RailBulletType(){{
|
||||||
shootEffect = Fx.railShoot;
|
shootEffect = Fx.railShoot;
|
||||||
speed = 65f;
|
speed = 67f;
|
||||||
lifetime = 8f;
|
lifetime = 8f;
|
||||||
pierceEffect = Fx.railHit;
|
pierceEffect = Fx.railHit;
|
||||||
updateEffect = Fx.railTrail;
|
updateEffect = Fx.railTrail;
|
||||||
hitEffect = Fx.massiveExplosion;
|
hitEffect = Fx.massiveExplosion;
|
||||||
smokeEffect = Fx.shootBig2;
|
smokeEffect = Fx.shootBig2;
|
||||||
damage = 1200;
|
damage = 1250;
|
||||||
pierceDamageFactor = 0.5f;
|
pierceDamageFactor = 0.5f;
|
||||||
}};
|
}};
|
||||||
}});
|
}});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public enum EditorTool{
|
|||||||
if(!Structs.inBounds(x, y, editor.width(), editor.height())) return;
|
if(!Structs.inBounds(x, y, editor.width(), editor.height())) return;
|
||||||
|
|
||||||
Tile tile = editor.tile(x, y);
|
Tile tile = editor.tile(x, y);
|
||||||
editor.drawBlock = tile.block() == Blocks.air ? tile.overlay() == Blocks.air ? tile.floor() : tile.overlay() : tile.block();
|
editor.drawBlock = tile.block() == Blocks.air || !tile.block().inEditor ? tile.overlay() == Blocks.air ? tile.floor() : tile.overlay() : tile.block();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
line(KeyCode.l, "replace", "orthogonal"){
|
line(KeyCode.l, "replace", "orthogonal"){
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean mining(){
|
boolean mining(){
|
||||||
return mineTile != null;
|
return mineTile != null && !(((Object)this) instanceof Builderc && ((Builderc)(Object)this).activelyBuilding());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -51,13 +51,12 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(mineTile == null || core == null || mineTile.block() != Blocks.air || dst(mineTile.worldx(), mineTile.worldy()) > miningRange
|
if(mineTile == null || core == null || mineTile.block() != Blocks.air || dst(mineTile.worldx(), mineTile.worldy()) > miningRange
|
||||||
|| (((Object)this) instanceof Builderc && ((Builderc)(Object)this).activelyBuilding())
|
|
||||||
|| mineTile.drop() == null || !canMine(mineTile.drop())){
|
|| mineTile.drop() == null || !canMine(mineTile.drop())){
|
||||||
mineTile = null;
|
mineTile = null;
|
||||||
mineTimer = 0f;
|
mineTimer = 0f;
|
||||||
}else{
|
}else if(mining()){
|
||||||
Item item = mineTile.drop();
|
Item item = mineTile.drop();
|
||||||
rotation(Mathf.slerpDelta(rotation(), angleTo(mineTile.worldx(), mineTile.worldy()), 0.4f));
|
rotation = Mathf.slerpDelta(rotation, angleTo(mineTile.worldx(), mineTile.worldy()), 0.4f);
|
||||||
mineTimer += Time.delta *type.mineSpeed;
|
mineTimer += Time.delta *type.mineSpeed;
|
||||||
|
|
||||||
if(Mathf.chance(0.06 * Time.delta)){
|
if(Mathf.chance(0.06 * Time.delta)){
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
|
|||||||
float rotation = this.rotation - 90;
|
float rotation = this.rotation - 90;
|
||||||
float weaponRotation = rotation + (weapon.rotate ? mount.rotation : 0);
|
float weaponRotation = rotation + (weapon.rotate ? mount.rotation : 0);
|
||||||
|
|
||||||
//m a t h
|
|
||||||
|
|
||||||
float mountX = this.x + Angles.trnsx(rotation, weapon.x, weapon.y),
|
float mountX = this.x + Angles.trnsx(rotation, weapon.x, weapon.y),
|
||||||
mountY = this.y + Angles.trnsy(rotation, weapon.x, weapon.y);
|
mountY = this.y + Angles.trnsy(rotation, weapon.x, weapon.y);
|
||||||
@@ -166,9 +165,8 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
|
|||||||
Angles.shotgun(weapon.shots, weapon.spacing, rotation, f -> bullet(weapon, x, y, f + Mathf.range(weapon.inaccuracy), lifeScl));
|
Angles.shotgun(weapon.shots, weapon.spacing, rotation, f -> bullet(weapon, x, y, f + Mathf.range(weapon.inaccuracy), lifeScl));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this instanceof Velc){
|
vel().add(Tmp.v1.trns(rotation + 180f, ammo.recoil));
|
||||||
((Velc)this).vel().add(Tmp.v1.trns(rotation + 180f, ammo.recoil));
|
|
||||||
}
|
|
||||||
boolean parentize = ammo.keepVelocity;
|
boolean parentize = ammo.keepVelocity;
|
||||||
|
|
||||||
Effect.shake(weapon.shake, weapon.shake, x, y);
|
Effect.shake(weapon.shake, weapon.shake, x, y);
|
||||||
@@ -178,6 +176,11 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void bullet(Weapon weapon, float x, float y, float angle, float lifescl){
|
private void bullet(Weapon weapon, float x, float y, float angle, float lifescl){
|
||||||
weapon.bullet.create(this, team(), x, y, angle, (1f - weapon.velocityRnd) + Mathf.random(weapon.velocityRnd), lifescl);
|
float xr = Mathf.range(weapon.xRand);
|
||||||
|
|
||||||
|
weapon.bullet.create(this, team(),
|
||||||
|
x + Angles.trnsx(angle, 0, xr),
|
||||||
|
y + Angles.trnsy(angle, 0, xr),
|
||||||
|
angle, (1f - weapon.velocityRnd) + Mathf.random(weapon.velocityRnd), lifescl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public class Weapon{
|
|||||||
public float shootX = 0f, shootY = 3f;
|
public float shootX = 0f, shootY = 3f;
|
||||||
/** offsets of weapon position on unit */
|
/** offsets of weapon position on unit */
|
||||||
public float x = 5f, y = 0f;
|
public float x = 5f, y = 0f;
|
||||||
|
/** random spread on the X axis */
|
||||||
|
public float xRand = 0f;
|
||||||
/** radius of occlusion drawn under the weapon; <0 to diable */
|
/** radius of occlusion drawn under the weapon; <0 to diable */
|
||||||
public float occlusion = -1f;
|
public float occlusion = -1f;
|
||||||
/** fraction of velocity that is random */
|
/** fraction of velocity that is random */
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import arc.struct.*;
|
|||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
@@ -129,7 +130,7 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
public static void displayUnit(Table table, UnitType unit){
|
public static void displayUnit(Table table, UnitType unit){
|
||||||
table.table(title -> {
|
table.table(title -> {
|
||||||
title.image(unit.icon(Cicon.xlarge)).size(8 * 6);
|
title.image(unit.icon(Cicon.xlarge));
|
||||||
title.add("[accent]" + unit.localizedName).padLeft(5);
|
title.add("[accent]" + unit.localizedName).padLeft(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -149,10 +150,16 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
table.left().defaults().fillX();
|
table.left().defaults().fillX();
|
||||||
|
|
||||||
table.add(Core.bundle.format("unit.health", unit.health));
|
Unit inst = unit.constructor.get();
|
||||||
table.row();
|
|
||||||
table.add(Core.bundle.format("unit.speed", Strings.fixed(unit.speed, 1)));
|
//TODO more stats
|
||||||
table.row();
|
table.add(Core.bundle.format("unit.health", unit.health)).row();
|
||||||
|
table.add(Core.bundle.format("unit.speed", Strings.fixed(unit.speed, 1))).row();
|
||||||
|
table.add(Core.bundle.format("unit.itemcapacity", unit.itemCapacity)).row();
|
||||||
|
|
||||||
|
if(inst instanceof Minerc) table.add(Core.bundle.format("unit.minespeed", (int)(unit.mineSpeed * 100f))).row();
|
||||||
|
if(inst instanceof Builderc) table.add(Core.bundle.format("unit.buildspeed", (int)(unit.buildSpeed * 100f))).row();
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,10 +306,22 @@ public class Generators{
|
|||||||
ImagePacker.generate("unit-icons", () -> content.units().each(type -> {
|
ImagePacker.generate("unit-icons", () -> content.units().each(type -> {
|
||||||
if(type.isHidden()) return; //hidden units don't generate
|
if(type.isHidden()) return; //hidden units don't generate
|
||||||
|
|
||||||
|
ObjectSet<String> outlined = new ObjectSet<>();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
type.load();
|
type.load();
|
||||||
type.init();
|
type.init();
|
||||||
|
|
||||||
|
//TODO decide whether to keep weapon outlines or not
|
||||||
|
if(true)
|
||||||
|
for(Weapon weapon : type.weapons){
|
||||||
|
if(weapon.rotate && outlined.add(weapon.name) && ImagePacker.has(weapon.name)){
|
||||||
|
ImagePacker.get(weapon.name).outline(4, Pal.darkerMetal).save(weapon.name);
|
||||||
|
|
||||||
|
((GenRegion)Core.atlas.find(weapon.name)).path.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Image image = ImagePacker.get(type.parts > 0 ? type.partRegions[0] : type.region);
|
Image image = ImagePacker.get(type.parts > 0 ? type.partRegions[0] : type.region);
|
||||||
for(int i = 1; i < type.parts; i++){
|
for(int i = 1; i < type.parts; i++){
|
||||||
image.draw(ImagePacker.get(type.partRegions[i]));
|
image.draw(ImagePacker.get(type.partRegions[i]));
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package mindustry.tools;
|
|||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.graphics.Color;
|
import arc.graphics.Color;
|
||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
|
import arc.math.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.tools.ImagePacker.*;
|
import mindustry.tools.ImagePacker.*;
|
||||||
@@ -60,6 +61,33 @@ class Image{
|
|||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Image outline(int radius, Color outlineColor){
|
||||||
|
Image out = copy();
|
||||||
|
for(int x = 0; x < out.width; x++){
|
||||||
|
for(int y = 0; y < out.height; y++){
|
||||||
|
|
||||||
|
Color color = getColor(x, y);
|
||||||
|
out.draw(x, y, color);
|
||||||
|
if(color.a < 1f){
|
||||||
|
boolean found = false;
|
||||||
|
outer:
|
||||||
|
for(int rx = -radius; rx <= radius; rx++){
|
||||||
|
for(int ry = -radius; ry <= radius; ry++){
|
||||||
|
if(Mathf.dst(rx, ry) <= radius && getColor(rx + x, ry + y).a > 0.01f){
|
||||||
|
found = true;
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(found){
|
||||||
|
out.draw(x, y, outlineColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
void each(Intc2 cons){
|
void each(Intc2 cons){
|
||||||
for(int x = 0; x < width; x++){
|
for(int x = 0; x < width; x++){
|
||||||
for(int y = 0; y < height; y++){
|
for(int y = 0; y < height; y++){
|
||||||
|
|||||||