Merge pull request #3532 from Quezler/patch-66
unitBuildSpeedMultiplier | UnitSpawnAbility.java
This commit is contained in:
@@ -12,6 +12,8 @@ import mindustry.graphics.*;
|
|||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
|
||||||
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class UnitSpawnAbility extends Ability{
|
public class UnitSpawnAbility extends Ability{
|
||||||
public UnitType type;
|
public UnitType type;
|
||||||
public float spawnTime = 60f, spawnX, spawnY;
|
public float spawnTime = 60f, spawnX, spawnY;
|
||||||
@@ -31,7 +33,7 @@ public class UnitSpawnAbility extends Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
timer += Time.delta;
|
timer += Time.delta * state.rules.unitBuildSpeedMultiplier;
|
||||||
|
|
||||||
if(timer >= spawnTime && Units.canCreate(unit.team, type)){
|
if(timer >= spawnTime && Units.canCreate(unit.team, type)){
|
||||||
float x = unit.x + Angles.trnsx(unit.rotation, spawnY, spawnX), y = unit.y + Angles.trnsy(unit.rotation, spawnY, spawnX);
|
float x = unit.x + Angles.trnsx(unit.rotation, spawnY, spawnX), y = unit.y + Angles.trnsy(unit.rotation, spawnY, spawnX);
|
||||||
|
|||||||
Reference in New Issue
Block a user