Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

 Conflicts:
	gradle.properties
This commit is contained in:
Anuken
2021-06-28 18:57:27 -04:00
86 changed files with 1926 additions and 1025 deletions

View File

@@ -52,22 +52,22 @@ public class Puddles{
Puddle p = map.get(tile.pos());
if(p == null){
Puddle puddle = Puddle.create();
puddle.tile(tile);
puddle.liquid(liquid);
puddle.amount(amount);
puddle.generation(generation);
puddle.tile = tile;
puddle.liquid = liquid;
puddle.amount = amount;
puddle.generation = generation;
puddle.set((tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f);
puddle.add();
map.put(tile.pos(), puddle);
}else if(p.liquid() == liquid){
p.accepting(Math.max(amount, p.accepting()));
}else if(p.liquid == liquid){
p.accepting = Math.max(amount, p.accepting);
if(generation == 0 && p.lastRipple <= Time.time - 40f && p.amount() >= maxLiquid / 2f){
Fx.ripple.at((tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f, 1f, p.liquid().color);
if(generation == 0 && p.lastRipple <= Time.time - 40f && p.amount >= maxLiquid / 2f){
Fx.ripple.at((tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f, 1f, p.liquid.color);
p.lastRipple = Time.time;
}
}else{
p.amount(p.amount() + reactPuddle(p.liquid(), liquid, amount, p.tile(), (p.x() + source.worldx())/2f, (p.y() + source.worldy())/2f));
p.amount += reactPuddle(p.liquid, liquid, amount, p.tile, (p.x + source.worldx())/2f, (p.y + source.worldy())/2f);
}
}

View File

@@ -297,7 +297,7 @@ public class BulletType extends Content implements Cloneable{
}
}
/** Called when the bullet reaches the end of its lifetime of is destroyed by something external. */
/** Called when the bullet reaches the end of its lifetime or is destroyed by something external. */
public void despawned(Bullet b){
if(despawnHit){
hit(b);

View File

@@ -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

View File

@@ -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));

View File

@@ -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. */

View File

@@ -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