Bugfixes / Negative knockback / Unit progress

This commit is contained in:
Anuken
2020-07-11 23:35:58 -04:00
parent 430eef02e2
commit dad5b186db
16 changed files with 39 additions and 12 deletions

View File

@@ -23,6 +23,8 @@ public class SapBulletType extends BulletType{
hitSize = 0f;
hittable = false;
hitEffect = Fx.hitLiquid;
status = StatusEffects.sapped;
statusDuration = 60f * 3f;
}
@Override

View File

@@ -19,6 +19,7 @@ import static mindustry.Vars.*;
abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Drawc, Shielderc, Ownerc, Velc, Bulletc, Timerc{
@Import Team team;
@Import Entityc owner;
@Import float x,y;
IntSeq collided = new IntSeq(6);
Object data;
@@ -91,7 +92,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
if(other instanceof Unit){
Unit unit = (Unit)other;
unit.vel.add(Tmp.v3.set(unit).sub(x, y).setLength(type.knockback / unit.mass()));
unit.impulse(Tmp.v3.set(unit).sub(this.x, this.y).nor().scl(type.knockback * 80f));
unit.apply(type.status, type.statusDuration);
}

View File

@@ -68,7 +68,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
//effects-only code
if(amount >= maxLiquid / 2f && updateTime <= 0f){
Units.nearby(rect.setSize(Mathf.clamp(amount / (maxLiquid / 1.5f)) * 10f).setCenter(x, y), unit -> {
if(unit.isGrounded()){
if(unit.isGrounded() && !unit.hovering){
unit.hitbox(rect2);
if(rect.overlaps(rect2)){
unit.apply(liquid.effect, 60 * 2);
@@ -80,11 +80,11 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
}
});
if(liquid.temperature > 0.7f && (tile.build != null) && Mathf.chance(0.3 * Time.delta())){
if(liquid.temperature > 0.7f && (tile.build != null) && Mathf.chance(0.5)){
Fires.create(tile);
}
updateTime = 20f;
updateTime = 40f;
}
updateTime -= Time.delta();