FlakDelay (#7281)
This commit is contained in:
@@ -6,7 +6,7 @@ import mindustry.entities.*;
|
|||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class FlakBulletType extends BasicBulletType{
|
public class FlakBulletType extends BasicBulletType{
|
||||||
public float explodeRange = 30f, explodeDelay = 5f, flakInterval = 6f;
|
public float explodeRange = 30f, explodeDelay = 5f, flakDelay = 0f, flakInterval = 6f;
|
||||||
|
|
||||||
public FlakBulletType(float speed, float damage){
|
public FlakBulletType(float speed, float damage){
|
||||||
super(speed, damage, "shell");
|
super(speed, damage, "shell");
|
||||||
@@ -27,9 +27,9 @@ public class FlakBulletType extends BasicBulletType{
|
|||||||
super.update(b);
|
super.update(b);
|
||||||
|
|
||||||
//don't check for targets if primed to explode
|
//don't check for targets if primed to explode
|
||||||
if(b.fdata >= 0 && b.timer(2, flakInterval)){
|
if(b.time >= flakDelay && b.fdata >= 0 && b.timer(2, flakInterval)){
|
||||||
Units.nearbyEnemies(b.team, Tmp.r1.setSize(explodeRange * 2f).setCenter(b.x, b.y), unit -> {
|
Units.nearbyEnemies(b.team, Tmp.r1.setSize(explodeRange * 2f).setCenter(b.x, b.y), unit -> {
|
||||||
//fadata < 0 means it's primed to explode
|
//fdata < 0 means it's primed to explode
|
||||||
if(b.fdata < 0f || !unit.checkTarget(collidesAir, collidesGround)) return;
|
if(b.fdata < 0f || !unit.checkTarget(collidesAir, collidesGround)) return;
|
||||||
|
|
||||||
if(unit.within(b, explodeRange + unit.hitSize/2f)){
|
if(unit.within(b, explodeRange + unit.hitSize/2f)){
|
||||||
|
|||||||
Reference in New Issue
Block a user