Static effects / Better shell ejections / Implemented new cannon turret
BIN
core/assets-raw/sprites/blocks/turrets/flakturret-heat.png
Normal file
After Width: | Height: | Size: 191 B |
BIN
core/assets-raw/sprites/blocks/turrets/flakturret-panel-left.png
Normal file
After Width: | Height: | Size: 192 B |
After Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 400 B |
BIN
core/assets-raw/sprites/effects/bullet-back.png
Normal file
After Width: | Height: | Size: 162 B |
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 127 B |
BIN
core/assets-raw/sprites/effects/casing.png
Normal file
After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 203 B |
BIN
core/assets-raw/sprites/effects/shell-back.png
Normal file
After Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 102 KiB |
@ -1,7 +1,7 @@
|
||||
#Autogenerated file. Do not modify.
|
||||
#Wed Apr 04 16:43:10 EDT 2018
|
||||
#Wed Apr 04 21:11:59 EDT 2018
|
||||
version=release
|
||||
androidBuildCode=822
|
||||
androidBuildCode=844
|
||||
name=Mindustry
|
||||
code=3.4
|
||||
build=custom build
|
||||
|
@ -144,6 +144,7 @@ public class Vars{
|
||||
public static final EntityGroup<Bullet> bulletGroup = Entities.addGroup(Bullet.class);
|
||||
public static final EntityGroup<Shield> shieldGroup = Entities.addGroup(Shield.class, false);
|
||||
public static final EntityGroup<EffectEntity> effectGroup = Entities.addGroup(EffectEntity.class, false);
|
||||
public static final EntityGroup<EffectEntity> staticEffectGroup = Entities.addGroup(EffectEntity.class, false);
|
||||
public static final EntityGroup<BaseUnit>[] unitGroups = new EntityGroup[Team.values().length];
|
||||
|
||||
static{
|
||||
|
@ -10,5 +10,7 @@ public class AmmoTypes {
|
||||
|
||||
basicSteel = new AmmoType(Items.steel, TurretBullets.basicSteel, 5, 0.8f),
|
||||
|
||||
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f, 0.9f);
|
||||
basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f, 0.9f),
|
||||
|
||||
basicLeadFrag = new AmmoType(Items.lead, TurretBullets.basicLeadFragShell, 1, 0.8f);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import io.anuke.mindustry.content.bullets.TurretBullets;
|
||||
import io.anuke.mindustry.graphics.fx.BulletFx;
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.resource.Weapon;
|
||||
|
||||
public class Weapons {
|
||||
|
@ -3,7 +3,7 @@ package io.anuke.mindustry.content.blocks;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.ItemStack;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.Wall;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.*;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.RepairTurret;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock;
|
||||
|
@ -3,7 +3,7 @@ package io.anuke.mindustry.content.blocks;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.production.Cultivator;
|
||||
import io.anuke.mindustry.world.blocks.types.production.Drill;
|
||||
|
@ -1,12 +1,16 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import io.anuke.mindustry.content.AmmoTypes;
|
||||
import io.anuke.mindustry.graphics.fx.BulletFx;
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.resource.AmmoType;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.LaserTurret;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.Turret;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.turrets.*;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
import io.anuke.ucore.util.Strings;
|
||||
|
||||
public class WeaponBlocks{
|
||||
public static Block
|
||||
@ -17,6 +21,7 @@ public class WeaponBlocks{
|
||||
restitution = 0.03f;
|
||||
shootEffect = BulletFx.shootSmall;
|
||||
smokeEffect = BulletFx.shootSmallSmoke;
|
||||
ammoUseEffect = BulletFx.shellEjectSmall;
|
||||
}},
|
||||
|
||||
gatlingturret = new BurstTurret("gatlingturret") {{
|
||||
@ -39,6 +44,10 @@ public class WeaponBlocks{
|
||||
shootCone = 50f;
|
||||
shootEffect = BulletFx.shootSmallFlame;
|
||||
ammoUseEffect = BulletFx.shellEjectSmall;
|
||||
|
||||
drawer = (tile, entity) -> {
|
||||
Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
};
|
||||
}},
|
||||
|
||||
railgunturret = new ItemTurret("railgunturret"){{
|
||||
@ -51,20 +60,35 @@ public class WeaponBlocks{
|
||||
shootShake = 2f;
|
||||
shootEffect = BulletFx.shootBig;
|
||||
smokeEffect = BulletFx.shootBigSmoke;
|
||||
ammoUseEffect = BulletFx.shellEjectBig;
|
||||
ammoUseEffect = BulletFx.shellEjectMedium;
|
||||
}},
|
||||
|
||||
flakturret = new ItemTurret("flakturret"){{
|
||||
size = 2;
|
||||
range = 100f;
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.basicSteel};
|
||||
reload = 100f;
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.basicLeadFrag};
|
||||
reload = 70f;
|
||||
restitution = 0.03f;
|
||||
ammoEjectBack = 2f;
|
||||
ammoEjectBack = 3f;
|
||||
cooldown = 0.03f;
|
||||
recoil = 3f;
|
||||
shootShake = 2f;
|
||||
shootEffect = BulletFx.shootBig;
|
||||
smokeEffect = BulletFx.shootBigSmoke;
|
||||
shootEffect = BulletFx.shootBig2;
|
||||
smokeEffect = BulletFx.shootBigSmoke2;
|
||||
ammoUseEffect = BulletFx.shellEjectBig;
|
||||
|
||||
drawer = (tile, entity) -> {
|
||||
Draw.rect(name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
float offsetx = (int)(Mathf.abscurve(Mathf.curve(entity.reload/reload, 0.3f, 0.2f)) * 3f);
|
||||
float offsety = -(int)(Mathf.abscurve(Mathf.curve(entity.reload/reload, 0.3f, 0.2f)) * 2f);
|
||||
|
||||
for(int i : Mathf.signs){
|
||||
float rot = entity.rotation + 90*i;
|
||||
Draw.rect(name + "-panel-" + Strings.dir(i),
|
||||
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
|
||||
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
|
||||
}
|
||||
};
|
||||
}},
|
||||
|
||||
laserturret = new LaserTurret("laserturret"){
|
||||
|
@ -1,11 +1,14 @@
|
||||
package io.anuke.mindustry.content.bullets;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.entities.Bullet;
|
||||
import io.anuke.mindustry.entities.BulletType;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.fx.BulletFx;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class TurretBullets {
|
||||
|
||||
@ -14,9 +17,8 @@ public class TurretBullets {
|
||||
basicIron = new BulletType(3f, 0) {
|
||||
@Override
|
||||
public void draw(Bullet b) {
|
||||
Draw.color(Palette.bulletYellow);
|
||||
Draw.rect("bullet", b.x, b.y, 9f, 5f + b.fract()*7f, b.angle() - 90);
|
||||
Draw.color();
|
||||
drawBullet(Palette.bulletYellow, Palette.bulletYellowBack,
|
||||
"bullet", b.x, b.y, 9f, 5f + b.fract()*7f, b.angle() - 90);
|
||||
}
|
||||
},
|
||||
|
||||
@ -28,9 +30,56 @@ public class TurretBullets {
|
||||
|
||||
@Override
|
||||
public void draw(Bullet b) {
|
||||
Draw.color(Palette.bulletYellow);
|
||||
Draw.rect("bullet", b.x, b.y, 11f, 9f + b.fract()*8f, b.angle() - 90);
|
||||
Draw.color();
|
||||
drawBullet(Palette.bulletYellow, Palette.bulletYellowBack,
|
||||
"bullet", b.x, b.y, 11f, 9f + b.fract()*8f, b.angle() - 90);
|
||||
}
|
||||
},
|
||||
|
||||
basicLeadFragShell = new BulletType(3f, 0) {
|
||||
{
|
||||
hiteffect = BulletFx.flakExplosion;
|
||||
knockback = 0.8f;
|
||||
lifetime = 90f;
|
||||
drag = 0.01f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Bullet b) {
|
||||
drawBullet(Palette.bulletYellow, Palette.bulletYellowBack,
|
||||
"shell", b.x, b.y, 9f, 9f, b.angle() - 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hit(Bullet b, float x, float y) {
|
||||
super.hit(b, x, y);
|
||||
for(int i = 0; i < 9; i ++){
|
||||
float len = Mathf.random(1f, 7f);
|
||||
float a = Mathf.random(360f);
|
||||
Bullet bullet = new Bullet(TurretBullets.basicLeadFrag, b,
|
||||
x + Angles.trnsx(a, len), y + Angles.trnsy(a, len), a);
|
||||
bullet.velocity.scl(Mathf.random(0.2f, 1f));
|
||||
bullet.add();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void despawned(Bullet b) {
|
||||
hit(b);
|
||||
}
|
||||
},
|
||||
|
||||
basicLeadFrag = new BulletType(3f, 0) {
|
||||
{
|
||||
drag = 0.1f;
|
||||
hiteffect = Fx.none;
|
||||
despawneffect = Fx.none;
|
||||
hitsize = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Bullet b) {
|
||||
drawBullet(Palette.bulletYellow, Palette.bulletYellowBack,
|
||||
"bullet", b.x, b.y, 10f, 1f + b.fract()*11f, b.angle() - 90);
|
||||
}
|
||||
},
|
||||
|
||||
@ -47,4 +96,12 @@ public class TurretBullets {
|
||||
@Override
|
||||
public void draw(Bullet b) {}
|
||||
};
|
||||
|
||||
private static void drawBullet(Color first, Color second, String name, float x, float y, float w, float h, float rot){
|
||||
Draw.color(second);
|
||||
Draw.rect(name + "-back", x, y, w, h, rot);
|
||||
Draw.color(first);
|
||||
Draw.rect(name, x, y, w, h, rot);
|
||||
Draw.color();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.graphics.fx;
|
||||
package io.anuke.mindustry.content.fx;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.graphics.fx;
|
||||
package io.anuke.mindustry.content.fx;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.effect.StaticEffectEntity.StaticEffect;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
@ -40,6 +41,15 @@ public class BulletFx {
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
shootBig2 = new Effect(10, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.GRAY, e.ifract());
|
||||
float w = 1.2f + 8 * e.fract();
|
||||
Shapes.tri(e.x, e.y, w, 29f * e.fract(), e.rotation);
|
||||
Shapes.tri(e.x, e.y, w, 5f * e.fract(), e.rotation + 180f);
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
|
||||
shootBigSmoke = new Effect(17f, e -> {
|
||||
Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract());
|
||||
|
||||
@ -50,6 +60,16 @@ public class BulletFx {
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
shootBigSmoke2 = new Effect(18f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract());
|
||||
|
||||
Angles.randLenVectors(e.id, 9, e.powfract()*23f, e.rotation, 20f, (x, y) -> {
|
||||
Fill.circle(e.x + x, e.y + y, e.fract()*2.4f + 0.2f);
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
shootSmallFlame = new Effect(30f, e -> {
|
||||
Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.ifract());
|
||||
|
||||
@ -60,26 +80,31 @@ public class BulletFx {
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
shellEjectSmall = new Effect(30f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract());
|
||||
Draw.alpha(e.fract());
|
||||
shellEjectSmall = new StaticEffect(30f, 300f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.ifract());
|
||||
float rot = e.rotation + 90f;
|
||||
for(int i : Mathf.signs){
|
||||
float len = (2f + e.powfract()*6f) * i;
|
||||
float lr = rot + e.ifract()*30f*i;
|
||||
Draw.rect("white", e.x + Angles.trnsx(lr, len), e.y + Angles.trnsy(lr, len), 1f, 2f, rot + e.ifract()*50f*i);
|
||||
Draw.rect("white",
|
||||
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.ifract()),
|
||||
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.ifract()),
|
||||
1f, 2f, rot + e.ifract()*50f*i);
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
|
||||
shellEjectBig = new Effect(30f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract());
|
||||
shellEjectMedium = new StaticEffect(34f, 300f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.ifract());
|
||||
float rot = e.rotation + 90f;
|
||||
for(int i : Mathf.signs){
|
||||
float len = (2f + e.powfract()*10f) * i;
|
||||
float lr = rot + e.ifract()*20f*i;
|
||||
Draw.rect("white", e.x + Angles.trnsx(lr, len), e.y + Angles.trnsy(lr, len), 2f, 3f, rot);
|
||||
Draw.rect("casing",
|
||||
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.ifract()),
|
||||
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.ifract()),
|
||||
2f, 3f, rot);
|
||||
}
|
||||
|
||||
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract());
|
||||
@ -93,6 +118,30 @@ public class BulletFx {
|
||||
Draw.color();
|
||||
}),
|
||||
|
||||
shellEjectBig = new StaticEffect(22f, 300f, e -> {
|
||||
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.ifract());
|
||||
float rot = e.rotation + 90f;
|
||||
for(int i : Mathf.signs){
|
||||
float len = (4f + e.powfract()*8f) * i;
|
||||
float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.ifract())*i;
|
||||
Draw.rect("casing",
|
||||
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.ifract()),
|
||||
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.ifract()),
|
||||
2.5f, 4f,
|
||||
rot+ e.ifract()*30f*i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.ifract()));
|
||||
}
|
||||
|
||||
Draw.color(Color.LIGHT_GRAY);
|
||||
|
||||
for(int i : Mathf.signs){
|
||||
Angles.randLenVectors(e.id, 4, -e.powfract()*15f, e.rotation + 90f*i, 25f, (x, y) -> {
|
||||
Fill.circle(e.x + x, e.y + y, e.fract()*2f);
|
||||
});
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
}),
|
||||
|
||||
hitBulletSmall = new Effect(14, e -> {
|
||||
Draw.color(Color.WHITE, Palette.lightOrange, e.ifract());
|
||||
Lines.stroke(0.5f + e.fract());
|
||||
@ -138,6 +187,30 @@ public class BulletFx {
|
||||
Lines.lineAngle(e.x + x, e.y + y, ang, e.fract()*2 + 1f);
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
flakExplosion = new Effect(20, e -> {
|
||||
|
||||
Draw.color(Palette.bulletYellow);
|
||||
e.scaled(6, i -> {
|
||||
Lines.stroke(3f * i.fract());
|
||||
Lines.circle(e.x, e.y, 3f + i.ifract()*10f);
|
||||
});
|
||||
|
||||
Draw.color(Color.GRAY);
|
||||
|
||||
Angles.randLenVectors(e.id, 5, 2f + 23f * e.powfract(), (x, y) ->{
|
||||
Fill.circle(e.x + x, e.y + y, e.fract()*3f + 0.5f);
|
||||
});
|
||||
|
||||
Draw.color(Palette.lighterOrange);
|
||||
Lines.stroke(1f * e.fract());
|
||||
|
||||
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.powfract(), (x, y) -> {
|
||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fract()*3f);
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
@ -1,43 +1,58 @@
|
||||
package io.anuke.mindustry.graphics.fx;
|
||||
package io.anuke.mindustry.content.fx;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Fill;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class ExplosionFx {
|
||||
public static final Effect
|
||||
|
||||
generatorexplosion = new Effect(28, 40f, e -> {
|
||||
Angles.randLenVectors(e.id, 16, 10f + e.ifract()*8f, (x, y)->{
|
||||
Angles.randLenVectors(e.id, 16, 10f + e.ifract()*8f, (x, y) -> {
|
||||
float size = e.fract()*12f + 1f;
|
||||
Draw.color(Color.WHITE, Color.PURPLE, e.ifract());
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
|
||||
shockwave = new Effect(10f, 80f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||
Lines.stroke(e.fract()*2f + 0.2f);
|
||||
Lines.circle(e.x, e.y, e.ifract()*28f);
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
nuclearShockwave = new Effect(10f, 200f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||
Lines.stroke(e.fract()*3f + 0.2f);
|
||||
Lines.poly(e.x, e.y, 40, e.ifract()*140f);
|
||||
Draw.reset();
|
||||
}),
|
||||
explosion = new Effect(11, e -> {
|
||||
Lines.stroke(2f*e.fract()+0.5f);
|
||||
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract());
|
||||
Lines.circle(e.x, e.y, 5f + e.powfract() * 6f);
|
||||
|
||||
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
|
||||
Angles.randLenVectors(e.id, 5, 8f, (x, y)->{
|
||||
Fill.circle(e.x + x, e.y + y, e.fract()*5f + 2.5f);
|
||||
explosion = new Effect(30, e -> {
|
||||
e.scaled(7, i -> {
|
||||
Lines.stroke(3f * i.fract());
|
||||
Lines.circle(e.x, e.y, 3f + i.ifract()*10f);
|
||||
});
|
||||
|
||||
Draw.color(Color.GRAY);
|
||||
|
||||
Angles.randLenVectors(e.id, 6, 2f + 19f * e.powfract(), (x, y) ->{
|
||||
Fill.circle(e.x + x, e.y + y, e.fract()*3f + 0.5f);
|
||||
Fill.circle(e.x + x/2f, e.y + y/2f, e.fract()*1f);
|
||||
});
|
||||
|
||||
Draw.color(Palette.lighterOrange, Palette.lightOrange, Color.GRAY, e.ifract());
|
||||
Lines.stroke(1.5f * e.fract());
|
||||
|
||||
Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.powfract(), (x, y) -> {
|
||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fract()*3f);
|
||||
});
|
||||
|
||||
Draw.reset();
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.graphics.fx;
|
||||
package io.anuke.mindustry.content.fx;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
@ -352,6 +352,7 @@ public class Control extends Module{
|
||||
|
||||
if(!state.is(State.paused) || Net.active()){
|
||||
Entities.update(effectGroup);
|
||||
Entities.update(staticEffectGroup);
|
||||
|
||||
if(respawntime > 0){
|
||||
|
||||
|
@ -12,20 +12,22 @@ import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.FloatArray;
|
||||
import com.badlogic.gdx.utils.Pools;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.SyncEntity;
|
||||
import io.anuke.mindustry.entities.effect.StaticEffectEntity;
|
||||
import io.anuke.mindustry.entities.effect.StaticEffectEntity.StaticEffect;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.graphics.BlockRenderer;
|
||||
import io.anuke.mindustry.graphics.Layer;
|
||||
import io.anuke.mindustry.graphics.Shaders;
|
||||
import io.anuke.mindustry.input.InputHandler;
|
||||
import io.anuke.mindustry.input.PlaceMode;
|
||||
import io.anuke.mindustry.ui.fragments.ToolFragment;
|
||||
import io.anuke.mindustry.world.BlockBar;
|
||||
import io.anuke.mindustry.graphics.Layer;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.ucore.core.*;
|
||||
import io.anuke.ucore.entities.EffectEntity;
|
||||
import io.anuke.ucore.entities.Entities;
|
||||
@ -63,8 +65,13 @@ public class Renderer extends RendererModule{
|
||||
Rectangle view = rect.setSize(camera.viewportWidth, camera.viewportHeight)
|
||||
.setCenter(camera.position.x, camera.position.y);
|
||||
Rectangle pos = rect2.setSize(name.size).setCenter(x, y);
|
||||
|
||||
if(view.overlaps(pos)){
|
||||
new EffectEntity(name, color, rotation).set(x, y).add(effectGroup);
|
||||
int id = new EffectEntity(name, color, rotation).set(x, y).add(effectGroup).id;
|
||||
|
||||
if(name instanceof StaticEffect){
|
||||
new StaticEffectEntity((StaticEffect) name, color, rotation).set(x, y).add(staticEffectGroup).id = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -183,6 +190,9 @@ public class Renderer extends RendererModule{
|
||||
drawPadding();
|
||||
|
||||
blocks.drawFloor();
|
||||
|
||||
Entities.draw(staticEffectGroup);
|
||||
|
||||
blocks.processBlocks();
|
||||
blocks.drawBlocks(Layer.overlay);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.anuke.mindustry.entities;
|
||||
|
||||
import io.anuke.mindustry.graphics.fx.BulletFx;
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.entities.BaseBulletType;
|
||||
|
||||
|
@ -6,8 +6,8 @@ import io.anuke.mindustry.content.Mechs;
|
||||
import io.anuke.mindustry.content.Weapons;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.graphics.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.mindustry.resource.Mech;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package io.anuke.mindustry.entities;
|
||||
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
|
@ -0,0 +1,45 @@
|
||||
package io.anuke.mindustry.entities.effect;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.entities.EffectEntity;
|
||||
import io.anuke.ucore.function.EffectRenderer;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class StaticEffectEntity extends EffectEntity {
|
||||
private boolean once;
|
||||
|
||||
public StaticEffectEntity(StaticEffect effect, Color color, float rotation) {
|
||||
super(effect, color, rotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
time += Timers.delta();
|
||||
|
||||
time = Mathf.clamp(time, 0, ((StaticEffect)renderer).staticLife);
|
||||
|
||||
if(!once && time >= lifetime){
|
||||
once = true;
|
||||
time = 0f;
|
||||
}else if(once && time >= ((StaticEffect)renderer).staticLife){
|
||||
remove();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawOver(){
|
||||
if(once) Effects.renderEffect(id, renderer, color, once ? lifetime : time, rotation, x, y);
|
||||
}
|
||||
|
||||
public static class StaticEffect extends Effect{
|
||||
public final float staticLife;
|
||||
|
||||
public StaticEffect(float life, float staticLife, EffectRenderer draw) {
|
||||
super(life, draw);
|
||||
this.staticLife = staticLife;
|
||||
}
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.ObjectSet;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.game.TeamInfo.TeamData;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
|
@ -5,7 +5,7 @@ import io.anuke.mindustry.entities.Bullet;
|
||||
import io.anuke.mindustry.entities.BulletType;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.graphics.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
|
@ -3,7 +3,8 @@ package io.anuke.mindustry.graphics;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
|
||||
public class Palette {
|
||||
public static final Color bulletYellow = Color.valueOf("f3d47f");
|
||||
public static final Color bulletYellow = Color.valueOf("ffeec9");
|
||||
public static final Color bulletYellowBack = Color.valueOf("f9c87a");
|
||||
|
||||
public static final Color lightFlame = Color.valueOf("ffdd55");
|
||||
public static final Color darkFlame = Color.valueOf("db401c");
|
||||
@ -12,4 +13,6 @@ public class Palette {
|
||||
|
||||
public static final Color lightOrange = Color.valueOf("f68021");
|
||||
public static final Color lighterOrange = Color.valueOf("f6e096");
|
||||
|
||||
public static final Color lightishGray = Color.valueOf("a2a2a2");
|
||||
}
|
||||
|
@ -2,11 +2,13 @@ package io.anuke.mindustry.ui.fragments;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.content.UnitTypes;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.scene.builders.button;
|
||||
import io.anuke.ucore.scene.builders.label;
|
||||
@ -51,7 +53,7 @@ public class DebugFragment implements Fragment {
|
||||
row();
|
||||
new button("blocks", "toggle", () -> showBlockDebug = !showBlockDebug);
|
||||
row();
|
||||
new button("paths", "toggle", () -> showPaths = !showPaths);
|
||||
new button("effect", () -> Effects.effect(ExplosionFx.explosion, player));
|
||||
row();
|
||||
new button("wave", () -> state.wavetime = 0f);
|
||||
row();
|
||||
|
@ -9,7 +9,7 @@ import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.DrawLayer;
|
||||
import io.anuke.mindustry.graphics.Layer;
|
||||
import io.anuke.mindustry.graphics.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.NetEvents;
|
||||
import io.anuke.mindustry.resource.ItemStack;
|
||||
|
@ -7,7 +7,7 @@ import io.anuke.mindustry.content.Recipes;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.resource.ItemStack;
|
||||
import io.anuke.mindustry.resource.Recipe;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
|
@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.defense;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.Wall;
|
||||
|
@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.graphics.Layer;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.defense.turrets.PowerTurret;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
|
@ -2,10 +2,10 @@ package io.anuke.mindustry.world.blocks.types.defense;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.graphics.Layer;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.resource.AmmoType;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.BlockGroup;
|
||||
@ -14,6 +14,7 @@ import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.function.BiConsumer;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
import io.anuke.ucore.util.Angles;
|
||||
@ -47,6 +48,7 @@ public abstract class Turret extends Block{
|
||||
protected Translator tr = new Translator();
|
||||
protected Translator tr2 = new Translator();
|
||||
protected String base = null; //name of the region to draw under turret, usually null
|
||||
protected BiConsumer<Tile, TurretEntity> drawer = (tile, entity) -> Draw.rect(name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
|
||||
protected Effect shootEffect = Fx.none;
|
||||
protected Effect smokeEffect = Fx.none;
|
||||
@ -96,9 +98,7 @@ public abstract class Turret extends Block{
|
||||
|
||||
tr2.trns(entity.rotation, -entity.recoil);
|
||||
|
||||
String region = entity.target != null && Draw.hasRegion(name + "-shoot") ? name + "-shoot" : name;
|
||||
|
||||
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
drawer.accept(tile, entity);
|
||||
|
||||
if(Draw.hasRegion(name + "-heat")){
|
||||
Graphics.setAdditiveBlending();
|
||||
|
@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.power;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.world.BarType;
|
||||
import io.anuke.mindustry.world.BlockBar;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package io.anuke.mindustry.world.blocks.types.power;
|
||||
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.resource.Liquid;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.power.BurnerGenerator.BurnerEntity;
|
||||
|
@ -4,8 +4,8 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.effect.DamageArea;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.graphics.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.Liquid;
|
||||
import io.anuke.mindustry.world.BarType;
|
||||
|
@ -2,8 +2,8 @@ package io.anuke.mindustry.world.blocks.types.power;
|
||||
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.graphics.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.ExplosionFx;
|
||||
import io.anuke.mindustry.world.Edges;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
||||
|
@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.production;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
|
@ -5,7 +5,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.graphics.Layer;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.Liquid;
|
||||
|
@ -2,8 +2,8 @@ package io.anuke.mindustry.world.blocks.types.production;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.ItemStack;
|
||||
import io.anuke.mindustry.resource.Liquid;
|
||||
|
@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.production;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.ItemStack;
|
||||
import io.anuke.mindustry.world.BarType;
|
||||
|
@ -2,7 +2,7 @@ package io.anuke.mindustry.world.blocks.types.production;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.world.BarType;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
|
@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.Liquids;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.graphics.fx.Fx;
|
||||
import io.anuke.mindustry.content.fx.Fx;
|
||||
import io.anuke.mindustry.resource.Liquid;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
|
@ -8,7 +8,7 @@ import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.entities.units.UnitType;
|
||||
import io.anuke.mindustry.graphics.fx.BlockFx;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.graphics.Shaders;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.ItemStack;
|
||||
|