mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-28 07:22:21 -08:00
FlakDelay (#7281)
This commit is contained in:
parent
3138f05cc2
commit
ff28daa3a4
1 changed files with 3 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ import mindustry.entities.*;
|
|||
import mindustry.gen.*;
|
||||
|
||||
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){
|
||||
super(speed, damage, "shell");
|
||||
|
|
@ -27,9 +27,9 @@ public class FlakBulletType extends BasicBulletType{
|
|||
super.update(b);
|
||||
|
||||
//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 -> {
|
||||
//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(unit.within(b, explodeRange + unit.hitSize/2f)){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue