Merge pull request #2806 from genNAowl/burning-affects-tiles

Incendiary Bullets Make Fires When Hitting Tiles
This commit is contained in:
Anuken 2020-10-05 16:35:13 -04:00 committed by GitHub
commit 93e21c6bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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;
}

View File

@ -143,6 +143,9 @@ public abstract class BulletType extends Content{
}
public void hitTile(Bullet b, Building tile, float initialHealth){
if(status == StatusEffects.burning) {
Fires.create(tile.tile);
}
hit(b);
}
@ -185,6 +188,12 @@ public abstract class BulletType extends Content{
if(status != StatusEffects.none){
Damage.status(b.team, x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround);
}
if(status == StatusEffects.burning) {
indexer.eachBlock(null, x, y, splashDamageRadius, other -> other.team != b.team, other -> {
Fires.create(other.tile);
});
}
}
for(int i = 0; i < lightning; i++){