Fixed lightning / Implemented delta ability and gun

This commit is contained in:
Anuken
2018-08-23 09:02:09 -04:00
parent 4c224d0b9c
commit 8f12c3f1a8
7 changed files with 24 additions and 40 deletions

View File

@ -36,10 +36,9 @@ public class AmmoTypes implements ContentList{
inaccuracy = 2f;
}};
shotgunTungsten = new AmmoType(WeaponBullets.tungstenShotgun){{
shootEffect = ShootFx.shootBig;
smokeEffect = ShootFx.shootBigSmoke;
recoil = 1f;
shotgunTungsten = new AmmoType(TurretBullets.lightning){{
shootEffect = BulletFx.hitLancer;
smokeEffect = Fx.none;
}};
shellCarbide = new AmmoType(WeaponBullets.shellCarbide){{

View File

@ -4,11 +4,13 @@ import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.content.fx.UnitFx;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.effect.Fire;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.graphics.Shaders;
@ -57,13 +59,17 @@ public class Mechs implements ContentList{
weapon = Weapons.shockgun;
trailColorTo = Color.valueOf("d3ddff");
maxSpeed = 5f;
altChargeAlpha = 0.05f;
altChargeAlpha = 0.03f;
}
@Override
public void updateAlt(Player player){
if(player.altHeat > 0.01f){
player.applyEffect(StatusEffects.overdrive, 0.1f);
if(player.altHeat >= 0.91f){
Effects.shake(3f, 3f, player);
for(int i = 0; i < 8; i++){
Timers.run(Mathf.random(5f), () -> Lightning.create(player.getTeam(), BulletFx.hitLancer, player.getTeam().color, 10f, player.x, player.y, Mathf.random(360f), 20));
}
player.altHeat = 0f;
}
}

View File

@ -65,13 +65,12 @@ public class Weapons implements ContentList{
shockgun = new Weapon("shockgun"){{
length = 1f;
reload = 50f;
reload = 40f;
roundrobin = true;
shots = 6;
inaccuracy = 10f;
velocityRnd = 0.7f;
shake = 2f;
ejectEffect = ShootFx.shellEjectSmall;
shots = 1;
inaccuracy = 0f;
velocityRnd = 0.2f;
ejectEffect = Fx.none;
ammo = AmmoTypes.shotgunTungsten;
}};

View File

@ -35,7 +35,7 @@ public class TurretBullets extends BulletList implements ContentList{
@Override
public void load(){
healBullet = new BulletType(5.2f, 25){
healBullet = new BulletType(5.2f, 19){
float healAmount = 20f;
{

View File

@ -13,7 +13,6 @@ 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.entities.effect.ItemDrop;
import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.entities.effect.Puddle;
import io.anuke.mindustry.entities.traits.TypeTrait;
import io.anuke.mindustry.entities.units.UnitType;
@ -171,6 +170,5 @@ public class ContentLoader{
TypeTrait.registerType(Fire.class, Fire::new);
TypeTrait.registerType(Puddle.class, Puddle::new);
TypeTrait.registerType(Bullet.class, Bullet::new);
TypeTrait.registerType(Lightning.class, Lightning::new);
}
}

View File

@ -9,7 +9,6 @@ import io.anuke.annotations.Annotations.Loc;
import io.anuke.annotations.Annotations.Remote;
import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.traits.SyncTrait;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.graphics.Palette;
@ -26,14 +25,10 @@ import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Pooling;
import io.anuke.ucore.util.SeedRandom;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import static io.anuke.mindustry.Vars.bulletGroup;
//TODO utterly broken
public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncTrait{
public class Lightning extends TimedEntity implements Poolable, DrawTrait{
private static Array<SolidTrait> entities = new Array<>();
private static Rectangle rect = new Rectangle();
private static Rectangle hitrect = new Rectangle();
@ -67,7 +62,7 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
l.random.setSeed(seed);
l.color = color;
float step = 3f;
float step = 4f;
float range = 6f;
float attractRange = 20f;
@ -111,7 +106,7 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
});
if(l.random.chance(0.1f)){
createLighting(l.random.nextInt(), team, effect, color, damage, x2, y2, angle + l.random.range(100f), length / 3);
createLighting(l.random.nextInt(), team, effect, color, damage, x2, y2, angle + l.random.range(30f), length / 3);
}
x = x2;
@ -122,21 +117,6 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
l.add();
}
@Override
public boolean isSyncing(){
return false;
}
@Override
public void write(DataOutput data) throws IOException{
}
@Override
public void read(DataInput data, long time) throws IOException{
}
@Override
public float lifetime(){
return 10;
@ -144,12 +124,14 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
@Override
public void reset(){
super.reset();
color = Palette.lancerLaser;
lines.clear();
}
@Override
public void removed(){
super.removed();
Pooling.free(this);
}

View File

@ -157,7 +157,7 @@ public class BuildBlock extends Block{
if(recipe != null){
Draw.rect(recipe.result.shadowRegion, tile.drawx(), tile.drawy());
}else if(previous != null){
}else if(previous != null && !(previous instanceof BuildBlock)){
previous.drawShadow(tile);
}
}