mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-01 20:04:02 +07:00
oopeth
This commit is contained in:
parent
43d1f363e5
commit
2dd234d960
@ -5,15 +5,17 @@ import arc.math.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class MovementLightningAbility extends Ability{
|
||||
public float damage = 35f, length = 10f, reload = 0.15;
|
||||
public float damage = 35f, reload = 0.15f;
|
||||
public int length = 12f;
|
||||
public float minSpeed = 0.8f, maxSpeed = 1.2f;
|
||||
public Effect shootEffect = Fx.lightningShoot;
|
||||
|
||||
MovementLightningAbility(){}
|
||||
|
||||
public MovementLightningAbility(float damage, float length, float reload, float minSpeed, float maxSpeed){
|
||||
public MovementLightningAbility(float damage, int length, float reload, float minSpeed, float maxSpeed){
|
||||
this.damage = damage;
|
||||
this.length = length;
|
||||
this.reload = reload;
|
||||
@ -23,10 +25,10 @@ public class MovementLightningAbility extends Ability{
|
||||
|
||||
@Override
|
||||
public void update(Unit unit){
|
||||
scl = Mathf.clamp((unit.velocity().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.velocity().x, unit.y + unit.velocity().y, unit.rotation, length);
|
||||
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 * Vars.state.rules.playerDamageMultiplie, unit.x + unit.vel().x, unit.y + unit.vel().y, unit.rotation, length);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user