Cleanup
This commit is contained in:
30
core/src/mindustry/entities/def/ShieldComp.java
Normal file
30
core/src/mindustry/entities/def/ShieldComp.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package mindustry.entities.def;
|
||||
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@Component
|
||||
abstract class ShieldComp implements Healthc{
|
||||
@Import float health, hitTime;
|
||||
@Import boolean dead;
|
||||
|
||||
/** Absorbs health damage. */
|
||||
float shield;
|
||||
|
||||
@Replace
|
||||
@Override
|
||||
public void damage(float amount){
|
||||
hitTime = 1f;
|
||||
|
||||
float shieldDamage = Math.min(shield, amount);
|
||||
shield -= shieldDamage;
|
||||
amount -= shieldDamage;
|
||||
|
||||
if(amount > 0){
|
||||
health -= amount;
|
||||
if(health <= 0 && !dead){
|
||||
kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox
|
||||
private UnitController controller;
|
||||
private UnitType type;
|
||||
|
||||
int level;
|
||||
|
||||
public void moveAt(Vec2 vector){
|
||||
moveAt(vector, type.accel);
|
||||
}
|
||||
|
||||
@@ -331,22 +331,25 @@ public class ContentParser{
|
||||
}
|
||||
|
||||
private void readBundle(ContentType type, String name, JsonValue value){
|
||||
UnlockableContent cont = locate(type, name) instanceof UnlockableContent ?
|
||||
locate(type, name) : null;
|
||||
UnlockableContent cont = locate(type, name) instanceof UnlockableContent ? locate(type, name) : null;
|
||||
|
||||
String entryName = cont == null ? type + "." + currentMod.name + "-" + name + "." : type + "." + cont.name + ".";
|
||||
I18NBundle bundle = Core.bundle;
|
||||
while(bundle.getParent() != null) bundle = bundle.getParent();
|
||||
|
||||
if(value.has("name")){
|
||||
bundle.getProperties().put(entryName + "name", value.getString("name"));
|
||||
if(cont != null) cont.localizedName = value.getString("name");
|
||||
if(!Core.bundle.has(entryName + "name")){
|
||||
bundle.getProperties().put(entryName + "name", value.getString("name"));
|
||||
if(cont != null) cont.localizedName = value.getString("name");
|
||||
}
|
||||
value.remove("name");
|
||||
}
|
||||
|
||||
if(value.has("description")){
|
||||
bundle.getProperties().put(entryName + "description", value.getString("description"));
|
||||
if(cont != null) cont.description = value.getString("description");
|
||||
if(!Core.bundle.has(entryName + "description")){
|
||||
bundle.getProperties().put(entryName + "description", value.getString("description"));
|
||||
if(cont != null) cont.description = value.getString("description");
|
||||
}
|
||||
value.remove("description");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ public class ContentDisplay{
|
||||
inset.add().size(10f);
|
||||
}
|
||||
|
||||
//map.get(stat).display(inset);
|
||||
}).fillX().padLeft(10);
|
||||
table.row();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ public class CoreBlock extends StorageBlock{
|
||||
}
|
||||
|
||||
public class CoreEntity extends TileEntity{
|
||||
// protected Playerc spawnPlayer;
|
||||
protected float time, heat, progress;
|
||||
protected int storageCapacity;
|
||||
protected boolean shouldBuild;
|
||||
|
||||
Reference in New Issue
Block a user