Javelin abilities

This commit is contained in:
Anuken
2018-08-24 17:53:54 -04:00
parent 88ba8f6f55
commit 8c3f3ac304
11 changed files with 579 additions and 505 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View File

@@ -255,14 +255,60 @@ public class Mechs implements ContentList{
trailColor = Palette.lightTrail; trailColor = Palette.lightTrail;
}}; }};
javelin = new Mech("javelin-ship", true){{ javelin = new Mech("javelin-ship", true){
drillPower = -1; float minV = 3.6f;
speed = 0.4f; float maxV = 6f;
maxSpeed = 3.6f; TextureRegion shield;
drag = 0.09f; {
weapon = Weapons.missiles; drillPower = -1;
trailColor = Color.valueOf("d3ddff"); speed = 0.11f;
}}; maxSpeed = 3.4f;
drag = 0.01f;
weapon = Weapons.missiles;
trailColor = Color.valueOf("d3ddff");
}
@Override
public void load(){
super.load();
shield = Draw.region(name + "-shield");
}
@Override
public float getRotationAlpha(Player player){
return 0.5f;
}
@Override
public void updateAlt(Player player){
float scl = scld(player);
if(Mathf.chance(Timers.delta() * (0.15*scl))){
Effects.effect(BulletFx.hitLancer, Palette.lancerLaser, player.x, player.y);
Lightning.create(player.getTeam(), BulletFx.hitLancer, Palette.lancerLaser, 10f,
player.x + player.getVelocity().x, player.y + player.getVelocity().y, player.rotation, 14);
}
}
@Override
public void draw(Player player){
float scl = scld(player);
if(scl < 0.01f) return;
float alpha = Core.batch.getColor().a;
Graphics.shader();
Graphics.setAdditiveBlending();
Draw.color(Palette.lancerLaser);
Draw.alpha(scl/2f);
Draw.rect(shield, player.snappedX() + Mathf.range(scl/2f), player.snappedY() + Mathf.range(scl/2f), player.rotation - 90);
Graphics.setNormalBlending();
Graphics.shader(Shaders.mix);
Draw.color();
Draw.alpha(alpha);
}
float scld(Player player){
return Mathf.clamp((player.getVelocity().len() - minV) / (maxV - minV));
}
};
trident = new Mech("trident-ship", true){{ trident = new Mech("trident-ship", true){{
drillPower = 1; drillPower = 1;

View File

@@ -32,7 +32,7 @@ public class Weapons implements ContentList{
healBlaster = new Weapon("heal-blaster"){{ healBlaster = new Weapon("heal-blaster"){{
length = 1.5f; length = 1.5f;
reload = 30f; reload = 24f;
roundrobin = false; roundrobin = false;
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2f; recoil = 2f;
@@ -41,12 +41,14 @@ public class Weapons implements ContentList{
missiles = new Weapon("missiles"){{ missiles = new Weapon("missiles"){{
length = 1.5f; length = 1.5f;
reload = 40f; reload = 60f;
shots = 2; shots = 4;
inaccuracy = 10f; inaccuracy = 2f;
roundrobin = false; roundrobin = false;
roundrobin = true; roundrobin = true;
ejectEffect = Fx.none; ejectEffect = Fx.none;
velocityRnd = 0.2f;
spacing = 1f;
ammo = AmmoTypes.weaponMissile; ammo = AmmoTypes.weaponMissile;
}}; }};
@@ -55,6 +57,7 @@ public class Weapons implements ContentList{
recoil = 4f; recoil = 4f;
reload = 60f; reload = 60f;
shots = 4; shots = 4;
spacing = 8f;
inaccuracy = 8f; inaccuracy = 8f;
roundrobin = false; roundrobin = false;
roundrobin = true; roundrobin = true;

View File

@@ -2,10 +2,13 @@ package io.anuke.mindustry.content.bullets;
import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.entities.bullet.Bullet;
import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.bullet.BulletType;
import io.anuke.mindustry.entities.bullet.MissileBulletType; import io.anuke.mindustry.entities.bullet.MissileBulletType;
import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.type.ContentList; import io.anuke.mindustry.type.ContentList;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
public class MissileBullets extends BulletList implements ContentList{ public class MissileBullets extends BulletList implements ContentList{
public static BulletType explosive, incindiary, surge, javelin, swarm; public static BulletType explosive, incindiary, surge, javelin, swarm;
@@ -52,18 +55,27 @@ public class MissileBullets extends BulletList implements ContentList{
} }
}; };
javelin = new MissileBulletType(2.5f, 14, "missile"){ javelin = new MissileBulletType(5f, 10.5f, "missile"){
{ {
bulletWidth = 8f; bulletWidth = 8f;
bulletHeight = 8f; bulletHeight = 8f;
bulletShrink = 0f; bulletShrink = 0f;
drag = -0.02f; drag = -0.003f;
keepVelocity = false; keepVelocity = false;
splashDamageRadius = 25f; splashDamageRadius = 20f;
splashDamage = 11f; splashDamage = 3f;
lifetime = 90f; lifetime = 90f;
trailColor = Color.valueOf("b6c6fd");
hiteffect = BulletFx.blastExplosion; hiteffect = BulletFx.blastExplosion;
despawneffect = BulletFx.blastExplosion; despawneffect = BulletFx.blastExplosion;
backColor = Palette.bulletYellowBack;
frontColor = Palette.bulletYellow;
}
@Override
public void update(Bullet b){
super.update(b);
b.getVelocity().rotate(Mathf.sin(Timers.time() + b.id * 4422, 8f, 2f));
} }
}; };
@@ -84,6 +96,12 @@ public class MissileBullets extends BulletList implements ContentList{
hiteffect = BulletFx.blastExplosion; hiteffect = BulletFx.blastExplosion;
despawneffect = BulletFx.blastExplosion; despawneffect = BulletFx.blastExplosion;
} }
@Override
public void update(Bullet b){
super.update(b);
b.getVelocity().rotate(Mathf.sin(Timers.time() + b.id * 4422, 8f, 2f));
}
}; };
} }
} }

View File

@@ -36,7 +36,7 @@ public class TurretBullets extends BulletList implements ContentList{
public void load(){ public void load(){
healBullet = new BulletType(5.2f, 19){ healBullet = new BulletType(5.2f, 19){
float healAmount = 20f; float healAmount = 21f;
{ {
hiteffect = BulletFx.hitLaser; hiteffect = BulletFx.hitLaser;

View File

@@ -360,9 +360,9 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
if(mech.flying || boostHeat > 0.001f){ if(mech.flying || boostHeat > 0.001f){
float wobblyness = 0.6f; float wobblyness = 0.6f;
trail.update(x + Angles.trnsx(rotation + 180f, 5f) + Mathf.range(wobblyness), if(!state.isPaused()) trail.update(x + Angles.trnsx(rotation + 180f, 5f) + Mathf.range(wobblyness),
y + Angles.trnsy(rotation + 180f, 5f) + Mathf.range(wobblyness)); y + Angles.trnsy(rotation + 180f, 5f) + Mathf.range(wobblyness));
trail.draw(Hue.mix(mech.trailColor, mech.trailColorTo, boostHeat, Tmp.c1), 5f * (isFlying() ? 1f : boostHeat)); trail.draw(Hue.mix(mech.trailColor, mech.trailColorTo, mech.flying ? 0f : boostHeat, Tmp.c1), 5f * (isFlying() ? 1f : boostHeat));
}else{ }else{
trail.clear(); trail.clear();
} }
@@ -587,7 +587,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
float baseLerp = mech.getRotationAlpha(this); float baseLerp = mech.getRotationAlpha(this);
if(!isShooting()){ if(!isShooting()){
if(!movement.isZero()){ if(!movement.isZero()){
rotation = Mathf.slerpDelta(rotation, movement.angle(), 0.13f * baseLerp); rotation = Mathf.slerpDelta(rotation, mech.flying ? velocity.angle() : movement.angle(), 0.13f * baseLerp);
} }
}else{ }else{
float angle = control.input(playerIndex).mouseAngle(x, y); float angle = control.input(playerIndex).mouseAngle(x, y);

View File

@@ -36,7 +36,7 @@ public class BasicBulletType extends BulletType{
public float incendChance = 1f; public float incendChance = 1f;
public float homingPower = 0f; public float homingPower = 0f;
public float homingRange = 40f; public float homingRange = 50f;
public TextureRegion backRegion; public TextureRegion backRegion;
public TextureRegion frontRegion; public TextureRegion frontRegion;

View File

@@ -14,7 +14,7 @@ public class MissileBulletType extends BasicBulletType{
super(speed, damage, bulletSprite); super(speed, damage, bulletSprite);
backColor = Palette.missileYellowBack; backColor = Palette.missileYellowBack;
frontColor = Palette.missileYellow; frontColor = Palette.missileYellow;
homingPower = 6f; homingPower = 7f;
} }
@Override @Override

View File

@@ -149,7 +149,7 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait{
Draw.color(color, Color.WHITE, fin()); Draw.color(color, Color.WHITE, fin());
for(int i = 0; i < lines.size; i++){ for(int i = 0; i < lines.size; i++){
Vector2 v = lines.get(i); Vector2 v = lines.get(i);
Lines.stroke(fout() * 3f + 1f - (float) i / lines.size); Lines.stroke(fout() * 3f * (1.5f - (float) i / lines.size));
Lines.line(lx, ly, v.x, v.y); Lines.line(lx, ly, v.x, v.y);
lx = v.x; lx = v.x;
ly = v.y; ly = v.y;