From d2bc2b07a9bd90a690c4008855976884bb89efb3 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Sun, 2 Aug 2020 13:31:16 -0700 Subject: [PATCH 1/8] the statud effect burning affects tiles --- core/src/mindustry/ai/BlockIndexer.java | 2 +- core/src/mindustry/entities/Damage.java | 5 +++++ core/src/mindustry/entities/bullet/BulletType.java | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 5931068c48..4d600be86e 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -185,7 +185,7 @@ public class BlockIndexer{ if(other == null) continue; - if(other.team() == team && pred.get(other) && intSet.add(other.pos())){ + if((other.team() == team || team == null) && pred.get(other) && intSet.add(other.pos())){ cons.get(other); any = true; } diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index a8d743a320..1e2c8c5cf6 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -267,6 +267,11 @@ public class Damage{ }else{ Units.nearby(rect, cons); } + if(effect == StatusEffects.burning) { + indexer.eachBlock(null, x, y, radius, other -> other.team != team, other -> { + Damage.createIncend(x, y, 1f, (int) duration/50); + }); + } } /** Damages all entities and blocks in a radius that are enemies of the team. */ diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 2d23d9eb4b..172b047c5a 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -131,6 +131,9 @@ public abstract class BulletType extends Content{ } public void hitTile(Bullet b, Building tile){ + if(status == StatusEffects.burning) { + Damage.createIncend(b.x, b.y, damage/10f, (int) damage/10); + } hit(b); } From 88639fffc5f5b1cadaf5367f25c2086e9c1138d3 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Fri, 2 Oct 2020 18:17:51 -0700 Subject: [PATCH 2/8] fix --- core/src/mindustry/ai/BlockIndexer.java | 2 +- core/src/mindustry/entities/Damage.java | 5 ----- core/src/mindustry/entities/bullet/BulletType.java | 6 ++++++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 0f52311b88..43eaf03323 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -192,7 +192,7 @@ public class BlockIndexer{ if(other == null) continue; - if(other.team == team && pred.get(other) && intSet.add(other.pos())){ + if((team == null || other.team == team) && pred.get(other) && intSet.add(other.pos())){ cons.get(other); any = true; } diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 9ca41fb85a..e22891eba5 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -288,11 +288,6 @@ public class Damage{ }else{ Units.nearby(rect, cons); } - if(effect == StatusEffects.burning) { - indexer.eachBlock(null, x, y, radius, other -> other.team != team, other -> { - Damage.createIncend(x, y, 1f, (int) duration/50); - }); - } } /** Damages all entities and blocks in a radius that are enemies of the team. */ diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 6e2b9ad9e8..76a1569303 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -189,6 +189,12 @@ public abstract class BulletType extends Content{ if(status != StatusEffects.none){ Damage.status(b.team, x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround); } + + if(effect == StatusEffects.burning) { + indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != team, other -> { + Damage.createIncend(x, y, damage/10f, (int) damage/10); + }); + } } for(int i = 0; i < lightning; i++){ From 39e956c934261d8d2ec6a0aa015807c9fe9c3fb4 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Fri, 2 Oct 2020 18:26:17 -0700 Subject: [PATCH 3/8] Update BulletType.java --- core/src/mindustry/entities/bullet/BulletType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 76a1569303..e750e35f9e 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -145,7 +145,7 @@ public abstract class BulletType extends Content{ public void hitTile(Bullet b, Building tile, float initialHealth){ if(status == StatusEffects.burning) { - Damage.createIncend(b.x, b.y, damage/10f, (int) damage/10); + Damage.createIncend(b.x, b.y, damage / 10f, (int)damage / 10); } hit(b); } @@ -192,7 +192,7 @@ public abstract class BulletType extends Content{ if(effect == StatusEffects.burning) { indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != team, other -> { - Damage.createIncend(x, y, damage/10f, (int) damage/10); + Damage.createIncend(x, y, damage / 10f, (int)damage / 10); }); } } From 5aa0ce97b82aeac34cd01dd41331e8ebb9e278b4 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Fri, 2 Oct 2020 18:27:33 -0700 Subject: [PATCH 4/8] fix --- core/src/mindustry/entities/bullet/BulletType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index e750e35f9e..38a5aab0f9 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -190,7 +190,7 @@ public abstract class BulletType extends Content{ Damage.status(b.team, x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround); } - if(effect == StatusEffects.burning) { + if(status == StatusEffects.burning) { indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != team, other -> { Damage.createIncend(x, y, damage / 10f, (int)damage / 10); }); From ca70b9c705fc9fd32fa0d3e7ef5ec30b5fe8947d Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Fri, 2 Oct 2020 18:28:36 -0700 Subject: [PATCH 5/8] fix (again) --- core/src/mindustry/entities/bullet/BulletType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 38a5aab0f9..814fb489ef 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -191,7 +191,7 @@ public abstract class BulletType extends Content{ } if(status == StatusEffects.burning) { - indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != team, other -> { + indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != b.team, other -> { Damage.createIncend(x, y, damage / 10f, (int)damage / 10); }); } From 74c0d0d0fdbc2947171004047e39050b296658fa Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Fri, 2 Oct 2020 19:33:11 -0700 Subject: [PATCH 6/8] Update BulletType.java --- core/src/mindustry/entities/bullet/BulletType.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 814fb489ef..a4d287862e 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -145,7 +145,10 @@ public abstract class BulletType extends Content{ public void hitTile(Bullet b, Building tile, float initialHealth){ if(status == StatusEffects.burning) { - Damage.createIncend(b.x, b.y, damage / 10f, (int)damage / 10); + Tile buildTile = world.tileWorld(tile.x, tile.y); + if(buildTile != null){ + Fires.create(buildTile); + } } hit(b); } @@ -192,7 +195,10 @@ public abstract class BulletType extends Content{ if(status == StatusEffects.burning) { indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != b.team, other -> { - Damage.createIncend(x, y, damage / 10f, (int)damage / 10); + Tile tile = world.tileWorld(other.x, other.y); + if(tile != null){ + Fires.create(tile); + } }); } } From e53a1d04725c56ab5d3cbe9402431c8d87562bcb Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Fri, 2 Oct 2020 19:47:47 -0700 Subject: [PATCH 7/8] Update BulletType.java --- core/src/mindustry/entities/bullet/BulletType.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index a4d287862e..a828f57232 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -195,10 +195,7 @@ public abstract class BulletType extends Content{ if(status == StatusEffects.burning) { indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != b.team, other -> { - Tile tile = world.tileWorld(other.x, other.y); - if(tile != null){ - Fires.create(tile); - } + Fires.create(other.tile); }); } } From 60d50481406e3a2d1f203b8dc7a6737dfb0ca32f Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Fri, 2 Oct 2020 21:25:05 -0700 Subject: [PATCH 8/8] Update BulletType.java --- core/src/mindustry/entities/bullet/BulletType.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index a828f57232..870a790341 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -145,10 +145,7 @@ public abstract class BulletType extends Content{ public void hitTile(Bullet b, Building tile, float initialHealth){ if(status == StatusEffects.burning) { - Tile buildTile = world.tileWorld(tile.x, tile.y); - if(buildTile != null){ - Fires.create(buildTile); - } + Fires.create(tile.tile); } hit(b); }