Procedural scorch marks / Bugfixes
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package mindustry.entities.def;
|
||||
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@Component
|
||||
abstract class FireComp implements Timedc{
|
||||
}
|
||||
@@ -34,8 +34,12 @@ abstract class HealthComp implements Entityc{
|
||||
}
|
||||
|
||||
void kill(){
|
||||
if(dead) return;
|
||||
|
||||
health = 0;
|
||||
dead = true;
|
||||
killed();
|
||||
remove();
|
||||
}
|
||||
|
||||
void heal(){
|
||||
@@ -50,8 +54,7 @@ abstract class HealthComp implements Entityc{
|
||||
void damage(float amount){
|
||||
health -= amount;
|
||||
if(health <= 0 && !dead){
|
||||
dead = true;
|
||||
killed();
|
||||
kill();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,10 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc{
|
||||
}
|
||||
|
||||
public void update(){
|
||||
if(unit.dead()){
|
||||
clearUnit();
|
||||
}
|
||||
|
||||
if(!dead()){
|
||||
x(unit.x());
|
||||
y(unit.y());
|
||||
|
||||
@@ -152,6 +152,7 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox
|
||||
|
||||
//TODO cleanup
|
||||
//ScorchDecal.create(getX(), getY());
|
||||
Effects.scorch(x, y, (int)(hitSize() / 5));
|
||||
Fx.explosion.at(this);
|
||||
Effects.shake(2f, 2f, this);
|
||||
type.deathSound.at(this);
|
||||
|
||||
Reference in New Issue
Block a user