Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
Conflicts: gradle.properties
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package mindustry.entities.comp;
|
||||
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@@ -24,7 +25,7 @@ abstract class BoundedComp implements Velc, Posc, Healthc, Flyingc{
|
||||
if(x > world.unitWidth()) dx -= (x - world.unitWidth())/warpDst;
|
||||
if(y > world.unitHeight()) dy -= (y - world.unitHeight())/warpDst;
|
||||
|
||||
velAddNet(dx, dy);
|
||||
velAddNet(dx * Time.delta, dy * Time.delta);
|
||||
}
|
||||
|
||||
//clamp position if not flying
|
||||
|
||||
@@ -28,6 +28,7 @@ abstract class FireComp implements Timedc, Posc, Syncc, Drawc{
|
||||
public static final TextureRegion[] regions = new TextureRegion[frames];
|
||||
|
||||
@Import float time, lifetime, x, y;
|
||||
@Import int id;
|
||||
|
||||
Tile tile;
|
||||
private transient Block block;
|
||||
@@ -116,7 +117,7 @@ abstract class FireComp implements Timedc, Posc, Syncc, Drawc{
|
||||
|
||||
Draw.alpha(Mathf.clamp(warmup / warmupDuration));
|
||||
Draw.z(Layer.effect);
|
||||
Draw.rect(regions[Math.min((int)animation, regions.length - 1)], x, y);
|
||||
Draw.rect(regions[Math.min((int)animation, regions.length - 1)], x + Mathf.randomSeedRange((int)y, 2), y + Mathf.randomSeedRange((int)x, 2));
|
||||
Draw.reset();
|
||||
|
||||
Drawf.light(x, y, 50f + Mathf.absin(5f, 5f), Pal.lightFlame, 0.6f * Mathf.clamp(warmup / warmupDuration));
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package mindustry.entities.comp;
|
||||
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
@@ -34,7 +33,7 @@ abstract class HealthComp implements Entityc, Posc{
|
||||
void kill(){
|
||||
if(dead) return;
|
||||
|
||||
health = 0;
|
||||
health = Math.min(health, 0);
|
||||
dead = true;
|
||||
killed();
|
||||
remove();
|
||||
@@ -86,7 +85,7 @@ abstract class HealthComp implements Entityc, Posc{
|
||||
}
|
||||
|
||||
void clampHealth(){
|
||||
health = Mathf.clamp(health, 0, maxHealth);
|
||||
health = Math.min(health, maxHealth);
|
||||
}
|
||||
|
||||
/** Heals by a flat amount. */
|
||||
|
||||
@@ -397,7 +397,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
//move down
|
||||
elevation -= type.fallSpeed * Time.delta;
|
||||
|
||||
if(isGrounded()){
|
||||
if(isGrounded() || health <= -maxHealth){
|
||||
Call.unitDestroy(id);
|
||||
}
|
||||
}
|
||||
@@ -528,7 +528,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
@Override
|
||||
public void killed(){
|
||||
wasPlayer = isLocal();
|
||||
health = 0;
|
||||
health = Math.min(health, 0);
|
||||
dead = true;
|
||||
|
||||
//don't waste time when the unit is already on the ground, just destroy it
|
||||
|
||||
Reference in New Issue
Block a user