Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2023-11-02 22:46:22 -04:00
39 changed files with 236 additions and 184 deletions

View File

@@ -3849,16 +3849,19 @@ public class Blocks{
requirements(Category.turret, with(Items.copper, 1000, Items.metaglass, 600, Items.surgeAlloy, 300, Items.plastanium, 200, Items.silicon, 600));
ammo(
Items.surgeAlloy, new PointBulletType(){{
Items.surgeAlloy, new RailBulletType(){{
shootEffect = Fx.instShoot;
hitEffect = Fx.instHit;
pierceEffect = Fx.railHit;
smokeEffect = Fx.smokeCloud;
trailEffect = Fx.instTrail;
pointEffect = Fx.instTrail;
despawnEffect = Fx.instBomb;
trailSpacing = 20f;
pointEffectSpace = 20f;
damage = 1350;
buildingDamageMultiplier = 0.2f;
speed = brange;
maxDamageFraction = 0.6f;
pierceDamageFactor = 1f;
length = brange;
hitShake = 6f;
ammoMultiplier = 1f;
}}

View File

@@ -197,6 +197,8 @@ public class UnitTypes{
singleTarget = true;
drownTimeMultiplier = 4f;
abilities.add(new ShieldRegenFieldAbility(25f, 500f, 60f * 1, 60f));
BulletType smallBullet = new BasicBulletType(3f, 10){{
width = 7f;
height = 9f;
@@ -219,10 +221,10 @@ public class UnitTypes{
shoot.shots = 3;
shoot.shotDelay = 4f;
bullet = new BasicBulletType(7f, 50){{
bullet = new BasicBulletType(8f, 80){{
width = 11f;
height = 20f;
lifetime = 25f;
lifetime = 27f;
shootEffect = Fx.shootBig;
lightning = 2;
lightningLength = 6;

View File

@@ -48,6 +48,8 @@ public class BulletType extends Content implements Cloneable{
public int pierceCap = -1;
/** Multiplier of damage decreased per health pierced. */
public float pierceDamageFactor = 0f;
/** If positive, limits non-splash damage dealt to a fraction of the target's maximum health. */
public float maxDamageFraction = -1f;
/** If false, this bullet isn't removed after pierceCap is exceeded. Expert usage only. */
public boolean removeAfterPierce = true;
/** For piercing lasers, setting this to true makes it get absorbed by plastanium walls. */
@@ -382,10 +384,16 @@ public class BulletType extends Content implements Cloneable{
boolean wasDead = entity instanceof Unit u && u.dead;
if(entity instanceof Healthc h){
float damage = b.damage;
if(maxDamageFraction > 0){
damage = Math.min(damage, h.maxHealth() * maxDamageFraction);
//cap health to effective health for handlePierce to handle it properly
health = Math.min(health, h.maxHealth() * maxDamageFraction);
}
if(pierceArmor){
h.damagePierce(b.damage);
h.damagePierce(damage);
}else{
h.damage(b.damage);
h.damage(damage);
}
}

View File

@@ -487,6 +487,10 @@ public class StatValues{
sep(bt, "@bullet.armorpierce");
}
if(type.maxDamageFraction > 0){
sep(bt, Core.bundle.format("bullet.maxdamagefraction", (int)(type.maxDamageFraction * 100)));
}
if(type.suppressionRange > 0){
sep(bt, Core.bundle.format("bullet.suppression", Strings.autoFixed(type.suppressionDuration / 60f, 2), Strings.fixed(type.suppressionRange / tilesize, 1)));
}