Cleanup continues
This commit is contained in:
@@ -1281,7 +1281,6 @@ public class Blocks implements ContentList{
|
||||
health = 1100;
|
||||
itemCapacity = 4000;
|
||||
size = 3;
|
||||
mech = Mechs.vanguard;
|
||||
}};
|
||||
|
||||
coreFoundation = new CoreBlock("core-foundation"){{
|
||||
@@ -1290,7 +1289,6 @@ public class Blocks implements ContentList{
|
||||
health = 2000;
|
||||
itemCapacity = 9000;
|
||||
size = 4;
|
||||
mech = Mechs.vanguard;
|
||||
}};
|
||||
|
||||
coreNucleus = new CoreBlock("core-nucleus"){{
|
||||
@@ -1299,7 +1297,6 @@ public class Blocks implements ContentList{
|
||||
health = 4000;
|
||||
itemCapacity = 13000;
|
||||
size = 5;
|
||||
mech = Mechs.vanguard;
|
||||
}};
|
||||
|
||||
vault = new Vault("vault"){{
|
||||
@@ -1548,7 +1545,7 @@ public class Blocks implements ContentList{
|
||||
@Override
|
||||
public void init(Bulletc b){
|
||||
for(int i = 0; i < rays; i++){
|
||||
Damage.collideLine(b, b.team(), hitEffect, b.x, b.y, b.rot(), rayLength - Math.abs(i - (rays / 2)) * 20f);
|
||||
Damage.collideLine(b, b.team(), hitEffect, b.x(), b.y(), b.rotation(), rayLength - Math.abs(i - (rays / 2)) * 20f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1558,13 +1555,13 @@ public class Blocks implements ContentList{
|
||||
Draw.color(Color.white, Pal.lancerLaser, b.fin());
|
||||
//Draw.alpha(b.fout());
|
||||
for(int i = 0; i < 7; i++){
|
||||
Tmp.v1.trns(b.rot(), i * 8f);
|
||||
Tmp.v1.trns(b.rotation(), i * 8f);
|
||||
float sl = Mathf.clamp(b.fout() - 0.5f) * (80f - i * 10);
|
||||
Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() + 90);
|
||||
Drawf.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() - 90);
|
||||
Drawf.tri(b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 4f, sl, b.rotation() + 90);
|
||||
Drawf.tri(b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, 4f, sl, b.rotation() - 90);
|
||||
}
|
||||
Drawf.tri(b.x, b.y, 20f * b.fout(), (rayLength + 50), b.rot());
|
||||
Drawf.tri(b.x, b.y, 20f * b.fout(), 10f, b.rot() + 180f);
|
||||
Drawf.tri(b.x(), b.y(), 20f * b.fout(), (rayLength + 50), b.rotation());
|
||||
Drawf.tri(b.x(), b.y(), 20f * b.fout(), 10f, b.rotation() + 180f);
|
||||
Draw.reset();
|
||||
}
|
||||
});
|
||||
@@ -1783,56 +1780,56 @@ public class Blocks implements ContentList{
|
||||
|
||||
dartPad = new MechPad("dart-ship-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 100, Items.graphite, 50, Items.copper, 75));
|
||||
mech = Mechs.dart;
|
||||
mech = UnitTypes.dart;
|
||||
size = 2;
|
||||
consumes.power(0.5f);
|
||||
}};
|
||||
|
||||
alphaPad = new MechPad("alpha-mech-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 100, Items.graphite, 50, Items.copper, 75));
|
||||
mech = Mechs.alpha;
|
||||
mech = UnitTypes.alpha;
|
||||
size = 2;
|
||||
consumes.power(0.5f);
|
||||
}};
|
||||
|
||||
deltaPad = new MechPad("delta-mech-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 175, Items.titanium, 175, Items.copper, 200, Items.silicon, 225, Items.thorium, 150));
|
||||
mech = Mechs.delta;
|
||||
mech = UnitTypes.delta;
|
||||
size = 2;
|
||||
consumes.power(0.7f);
|
||||
}};
|
||||
|
||||
tauPad = new MechPad("tau-mech-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 125, Items.titanium, 125, Items.copper, 125, Items.silicon, 125));
|
||||
mech = Mechs.tau;
|
||||
mech = UnitTypes.tau;
|
||||
size = 2;
|
||||
consumes.power(1f);
|
||||
}};
|
||||
|
||||
omegaPad = new MechPad("omega-mech-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 225, Items.graphite, 275, Items.silicon, 325, Items.thorium, 300, Items.surgealloy, 120));
|
||||
mech = Mechs.omega;
|
||||
mech = UnitTypes.omega;
|
||||
size = 3;
|
||||
consumes.power(1.2f);
|
||||
}};
|
||||
|
||||
javelinPad = new MechPad("javelin-ship-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 175, Items.silicon, 225, Items.titanium, 250, Items.plastanium, 200, Items.phasefabric, 100));
|
||||
mech = Mechs.javelin;
|
||||
mech = UnitTypes.javelin;
|
||||
size = 2;
|
||||
consumes.power(0.8f);
|
||||
}};
|
||||
|
||||
tridentPad = new MechPad("trident-ship-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 125, Items.copper, 125, Items.silicon, 125, Items.titanium, 150, Items.plastanium, 100));
|
||||
mech = Mechs.trident;
|
||||
mech = UnitTypes.trident;
|
||||
size = 2;
|
||||
consumes.power(1f);
|
||||
}};
|
||||
|
||||
glaivePad = new MechPad("glaive-ship-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 225, Items.silicon, 325, Items.titanium, 350, Items.plastanium, 300, Items.surgealloy, 100));
|
||||
mech = Mechs.glaive;
|
||||
mech = UnitTypes.glaive;
|
||||
size = 3;
|
||||
consumes.power(1.2f);
|
||||
}};
|
||||
|
||||
@@ -4,11 +4,10 @@ import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.ctype.ContentList;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.entities.effect.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
@@ -412,31 +411,31 @@ public class Bullets implements ContentList{
|
||||
|
||||
@Override
|
||||
public void init(Bulletc b){
|
||||
b.velocity().setLength(0.6f + Mathf.random(2f));
|
||||
b.vel().setLength(0.6f + Mathf.random(2f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Bulletc b){
|
||||
Draw.color(Pal.lightFlame, Pal.darkFlame, Color.gray, b.fin());
|
||||
Fill.circle(b.x, b.y, 3f * b.fout());
|
||||
Fill.circle(b.x(), b.y(), 3f * b.fout());
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Bulletc b){
|
||||
if(Mathf.chance(0.04 * Time.delta())){
|
||||
Tile tile = world.tileWorld(b.x, b.y);
|
||||
Tile tile = world.tileWorld(b.x(), b.y());
|
||||
if(tile != null){
|
||||
Fire.create(tile);
|
||||
}
|
||||
}
|
||||
|
||||
if(Mathf.chance(0.1 * Time.delta())){
|
||||
Fx.fireballsmoke.at(b.x, b.y);
|
||||
Fx.fireballsmoke.at(b.x(), b.y());
|
||||
}
|
||||
|
||||
if(Mathf.chance(0.1 * Time.delta())){
|
||||
Fx.ballfire.at(b.x, b.y);
|
||||
Fx.ballfire.at(b.x(), b.y());
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -512,15 +511,15 @@ public class Bullets implements ContentList{
|
||||
|
||||
@Override
|
||||
public void update(Bulletc b){
|
||||
if(b.timer.get(1, 5f)){
|
||||
Damage.collideLine(b, b.team(), hitEffect, b.x, b.y, b.rot(), length, true);
|
||||
if(b.timer(1, 5f)){
|
||||
Damage.collideLine(b, b.team(), hitEffect, b.x(), b.y(), b.rotation(), length, true);
|
||||
}
|
||||
Effects.shake(1f, 1f, b.x, b.y);
|
||||
Effects.shake(1f, 1f, b.x(), b.y());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hit(Bulletc b, float hitx, float hity){
|
||||
hitEffect.at(colors[2], hitx, hity);
|
||||
hitEffect.at(hitx, hity, colors[2]);
|
||||
if(Mathf.chance(0.4)){
|
||||
Fire.create(world.tileWorld(hitx + Mathf.range(5f), hity + Mathf.range(5f)));
|
||||
}
|
||||
@@ -530,13 +529,13 @@ public class Bullets implements ContentList{
|
||||
public void draw(Bulletc b){
|
||||
float baseLen = (length) * b.fout();
|
||||
|
||||
Lines.lineAngle(b.x, b.y, b.rot(), baseLen);
|
||||
Lines.lineAngle(b.x(), b.y(), b.rotation(), baseLen);
|
||||
for(int s = 0; s < colors.length; s++){
|
||||
Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Time.time(), 1f, 0.1f)));
|
||||
for(int i = 0; i < tscales.length; i++){
|
||||
Tmp.v1.trns(b.rot() + 180f, (lenscales[i] - 1f) * 35f);
|
||||
Tmp.v1.trns(b.rotation() + 180f, (lenscales[i] - 1f) * 35f);
|
||||
Lines.stroke((9f + Mathf.absin(Time.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]);
|
||||
Lines.lineAngle(b.x + Tmp.v1.x, b.y + Tmp.v1.y, b.rot(), baseLen * lenscales[i], CapStyle.none);
|
||||
Lines.lineAngle(b.x() + Tmp.v1.x, b.y() + Tmp.v1.y, b.rotation(), baseLen * lenscales[i], CapStyle.none);
|
||||
}
|
||||
}
|
||||
Draw.reset();
|
||||
@@ -587,7 +586,8 @@ public class Bullets implements ContentList{
|
||||
|
||||
@Override
|
||||
public void init(Bulletc b){
|
||||
Lightning.create(b.team(), Pal.lancerLaser, damage * (b.getOwner() instanceof Player ? state.rules.playerDamageMultiplier : 1f), b.x, b.y, b.rot(), 30);
|
||||
//TODO owners are never players...
|
||||
Lightning.create(b.team(), Pal.lancerLaser, damage * (b.owner() instanceof Playerc ? state.rules.playerDamageMultiplier : 1f), b.x(), b.y(), b.rotation(), 30);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+836
-842
File diff suppressed because it is too large
Load Diff
@@ -1,461 +0,0 @@
|
||||
package mindustry.content;
|
||||
|
||||
import arc.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.entities.effect.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
|
||||
import static mindustry.Vars.indexer;
|
||||
|
||||
public class Mechs implements ContentList{
|
||||
public static UnitDef vanguard, alpha, delta, tau, omega, dart, javelin, trident, glaive;
|
||||
|
||||
public static UnitDef starter;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
|
||||
vanguard = new UnitDef("vanguard-ship"){
|
||||
float healRange = 60f;
|
||||
float healReload = 200f;
|
||||
float healPercent = 10f;
|
||||
|
||||
{
|
||||
flying = true;
|
||||
drillTier = 1;
|
||||
minePower = 4f;
|
||||
speed = 0.49f;
|
||||
drag = 0.09f;
|
||||
health = 200f;
|
||||
weaponOffsetX = -1;
|
||||
engineSize = 2.3f;
|
||||
weaponOffsetY = -1;
|
||||
engineColor = Pal.lightTrail;
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 1.2f;
|
||||
weapon = new Weapon("vanguard-blaster"){{
|
||||
length = 1.5f;
|
||||
reload = 30f;
|
||||
alternate = true;
|
||||
inaccuracy = 6f;
|
||||
velocityRnd = 0.1f;
|
||||
ejectEffect = Fx.none;
|
||||
bullet = new HealBulletType(){{
|
||||
healPercent = 3f;
|
||||
backColor = engineColor;
|
||||
homingPower = 20f;
|
||||
bulletHeight = 4f;
|
||||
bulletWidth = 1.5f;
|
||||
damage = 3f;
|
||||
speed = 4f;
|
||||
lifetime = 40f;
|
||||
shootEffect = Fx.shootHealYellow;
|
||||
smokeEffect = hitEffect = despawnEffect = Fx.hitYellowLaser;
|
||||
}};
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alwaysUnlocked(){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Player player){
|
||||
if(player.timer.get(Player.timerAbility, healReload)){
|
||||
if(indexer.eachBlock(player, healRange, other -> other.entity.damaged(), other -> {
|
||||
other.entity.healBy(other.entity.maxHealth() * healPercent / 100f);
|
||||
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
|
||||
})){
|
||||
Fx.healWave.at(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
alpha = new UnitDef("alpha-mech", false){
|
||||
{
|
||||
drillTier = -1;
|
||||
speed = 0.5f;
|
||||
boostSpeed = 0.95f;
|
||||
itemCapacity = 15;
|
||||
mass = 0.9f;
|
||||
health = 150f;
|
||||
buildPower = 0.9f;
|
||||
weaponOffsetX = 1;
|
||||
weaponOffsetY = -1;
|
||||
engineColor = Pal.heal;
|
||||
|
||||
weapon = new Weapon("shockgun"){{
|
||||
shake = 2f;
|
||||
length = 0.5f;
|
||||
reload = 70f;
|
||||
alternate = true;
|
||||
recoil = 4f;
|
||||
width = 5f;
|
||||
shootSound = Sounds.laser;
|
||||
|
||||
bullet = new LaserBulletType(){{
|
||||
damage = 20f;
|
||||
recoil = 1f;
|
||||
sideAngle = 45f;
|
||||
sideWidth = 1f;
|
||||
sideLength = 70f;
|
||||
colors = new Color[]{Pal.heal.cpy().a(0.4f), Pal.heal, Color.white};
|
||||
}};
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Player player){
|
||||
player.healBy(Time.delta() * 0.09f);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
delta = new UnitDef("delta-mech", false){
|
||||
{
|
||||
drillPower = 1;
|
||||
mineSpeed = 1.5f;
|
||||
mass = 1.2f;
|
||||
speed = 0.5f;
|
||||
itemCapacity = 40;
|
||||
boostSpeed = 0.95f;
|
||||
buildPower = 1.2f;
|
||||
engineColor = Color.valueOf("ffd37f");
|
||||
health = 250f;
|
||||
weaponOffsetX = 4f;
|
||||
|
||||
weapon = new Weapon("flamethrower"){{
|
||||
length = 1.5f;
|
||||
reload = 30f;
|
||||
width = 4f;
|
||||
alternate = true;
|
||||
shots = 3;
|
||||
inaccuracy = 40f;
|
||||
shootSound = Sounds.spark;
|
||||
bullet = new LightningBulletType(){{
|
||||
damage = 5;
|
||||
lightningLength = 10;
|
||||
lightningColor = Pal.lightFlame;
|
||||
}};
|
||||
}};
|
||||
}
|
||||
};
|
||||
|
||||
tau = new UnitDef("tau-mech", false){
|
||||
float healRange = 60f;
|
||||
float healAmount = 10f;
|
||||
float healReload = 160f;
|
||||
boolean wasHealed;
|
||||
|
||||
{
|
||||
drillPower = 4;
|
||||
mineSpeed = 3f;
|
||||
itemCapacity = 70;
|
||||
weaponOffsetY = -1;
|
||||
weaponOffsetX = 1;
|
||||
mass = 1.75f;
|
||||
speed = 0.44f;
|
||||
drag = 0.35f;
|
||||
boostSpeed = 0.8f;
|
||||
canHeal = true;
|
||||
health = 200f;
|
||||
buildPower = 1.6f;
|
||||
engineColor = Pal.heal;
|
||||
|
||||
weapon = new Weapon("heal-blaster"){{
|
||||
length = 1.5f;
|
||||
reload = 24f;
|
||||
alternate = false;
|
||||
ejectEffect = Fx.none;
|
||||
recoil = 2f;
|
||||
bullet = Bullets.healBullet;
|
||||
shootSound = Sounds.pew;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Player player){
|
||||
|
||||
if(player.timer.get(Player.timerAbility, healReload)){
|
||||
wasHealed = false;
|
||||
|
||||
Units.nearby(player.team(), player.x, player.y, healRange, unit -> {
|
||||
if(unit.health < unit.maxHealth()){
|
||||
Fx.heal.at(unit);
|
||||
wasHealed = true;
|
||||
}
|
||||
unit.healBy(healAmount);
|
||||
});
|
||||
|
||||
if(wasHealed){
|
||||
Fx.healWave.at(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
omega = new UnitDef("omega-mech", false){
|
||||
protected TextureRegion armorRegion;
|
||||
|
||||
{
|
||||
drillPower = 2;
|
||||
mineSpeed = 1.5f;
|
||||
itemCapacity = 80;
|
||||
speed = 0.36f;
|
||||
boostSpeed = 0.6f;
|
||||
mass = 4f;
|
||||
shake = 4f;
|
||||
weaponOffsetX = 1;
|
||||
weaponOffsetY = 0;
|
||||
engineColor = Color.valueOf("feb380");
|
||||
health = 350f;
|
||||
buildPower = 1.5f;
|
||||
weapon = new Weapon("swarmer"){{
|
||||
length = 1.5f;
|
||||
recoil = 4f;
|
||||
reload = 38f;
|
||||
shots = 4;
|
||||
spacing = 8f;
|
||||
inaccuracy = 8f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.none;
|
||||
shake = 3f;
|
||||
bullet = Bullets.missileSwarm;
|
||||
shootSound = Sounds.shootBig;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotationAlpha(Player player){
|
||||
return 0.6f - player.shootHeat * 0.3f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float spreadX(Player player){
|
||||
return player.shootHeat * 2f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
armorRegion = Core.atlas.find(name + "-armor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Player player){
|
||||
float scl = 1f - player.shootHeat / 2f*Time.delta();
|
||||
player.velocity().scl(scl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraArmor(Player player){
|
||||
return player.shootHeat * 30f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Player player){
|
||||
if(player.shootHeat <= 0.01f) return;
|
||||
|
||||
Shaders.build.progress = player.shootHeat;
|
||||
Shaders.build.region = armorRegion;
|
||||
Shaders.build.time = Time.time() / 10f;
|
||||
Shaders.build.color.set(Pal.accent).a = player.shootHeat;
|
||||
Draw.shader(Shaders.build);
|
||||
Draw.rect(armorRegion, player.x, player.y, player.rotation);
|
||||
Draw.shader();
|
||||
}
|
||||
};
|
||||
|
||||
dart = new UnitDef("dart-ship"){
|
||||
float effectRange = 60f;
|
||||
float effectReload = 60f * 5;
|
||||
float effectDuration = 60f * 10f;
|
||||
|
||||
{
|
||||
flying = true;
|
||||
drillPower = 1;
|
||||
mineSpeed = 2f;
|
||||
speed = 0.5f;
|
||||
drag = 0.09f;
|
||||
health = 200f;
|
||||
weaponOffsetX = -1;
|
||||
weaponOffsetY = -1;
|
||||
engineColor = Pal.lightTrail;
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 1.1f;
|
||||
weapon = new Weapon("blaster"){{
|
||||
length = 1.5f;
|
||||
reload = 15f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.shellEjectSmall;
|
||||
bullet = Bullets.standardCopper;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Player player){
|
||||
super.update(player);
|
||||
|
||||
if(player.timer.get(Player.timerAbility, effectReload)){
|
||||
|
||||
Units.nearby(player.team(), player.x, player.y, effectRange, unit -> {
|
||||
//unit.applyEffect(StatusEffects.overdrive, effectDuration);
|
||||
});
|
||||
|
||||
indexer.eachBlock(player, effectRange, other -> other.entity.damaged(), other -> {
|
||||
other.entity.applyBoost(1.5f, effectDuration);
|
||||
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
|
||||
});
|
||||
|
||||
Fx.overdriveWave.at(player);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
javelin = new UnitDef("javelin-ship"){
|
||||
float minV = 3.6f;
|
||||
float maxV = 6f;
|
||||
TextureRegion shield;
|
||||
|
||||
{
|
||||
flying = true;
|
||||
drillPower = -1;
|
||||
speed = 0.11f;
|
||||
drag = 0.01f;
|
||||
mass = 2f;
|
||||
health = 170f;
|
||||
engineColor = Color.valueOf("d3ddff");
|
||||
cellTrnsY = 1f;
|
||||
weapon = new Weapon("missiles"){{
|
||||
length = 1.5f;
|
||||
reload = 70f;
|
||||
shots = 4;
|
||||
inaccuracy = 2f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.none;
|
||||
velocityRnd = 0.2f;
|
||||
spacing = 1f;
|
||||
bullet = Bullets.missileJavelin;
|
||||
shootSound = Sounds.missile;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
shield = Core.atlas.find(name + "-shield");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotationAlpha(Player player){
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Player player){
|
||||
float scl = scld(player);
|
||||
if(Mathf.chance(Time.delta() * (0.15 * scl))){
|
||||
Fx.hitLancer.at(Pal.lancerLaser, player.x, player.y);
|
||||
Lightning.create(player.team(), Pal.lancerLaser, 10f * Vars.state.rules.playerDamageMultiplier,
|
||||
player.x + player.velocity().x, player.y + player.velocity().y, player.rotation, 14);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Player player){
|
||||
float scl = scld(player);
|
||||
if(scl < 0.01f) return;
|
||||
Draw.color(Pal.lancerLaser);
|
||||
Draw.alpha(scl / 2f);
|
||||
Draw.blend(Blending.additive);
|
||||
Draw.rect(shield, player.x + Mathf.range(scl / 2f), player.y + Mathf.range(scl / 2f), player.rotation - 90);
|
||||
Draw.blend();
|
||||
}
|
||||
|
||||
float scld(Player player){
|
||||
return Mathf.clamp((player.velocity().len() - minV) / (maxV - minV));
|
||||
}
|
||||
};
|
||||
|
||||
trident = new UnitDef("trident-ship"){
|
||||
{
|
||||
flying = true;
|
||||
drillPower = 2;
|
||||
speed = 0.15f;
|
||||
drag = 0.034f;
|
||||
mass = 2.5f;
|
||||
turnCursor = false;
|
||||
health = 250f;
|
||||
itemCapacity = 30;
|
||||
engineColor = Color.valueOf("84f491");
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 2.5f;
|
||||
weapon = new Weapon("bomber"){{
|
||||
length = 0f;
|
||||
width = 2f;
|
||||
reload = 25f;
|
||||
shots = 2;
|
||||
shotDelay = 1f;
|
||||
shots = 8;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.none;
|
||||
velocityRnd = 1f;
|
||||
inaccuracy = 20f;
|
||||
ignoreRotation = true;
|
||||
bullet = new BombBulletType(16f, 25f, "shell"){{
|
||||
bulletWidth = 10f;
|
||||
bulletHeight = 14f;
|
||||
hitEffect = Fx.flakExplosion;
|
||||
shootEffect = Fx.none;
|
||||
smokeEffect = Fx.none;
|
||||
shootSound = Sounds.artillery;
|
||||
}};
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canShoot(Player player){
|
||||
return player.velocity().len() > 1.2f;
|
||||
}
|
||||
};
|
||||
|
||||
glaive = new UnitDef("glaive-ship"){
|
||||
{
|
||||
flying = true;
|
||||
drillPower = 4;
|
||||
mineSpeed = 1.3f;
|
||||
speed = 0.32f;
|
||||
drag = 0.06f;
|
||||
mass = 3f;
|
||||
health = 240f;
|
||||
itemCapacity = 60;
|
||||
engineColor = Color.valueOf("feb380");
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 1.2f;
|
||||
|
||||
weapon = new Weapon("bomber"){{
|
||||
length = 1.5f;
|
||||
reload = 13f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.shellEjectSmall;
|
||||
bullet = Bullets.standardGlaive;
|
||||
shootSound = Sounds.shootSnap;
|
||||
}};
|
||||
}
|
||||
};
|
||||
|
||||
starter = vanguard;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class StatusEffects implements ContentList{
|
||||
opposite(wet,freezing);
|
||||
trans(tarred, ((unit, time, newTime, result) -> {
|
||||
unit.damage(1f);
|
||||
Fx.burning.at(unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
|
||||
Fx.burning.at(unit.x() + Mathf.range(unit.bounds() / 2f), unit.y() + Mathf.range(unit.bounds() / 2f));
|
||||
result.set(this, Math.min(time + newTime, 300f));
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package mindustry.content;
|
||||
|
||||
import arc.struct.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.entities.type.base.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
|
||||
public class UnitTypes implements ContentList{
|
||||
@@ -13,8 +9,12 @@ public class UnitTypes implements ContentList{
|
||||
wraith, ghoul, revenant, lich, reaper,
|
||||
dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator;
|
||||
|
||||
public static UnitDef vanguard, alpha, delta, tau, omega, dart, javelin, trident, glaive;
|
||||
public static UnitDef starter;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
/*
|
||||
draug = new UnitDef("draug", MinerDrone::new){{
|
||||
flying = true;
|
||||
drag = 0.01f;
|
||||
@@ -372,5 +372,440 @@ public class UnitTypes implements ContentList{
|
||||
shootSound = Sounds.shootBig;
|
||||
}};
|
||||
}};
|
||||
|
||||
|
||||
/*
|
||||
vanguard = new UnitDef("vanguard-ship"){
|
||||
float healRange = 60f;
|
||||
float healReload = 200f;
|
||||
float healPercent = 10f;
|
||||
|
||||
{
|
||||
flying = true;
|
||||
drillTier = 1;
|
||||
minePower = 4f;
|
||||
speed = 0.49f;
|
||||
drag = 0.09f;
|
||||
health = 200f;
|
||||
weaponOffsetX = -1;
|
||||
engineSize = 2.3f;
|
||||
weaponOffsetY = -1;
|
||||
engineColor = Pal.lightTrail;
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 1.2f;
|
||||
weapon = new Weapon("vanguard-blaster"){{
|
||||
length = 1.5f;
|
||||
reload = 30f;
|
||||
alternate = true;
|
||||
inaccuracy = 6f;
|
||||
velocityRnd = 0.1f;
|
||||
ejectEffect = Fx.none;
|
||||
bullet = new HealBulletType(){{
|
||||
healPercent = 3f;
|
||||
backColor = engineColor;
|
||||
homingPower = 20f;
|
||||
bulletHeight = 4f;
|
||||
bulletWidth = 1.5f;
|
||||
damage = 3f;
|
||||
speed = 4f;
|
||||
lifetime = 40f;
|
||||
shootEffect = Fx.shootHealYellow;
|
||||
smokeEffect = hitEffect = despawnEffect = Fx.hitYellowLaser;
|
||||
}};
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alwaysUnlocked(){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Playerc player){
|
||||
if(player.timer.get(Playerc.timerAbility, healReload)){
|
||||
if(indexer.eachBlock(player, healRange, other -> other.entity.damaged(), other -> {
|
||||
other.entity.healBy(other.entity.maxHealth() * healPercent / 100f);
|
||||
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
|
||||
})){
|
||||
Fx.healWave.at(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
alpha = new UnitDef("alpha-mech", false){
|
||||
{
|
||||
drillTier = -1;
|
||||
speed = 0.5f;
|
||||
boostSpeed = 0.95f;
|
||||
itemCapacity = 15;
|
||||
mass = 0.9f;
|
||||
health = 150f;
|
||||
buildPower = 0.9f;
|
||||
weaponOffsetX = 1;
|
||||
weaponOffsetY = -1;
|
||||
engineColor = Pal.heal;
|
||||
|
||||
weapon = new Weapon("shockgun"){{
|
||||
shake = 2f;
|
||||
length = 0.5f;
|
||||
reload = 70f;
|
||||
alternate = true;
|
||||
recoil = 4f;
|
||||
width = 5f;
|
||||
shootSound = Sounds.laser;
|
||||
|
||||
bullet = new LaserBulletType(){{
|
||||
damage = 20f;
|
||||
recoil = 1f;
|
||||
sideAngle = 45f;
|
||||
sideWidth = 1f;
|
||||
sideLength = 70f;
|
||||
colors = new Color[]{Pal.heal.cpy().a(0.4f), Pal.heal, Color.white};
|
||||
}};
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Playerc player){
|
||||
player.healBy(Time.delta() * 0.09f);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
delta = new UnitDef("delta-mech", false){
|
||||
{
|
||||
drillPower = 1;
|
||||
mineSpeed = 1.5f;
|
||||
mass = 1.2f;
|
||||
speed = 0.5f;
|
||||
itemCapacity = 40;
|
||||
boostSpeed = 0.95f;
|
||||
buildPower = 1.2f;
|
||||
engineColor = Color.valueOf("ffd37f");
|
||||
health = 250f;
|
||||
weaponOffsetX = 4f;
|
||||
|
||||
weapon = new Weapon("flamethrower"){{
|
||||
length = 1.5f;
|
||||
reload = 30f;
|
||||
width = 4f;
|
||||
alternate = true;
|
||||
shots = 3;
|
||||
inaccuracy = 40f;
|
||||
shootSound = Sounds.spark;
|
||||
bullet = new LightningBulletType(){{
|
||||
damage = 5;
|
||||
lightningLength = 10;
|
||||
lightningColor = Pal.lightFlame;
|
||||
}};
|
||||
}};
|
||||
}
|
||||
};
|
||||
|
||||
tau = new UnitDef("tau-mech", false){
|
||||
float healRange = 60f;
|
||||
float healAmount = 10f;
|
||||
float healReload = 160f;
|
||||
boolean wasHealed;
|
||||
|
||||
{
|
||||
drillPower = 4;
|
||||
mineSpeed = 3f;
|
||||
itemCapacity = 70;
|
||||
weaponOffsetY = -1;
|
||||
weaponOffsetX = 1;
|
||||
mass = 1.75f;
|
||||
speed = 0.44f;
|
||||
drag = 0.35f;
|
||||
boostSpeed = 0.8f;
|
||||
canHeal = true;
|
||||
health = 200f;
|
||||
buildPower = 1.6f;
|
||||
engineColor = Pal.heal;
|
||||
|
||||
weapon = new Weapon("heal-blaster"){{
|
||||
length = 1.5f;
|
||||
reload = 24f;
|
||||
alternate = false;
|
||||
ejectEffect = Fx.none;
|
||||
recoil = 2f;
|
||||
bullet = Bullets.healBullet;
|
||||
shootSound = Sounds.pew;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Playerc player){
|
||||
|
||||
if(player.timer.get(Playerc.timerAbility, healReload)){
|
||||
wasHealed = false;
|
||||
|
||||
Units.nearby(player.team(), player.x, player.y, healRange, unit -> {
|
||||
if(unit.health < unit.maxHealth()){
|
||||
Fx.heal.at(unit);
|
||||
wasHealed = true;
|
||||
}
|
||||
unit.healBy(healAmount);
|
||||
});
|
||||
|
||||
if(wasHealed){
|
||||
Fx.healWave.at(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
omega = new UnitDef("omega-mech", false){
|
||||
protected TextureRegion armorRegion;
|
||||
|
||||
{
|
||||
drillPower = 2;
|
||||
mineSpeed = 1.5f;
|
||||
itemCapacity = 80;
|
||||
speed = 0.36f;
|
||||
boostSpeed = 0.6f;
|
||||
mass = 4f;
|
||||
shake = 4f;
|
||||
weaponOffsetX = 1;
|
||||
weaponOffsetY = 0;
|
||||
engineColor = Color.valueOf("feb380");
|
||||
health = 350f;
|
||||
buildPower = 1.5f;
|
||||
weapon = new Weapon("swarmer"){{
|
||||
length = 1.5f;
|
||||
recoil = 4f;
|
||||
reload = 38f;
|
||||
shots = 4;
|
||||
spacing = 8f;
|
||||
inaccuracy = 8f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.none;
|
||||
shake = 3f;
|
||||
bullet = Bullets.missileSwarm;
|
||||
shootSound = Sounds.shootBig;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotationAlpha(Playerc player){
|
||||
return 0.6f - player.shootHeat * 0.3f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float spreadX(Playerc player){
|
||||
return player.shootHeat * 2f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
armorRegion = Core.atlas.find(name + "-armor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Playerc player){
|
||||
float scl = 1f - player.shootHeat / 2f*Time.delta();
|
||||
player.vel().scl(scl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraArmor(Playerc player){
|
||||
return player.shootHeat * 30f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Playerc player){
|
||||
if(player.shootHeat <= 0.01f) return;
|
||||
|
||||
Shaders.build.progress = player.shootHeat;
|
||||
Shaders.build.region = armorRegion;
|
||||
Shaders.build.time = Time.time() / 10f;
|
||||
Shaders.build.color.set(Pal.accent).a = player.shootHeat;
|
||||
Draw.shader(Shaders.build);
|
||||
Draw.rect(armorRegion, player.x, player.y, player.rotation);
|
||||
Draw.shader();
|
||||
}
|
||||
};
|
||||
|
||||
dart = new UnitDef("dart-ship"){
|
||||
float effectRange = 60f;
|
||||
float effectReload = 60f * 5;
|
||||
float effectDuration = 60f * 10f;
|
||||
|
||||
{
|
||||
flying = true;
|
||||
drillPower = 1;
|
||||
mineSpeed = 2f;
|
||||
speed = 0.5f;
|
||||
drag = 0.09f;
|
||||
health = 200f;
|
||||
weaponOffsetX = -1;
|
||||
weaponOffsetY = -1;
|
||||
engineColor = Pal.lightTrail;
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 1.1f;
|
||||
weapon = new Weapon("blaster"){{
|
||||
length = 1.5f;
|
||||
reload = 15f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.shellEjectSmall;
|
||||
bullet = Bullets.standardCopper;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Playerc player){
|
||||
super.update(player);
|
||||
|
||||
if(player.timer.get(Playerc.timerAbility, effectReload)){
|
||||
|
||||
Units.nearby(player.team(), player.x, player.y, effectRange, unit -> {
|
||||
//unit.applyEffect(StatusEffects.overdrive, effectDuration);
|
||||
});
|
||||
|
||||
indexer.eachBlock(player, effectRange, other -> other.entity.damaged(), other -> {
|
||||
other.entity.applyBoost(1.5f, effectDuration);
|
||||
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
|
||||
});
|
||||
|
||||
Fx.overdriveWave.at(player);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
javelin = new UnitDef("javelin-ship"){
|
||||
float minV = 3.6f;
|
||||
float maxV = 6f;
|
||||
TextureRegion shield;
|
||||
|
||||
{
|
||||
flying = true;
|
||||
drillPower = -1;
|
||||
speed = 0.11f;
|
||||
drag = 0.01f;
|
||||
mass = 2f;
|
||||
health = 170f;
|
||||
engineColor = Color.valueOf("d3ddff");
|
||||
cellTrnsY = 1f;
|
||||
weapon = new Weapon("missiles"){{
|
||||
length = 1.5f;
|
||||
reload = 70f;
|
||||
shots = 4;
|
||||
inaccuracy = 2f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.none;
|
||||
velocityRnd = 0.2f;
|
||||
spacing = 1f;
|
||||
bullet = Bullets.missileJavelin;
|
||||
shootSound = Sounds.missile;
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
shield = Core.atlas.find(name + "-shield");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotationAlpha(Playerc player){
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Playerc player){
|
||||
float scl = scld(player);
|
||||
if(Mathf.chance(Time.delta() * (0.15 * scl))){
|
||||
Fx.hitLancer.at(Pal.lancerLaser, player.x, player.y);
|
||||
Lightning.create(player.team(), Pal.lancerLaser, 10f * Vars.state.rules.playerDamageMultiplier,
|
||||
player.x + player.vel().x, player.y + player.vel().y, player.rotation, 14);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Playerc player){
|
||||
float scl = scld(player);
|
||||
if(scl < 0.01f) return;
|
||||
Draw.color(Pal.lancerLaser);
|
||||
Draw.alpha(scl / 2f);
|
||||
Draw.blend(Blending.additive);
|
||||
Draw.rect(shield, player.x + Mathf.range(scl / 2f), player.y + Mathf.range(scl / 2f), player.rotation - 90);
|
||||
Draw.blend();
|
||||
}
|
||||
|
||||
float scld(Playerc player){
|
||||
return Mathf.clamp((player.vel().len() - minV) / (maxV - minV));
|
||||
}
|
||||
};
|
||||
|
||||
trident = new UnitDef("trident-ship"){
|
||||
{
|
||||
flying = true;
|
||||
drillPower = 2;
|
||||
speed = 0.15f;
|
||||
drag = 0.034f;
|
||||
mass = 2.5f;
|
||||
turnCursor = false;
|
||||
health = 250f;
|
||||
itemCapacity = 30;
|
||||
engineColor = Color.valueOf("84f491");
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 2.5f;
|
||||
weapon = new Weapon("bomber"){{
|
||||
length = 0f;
|
||||
width = 2f;
|
||||
reload = 25f;
|
||||
shots = 2;
|
||||
shotDelay = 1f;
|
||||
shots = 8;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.none;
|
||||
velocityRnd = 1f;
|
||||
inaccuracy = 20f;
|
||||
ignoreRotation = true;
|
||||
bullet = new BombBulletType(16f, 25f, "shell"){{
|
||||
bulletWidth = 10f;
|
||||
bulletHeight = 14f;
|
||||
hitEffect = Fx.flakExplosion;
|
||||
shootEffect = Fx.none;
|
||||
smokeEffect = Fx.none;
|
||||
shootSound = Sounds.artillery;
|
||||
}};
|
||||
}};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canShoot(Playerc player){
|
||||
return player.vel().len() > 1.2f;
|
||||
}
|
||||
};
|
||||
|
||||
glaive = new UnitDef("glaive-ship"){
|
||||
{
|
||||
flying = true;
|
||||
drillPower = 4;
|
||||
mineSpeed = 1.3f;
|
||||
speed = 0.32f;
|
||||
drag = 0.06f;
|
||||
mass = 3f;
|
||||
health = 240f;
|
||||
itemCapacity = 60;
|
||||
engineColor = Color.valueOf("feb380");
|
||||
cellTrnsY = 1f;
|
||||
buildPower = 1.2f;
|
||||
|
||||
weapon = new Weapon("bomber"){{
|
||||
length = 1.5f;
|
||||
reload = 13f;
|
||||
alternate = true;
|
||||
ejectEffect = Fx.shellEjectSmall;
|
||||
bullet = Bullets.standardGlaive;
|
||||
shootSound = Sounds.shootSnap;
|
||||
}};
|
||||
}
|
||||
};
|
||||
|
||||
starter = vanguard;*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user