This commit is contained in:
Anuken
2020-04-26 21:59:49 -04:00
parent 1941b0fa8a
commit f6bf229b0a
21 changed files with 2997 additions and 2877 deletions

View 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();
}
}
}
}

View File

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

View File

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

View File

@@ -55,7 +55,6 @@ public class ContentDisplay{
inset.add().size(10f);
}
//map.get(stat).display(inset);
}).fillX().padLeft(10);
table.row();
}

View File

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