This commit is contained in:
Anuken
2025-04-04 13:18:15 -04:00
parent bd0436bbff
commit c2de9170dd
2 changed files with 8 additions and 2 deletions

View File

@@ -161,6 +161,8 @@ public class BulletType extends Content implements Cloneable{
public float healPercent = 0f;
/** flat amount of block health healed */
public float healAmount = 0f;
/** Fraction of bullet damage that heals that shooter. */
public float lifesteal = 0f;
/** Whether to make fire on impact */
public boolean makeFire = false;
/** Whether this bullet will always hit blocks under it. */
@@ -450,6 +452,10 @@ public class BulletType extends Content implements Cloneable{
}else{
health += shield;
}
if(lifesteal > 0f && b.owner instanceof Healthc o){
float result = Math.max(Math.min(h.health(), damage), 0);
o.heal(result * lifesteal);
}
if(pierceArmor){
h.damagePierce(damage);
}else{