No lightning status chance

This commit is contained in:
Anuken
2026-09-02 17:47:58 -04:00
parent a298ccfd45
commit 9e95a4bbc4
5 changed files with 5 additions and 30 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ public class Lightning{
bhit = false;
for(int i = 0; i < length / 2; i++){
hitCreate.create(null, team, x, y, rotation, damage * (hitter == null ? 1f : hitter.damageMultiplier()), 1f, 1f, hitter);
hitCreate.create(null, team, x, y, rotation, damage * (hitter == null ? 1f : hitter.damageMultiplier()), 1f, 1f, null);
lines.add(new Vec2(x + Mathf.range(3f), y + Mathf.range(3f)));
if(lines.size > 1){
@@ -122,8 +122,6 @@ public class BulletType extends Content implements Cloneable{
public float statusDuration = 60 * 8f;
/** Chance for this bullet to apply a status effect */
public float statusChance = 1f;
/** Chance for lightning chains to apply a status effect. If -1, uses the parent bullet's statusChance instead. */
public float lightningStatusChance = -1f;
/** Turret only. If false, blocks will not be targeted. */
public boolean targetBlocks = true;
/** Turret only. If false, missiles will not be targeted. */
@@ -518,7 +516,7 @@ public class BulletType extends Content implements Cloneable{
unit.impulse(Tmp.v3);
}
if(Mathf.chance(getStatusChance(b))){
if(Mathf.chance(statusChance)){
unit.apply(status, statusDuration);
}
@@ -607,7 +605,7 @@ public class BulletType extends Content implements Cloneable{
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, getStatusChance(b));
Damage.status(b.team, x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround, statusChance);
}
if(heals()){
@@ -645,21 +643,6 @@ public class BulletType extends Content implements Cloneable{
}
}
// used for lightning bullets only
public float getLightningStatusChance(){
return lightningStatusChance < 0f ? statusChance : lightningStatusChance;
}
/** Gets the status chance from lightning bullets */
public float getStatusChance(Bullet b){
if(b.data instanceof Bullet parent &&
(parent.type.lightningType == b.type || parent.type.lightningType == null && b.type == Bullets.damageLightning)){
return parent.type.getLightningStatusChance();
}
return statusChance;
}
/** Called when the bullet reaches the end of its lifetime or is destroyed by something external. */
public void despawned(Bullet b){
if(despawnHit){
@@ -58,7 +58,7 @@ public class EmpBulletType extends BasicBulletType{
hitPowerEffect.at(other.x, other.y, b.angleTo(other), hitColor);
chainEffect.at(x, y, 0, hitColor, other);
other.damage(damage * unitDamageScl);
if(Mathf.chance(getStatusChance(b))){
if(Mathf.chance(statusChance)){
other.apply(status, statusDuration);
}
}
@@ -238,7 +238,7 @@ public class TargetDummy extends Block{
t.check(Core.bundle.get("rules.enemyteam"), unitTeam != team, b -> configureFloat(0, Mathf.num(b))).colspan(3).row();
t.check(Core.bundle.get("stat.flying"), boosting, b -> configureFloat(1, Mathf.num(b))).colspan(3).row();
t.add(Core.bundle.get("stat.armor"));
t.field("" + unitArmor, TextFieldFilter.floatsOnly, s -> configureFloat(2, Strings.parseFloat(s))).width(200f).padLeft(8f).colspan(2).row();
t.field("" + (int)unitArmor, TextFieldFilter.digitsOnly, s -> configureFloat(2, Strings.parseInt(s))).width(200f).padLeft(8f).colspan(2).row();
t.add(Core.bundle.get("stat.resettime"));
t.field(Strings.autoFixed(resetTime / 60f, 2), TextFieldFilter.floatsOnly, s -> configureFloat(3, Strings.parseFloat(s) * 60f)).padLeft(8f).growX();
t.add(StatUnit.seconds.localized()).padLeft(8).row();
@@ -730,14 +730,6 @@ public class StatValues{
type.lightning,
type.lightningDamage < 0 ? type.damage : type.lightningDamage
));
BulletType lightningType = type.lightningType == null ? Bullets.damageLightning : type.lightningType;
float chance = type.getLightningStatusChance();
if(lightningType.status != StatusEffects.none && chance > 0f){
sep(bt, statusText(lightningType.status, lightningType.statusDuration, chance))
.with(c -> withTooltip(c, lightningType.status));
}
}
if(type instanceof LaserBulletType b && b.lightningSpacing > 0){