mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-09 20:29:06 +07:00
Define color instead of based on team
This commit is contained in:
parent
0bd07866d8
commit
50410be90a
@ -13,23 +13,25 @@ public class MovementLightningAbility extends Ability{
|
||||
public float minSpeed = 0.8f, maxSpeed = 1.2f;
|
||||
public Effect shootEffect = Fx.sparkShoot;
|
||||
public Sound shootSound = Sounds.spark;
|
||||
public Color color = Pal.lancerLaser;
|
||||
|
||||
MovementLightningAbility(){}
|
||||
|
||||
public MovementLightningAbility(float damage, int length, float reload, float minSpeed, float maxSpeed){
|
||||
public MovementLightningAbility(float damage, int length, float reload, float minSpeed, float maxSpeed, Color color){
|
||||
this.damage = damage;
|
||||
this.length = length;
|
||||
this.reload = reload;
|
||||
this.minSpeed = minSpeed;
|
||||
this.maxSpeed = maxSpeed;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Unit unit){
|
||||
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
||||
if(Mathf.chance(Time.delta * (reload * scl))){
|
||||
shootEffect.at(unit.x, unit.y, unit.rotation, unit.team.color);
|
||||
Lightning.create(unit.team, unit.team.color, damage, unit.x + unit.vel().x, unit.y + unit.vel().y, unit.rotation, length);
|
||||
shootEffect.at(unit.x, unit.y, unit.rotation, color);
|
||||
Lightning.create(unit.team, color, damage, unit.x + unit.vel().x, unit.y + unit.vel().y, unit.rotation, length);
|
||||
shootSound.at(unit.x, unit.y);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user