Unit naming / Fixed #2209
|
|
@ -5,6 +5,7 @@ block=1
|
|||
cix=2
|
||||
draug=3
|
||||
mace=4
|
||||
mega=28
|
||||
mindustry.entities.comp.BuildingComp=22
|
||||
mindustry.entities.comp.Buildingomp=11
|
||||
mindustry.entities.comp.BulletComp=24
|
||||
|
|
@ -21,8 +22,13 @@ mindustry.type.Weather.WeatherComp=12
|
|||
mindustry.type.Weather.WeatherStateComp=26
|
||||
mindustry.world.blocks.campaign.CoreLauncher.LaunchCoreComp=13
|
||||
mindustry.world.blocks.campaign.LaunchPad.LaunchPayloadComp=14
|
||||
mono=29
|
||||
nova=30
|
||||
oculon=15
|
||||
phantom=16
|
||||
poly=31
|
||||
quasar=32
|
||||
risse=33
|
||||
spirit=27
|
||||
tau=17
|
||||
trident=18
|
||||
|
|
|
|||
BIN
core/assets-raw/sprites/units/beta-cell.png
Normal file
|
After Width: | Height: | Size: 279 B |
BIN
core/assets-raw/sprites/units/beta.png
Normal file
|
After Width: | Height: | Size: 890 B |
|
Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 356 B |
BIN
core/assets-raw/sprites/units/gamma.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |
BIN
core/assets-raw/sprites/units/mono.png
Normal file
|
After Width: | Height: | Size: 743 B |
|
Before Width: | Height: | Size: 361 B |
|
Before Width: | Height: | Size: 901 B |
|
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
BIN
core/assets-raw/sprites/units/poly.png
Normal file
|
After Width: | Height: | Size: 926 B |
|
Before Width: | Height: | Size: 372 B |
|
Before Width: | Height: | Size: 849 KiB After Width: | Height: | Size: 849 KiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 185 KiB |
|
|
@ -33,7 +33,7 @@ public class BlockIndexer{
|
|||
/** Maps each team ID to a quarant. A quadrant is a grid of bits, where each bit is set if and only if there is a block of that team in that quadrant. */
|
||||
private GridBits[] structQuadrants;
|
||||
/** Stores all damaged tile entities by team. */
|
||||
private TileArray[] damagedTiles = new TileArray[Team.all.length];
|
||||
private BuildingArray[] damagedTiles = new BuildingArray[Team.all.length];
|
||||
/** All ores available on this map. */
|
||||
private ObjectSet<Item> allOres = new ObjectSet<>();
|
||||
/** Stores teams that are present here as tiles. */
|
||||
|
|
@ -48,6 +48,8 @@ public class BlockIndexer{
|
|||
private TileArray emptySet = new TileArray();
|
||||
/** Array used for returning and reusing. */
|
||||
private Seq<Tile> returnArray = new Seq<>();
|
||||
/** Array used for returning and reusing. */
|
||||
private Seq<Building> breturnArray = new Seq<>();
|
||||
|
||||
public BlockIndexer(){
|
||||
Events.on(BuildinghangeEvent.class, event -> {
|
||||
|
|
@ -68,7 +70,7 @@ public class BlockIndexer{
|
|||
Events.on(WorldLoadEvent.class, event -> {
|
||||
scanOres.clear();
|
||||
scanOres.addAll(Item.getAllOres());
|
||||
damagedTiles = new TileArray[Team.all.length];
|
||||
damagedTiles = new BuildingArray[Team.all.length];
|
||||
flagMap = new TileArray[Team.all.length][BlockFlag.all.length];
|
||||
unitCaps = new int[Team.all.length];
|
||||
|
||||
|
|
@ -136,21 +138,21 @@ public class BlockIndexer{
|
|||
}
|
||||
|
||||
/** Returns all damaged tiles by team. */
|
||||
public TileArray getDamaged(Team team){
|
||||
public BuildingArray getDamaged(Team team){
|
||||
returnArray.clear();
|
||||
|
||||
if(damagedTiles[team.id] == null){
|
||||
damagedTiles[team.id] = new TileArray();
|
||||
damagedTiles[team.id] = new BuildingArray();
|
||||
}
|
||||
|
||||
TileArray set = damagedTiles[team.id];
|
||||
for(Tile tile : set){
|
||||
if((tile.build == null || tile.build.team() != team || !tile.build.damaged()) || tile.block() instanceof BuildBlock){
|
||||
returnArray.add(tile);
|
||||
BuildingArray set = damagedTiles[team.id];
|
||||
for(Building build : set){
|
||||
if((!build.isValid() || build.team != team || !build.damaged()) || build.block instanceof BuildBlock){
|
||||
breturnArray.add(build);
|
||||
}
|
||||
}
|
||||
|
||||
for(Tile tile : returnArray){
|
||||
for(Building tile : breturnArray){
|
||||
set.remove(tile);
|
||||
}
|
||||
|
||||
|
|
@ -211,11 +213,10 @@ public class BlockIndexer{
|
|||
|
||||
public void notifyTileDamaged(Building entity){
|
||||
if(damagedTiles[entity.team().id] == null){
|
||||
damagedTiles[entity.team().id] = new TileArray();
|
||||
damagedTiles[entity.team().id] = new BuildingArray();
|
||||
}
|
||||
|
||||
TileArray set = damagedTiles[entity.team().id];
|
||||
set.add(entity.tile());
|
||||
damagedTiles[entity.team().id].add(entity);
|
||||
}
|
||||
|
||||
public Building findEnemyTile(Team team, float x, float y, float range, Boolf<Building> pred){
|
||||
|
|
@ -471,4 +472,35 @@ public class BlockIndexer{
|
|||
return tiles.iterator();
|
||||
}
|
||||
}
|
||||
|
||||
//TODO copy-pasted code, generics would be nice here
|
||||
public static class BuildingArray implements Iterable<Building>{
|
||||
private Seq<Building> tiles = new Seq<>(false, 16);
|
||||
private IntSet contained = new IntSet();
|
||||
|
||||
public void add(Building tile){
|
||||
if(contained.add(tile.pos())){
|
||||
tiles.add(tile);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove(Building tile){
|
||||
if(contained.remove(tile.pos())){
|
||||
tiles.remove(tile);
|
||||
}
|
||||
}
|
||||
|
||||
public int size(){
|
||||
return tiles.size;
|
||||
}
|
||||
|
||||
public Building first(){
|
||||
return tiles.first();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Building> iterator(){
|
||||
return tiles.iterator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1268,6 +1268,7 @@ public class Blocks implements ContentList{
|
|||
requirements(Category.effect, BuildVisibility.hidden, with(Items.copper, 1000, Items.lead, 1000));
|
||||
alwaysUnlocked = true;
|
||||
|
||||
unitType = UnitTypes.alpha;
|
||||
health = 1100;
|
||||
itemCapacity = 4000;
|
||||
size = 3;
|
||||
|
|
@ -1276,6 +1277,7 @@ public class Blocks implements ContentList{
|
|||
coreFoundation = new CoreBlock("core-foundation"){{
|
||||
requirements(Category.effect, with(Items.copper, 3000, Items.lead, 3000, Items.silicon, 2000));
|
||||
|
||||
unitType = UnitTypes.beta;
|
||||
health = 2000;
|
||||
itemCapacity = 9000;
|
||||
size = 4;
|
||||
|
|
@ -1284,6 +1286,7 @@ public class Blocks implements ContentList{
|
|||
coreNucleus = new CoreBlock("core-nucleus"){{
|
||||
requirements(Category.effect, with(Items.copper, 1000, Items.lead, 1000));
|
||||
|
||||
unitType = UnitTypes.gamma;
|
||||
health = 4000;
|
||||
itemCapacity = 13000;
|
||||
size = 5;
|
||||
|
|
@ -1678,7 +1681,7 @@ public class Blocks implements ContentList{
|
|||
plans = new UnitPlan[]{
|
||||
new UnitPlan(UnitTypes.dagger, 200f, with(Items.silicon, 10, Items.lead, 10)),
|
||||
new UnitPlan(UnitTypes.crawler, 200f, with(Items.silicon, 10, Items.blastCompound, 5)),
|
||||
new UnitPlan(UnitTypes.tau, 200f, with(Items.silicon, 20, Items.lead, 10)),
|
||||
new UnitPlan(UnitTypes.nova, 200f, with(Items.silicon, 20, Items.lead, 10)),
|
||||
};
|
||||
size = 3;
|
||||
consumes.power(1.2f);
|
||||
|
|
@ -1688,7 +1691,7 @@ public class Blocks implements ContentList{
|
|||
requirements(Category.units, with(Items.copper, 30, Items.lead, 70));
|
||||
plans = new UnitPlan[]{
|
||||
new UnitPlan(UnitTypes.wraith, 200f, with(Items.silicon, 10)),
|
||||
new UnitPlan(UnitTypes.spirit, 200f, with(Items.silicon, 10)),
|
||||
new UnitPlan(UnitTypes.mono, 200f, with(Items.silicon, 10)),
|
||||
new UnitPlan(UnitTypes.phantom, 200f, with(Items.silicon, 10)),
|
||||
};
|
||||
size = 3;
|
||||
|
|
@ -1698,7 +1701,7 @@ public class Blocks implements ContentList{
|
|||
navalFactory = new UnitFactory("naval-factory"){{
|
||||
requirements(Category.units, with(Items.copper, 30, Items.lead, 70));
|
||||
plans = new UnitPlan[]{
|
||||
new UnitPlan(UnitTypes.vanguard, 200f, with(Items.silicon, 10)),
|
||||
new UnitPlan(UnitTypes.risse, 200f, with(Items.silicon, 10)),
|
||||
};
|
||||
size = 3;
|
||||
requiresWater = true;
|
||||
|
|
@ -1715,10 +1718,11 @@ public class Blocks implements ContentList{
|
|||
constructTime = 60f * 5f;
|
||||
|
||||
upgrades = new UnitType[][]{
|
||||
{UnitTypes.tau, UnitTypes.oculon},
|
||||
{UnitTypes.nova, UnitTypes.quasar},
|
||||
{UnitTypes.dagger, UnitTypes.mace},
|
||||
{UnitTypes.crawler, UnitTypes.eruptor},
|
||||
{UnitTypes.wraith, UnitTypes.ghoul},
|
||||
{UnitTypes.mono, UnitTypes.poly},
|
||||
};
|
||||
}};
|
||||
|
||||
|
|
@ -1734,6 +1738,7 @@ public class Blocks implements ContentList{
|
|||
upgrades = new UnitType[][]{
|
||||
{UnitTypes.ghoul, UnitTypes.revenant},
|
||||
{UnitTypes.mace, UnitTypes.fortress},
|
||||
{UnitTypes.poly, UnitTypes.mega},
|
||||
};
|
||||
}};
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ public class UnitTypes implements ContentList{
|
|||
public static @EntityDef({Unitc.class, Mechc.class}) UnitType mace, dagger, crawler, fortress, siegeArray, eradicator;
|
||||
|
||||
//ground + builder
|
||||
public static @EntityDef({Unitc.class, Mechc.class, Builderc.class}) UnitType tau;
|
||||
public static @EntityDef({Unitc.class, Mechc.class, Builderc.class}) UnitType nova;
|
||||
|
||||
//ground + builder + miner + commander
|
||||
public static @EntityDef({Unitc.class, Mechc.class, Builderc.class, Minerc.class, Commanderc.class}) UnitType oculon;
|
||||
public static @EntityDef({Unitc.class, Mechc.class, Builderc.class, Minerc.class, Commanderc.class}) UnitType quasar;
|
||||
|
||||
//legs
|
||||
public static @EntityDef({Unitc.class, Legsc.class}) UnitType cix, eruptor;
|
||||
|
|
@ -28,20 +28,22 @@ public class UnitTypes implements ContentList{
|
|||
public static @EntityDef({Unitc.class}) UnitType wraith, reaper, ghoul, revenant, lich;
|
||||
|
||||
//air + building
|
||||
public static @EntityDef({Unitc.class, Builderc.class}) UnitType spirit;
|
||||
public static @EntityDef({Unitc.class, Builderc.class}) UnitType mono;
|
||||
|
||||
//air + building + mining
|
||||
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType poly;
|
||||
|
||||
//air + building + mining + payload
|
||||
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Payloadc.class}) UnitType mega;
|
||||
|
||||
//air + mining
|
||||
public static @EntityDef({Unitc.class, Minerc.class}) UnitType phantom;
|
||||
|
||||
//air + building + mining
|
||||
//TODO implement other starter drones
|
||||
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Trailc.class}) UnitType alpha, beta, gamma;
|
||||
|
||||
//air + building + mining + payload
|
||||
public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Payloadc.class}) UnitType trident;
|
||||
|
||||
//water
|
||||
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType vanguard;
|
||||
public static @EntityDef({Unitc.class, WaterMovec.class, Commanderc.class}) UnitType risse, minke, bryde;
|
||||
|
||||
//special block unit type
|
||||
public static @EntityDef({Unitc.class, BlockUnitc.class}) UnitType block;
|
||||
|
|
@ -93,7 +95,7 @@ public class UnitTypes implements ContentList{
|
|||
}});
|
||||
}};
|
||||
|
||||
tau = new UnitType("tau"){{
|
||||
nova = new UnitType("nova"){{
|
||||
itemCapacity = 60;
|
||||
canBoost = true;
|
||||
boostMultiplier = 1.5f;
|
||||
|
|
@ -114,7 +116,7 @@ public class UnitTypes implements ContentList{
|
|||
}});
|
||||
}};
|
||||
|
||||
oculon = new UnitType("oculon"){{
|
||||
quasar = new UnitType("quasar"){{
|
||||
mineTier = 1;
|
||||
hitsize = 9f;
|
||||
boostMultiplier = 2f;
|
||||
|
|
@ -388,7 +390,7 @@ public class UnitTypes implements ContentList{
|
|||
}});
|
||||
}};
|
||||
|
||||
vanguard = new UnitType("vanguard"){{
|
||||
risse = new UnitType("risse"){{
|
||||
speed = 1.3f;
|
||||
drag = 0.1f;
|
||||
hitsize = 8f;
|
||||
|
|
@ -403,23 +405,33 @@ public class UnitTypes implements ContentList{
|
|||
}});
|
||||
}};
|
||||
|
||||
spirit = new UnitType("spirit"){{
|
||||
flying = true;
|
||||
drag = 0.05f;
|
||||
accel = 0.2f;
|
||||
speed = 2f;
|
||||
range = 50f;
|
||||
health = 100;
|
||||
engineSize = 1.8f;
|
||||
engineOffset = 5.7f;
|
||||
weapons.add(new Weapon(){{
|
||||
y = 1.5f;
|
||||
reload = 40f;
|
||||
x = 0.5f;
|
||||
ejectEffect = Fx.none;
|
||||
recoil = 2f;
|
||||
bullet = Bullets.healBulletBig;
|
||||
shootSound = Sounds.pew;
|
||||
minke = new UnitType("minke"){{
|
||||
speed = 1.3f;
|
||||
drag = 0.1f;
|
||||
hitsize = 8f;
|
||||
health = 130;
|
||||
immunities = ObjectSet.with(StatusEffects.wet);
|
||||
weapons.add(new Weapon("mount-weapon"){{
|
||||
reload = 10f;
|
||||
x = 1.25f;
|
||||
rotate = true;
|
||||
ejectEffect = Fx.shellEjectSmall;
|
||||
bullet = Bullets.standardCopper;
|
||||
}});
|
||||
}};
|
||||
|
||||
bryde = new UnitType("bryde"){{
|
||||
speed = 1.3f;
|
||||
drag = 0.1f;
|
||||
hitsize = 8f;
|
||||
health = 130;
|
||||
immunities = ObjectSet.with(StatusEffects.wet);
|
||||
weapons.add(new Weapon("mount-weapon"){{
|
||||
reload = 10f;
|
||||
x = 1.25f;
|
||||
rotate = true;
|
||||
ejectEffect = Fx.shellEjectSmall;
|
||||
bullet = Bullets.standardCopper;
|
||||
}});
|
||||
}};
|
||||
|
||||
|
|
@ -458,7 +470,97 @@ public class UnitTypes implements ContentList{
|
|||
}});
|
||||
}};
|
||||
|
||||
phantom = new UnitType("phantom"){{
|
||||
beta = new UnitType("beta"){{
|
||||
//TODO maybe these should be changed
|
||||
defaultController = BuilderAI::new;
|
||||
isCounted = false;
|
||||
|
||||
flying = true;
|
||||
mineSpeed = 2f;
|
||||
mineTier = 1;
|
||||
buildSpeed = 0.5f;
|
||||
drag = 0.05f;
|
||||
speed = 2.4f;
|
||||
rotateSpeed = 15f;
|
||||
accel = 0.1f;
|
||||
range = 70f;
|
||||
itemCapacity = 30;
|
||||
health = 80f;
|
||||
engineOffset = 6f;
|
||||
hitsize = 8f;
|
||||
|
||||
weapons.add(new Weapon("small-basic-weapon"){{
|
||||
reload = 15f;
|
||||
x = 2.75f;
|
||||
y = 1f;
|
||||
|
||||
bullet = new BasicBulletType(2.5f, 9){{
|
||||
width = 7f;
|
||||
height = 9f;
|
||||
lifetime = 60f;
|
||||
shootEffect = Fx.shootSmall;
|
||||
smokeEffect = Fx.shootSmallSmoke;
|
||||
tileDamageMultiplier = 0.1f;
|
||||
}};
|
||||
}});
|
||||
}};
|
||||
|
||||
gamma = new UnitType("gamma"){{
|
||||
//TODO maybe these should be changed
|
||||
defaultController = BuilderAI::new;
|
||||
isCounted = false;
|
||||
|
||||
flying = true;
|
||||
mineSpeed = 2f;
|
||||
mineTier = 1;
|
||||
buildSpeed = 0.5f;
|
||||
drag = 0.05f;
|
||||
speed = 2.4f;
|
||||
rotateSpeed = 15f;
|
||||
accel = 0.1f;
|
||||
range = 70f;
|
||||
itemCapacity = 30;
|
||||
health = 80f;
|
||||
engineOffset = 6f;
|
||||
hitsize = 8f;
|
||||
|
||||
weapons.add(new Weapon("small-basic-weapon"){{
|
||||
reload = 15f;
|
||||
x = 2.75f;
|
||||
y = 1f;
|
||||
|
||||
bullet = new BasicBulletType(2.5f, 9){{
|
||||
width = 7f;
|
||||
height = 9f;
|
||||
lifetime = 60f;
|
||||
shootEffect = Fx.shootSmall;
|
||||
smokeEffect = Fx.shootSmallSmoke;
|
||||
tileDamageMultiplier = 0.1f;
|
||||
}};
|
||||
}});
|
||||
}};
|
||||
|
||||
mono = new UnitType("mono"){{
|
||||
flying = true;
|
||||
drag = 0.05f;
|
||||
accel = 0.2f;
|
||||
speed = 2f;
|
||||
range = 50f;
|
||||
health = 100;
|
||||
engineSize = 1.8f;
|
||||
engineOffset = 5.7f;
|
||||
weapons.add(new Weapon(){{
|
||||
y = 1.5f;
|
||||
reload = 40f;
|
||||
x = 0.5f;
|
||||
ejectEffect = Fx.none;
|
||||
recoil = 2f;
|
||||
bullet = Bullets.healBulletBig;
|
||||
shootSound = Sounds.pew;
|
||||
}});
|
||||
}};
|
||||
|
||||
poly = new UnitType("poly"){{
|
||||
defaultController = BuilderAI::new;
|
||||
|
||||
flying = true;
|
||||
|
|
@ -474,7 +576,7 @@ public class UnitTypes implements ContentList{
|
|||
hitsize = 8f;
|
||||
}};
|
||||
|
||||
trident = new UnitType("trident"){{
|
||||
mega = new UnitType("mega"){{
|
||||
|
||||
health = 500;
|
||||
speed = 2f;
|
||||
|
|
@ -484,7 +586,7 @@ public class UnitTypes implements ContentList{
|
|||
flying = true;
|
||||
engineOffset = 10.5f;
|
||||
rotateShooting = false;
|
||||
hitsize = 14f;
|
||||
hitsize = 15f;
|
||||
engineSize = 3f;
|
||||
|
||||
weapons.add(
|
||||
|
|
|
|||
|
|
@ -92,8 +92,7 @@ public class Units{
|
|||
|
||||
/** Returns the neareset damaged tile. */
|
||||
public static Building findDamagedTile(Team team, float x, float y){
|
||||
Tile tile = Geometry.findClosest(x, y, indexer.getDamaged(team));
|
||||
return tile == null ? null : tile.build;
|
||||
return Geometry.findClosest(x, y, indexer.getDamaged(team));
|
||||
}
|
||||
|
||||
/** Returns the neareset ally tile in a range. */
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ public class UnitType extends UnlockableContent{
|
|||
super(name);
|
||||
|
||||
constructor = EntityMapping.map(name);
|
||||
if(constructor == null) throw new IllegalArgumentException("no unit for " + name);
|
||||
}
|
||||
|
||||
public UnitController createController(){
|
||||
|
|
|
|||
|
|
@ -102,8 +102,7 @@ public abstract class Turret extends Block{
|
|||
|
||||
stats.add(BlockStat.shootRange, range / tilesize, StatUnit.blocks);
|
||||
stats.add(BlockStat.inaccuracy, (int)inaccuracy, StatUnit.degrees);
|
||||
stats.add(BlockStat.reload, 60f / reloadTime, StatUnit.none);
|
||||
stats.add(BlockStat.shots, shots, StatUnit.none);
|
||||
stats.add(BlockStat.reload, 60f / reloadTime * shots, StatUnit.none);
|
||||
stats.add(BlockStat.targetsAir, targetAir);
|
||||
stats.add(BlockStat.targetsGround, targetGround);
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class Sorter extends Block{
|
|||
}
|
||||
|
||||
boolean isSame(Building other){
|
||||
//uncomment comment below to prevent sorter/gate chaining (hacky)
|
||||
//uncomment code below to prevent sorter/gate chaining
|
||||
return other != null && (other.block() instanceof Sorter/* || other.block() instanceof OverflowGate */);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=5e12ee82715df10aa81012c6b9db0865d47ceb16
|
||||
archash=351143a87915cb3d0aa7840d0a8277145988edbb
|
||||
|
|
|
|||