This commit is contained in:
SomeonesShade 2026-05-11 17:42:52 +02:00 committed by GitHub
commit ceffa45383
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -498,6 +498,11 @@ public class Damage{
/** Damages all entities and blocks in a radius that are enemies of the team. */
public static void damage(Team team, float x, float y, float radius, float damage, boolean complete, boolean air, boolean ground, boolean scaled, @Nullable Bullet source){
damage(team, x, y, radius, damage, complete, air, ground, scaled, source, 1);
}
/** Damages all entities and blocks in a radius that are enemies of the team. */
public static void damage(Team team, float x, float y, float radius, float damage, boolean complete, boolean air, boolean ground, boolean scaled, @Nullable Bullet source, float armorMult){
Cons<Unit> cons = unit -> {
if(unit.team == team || !unit.checkTarget(air, ground) || !unit.hittable() || !unit.within(x, y, radius + (scaled ? unit.hitSize / 2f : 0f))){
return;
@ -506,7 +511,11 @@ public class Damage{
boolean dead = unit.dead;
float amount = calculateDamage(scaled ? Math.max(0, unit.dst(x, y) - unit.type.hitSize/2) : unit.dst(x, y), radius, damage);
unit.damage(amount);
if(armorMult != 1){
unit.damageArmorMult(amount, armorMult);
}else{
unit.damage(amount);
}
if(source != null){
Events.fire(bulletDamageEvent.set(unit, source));

View file

@ -592,7 +592,7 @@ public class BulletType extends Content implements Cloneable{
public void createSplashDamage(Bullet b, float x, float y){
if(splashDamageRadius > 0 && !b.absorbed){
Damage.damage(b.team, x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), splashDamagePierce, collidesAir, collidesGround, scaledSplashDamage, b);
Damage.damage(b.team, x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), splashDamagePierce, collidesAir, collidesGround, scaledSplashDamage, b, armorMultiplier);
if(status != StatusEffects.none){
Damage.status(b.team, x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround);