Custom Unit Death Explosion Effects (#5389)
This commit is contained in:
@@ -31,11 +31,16 @@ public class Damage{
|
|||||||
|
|
||||||
/** Creates a dynamic explosion based on specified parameters. */
|
/** Creates a dynamic explosion based on specified parameters. */
|
||||||
public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage){
|
public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage){
|
||||||
dynamicExplosion(x, y, flammability, explosiveness, power, radius, damage, true, null);
|
dynamicExplosion(x, y, flammability, explosiveness, power, radius, damage, true, null, Fx.dynamicExplosion);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates a dynamic explosion based on specified parameters. */
|
/** Creates a dynamic explosion based on specified parameters. */
|
||||||
public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, @Nullable Team ignoreTeam){
|
public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, @Nullable Team ignoreTeam){
|
||||||
|
dynamicExplosion(x, y, flammability, explosiveness, power, radius, damage, fire, ignoreTeam, Fx.dynamicExplosion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates a dynamic explosion based on specified parameters. */
|
||||||
|
public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, @Nullable Team ignoreTeam, Effect explosion){
|
||||||
if(damage){
|
if(damage){
|
||||||
for(int i = 0; i < Mathf.clamp(power / 700, 0, 8); i++){
|
for(int i = 0; i < Mathf.clamp(power / 700, 0, 8); i++){
|
||||||
int length = 5 + Mathf.clamp((int)(power / 500), 1, 20);
|
int length = 5 + Mathf.clamp((int)(power / 500), 1, 20);
|
||||||
@@ -69,7 +74,7 @@ public class Damage{
|
|||||||
|
|
||||||
float shake = Math.min(explosiveness / 4f + 3f, 9f);
|
float shake = Math.min(explosiveness / 4f + 3f, 9f);
|
||||||
Effect.shake(shake, shake, x, y);
|
Effect.shake(shake, shake, x, y);
|
||||||
Fx.dynamicExplosion.at(x, y, radius / 8f);
|
explosion.at(x, y, radius / 8f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createIncend(float x, float y, float range, int amount){
|
public static void createIncend(float x, float y, float range, int amount){
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
float power = item().charge * stack().amount * 150f;
|
float power = item().charge * stack().amount * 150f;
|
||||||
|
|
||||||
if(!spawnedByCore){
|
if(!spawnedByCore){
|
||||||
Damage.dynamicExplosion(x, y, flammability, explosiveness, power, bounds() / 2f, state.rules.damageExplosions, item().flammability > 1, team);
|
Damage.dynamicExplosion(x, y, flammability, explosiveness, power, bounds() / 2f, state.rules.damageExplosions, item().flammability > 1, team, type.deathExplosionEffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
float shake = hitSize / 3f;
|
float shake = hitSize / 3f;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
public boolean omniMovement = true;
|
public boolean omniMovement = true;
|
||||||
public Effect fallEffect = Fx.fallSmoke;
|
public Effect fallEffect = Fx.fallSmoke;
|
||||||
public Effect fallThrusterEffect = Fx.fallSmoke;
|
public Effect fallThrusterEffect = Fx.fallSmoke;
|
||||||
|
public Effect deathExplosionEffect = Fx.dynamicExplosion;
|
||||||
public Seq<Ability> abilities = new Seq<>();
|
public Seq<Ability> abilities = new Seq<>();
|
||||||
public BlockFlag targetFlag = BlockFlag.generator;
|
public BlockFlag targetFlag = BlockFlag.generator;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user