Define color instead of based on team
This commit is contained in:
@@ -13,23 +13,25 @@ public class MovementLightningAbility extends Ability{
|
|||||||
public float minSpeed = 0.8f, maxSpeed = 1.2f;
|
public float minSpeed = 0.8f, maxSpeed = 1.2f;
|
||||||
public Effect shootEffect = Fx.sparkShoot;
|
public Effect shootEffect = Fx.sparkShoot;
|
||||||
public Sound shootSound = Sounds.spark;
|
public Sound shootSound = Sounds.spark;
|
||||||
|
public Color color = Pal.lancerLaser;
|
||||||
|
|
||||||
MovementLightningAbility(){}
|
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.damage = damage;
|
||||||
this.length = length;
|
this.length = length;
|
||||||
this.reload = reload;
|
this.reload = reload;
|
||||||
this.minSpeed = minSpeed;
|
this.minSpeed = minSpeed;
|
||||||
this.maxSpeed = maxSpeed;
|
this.maxSpeed = maxSpeed;
|
||||||
|
this.color = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
||||||
if(Mathf.chance(Time.delta * (reload * scl))){
|
if(Mathf.chance(Time.delta * (reload * scl))){
|
||||||
shootEffect.at(unit.x, unit.y, unit.rotation, unit.team.color);
|
shootEffect.at(unit.x, unit.y, unit.rotation, color);
|
||||||
Lightning.create(unit.team, unit.team.color, damage, unit.x + unit.vel().x, unit.y + unit.vel().y, unit.rotation, length);
|
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);
|
shootSound.at(unit.x, unit.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user