From 8a6b5668faaa89deb2397c6c256dbcaba801fec8 Mon Sep 17 00:00:00 2001 From: Sunny Kim <58885089+sk7725@users.noreply.github.com> Date: Mon, 7 Sep 2020 00:55:24 +0900 Subject: [PATCH 1/2] Distribution/PowerNode/TractorBeamTurret fields for modding (#2498) * Effect stuff for quezler conveyors * shootSound for mass driver * *color intensifies* * Update TractorBeamTurret.java * Update MassDriver.java Co-authored-by: Anuken --- .../mindustry/world/blocks/defense/TractorBeamTurret.java | 3 ++- .../mindustry/world/blocks/distribution/MassDriver.java | 4 ++++ .../mindustry/world/blocks/distribution/StackConveyor.java | 7 +++++-- core/src/mindustry/world/blocks/power/PowerNode.java | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/world/blocks/defense/TractorBeamTurret.java b/core/src/mindustry/world/blocks/defense/TractorBeamTurret.java index 971de2d887..a68073291e 100644 --- a/core/src/mindustry/world/blocks/defense/TractorBeamTurret.java +++ b/core/src/mindustry/world/blocks/defense/TractorBeamTurret.java @@ -31,6 +31,7 @@ public class TractorBeamTurret extends Block{ public float scaledForce = 0f; public float damage = 0f; public boolean targetAir = true, targetGround = false; + public Color laserColor = Color.white; public TractorBeamTurret(String name){ super(name); @@ -113,7 +114,7 @@ public class TractorBeamTurret extends Block{ float ang = angleTo(lastX, lastY); float len = 5f; - Draw.mixcol(Color.white, Mathf.absin(4f, 0.6f)); + Draw.mixcol(laserColor, Mathf.absin(4f, 0.6f)); Drawf.laser(team, laser, laserEnd, x + Angles.trnsx(ang, len), y + Angles.trnsy(ang, len), diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java index 4afadbdba8..711d85aeae 100644 --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java @@ -1,5 +1,6 @@ package mindustry.world.blocks.distribution; +import arc.audio.*; import arc.graphics.g2d.*; import arc.math.*; import arc.math.geom.*; @@ -30,6 +31,7 @@ public class MassDriver extends Block{ public Effect shootEffect = Fx.shootBig2; public Effect smokeEffect = Fx.shootBigSmoke2; public Effect receiveEffect = Fx.mineBig; + public Sound shootSound = Sounds.shootBig; public float shake = 3f; public @Load("@-base") TextureRegion baseRegion; @@ -265,6 +267,8 @@ public class MassDriver extends Block{ y + Angles.trnsy(angle, translation), angle); Effect.shake(shake, shake, this); + + shootSound.at(tile, Mathf.random(0.9f, 1.1f)); } public void handlePayload(Bullet bullet, DriverBulletData data){ diff --git a/core/src/mindustry/world/blocks/distribution/StackConveyor.java b/core/src/mindustry/world/blocks/distribution/StackConveyor.java index 712d62d4c5..8f1caf2a21 100644 --- a/core/src/mindustry/world/blocks/distribution/StackConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/StackConveyor.java @@ -6,6 +6,7 @@ import arc.util.*; import arc.util.io.*; import mindustry.annotations.Annotations.*; import mindustry.content.*; +import mindustry.entities.*; import mindustry.entities.units.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -27,6 +28,8 @@ public class StackConveyor extends Block implements Autotiler{ public float speed = 0f; public boolean splitOut = true; public float recharge = 2f; + public Effect loadEffect = Fx.plasticburn; + public Effect unloadEffect = Fx.plasticburn; public StackConveyor(String name){ super(name); @@ -221,11 +224,11 @@ public class StackConveyor extends Block implements Autotiler{ protected void poofIn(){ link = tile.pos(); - Fx.plasticburn.at(this); + loadEffect.at(this); } protected void poofOut(){ - Fx.plasticburn.at(this); + unloadEffect.at(this); link = -1; } diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index 0871ef6e87..eabef55b56 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -33,6 +33,8 @@ public class PowerNode extends PowerBlock{ public @Load("laser-end") TextureRegion laserEnd; public float laserRange = 6; public int maxNodes = 3; + public Color laserColor1 = Color.white; + public Color laserColor2 = Pal.powerLight; public PowerNode(String name){ super(name); @@ -158,7 +160,7 @@ public class PowerNode extends PowerBlock{ float fract = 1f - satisfaction; - Draw.color(Color.white, Pal.powerLight, fract * 0.86f + Mathf.absin(3f, 0.1f)); + Draw.color(laserColor1, laserColor2, fract * 0.86f + Mathf.absin(3f, 0.1f)); Draw.alpha(opacity); Drawf.laser(team, laser, laserEnd, x1, y1, x2, y2, 0.25f); Draw.color(); From f5fa73786714276f348413af3ae239138ddbe629 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 6 Sep 2020 12:09:52 -0400 Subject: [PATCH 2/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe38a3a925..58eed0c4fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,3 +68,6 @@ If something needs to be encapsulated in the future, IntelliJ can handle it with #### Do not create methods unless necessary. Unless a block of code is very large or used in more than 1-2 places, don't split it up into a separate method. Making unnecessary methods only creates confusion, and may slightly decrease performance. + +## Other Notes +If you would like your name to appear in the game's credits, add it to the [list of contributors](https://github.com/Anuken/Mindustry/blob/master/core/assets/contributors) as part of your PR.