Bugfixes, balancing
This commit is contained in:
@@ -23,6 +23,7 @@ public class ForceFieldAbility implements Ability{
|
||||
|
||||
private float realRad;
|
||||
private Unit paramUnit;
|
||||
private boolean hadShield;
|
||||
private final Cons<Shielderc> shieldConsumer = trait -> {
|
||||
if(trait.team() != paramUnit.team && Intersector.isInsideHexagon(paramUnit.x, paramUnit.y, realRad * 2f, trait.x(), trait.y()) && paramUnit.shield > 0){
|
||||
trait.absorb();
|
||||
@@ -31,7 +32,6 @@ public class ForceFieldAbility implements Ability{
|
||||
//break shield
|
||||
if(paramUnit.shield <= trait.damage()){
|
||||
paramUnit.shield -= cooldown * regen;
|
||||
Fx.shieldBreak.at(paramUnit.x, paramUnit.y, radius, paramUnit.team.color);
|
||||
}
|
||||
|
||||
paramUnit.shield -= trait.damage();
|
||||
@@ -54,6 +54,13 @@ public class ForceFieldAbility implements Ability{
|
||||
unit.shield += Time.delta * regen;
|
||||
}
|
||||
|
||||
//break effect
|
||||
if(hadShield && unit.shield <= 0){
|
||||
Fx.shieldBreak.at(paramUnit.x, paramUnit.y, radius, paramUnit.team.color);
|
||||
}
|
||||
|
||||
hadShield = unit.shield > 0;
|
||||
|
||||
if(unit.shield > 0){
|
||||
unit.timer2 = Mathf.lerpDelta(unit.timer2, 1f, 0.06f);
|
||||
paramUnit = unit;
|
||||
|
||||
@@ -113,7 +113,8 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
|
||||
can && //must be able to shoot
|
||||
(ammo > 0 || !state.rules.unitAmmo || team().rules().infiniteAmmo) && //check ammo
|
||||
(!weapon.alternate || mount.side == weapon.flipSprite) &&
|
||||
vel.len() >= mount.weapon.minShootVelocity && //check velocity requirements
|
||||
//TODO checking for velocity this way isn't entirely correct
|
||||
(vel.len() >= mount.weapon.minShootVelocity || (net.active() && !isLocal())) && //check velocity requirements
|
||||
mount.reload <= 0.0001f && //reload has to be 0
|
||||
Angles.within(weapon.rotate ? mount.rotation : this.rotation, mount.targetRotation, mount.weapon.shootCone) //has to be within the cone
|
||||
){
|
||||
|
||||
Reference in New Issue
Block a user