From f8c7ff0159c1882302812a41bb60e54e31bc0fd0 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sat, 28 Aug 2021 05:46:08 -0700 Subject: [PATCH 1/4] `Damage.damage` doesn't properly convert cores (#5882) * `Damage.damage` doesn't properly convert cores * Well that was a complete failure --- core/src/mindustry/entities/Damage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index cc11cf29fa..bc5b55a4ef 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -466,7 +466,7 @@ public class Damage{ for(int dy = -trad; dy <= trad; dy++){ Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy); if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && Mathf.dst(dx, dy) <= trad){ - tile.build.damage(damage); + tile.build.damage(team, damage); } } } From 60b2842d821ba39d1b32a9408412955cffc681f2 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sat, 28 Aug 2021 05:47:11 -0700 Subject: [PATCH 2/4] Rotator `spinSpeed` (#5881) --- core/src/mindustry/world/draw/DrawRotator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/draw/DrawRotator.java b/core/src/mindustry/world/draw/DrawRotator.java index 3bbf1accc8..a6f2817748 100644 --- a/core/src/mindustry/world/draw/DrawRotator.java +++ b/core/src/mindustry/world/draw/DrawRotator.java @@ -9,14 +9,15 @@ import mindustry.world.blocks.production.GenericCrafter.*; public class DrawRotator extends DrawBlock{ public TextureRegion rotator, top; public boolean drawSpinSprite = false; + public float spinSpeed = 2f; @Override public void draw(GenericCrafterBuild build){ Draw.rect(build.block.region, build.x, build.y); if(drawSpinSprite){ - Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * 2f); + Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * spinSpeed); }else{ - Draw.rect(rotator, build.x, build.y, build.totalProgress * 2f); + Draw.rect(rotator, build.x, build.y, build.totalProgress * spinSpeed); } if(top.found()) Draw.rect(top, build.x, build.y); } From 800f0f4511cd0b3348cbd45ff84a96d1ef101153 Mon Sep 17 00:00:00 2001 From: "SMOLKEYS.exe" <75618732+SMOLKEYS@users.noreply.github.com> Date: Sat, 28 Aug 2021 21:13:57 +0800 Subject: [PATCH 3/4] inconspicuous OCD goes to brazil (#5884) --- core/src/mindustry/world/blocks/payloads/UnitPayload.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/payloads/UnitPayload.java b/core/src/mindustry/world/blocks/payloads/UnitPayload.java index a33bb35dcf..99558971da 100644 --- a/core/src/mindustry/world/blocks/payloads/UnitPayload.java +++ b/core/src/mindustry/world/blocks/payloads/UnitPayload.java @@ -94,7 +94,7 @@ public class UnitPayload implements Payload{ if(solid.solid(tx, ty)) return false; } - //cannnot dump when there's a lot of overlap going on + //cannot dump when there's a lot of overlap going on if(!unit.type.flying && Units.count(unit.x, unit.y, unit.physicSize(), o -> o.isGrounded() && (o.type.allowLegStep == unit.type.allowLegStep)) > 0){ return false; } From d254d971a9a11710663c55c690f68c74b7223d51 Mon Sep 17 00:00:00 2001 From: Darkness6030 <79508138+Darkness6030@users.noreply.github.com> Date: Sat, 28 Aug 2021 17:53:19 +0300 Subject: [PATCH 4/4] Add unitSpawnEvent (#5876) --- core/assets/contributors | 1 + core/src/mindustry/ai/WaveSpawner.java | 1 + core/src/mindustry/game/EventType.java | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/core/assets/contributors b/core/assets/contributors index 5099ab7e37..55e0341789 100644 --- a/core/assets/contributors +++ b/core/assets/contributors @@ -127,3 +127,4 @@ WilloIzCitron SAMBUYYA genNAowl TranquillyUnpleasant +Darkness6030 diff --git a/core/src/mindustry/ai/WaveSpawner.java b/core/src/mindustry/ai/WaveSpawner.java index 40be2defad..276b86bb26 100644 --- a/core/src/mindustry/ai/WaveSpawner.java +++ b/core/src/mindustry/ai/WaveSpawner.java @@ -196,6 +196,7 @@ public class WaveSpawner{ unit.apply(StatusEffects.invincible, 60f); unit.add(); + Events.fire(new UnitSpawnEvent(unit)); Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type); } diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index c72ffc403c..66bc472c6f 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -428,6 +428,15 @@ public class EventType{ } } + /** Called when a unit is spawned by wave. */ + public static class UnitSpawnEvent{ + public final Unit unit; + + public UnitSpawnEvent(Unit unit) { + this.unit = unit; + } + } + /** Called when a unit is dumped from any payload block. */ public static class UnitUnloadEvent{ public final Unit unit;