This commit is contained in:
Anuken
2018-09-03 09:56:14 -04:00
parent 019e22aff2
commit e36667cd08
4 changed files with 10 additions and 7 deletions

View File

@@ -73,12 +73,13 @@ public class PowerBlocks extends BlockList implements ContentList{
powerNode = new PowerNode("power-node"){{ powerNode = new PowerNode("power-node"){{
shadow = "shadow-round-1"; shadow = "shadow-round-1";
powerSpeed = 0.5f;
maxNodes = 4; maxNodes = 4;
}}; }};
powerNodeLarge = new PowerNode("power-node-large"){{ powerNodeLarge = new PowerNode("power-node-large"){{
size = 2; size = 2;
powerSpeed = 1f; powerSpeed = 1.5f;
maxNodes = 6; maxNodes = 6;
laserRange = 7.5f; laserRange = 7.5f;
shadow = "shadow-round-2"; shadow = "shadow-round-2";

View File

@@ -217,7 +217,7 @@ public class NetClient extends Module{
int totalChunks = Mathf.ceil((float) totalLength / NetServer.maxSnapshotSize); int totalChunks = Mathf.ceil((float) totalLength / NetServer.maxSnapshotSize);
//reset status when a new snapshot sending begins //reset status when a new snapshot sending begins
if(netClient.currentSnapshotID != snapshotID || netClient.recievedChunks == null){ if(netClient.currentSnapshotID != snapshotID || netClient.recievedChunks == null || netClient.recievedChunks.length != totalChunks){
netClient.currentSnapshotID = snapshotID; netClient.currentSnapshotID = snapshotID;
netClient.currentSnapshot = new byte[totalLength]; netClient.currentSnapshot = new byte[totalLength];
netClient.recievedChunkCounter = 0; netClient.recievedChunkCounter = 0;

View File

@@ -127,6 +127,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
tile.block().handleBulletHit(this, other); tile.block().handleBulletHit(this, other);
} }
public void kill(){
Call.onTileDestroyed(tile);
}
public void damage(float damage){ public void damage(float damage){
if(dead) return; if(dead) return;

View File

@@ -121,8 +121,8 @@ public class NuclearReactor extends PowerGenerator{
entity.heat = Mathf.clamp(entity.heat); entity.heat = Mathf.clamp(entity.heat);
if(entity.heat >= 1f){ if(entity.heat >= 0.999f){
entity.damage((int) entity.health); entity.kill();
}else{ }else{
distributePower(tile); distributePower(tile);
} }
@@ -141,9 +141,7 @@ public class NuclearReactor extends PowerGenerator{
Effects.shake(6f, 16f, tile.worldx(), tile.worldy()); Effects.shake(6f, 16f, tile.worldx(), tile.worldy());
Effects.effect(ExplosionFx.nuclearShockwave, tile.worldx(), tile.worldy()); Effects.effect(ExplosionFx.nuclearShockwave, tile.worldx(), tile.worldy());
for(int i = 0; i < 6; i++){ for(int i = 0; i < 6; i++){
Timers.run(Mathf.random(40), () -> { Timers.run(Mathf.random(40), () -> Effects.effect(BlockFx.nuclearcloud, tile.worldx(), tile.worldy()));
Effects.effect(BlockFx.nuclearcloud, tile.worldx(), tile.worldy());
});
} }
Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4); Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4);