mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
Dynamic lightning damage tweaks
This commit is contained in:
parent
a13d51e09a
commit
c658865907
@ -39,9 +39,9 @@ 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, 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){
|
||||||
if(damage){
|
if(damage){
|
||||||
for(int i = 0; i < Mathf.clamp(power / 20, 0, 6); i++){
|
for(int i = 0; i < Mathf.clamp(power / 700, 0, 8); i++){
|
||||||
int branches = 5 + Mathf.clamp((int)(power / 30), 1, 20);
|
int length = 5 + Mathf.clamp((int)(power / 500), 1, 20);
|
||||||
Time.run(i * 2f + Mathf.random(4f), () -> Lightning.create(Team.derelict, Pal.power, 3, x, y, Mathf.random(360f), branches + Mathf.range(2)));
|
Time.run(i * 0.8f + Mathf.random(4f), () -> Lightning.create(Team.derelict, Pal.power, 3, x, y, Mathf.random(360f), length + Mathf.range(2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fire){
|
if(fire){
|
||||||
|
@ -411,7 +411,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
float explosiveness = 2f + item().explosiveness * stack().amount * 1.53f;
|
float explosiveness = 2f + item().explosiveness * stack().amount * 1.53f;
|
||||||
float flammability = item().flammability * stack().amount / 1.9f;
|
float flammability = item().flammability * stack().amount / 1.9f;
|
||||||
float power = item().charge * stack().amount * 160f;
|
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);
|
||||||
|
@ -35,6 +35,11 @@ public class LogicDialog extends BaseDialog{
|
|||||||
p.table(Tex.button, t -> {
|
p.table(Tex.button, t -> {
|
||||||
TextButtonStyle style = Styles.cleart;
|
TextButtonStyle style = Styles.cleart;
|
||||||
t.defaults().size(280f, 60f).left();
|
t.defaults().size(280f, 60f).left();
|
||||||
|
|
||||||
|
t.button("@schematic.copy", Icon.copy, style, () -> {
|
||||||
|
dialog.hide();
|
||||||
|
Core.app.setClipboardText(canvas.save());
|
||||||
|
}).marginLeft(12f);
|
||||||
t.row();
|
t.row();
|
||||||
t.button("@schematic.copy.import", Icon.download, style, () -> {
|
t.button("@schematic.copy.import", Icon.download, style, () -> {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
@ -44,11 +49,6 @@ public class LogicDialog extends BaseDialog{
|
|||||||
ui.showException(e);
|
ui.showException(e);
|
||||||
}
|
}
|
||||||
}).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null);
|
}).marginLeft(12f).disabled(b -> Core.app.getClipboardText() == null);
|
||||||
t.row();
|
|
||||||
t.button("@schematic.copy", Icon.copy, style, () -> {
|
|
||||||
dialog.hide();
|
|
||||||
Core.app.setClipboardText(canvas.save());
|
|
||||||
}).marginLeft(12f);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user