Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wreck health & damage tweak #2

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions core/src/mindustry/entities/comp/UnitComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public void update(){
//move down
elevation -= type.fallSpeed * Time.delta;

if(isGrounded() || health <= -maxHealth){
if(isGrounded() || health <= -0.4f * maxHealth){
Call.unitDestroy(id);
}
}
Expand Down Expand Up @@ -732,7 +732,7 @@ public void destroy(){
//if this unit crash landed (was flying), damage stuff in a radius
if(type.flying && !spawnedByCore && type.createWreck && state.rules.unitCrashDamage(team) > 0){
var shields = indexer.getEnemy(team, BlockFlag.shield);
float crashDamage = Mathf.pow(hitSize, 0.75f) * type.crashDamageMultiplier * 5f * state.rules.unitCrashDamage(team);
float crashDamage = Mathf.pow(hitSize, 1.65f) * type.crashDamageMultiplier * state.rules.unitCrashDamage(team) * Math.max(0.2f , (0.4f * maxHealth + health) / maxHealth);
if(shields.isEmpty() || !shields.contains(b -> b instanceof ExplosionShield s && s.absorbExplosion(x, y, crashDamage))){
Damage.damage(team, x, y, Mathf.pow(hitSize, 0.94f) * 1.25f, crashDamage, true, false, true);
}
Expand Down