Unit weapon rework, titan and bomber enemies added, various fixes
This commit is contained in:
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.bullets.*;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.ShootFx;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.type.AmmoType;
|
||||
@@ -9,7 +10,7 @@ import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class AmmoTypes implements ContentList {
|
||||
public static AmmoType bulletTungsten, bulletLead, bulletCarbide, bulletThorium, bulletSilicon, bulletThermite,
|
||||
shotgunTungsten,
|
||||
shotgunTungsten, bombExplosive, bombIncendiary,
|
||||
flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge,
|
||||
artilleryCarbide, artilleryThorium, artilleryPlastic, artilleryHoming, artilleryIncindiary,
|
||||
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
|
||||
@@ -63,6 +64,16 @@ public class AmmoTypes implements ContentList {
|
||||
recoil = 1f;
|
||||
}};
|
||||
|
||||
bombExplosive = new AmmoType(Items.blastCompound, WeaponBullets.bombExplosive, 3) {{
|
||||
shootEffect = Fx.none;
|
||||
smokeEffect = Fx.none;
|
||||
}};
|
||||
|
||||
bombIncendiary = new AmmoType(Items.thermite, WeaponBullets.bombIncendiary, 3) {{
|
||||
shootEffect = Fx.none;
|
||||
smokeEffect = Fx.none;
|
||||
}};
|
||||
|
||||
//flak
|
||||
|
||||
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5) {{
|
||||
|
||||
@@ -2,19 +2,16 @@ package io.anuke.mindustry.content;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.entities.units.UnitType;
|
||||
import io.anuke.mindustry.entities.units.types.Drone;
|
||||
import io.anuke.mindustry.entities.units.types.Scout;
|
||||
import io.anuke.mindustry.entities.units.types.Vtol;
|
||||
import io.anuke.mindustry.entities.units.types.*;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.type.StatusEffect;
|
||||
|
||||
public class UnitTypes implements ContentList {
|
||||
public static UnitType drone, scout, vtol;
|
||||
public static UnitType drone, scout, vtol, monsoon, titan;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
drone = new UnitType("drone", team -> new Drone(drone, team)){{
|
||||
drone = new UnitType("drone", Drone.class, Drone::new){{
|
||||
isFlying = true;
|
||||
drag = 0.01f;
|
||||
speed = 0.2f;
|
||||
@@ -23,26 +20,43 @@ public class UnitTypes implements ContentList {
|
||||
range = 50f;
|
||||
}};
|
||||
|
||||
scout = new UnitType("scout", team -> new Scout(scout, team)){{
|
||||
scout = new UnitType("scout", Scout.class, Scout::new){{
|
||||
maxVelocity = 1.1f;
|
||||
speed = 0.2f;
|
||||
drag = 0.4f;
|
||||
range = 40f;
|
||||
setAmmo(AmmoTypes.bulletLead);
|
||||
weapon = Weapons.blaster;
|
||||
}};
|
||||
|
||||
vtol = new UnitType("vtol", team -> new Vtol(vtol, team)){{
|
||||
titan = new UnitType("titan", Titan.class, Titan::new){{
|
||||
maxVelocity = 0.8f;
|
||||
speed = 0.18f;
|
||||
drag = 0.4f;
|
||||
range = 10f;
|
||||
weapon = Weapons.shockgun;
|
||||
}};
|
||||
|
||||
vtol = new UnitType("vtol", Vtol.class, Vtol::new){{
|
||||
speed = 0.3f;
|
||||
maxVelocity = 2f;
|
||||
maxVelocity = 2.1f;
|
||||
drag = 0.01f;
|
||||
isFlying = true;
|
||||
reload = 7;
|
||||
setAmmo(AmmoTypes.bulletLead);
|
||||
}};
|
||||
|
||||
monsoon = new UnitType("monsoon", Monsoon.class, Monsoon::new){{
|
||||
health = 300;
|
||||
speed = 0.2f;
|
||||
maxVelocity = 1.5f;
|
||||
drag = 0.01f;
|
||||
isFlying = true;
|
||||
reload = 7;
|
||||
weapon = Weapons.bomber;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Array<? extends Content> getAll() {
|
||||
return StatusEffect.all();
|
||||
return UnitType.all();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.ShootFx;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
@@ -8,7 +9,7 @@ import io.anuke.mindustry.type.Upgrade;
|
||||
import io.anuke.mindustry.type.Weapon;
|
||||
|
||||
public class Weapons implements ContentList {
|
||||
public static Weapon blaster, shockgun, sapper, swarmer;
|
||||
public static Weapon blaster, shockgun, sapper, swarmer, bomber;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
@@ -48,6 +49,17 @@ public class Weapons implements ContentList {
|
||||
ejectEffect = ShootFx.shellEjectSmall;
|
||||
setAmmo(AmmoTypes.bulletThermite);
|
||||
}};
|
||||
|
||||
bomber = new Weapon("bomber") {{
|
||||
length = 0f;
|
||||
width = 2f;
|
||||
reload = 5f;
|
||||
roundrobin = true;
|
||||
ejectEffect = Fx.none;
|
||||
velocityRnd = 1f;
|
||||
inaccuracy = 40f;
|
||||
setAmmo(AmmoTypes.bombExplosive);
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
package io.anuke.mindustry.content.bullets;
|
||||
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.BombBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.entities.effect.Fire;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class WeaponBullets extends BulletList {
|
||||
public static BulletType tungstenShotgun;
|
||||
public static BulletType tungstenShotgun, bombExplosive, bombIncendiary;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
@@ -17,5 +26,37 @@ public class WeaponBullets extends BulletList {
|
||||
drag = 0.04f;
|
||||
}
|
||||
};
|
||||
|
||||
bombExplosive = new BombBulletType(20f, 20f, "shell"){
|
||||
{
|
||||
bulletWidth = 9f;
|
||||
bulletHeight = 13f;
|
||||
hiteffect = BulletFx.flakExplosion;
|
||||
}
|
||||
};
|
||||
|
||||
bombIncendiary = new BombBulletType(20f, 20f, "shell"){
|
||||
{
|
||||
bulletWidth = 9f;
|
||||
bulletHeight = 13f;
|
||||
hiteffect = BulletFx.flakExplosion;
|
||||
backColor = Palette.darkFlame;
|
||||
frontColor = Palette.lightFlame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hit(Bullet b, float x, float y) {
|
||||
super.hit(b, x, y);
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
float cx = x + Mathf.range(10f);
|
||||
float cy = y + Mathf.range(10f);
|
||||
Tile tile = world.tileWorld(cx, cy);
|
||||
if(tile != null){
|
||||
Fire.create(tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user