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{

View File

@@ -35,7 +35,7 @@ public class LAssembler{
Seq<LStatement> st = read(data, privileged);
asm.privileged = privileged;
asm.instructions = st.map(l -> l.build(asm)).retainAll(l -> l != null).toArray(LInstruction.class);
return asm;
}
@@ -74,7 +74,7 @@ public class LAssembler{
symbol = symbol.replace(' ', '_');
//use a positive invalid number if number might be negative, else use a negative invalid number
int usedInvalidNum = symbol.startsWith("-") ? invalidNumPositive : invalidNumNegative;
int usedInvalidNum = symbol.length() > 0 && symbol.charAt(0) == '-' ? invalidNumPositive : invalidNumNegative;
double value = parseDouble(symbol, usedInvalidNum);
if(value == usedInvalidNum){