Bugfixes, balancing

This commit is contained in:
Anuken
2020-08-20 23:36:27 -04:00
parent 48d1c2038e
commit 28d2243abc
6 changed files with 25 additions and 19 deletions

View File

@@ -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;

View File

@@ -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
){