mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
AirBlast and AirBurst Changes (#1017)
## Removals * Removes `AirBurst#getAffectedEntities()`, shouldn't allow direct access to the list ## Misc. Changes * Lowers "friction" in AirBlast knockback for entities on the ground * Ignore "friction" in AirBlast when the AirBurst source isn't null * Changes entity velocity comparison to only add vectors angled > pi/3 from push vector * Increase default AirBurst push option
This commit is contained in:
parent
0f2940f5eb
commit
2091e58c35
3 changed files with 49 additions and 55 deletions
|
@ -218,7 +218,6 @@ public class AirBlast extends AirAbility {
|
|||
}
|
||||
}
|
||||
|
||||
if (!affectedEntities.contains(entity)) {
|
||||
final boolean isUser = entity.getUniqueId() == this.player.getUniqueId();
|
||||
double knockback = this.pushFactorForOthers;
|
||||
|
||||
|
@ -245,13 +244,13 @@ public class AirBlast extends AirAbility {
|
|||
knockback *= 1 - this.location.distance(this.origin) / (2 * this.range);
|
||||
}
|
||||
|
||||
if (GeneralMethods.isSolid(entity.getLocation().add(0, -.5, 0).getBlock())) {
|
||||
knockback *= .5;
|
||||
if (GeneralMethods.isSolid(entity.getLocation().add(0, -0.5, 0).getBlock()) && source == null) {
|
||||
knockback *= 0.85;
|
||||
}
|
||||
|
||||
push.normalize().multiply(knockback);
|
||||
|
||||
if (Math.abs(entity.getVelocity().dot(push)) > knockback) {
|
||||
if (Math.abs(entity.getVelocity().dot(push)) > knockback && entity.getVelocity().angle(push) > Math.PI / 3) {
|
||||
push.normalize().add(entity.getVelocity()).multiply(knockback);
|
||||
}
|
||||
|
||||
|
@ -263,13 +262,12 @@ public class AirBlast extends AirAbility {
|
|||
new HorizontalVelocityTracker(entity, this.player, 200l, this);
|
||||
}
|
||||
|
||||
if (this.damage > 0 && entity instanceof LivingEntity && !entity.equals(this.player)) {
|
||||
if (this.damage > 0 && entity instanceof LivingEntity && !entity.equals(this.player) && !this.affectedEntities.contains(entity)) {
|
||||
if (this.source != null) {
|
||||
DamageHandler.damageEntity(entity, this.damage, this.source);
|
||||
} else {
|
||||
DamageHandler.damageEntity(entity, this.damage, this);
|
||||
}
|
||||
}
|
||||
|
||||
this.affectedEntities.add(entity);
|
||||
}
|
||||
|
|
|
@ -321,8 +321,4 @@ public class AirBurst extends AirAbility {
|
|||
public ArrayList<AirBlast> getBlasts() {
|
||||
return this.blasts;
|
||||
}
|
||||
|
||||
public ArrayList<Entity> getAffectedEntities() {
|
||||
return this.affectedEntities;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -811,7 +811,7 @@ public class ConfigManager {
|
|||
|
||||
config.addDefault("Abilities.Air.AirBurst.Enabled", true);
|
||||
config.addDefault("Abilities.Air.AirBurst.FallThreshold", 10);
|
||||
config.addDefault("Abilities.Air.AirBurst.PushFactor", 1.5);
|
||||
config.addDefault("Abilities.Air.AirBurst.PushFactor", 2.8);
|
||||
config.addDefault("Abilities.Air.AirBurst.ChargeTime", 1750);
|
||||
config.addDefault("Abilities.Air.AirBurst.Damage", 0);
|
||||
config.addDefault("Abilities.Air.AirBurst.Cooldown", 0);
|
||||
|
|
Loading…
Reference in a new issue