Implemented Fortress unit / Made artillery ignore air

This commit is contained in:
Anuken
2018-10-01 09:51:12 -04:00
parent d5d90bde9a
commit d2ce051c4a
28 changed files with 680 additions and 618 deletions
@@ -9,14 +9,15 @@ import io.anuke.mindustry.type.AmmoType;
import io.anuke.mindustry.type.ContentType;
public class AmmoTypes implements ContentList{
public static AmmoType bulletCopper, bulletDense, bulletThorium, bulletSilicon, bulletPyratite,
bulletDenseBig, bulletPyratiteBig, bulletThoriumBig,
shock, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile, weaponMissileSwarm, bulletMech,
healBlaster, bulletGlaive,
flakExplosive, flakPlastic, flakSurge,
missileExplosive, missileIncindiary, missileSurge,
artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive,
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid, arc;
public static AmmoType
bulletCopper, bulletDense, bulletThorium, bulletSilicon, bulletPyratite,
bulletDenseBig, bulletPyratiteBig, bulletThoriumBig,
shock, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile, weaponMissileSwarm, bulletMech,
healBlaster, bulletGlaive,
flakExplosive, flakPlastic, flakSurge,
missileExplosive, missileIncindiary, missileSurge,
artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive, unitArtillery,
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid, arc;
@Override
public void load(){
@@ -201,6 +202,13 @@ public class AmmoTypes implements ContentList{
reloadMultiplier = 1.6f;
}};
unitArtillery = new AmmoType(Items.blastCompound, ArtilleryBullets.unit, 1){{
shootEffect = ShootFx.shootBig2;
smokeEffect = ShootFx.shootBigSmoke2;
reloadMultiplier = 1.6f;
}};
//flame
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f){{
@@ -107,7 +107,7 @@ public class Mechs implements ContentList{
float healAmount = 10f;
float healReload = 160f;
Rectangle rect = new Rectangle();
boolean wasHeadled;
boolean wasHealed;
{
drillPower = 4;
@@ -128,20 +128,20 @@ public class Mechs implements ContentList{
public void updateAlt(Player player){
if(player.timer.get(Player.timerAbility, healReload)){
wasHeadled = false;
wasHealed = false;
rect.setSize(healRange*2f).setCenter(player.x, player.y);
Units.getNearby(player.getTeam(), rect, unit -> {
if(unit.distanceTo(player) <= healRange){
if(unit.health < unit.maxHealth()){
Effects.effect(UnitFx.heal, unit);
wasHeadled = true;
wasHealed = true;
}
unit.healBy(healAmount);
}
});
if(wasHeadled){
if(wasHealed){
Effects.effect(UnitFx.healWave, player);
}
}
@@ -167,6 +167,7 @@ public class Recipes implements ContentList{
new Recipe(units, UnitBlocks.daggerFactory, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 70));
new Recipe(units, UnitBlocks.titanFactory, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.fortressFactory, new ItemStack(Items.thorium, 200), new ItemStack(Items.lead, 220), new ItemStack(Items.silicon, 150), new ItemStack(Items.surgealloy, 100), new ItemStack(Items.phasematter, 50));
new Recipe(units, UnitBlocks.wraithFactory, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90));
new Recipe(units, UnitBlocks.ghoulFactory, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220));
@@ -58,17 +58,21 @@ public class UnitTypes implements ContentList{
speed = 0.18f;
drag = 0.4f;
range = 10f;
rotatespeed = 0.1f;
weapon = Weapons.flamethrower;
health = 440;
}};
fortress = new UnitType("fortress", Fortress.class, Fortress::new){{
maxVelocity = 0.8f;
speed = 0.18f;
speed = 0.15f;
drag = 0.4f;
range = 10f;
rotatespeed = 0.06f;
weaponOffsetX = 1;
targetAir = false;
weapon = Weapons.artillery;
health = 500;
health = 800;
}};
wraith = new UnitType("wraith", Wraith.class, Wraith::new){{
@@ -86,6 +90,7 @@ public class UnitTypes implements ContentList{
maxVelocity = 1.4f;
drag = 0.01f;
isFlying = true;
targetAir = false;
weapon = Weapons.bomber;
}};
@@ -124,9 +124,10 @@ public class Weapons implements ContentList{
length = 1f;
reload = 60f;
roundrobin = true;
recoil = 1f;
recoil = 5f;
shake = 2f;
ejectEffect = ShootFx.shellEjectMedium;
ammo = AmmoTypes.artilleryExplosive;
ammo = AmmoTypes.unitArtillery;
}};
sapper = new Weapon("sapper"){{
@@ -11,7 +11,7 @@ public class UnitBlocks extends BlockList implements ContentList{
public static Block
spiritFactory, phantomFactory,
wraithFactory, ghoulFactory, revenantFactory,
daggerFactory, titanFactory,
daggerFactory, titanFactory, fortressFactory,
reconstructor, repairPoint, commandCenter;
@Override
@@ -75,6 +75,15 @@ public class UnitBlocks extends BlockList implements ContentList{
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)});
}};
fortressFactory = new UnitFactory("fortress-factory"){{
type = UnitTypes.fortress;
produceTime = 5000;
size = 3;
consumes.power(0.2f);
shadow = "shadow-round-3";
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50)});
}};
repairPoint = new RepairPoint("repair-point"){{
shadow = "shadow-round-1";
repairSpeed = 0.1f;
@@ -9,7 +9,7 @@ import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.game.ContentList;
public class ArtilleryBullets extends BulletList implements ContentList{
public static BulletType dense, plastic, plasticFrag, homing, incindiary, explosive, surge;
public static BulletType dense, plastic, plasticFrag, homing, incindiary, explosive, surge, unit;
@Override
public void load(){
@@ -99,6 +99,20 @@ public class ArtilleryBullets extends BulletList implements ContentList{
}
};
unit = new ArtilleryBulletType(2f, 0, "shell"){
{
hiteffect = BulletFx.blastExplosion;
knockback = 0.8f;
lifetime = 90f;
bulletWidth = bulletHeight = 14f;
collides = true;
splashDamageRadius = 45f;
splashDamage = 50f;
backColor = Palette.bulletYellowBack;
frontColor = Palette.bulletYellow;
}
};
surge = new ArtilleryBulletType(3f, 0, "shell"){
{
//TODO