Organized FX

This commit is contained in:
Anuken
2018-03-31 15:30:06 -04:00
parent dd0ad495f7
commit eab226f04d
40 changed files with 652 additions and 734 deletions

View File

@@ -3,7 +3,9 @@ package io.anuke.mindustry.entities;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.entities.effect.DamageArea;
import io.anuke.mindustry.entities.effect.EMP;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.graphics.fx.BlockFx;
import io.anuke.mindustry.graphics.fx.BulletFx;
import io.anuke.mindustry.graphics.fx.Fx;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.entities.BaseBulletType;
@@ -12,7 +14,7 @@ import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.graphics.Fx.*;
import static io.anuke.mindustry.graphics.fx.Fx.*;
public abstract class BulletType extends BaseBulletType<Bullet>{
@@ -52,7 +54,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void update(Bullet b){
if(b.timer.get(0, 4)){
Effects.effect(Fx.railsmoke, b.x, b.y);
Effects.effect(BulletFx.railsmoke, b.x, b.y);
}
}
},
@@ -73,7 +75,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void update(Bullet b){
if(b.timer.get(0, 2)){
Effects.effect(Fx.empspark, b.x + Mathf.range(2), b.y + Mathf.range(2));
Effects.effect(BulletFx.empspark, b.x + Mathf.range(2), b.y + Mathf.range(2));
}
}
@@ -83,7 +85,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void hit(Bullet b, float hitx, float hity){
Timers.run(5f, ()-> new EMP(b.x, b.y, b.getDamage()).add());
Effects.effect(Fx.empshockwave, b);
Effects.effect(BulletFx.empshockwave, b);
Effects.shake(3f, 3f, b);
}
},
@@ -118,8 +120,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void hit(Bullet b, float hitx, float hity){
Effects.shake(3f, 3f, b);
Effects.effect(Fx.shellsmoke, b);
Effects.effect(Fx.shellexplosion, b);
Effects.effect(BulletFx.shellsmoke, b);
Effects.effect(BulletFx.shellexplosion, b);
DamageArea.damage(b.team, b.x, b.y, 25f, (int)(damage * 2f/3f));
}
@@ -146,7 +148,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
}
public void hit(Bullet b, float hitx, float hity) {
Effects.effect(shellsmoke, b);
Effects.effect(BulletFx.shellsmoke, b);
for(int i = 0; i < 3; i ++){
Bullet bullet = new Bullet(flakspark, b, hitx, hity, b.angle() + Mathf.range(120f));
bullet.add();
@@ -198,8 +200,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void hit(Bullet b, float hitx, float hity){
Effects.shake(3f, 3f, b);
Effects.effect(Fx.shellsmoke, b);
Effects.effect(Fx.shockwaveSmall, b);
Effects.effect(BulletFx.shellsmoke, b);
Effects.effect(BulletFx.shockwaveSmall, b);
DamageArea.damage(b.team, b.x, b.y, 50f, (int)(damage * 2f/3f));
}
@@ -229,8 +231,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void hit(Bullet b, float hitx, float hity){
Effects.shake(3f, 3f, b);
Effects.effect(Fx.shellsmoke, b);
Effects.effect(Fx.shockwaveSmall, b);
Effects.effect(BulletFx.shellsmoke, b);
Effects.effect(BulletFx.shockwaveSmall, b);
DamageArea.damage(b.team, b.x, b.y, 25f, (int)(damage * 2f/3f));
}
@@ -249,8 +251,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void hit(Bullet b, float hitx, float hity){
Effects.shake(3f, 3f, b);
Effects.effect(Fx.blastsmoke, b);
Effects.effect(Fx.blastexplosion, b);
Effects.effect(BlockFx.blastsmoke, b);
Effects.effect(BulletFx.blastexplosion, b);
//TODO remove translation() usage
Angles.circleVectors(30, 6f, (nx, ny) -> {
@@ -368,7 +370,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void hit(Bullet b, float hitx, float hity){
Effects.shake(1.5f, 1.5f, b);
Effects.effect(Fx.clusterbomb, b);
Effects.effect(BulletFx.clusterbomb, b);
DamageArea.damage(b.team, b.x, b.y, 35f, damage);
}
@@ -391,7 +393,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void update(Bullet b){
if(b.timer.get(0, 4)){
Effects.effect(Fx.chainsmoke, b.x, b.y);
Effects.effect(BulletFx.chainsmoke, b.x, b.y);
}
}
},
@@ -449,7 +451,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
}
public void init(Bullet b) {
DamageArea.damageLine(b.team, Fx.beamhit, b.x, b.y, b.angle(), length, damage);
DamageArea.damageLine(b.team, BulletFx.beamhit, b.x, b.y, b.angle(), length, damage);
}
public void draw(Bullet b) {

View File

@@ -6,7 +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;
import io.anuke.mindustry.graphics.fx.ExplosionFx;
import io.anuke.mindustry.graphics.fx.Fx;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.net.NetEvents;
import io.anuke.mindustry.resource.Mech;
@@ -109,7 +110,7 @@ public class Player extends Unit{
NetEvents.handleUnitDeath(this);
}
Effects.effect(Fx.explosion, this);
Effects.effect(ExplosionFx.explosion, this);
Effects.shake(4f, 5f, this);
Effects.sound("die", this);
@@ -120,7 +121,7 @@ public class Player extends Unit{
@Override
public void onRemoteDeath(){
dead = true;
Effects.effect(Fx.explosion, this);
Effects.effect(ExplosionFx.explosion, this);
Effects.shake(4f, 5f, this);
Effects.sound("die", this);
@@ -245,7 +246,7 @@ public class Player extends Unit{
}
if(dashing && timer.get(timerDash, 3) && movement.len() > 0){
Effects.effect(Fx.dashsmoke, x + Angles.trnsx(rotation + 180f, 3f), y + Angles.trnsy(rotation + 180f, 3f));
Effects.effect(Fx.dash, x + Angles.trnsx(rotation + 180f, 3f), y + Angles.trnsy(rotation + 180f, 3f));
}
movement.limit(speed);
@@ -357,11 +358,11 @@ public class Player extends Unit{
float ty = y + Angles.trnsy(rotation + 180f, 4f);
if(mech.flying && i.target.dst(i.last) > 2f && timer.get(timerDash, 1)){
Effects.effect(Fx.dashsmoke, tx, ty);
Effects.effect(Fx.dash, tx, ty);
}
if(dashing && !dead && timer.get(timerDash, 3) && i.target.dst(i.last) > 1f){
Effects.effect(Fx.dashsmoke, tx, ty);
Effects.effect(Fx.dash, tx, ty);
}
}

View File

@@ -1,6 +1,6 @@
package io.anuke.mindustry.entities;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.graphics.fx.Fx;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.net.NetEvents;
import io.anuke.mindustry.world.Block;

View File

@@ -3,7 +3,7 @@ package io.anuke.mindustry.entities.effect;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.graphics.fx.BulletFx;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.entities.TimedEntity;
@@ -61,7 +61,7 @@ public class EMP extends TimedEntity{
if(tile == null) continue;
//entity may be null here, after the block is dead!
Effects.effect(Fx.empspark, tile.worldx(), tile.worldy());
Effects.effect(BulletFx.empspark, tile.worldx(), tile.worldy());
if(tile.entity != null) tile.entity.damage(damage);
}
}

View File

@@ -8,7 +8,7 @@ import com.badlogic.gdx.utils.ObjectSet;
import io.anuke.mindustry.entities.Units;
import io.anuke.mindustry.entities.units.BaseUnit;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.graphics.fx.BulletFx;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.entities.Entity;
@@ -70,7 +70,7 @@ public class TeslaOrb extends Entity{
void damageEnemy(BaseUnit enemy){
enemy.damage(damage);
Effects.effect(Fx.laserhit, enemy.x + Mathf.range(2f), enemy.y + Mathf.range(2f));
Effects.effect(BulletFx.laserhit, enemy.x + Mathf.range(2f), enemy.y + Mathf.range(2f));
}
@Override

View File

@@ -5,7 +5,7 @@ import com.badlogic.gdx.utils.ObjectSet;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.mindustry.entities.Unit;
import io.anuke.mindustry.game.TeamInfo.TeamData;
import io.anuke.mindustry.graphics.Fx;
import io.anuke.mindustry.graphics.fx.Fx;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
@@ -34,7 +34,7 @@ public class FlyingUnitType extends UnitType {
unit.rotation = unit.velocity.angle();
if(unit.velocity.len() > 0.2f && unit.timer.get(timerBoost, 2f)){
Effects.effect(Fx.dashsmoke, unit.x + Angles.trnsx(unit.rotation + 180f, boosterLength),
Effects.effect(Fx.dash, unit.x + Angles.trnsx(unit.rotation + 180f, boosterLength),
unit.y + Angles.trnsy(unit.rotation + 180f, boosterLength));
}
}

View File

@@ -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;
import io.anuke.mindustry.graphics.fx.ExplosionFx;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.net.NetEvents;
import io.anuke.ucore.core.Effects;
@@ -111,7 +111,7 @@ public abstract class UnitType {
public void onDeath(BaseUnit unit){
//TODO other things, such as enemies?
Effects.effect(Fx.explosion, unit);
Effects.effect(ExplosionFx.explosion, unit);
if(Net.server()){
NetEvents.handleUnitDeath(unit);