Updates for new uCore version

This commit is contained in:
Anuken
2018-04-05 22:30:25 -04:00
parent 53ca2d0755
commit 5172ae781f
15 changed files with 220 additions and 220 deletions

View File

@@ -25,7 +25,7 @@ allprojects {
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.8' gdxVersion = '1.9.8'
aiVersion = '1.8.1' aiVersion = '1.8.1'
uCoreVersion = 'a41b4c2' uCoreVersion = 'b41a747'
getVersionString = { getVersionString = {
String buildVersion = getBuildVersion() String buildVersion = getBuildVersion()

View File

@@ -64,11 +64,11 @@ void main() {
if(i >= u_hitamount) break; if(i >= u_hitamount) break;
vec3 hit = u_hits[i]; vec3 hit = u_hits[i];
float rad = hit.z * HIT_RADIUS; float rad = hit.z * HIT_RADIUS;
float fract = 1.0 - hit.z; float fin = 1.0 - hit.z;
if(abs(distance(vec2(hit.x, hit.y), coords - u_texsize/2.0) - rad) < 1.0){ if(abs(distance(vec2(hit.x, hit.y), coords - u_texsize/2.0) - rad) < 1.0){
color = mix(color, u_color* vec4(si, si, si, 1.0), (1.0 * fract)); color = mix(color, u_color* vec4(si, si, si, 1.0), (1.0 * fin));
color.a = ALPHA + 0.82 *fract; color.a = ALPHA + 0.82 *fin;
} }
} }
} }

View File

@@ -1,7 +1,7 @@
#Autogenerated file. Do not modify. #Autogenerated file. Do not modify.
#Tue Apr 03 23:58:20 EDT 2018 #Thu Apr 05 22:28:48 EDT 2018
version=release version=release
androidBuildCode=501 androidBuildCode=502
name=Mindustry name=Mindustry
code=3.5 code=3.5
build=custom build build=custom build

View File

@@ -541,14 +541,14 @@ public class Renderer extends RendererModule{
} }
//TODO optimize! //TODO optimize!
public void drawBar(Color color, float x, float y, float fraction){ public void drawBar(Color color, float x, float y, float finion){
fraction = Mathf.clamp(fraction); finion = Mathf.clamp(finion);
if(fraction > 0) fraction = Mathf.clamp(fraction + 0.2f, 0.24f, 1f); if(finion > 0) finion = Mathf.clamp(finion + 0.2f, 0.24f, 1f);
float len = 3; float len = 3;
float w = (int) (len * 2 * fraction) + 0.5f; float w = (int) (len * 2 * finion) + 0.5f;
x -= 0.5f; x -= 0.5f;
y += 0.5f; y += 0.5f;

View File

@@ -168,8 +168,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
} }
public void draw(Bullet b) { public void draw(Bullet b) {
Draw.color(Color.LIGHT_GRAY, Color.GRAY, b.ifract()); Draw.color(Color.LIGHT_GRAY, Color.GRAY, b.fout());
Lines.stroke(2f - b.ifract()); Lines.stroke(2f - b.fout());
Lines.lineAngleCenter(b.x, b.y, b.angle(), 2f); Lines.lineAngleCenter(b.x, b.y, b.angle(), 2f);
Draw.reset(); Draw.reset();
} }
@@ -325,7 +325,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
} }
public void draw(Bullet b){ public void draw(Bullet b){
Draw.color(Color.WHITE, lightOrange, b.fract()/2f + 0.25f); Draw.color(Color.WHITE, lightOrange, b.fin()/2f + 0.25f);
Lines.stroke(1.5f); Lines.stroke(1.5f);
Lines.lineAngle(b.x, b.y, b.angle(), 3f); Lines.lineAngle(b.x, b.y, b.angle(), 3f);
Draw.reset(); Draw.reset();
@@ -337,7 +337,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
} }
public void draw(Bullet b) { public void draw(Bullet b) {
float size = 3f - b.ifract()*1f; float size = 3f - b.fout()*1f;
Draw.color(Color.PURPLE, Color.WHITE, 0.8f); Draw.color(Color.PURPLE, Color.WHITE, 0.8f);
Lines.stroke(1f); Lines.stroke(1f);
@@ -356,8 +356,8 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
Draw.color(lightOrange, Color.WHITE, 0.4f); Draw.color(lightOrange, Color.WHITE, 0.4f);
Lines.poly(b.x, b.y, 3, 1.6f, b.angle()); Lines.poly(b.x, b.y, 3, 1.6f, b.angle());
Lines.stroke(1f); Lines.stroke(1f);
Draw.color(Color.WHITE, lightOrange, b.ifract()/2f); Draw.color(Color.WHITE, lightOrange, b.fout()/2f);
Draw.alpha(b.ifract()); Draw.alpha(b.fout());
Lines.spikes(b.x, b.y, 1.5f, 2f, 6); Lines.spikes(b.x, b.y, 1.5f, 2f, 6);
Draw.reset(); Draw.reset();
} }
@@ -408,9 +408,9 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
} }
public void draw(Bullet b) { public void draw(Bullet b) {
Draw.color(Color.WHITE, Color.ORANGE, b.ifract()); Draw.color(Color.WHITE, Color.ORANGE, b.fout());
Lines.stroke(2f); Lines.stroke(2f);
Lines.lineAngleCenter(b.x, b.y, b.angle(), b.fract()*5f); Lines.lineAngleCenter(b.x, b.y, b.angle(), b.fin()*5f);
Draw.reset(); Draw.reset();
} }
@@ -436,9 +436,9 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
} }
public void draw(Bullet b) { public void draw(Bullet b) {
Draw.color(Color.WHITE, Color.ORANGE, b.ifract()); Draw.color(Color.WHITE, Color.ORANGE, b.fout());
Lines.stroke(1f); Lines.stroke(1f);
Lines.lineAngleCenter(b.x, b.y, b.angle(), b.fract()*4f); Lines.lineAngleCenter(b.x, b.y, b.angle(), b.fin()*4f);
Draw.reset(); Draw.reset();
} }
}, },
@@ -454,7 +454,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
} }
public void draw(Bullet b) { public void draw(Bullet b) {
float f = b.fract()*1.5f; float f = b.fin()*1.5f;
Draw.color(beam); Draw.color(beam);
Draw.rect("circle", b.x, b.y, 6f*f, 6f*f); Draw.rect("circle", b.x, b.y, 6f*f, 6f*f);

View File

@@ -60,7 +60,7 @@ public class Player extends SyncEntity{
} }
@Override @Override
public void damage(int amount){ public void damage(float amount){
if(debug || isAndroid) return; if(debug || isAndroid) return;
health -= amount; health -= amount;

View File

@@ -77,7 +77,7 @@ public class EMP extends TimedEntity{
drawLine(target.worldx(), target.worldy()); drawLine(target.worldx(), target.worldy());
float rad = 5f*fract(); float rad = 5f*fin();
Draw.rect("circle", target.worldx(), target.worldy(), rad, rad); Draw.rect("circle", target.worldx(), target.worldy(), rad, rad);
} }
@@ -86,7 +86,7 @@ public class EMP extends TimedEntity{
drawLine(x + tr.x, y + tr.y); drawLine(x + tr.x, y + tr.y);
} }
Lines.stroke(fract()*2f); Lines.stroke(fin()*2f);
Lines.poly(x, y, 34, radius * tilesize); Lines.poly(x, y, 34, radius * tilesize);
Draw.reset(); Draw.reset();
@@ -114,7 +114,7 @@ public class EMP extends TimedEntity{
} }
private void drawLaser(float x, float y, float x2, float y2){ private void drawLaser(float x, float y, float x2, float y2){
Lines.stroke(fract() * 2f); Lines.stroke(fin() * 2f);
Lines.line(x, y, x2, y2); Lines.line(x, y, x2, y2);
} }
} }

View File

@@ -72,7 +72,7 @@ public class Enemy extends SyncEntity {
} }
@Override @Override
public void damage(int amount){ public void damage(float amount){
super.damage(amount); super.damage(amount);
hitTime = EnemyType.hitDuration; hitTime = EnemyType.hitDuration;
} }

View File

@@ -27,125 +27,125 @@ public class Fx{
public static final Effect public static final Effect
generatorexplosion = new Effect(28, 40f, e -> { generatorexplosion = new Effect(28, 40f, e -> {
Angles.randLenVectors(e.id, 16, 10f + e.ifract()*8f, (x, y)->{ Angles.randLenVectors(e.id, 16, 10f + e.fout()*8f, (x, y)->{
float size = e.fract()*12f + 1f; float size = e.fin()*12f + 1f;
Draw.color(Color.WHITE, lightOrange, e.ifract()); Draw.color(Color.WHITE, lightOrange, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
}), }),
reactorsmoke = new Effect(17, e -> { reactorsmoke = new Effect(17, e -> {
Angles.randLenVectors(e.id, 4, e.ifract()*8f, (x, y)->{ Angles.randLenVectors(e.id, 4, e.fout()*8f, (x, y)->{
float size = 1f+e.fract()*5f; float size = 1f+e.fin()*5f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
}), }),
nuclearsmoke = new Effect(40, e -> { nuclearsmoke = new Effect(40, e -> {
Angles.randLenVectors(e.id, 4, e.ifract()*13f, (x, y)->{ Angles.randLenVectors(e.id, 4, e.fout()*13f, (x, y)->{
float size = e.sfract()*4f; float size = e.finpow()*4f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
}), }),
nuclearcloud = new Effect(90, 200f, e -> { nuclearcloud = new Effect(90, 200f, e -> {
Angles.randLenVectors(e.id, 10, e.powfract()*90f, (x, y)->{ Angles.randLenVectors(e.id, 10, e.finpow()*90f, (x, y)->{
float size = e.fract()*14f; float size = e.fin()*14f;
Draw.color(Color.LIME, Color.GRAY, e.ifract()); Draw.color(Color.LIME, Color.GRAY, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
}), }),
chainshot = new Effect(9f, e -> { chainshot = new Effect(9f, e -> {
Draw.color(Color.WHITE, lightOrange, e.ifract()); Draw.color(Color.WHITE, lightOrange, e.fout());
Lines.stroke(e.fract()*4f); Lines.stroke(e.fin()*4f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*7f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*7f);
Lines.stroke(e.fract()*2f); Lines.stroke(e.fin()*2f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*10f);
Draw.reset(); Draw.reset();
}), }),
mortarshot = new Effect(10f, e -> { mortarshot = new Effect(10f, e -> {
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract()); Draw.color(Color.WHITE, Color.DARK_GRAY, e.fout());
Lines.stroke(e.fract()*6f); Lines.stroke(e.fin()*6f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*10f);
Lines.stroke(e.fract()*5f); Lines.stroke(e.fin()*5f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*14f);
Lines.stroke(e.fract()*1f); Lines.stroke(e.fin()*1f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*16f);
Draw.reset(); Draw.reset();
}), }),
railshot = new Effect(9f, e -> { railshot = new Effect(9f, e -> {
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract()); Draw.color(Color.WHITE, Color.DARK_GRAY, e.fout());
Lines.stroke(e.fract()*5f); Lines.stroke(e.fin()*5f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*8f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*8f);
Lines.stroke(e.fract()*4f); Lines.stroke(e.fin()*4f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*12f);
Lines.stroke(e.fract()*1f); Lines.stroke(e.fin()*1f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*14f);
Draw.reset(); Draw.reset();
}), }),
titanshot = new Effect(12f, e -> { titanshot = new Effect(12f, e -> {
Draw.color(Color.WHITE, lightOrange, e.ifract()); Draw.color(Color.WHITE, lightOrange, e.fout());
Lines.stroke(e.fract()*7f); Lines.stroke(e.fin()*7f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*12f);
Lines.stroke(e.fract()*4f); Lines.stroke(e.fin()*4f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*16f);
Lines.stroke(e.fract()*2f); Lines.stroke(e.fin()*2f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*18f);
Draw.reset(); Draw.reset();
}), }),
largeCannonShot = new Effect(11f, e -> { largeCannonShot = new Effect(11f, e -> {
Draw.color(Color.WHITE, whiteYellow, e.ifract()); Draw.color(Color.WHITE, whiteYellow, e.fout());
Lines.stroke(e.fract()*6f); Lines.stroke(e.fin()*6f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*12f);
Lines.stroke(e.fract()*3f); Lines.stroke(e.fin()*3f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*16f);
Lines.stroke(e.fract()*1f); Lines.stroke(e.fin()*1f);
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f); Lines.lineAngle(e.x, e.y, e.rotation, e.fin()*18f);
Draw.reset(); Draw.reset();
}), }),
shockwave = new Effect(10f, 80f, e -> { shockwave = new Effect(10f, 80f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fout());
Lines.stroke(e.fract()*2f + 0.2f); Lines.stroke(e.fin()*2f + 0.2f);
Lines.circle(e.x, e.y, e.ifract()*28f); Lines.circle(e.x, e.y, e.fout()*28f);
Draw.reset(); Draw.reset();
}), }),
nuclearShockwave = new Effect(10f, 200f, e -> { nuclearShockwave = new Effect(10f, 200f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fout());
Lines.stroke(e.fract()*3f + 0.2f); Lines.stroke(e.fin()*3f + 0.2f);
Lines.poly(e.x, e.y, 40, e.ifract()*140f); Lines.poly(e.x, e.y, 40, e.fout()*140f);
Draw.reset(); Draw.reset();
}), }),
shockwaveSmall = new Effect(10f, e -> { shockwaveSmall = new Effect(10f, e -> {
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fout());
Lines.stroke(e.fract()*2f + 0.1f); Lines.stroke(e.fin()*2f + 0.1f);
Lines.circle(e.x, e.y, e.ifract()*15f); Lines.circle(e.x, e.y, e.fout()*15f);
Draw.reset(); Draw.reset();
}), }),
empshockwave = new Effect(7f, e -> { empshockwave = new Effect(7f, e -> {
Draw.color(Color.WHITE, Color.SKY, e.ifract()); Draw.color(Color.WHITE, Color.SKY, e.fout());
Lines.stroke(e.fract()*2f); Lines.stroke(e.fin()*2f);
Lines.circle(e.x, e.y, e.ifract()*40f); Lines.circle(e.x, e.y, e.fout()*40f);
Draw.reset(); Draw.reset();
}), }),
empspark = new Effect(13, e -> { empspark = new Effect(13, e -> {
Angles.randLenVectors(e.id, 7, 1f + e.ifract()*12f, (x, y)->{ Angles.randLenVectors(e.id, 7, 1f + e.fout()*12f, (x, y)->{
float len = 1f+e.fract()*6f; float len = 1f+e.fin()*6f;
Draw.color(Color.SKY); Draw.color(Color.SKY);
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len); Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len);
Draw.reset(); Draw.reset();
@@ -153,67 +153,67 @@ public class Fx{
}), }),
redgeneratespark = new Effect(18, e -> { redgeneratespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.ifract()*8f, (x, y)->{ Angles.randLenVectors(e.id, 5, e.fout()*8f, (x, y)->{
float len = e.fract()*4f; float len = e.fin()*4f;
Draw.color(Color.valueOf("fbb97f"), Color.GRAY, e.ifract()); Draw.color(Color.valueOf("fbb97f"), Color.GRAY, e.fout());
//Draw.alpha(e.fract()); //Draw.alpha(e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len); Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset(); Draw.reset();
}); });
}), }),
generatespark = new Effect(18, e -> { generatespark = new Effect(18, e -> {
Angles.randLenVectors(e.id, 5, e.ifract()*8f, (x, y)->{ Angles.randLenVectors(e.id, 5, e.fout()*8f, (x, y)->{
float len = e.fract()*4f; float len = e.fin()*4f;
Draw.color(Color.valueOf("d2b29c"), Color.GRAY, e.ifract()); Draw.color(Color.valueOf("d2b29c"), Color.GRAY, e.fout());
//Draw.alpha(e.fract()); //Draw.alpha(e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len); Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset(); Draw.reset();
}); });
}), }),
fuelburn = new Effect(23, e -> { fuelburn = new Effect(23, e -> {
Angles.randLenVectors(e.id, 5, e.ifract()*9f, (x, y)->{ Angles.randLenVectors(e.id, 5, e.fout()*9f, (x, y)->{
float len = e.fract()*4f; float len = e.fin()*4f;
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fout());
//Draw.alpha(e.fract()); //Draw.alpha(e.fin());
Draw.rect("circle", e.x + x, e.y + y, len, len); Draw.rect("circle", e.x + x, e.y + y, len, len);
Draw.reset(); Draw.reset();
}); });
}), }),
laserspark = new Effect(14, e -> { laserspark = new Effect(14, e -> {
Angles.randLenVectors(e.id, 8, 1f + e.ifract()*11f, (x, y)->{ Angles.randLenVectors(e.id, 8, 1f + e.fout()*11f, (x, y)->{
float len = 1f+e.fract()*5f; float len = 1f+e.fin()*5f;
Draw.color(Color.WHITE, Color.CORAL, e.ifract()); Draw.color(Color.WHITE, Color.CORAL, e.fout());
Draw.alpha(e.ifract()/1.3f); Draw.alpha(e.fout()/1.3f);
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len); Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len);
Draw.reset(); Draw.reset();
}); });
}), }),
shellsmoke = new Effect(20, e -> { shellsmoke = new Effect(20, e -> {
Angles.randLenVectors(e.id, 8, 3f + e.ifract()*17f, (x, y)->{ Angles.randLenVectors(e.id, 8, 3f + e.fout()*17f, (x, y)->{
float size = 2f+e.fract()*5f; float size = 2f+e.fin()*5f;
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
}), }),
blastsmoke = new Effect(26, e -> { blastsmoke = new Effect(26, e -> {
Angles.randLenVectors(e.id, 12, 1f + e.ifract()*23f, (x, y)->{ Angles.randLenVectors(e.id, 12, 1f + e.fout()*23f, (x, y)->{
float size = 2f+e.fract()*6f; float size = 2f+e.fin()*6f;
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
}), }),
lava = new Effect(18, e -> { lava = new Effect(18, e -> {
Angles.randLenVectors(e.id, 3, 1f + e.ifract()*10f, (x, y)->{ Angles.randLenVectors(e.id, 3, 1f + e.fout()*10f, (x, y)->{
float size = e.sfract()*4f; float size = e.finpow()*4f;
Draw.color(Color.ORANGE, Color.GRAY, e.ifract()); Draw.color(Color.ORANGE, Color.GRAY, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
@@ -222,194 +222,194 @@ public class Fx{
lavabubble = new Effect(45f, e -> { lavabubble = new Effect(45f, e -> {
Draw.color(Color.ORANGE); Draw.color(Color.ORANGE);
float scl = 0.35f; float scl = 0.35f;
Lines.stroke(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl)); Lines.stroke(1f - Mathf.clamp(e.fout() - (1f-scl)) * (1f/scl));
Lines.circle(e.x, e.y, e.ifract()*4f); Lines.circle(e.x, e.y, e.fout()*4f);
Draw.reset(); Draw.reset();
}), }),
oilbubble = new Effect(64f, e -> { oilbubble = new Effect(64f, e -> {
Draw.color(Color.DARK_GRAY); Draw.color(Color.DARK_GRAY);
float scl = 0.25f; float scl = 0.25f;
Lines.stroke(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl)); Lines.stroke(1f - Mathf.clamp(e.fout() - (1f-scl)) * (1f/scl));
Lines.circle(e.x, e.y, e.ifract()*3f); Lines.circle(e.x, e.y, e.fout()*3f);
Draw.reset(); Draw.reset();
}), }),
shellexplosion = new Effect(9, e -> { shellexplosion = new Effect(9, e -> {
Lines.stroke(2f - e.ifract()*1.7f); Lines.stroke(2f - e.fout()*1.7f);
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract()); Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fout());
Lines.circle(e.x, e.y, 3f + e.ifract() * 9f); Lines.circle(e.x, e.y, 3f + e.fout() * 9f);
Draw.reset(); Draw.reset();
}), }),
blastexplosion = new Effect(14, e -> { blastexplosion = new Effect(14, e -> {
Lines.stroke(1.2f - e.ifract()); Lines.stroke(1.2f - e.fout());
Draw.color(Color.WHITE, lightOrange, e.ifract()); Draw.color(Color.WHITE, lightOrange, e.fout());
Lines.circle(e.x, e.y, 1.5f + e.ifract() * 9f); Lines.circle(e.x, e.y, 1.5f + e.fout() * 9f);
Draw.reset(); Draw.reset();
}), }),
place = new Effect(16, e -> { place = new Effect(16, e -> {
Lines.stroke(3f - e.ifract() * 2f); Lines.stroke(3f - e.fout() * 2f);
Lines.square(e.x, e.y, tilesize / 2f + e.ifract() * 3f); Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 3f);
Draw.reset(); Draw.reset();
}), }),
dooropen = new Effect(10, e -> { dooropen = new Effect(10, e -> {
Lines.stroke(e.fract() * 1.6f); Lines.stroke(e.fin() * 1.6f);
Lines.square(e.x, e.y, tilesize / 2f + e.ifract() * 2f); Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 2f);
Draw.reset(); Draw.reset();
}), }),
doorclose= new Effect(10, e -> { doorclose= new Effect(10, e -> {
Lines.stroke(e.fract() * 1.6f); Lines.stroke(e.fin() * 1.6f);
Lines.square(e.x, e.y, tilesize / 2f + e.fract() * 2f); Lines.square(e.x, e.y, tilesize / 2f + e.fin() * 2f);
Draw.reset(); Draw.reset();
}), }),
dooropenlarge = new Effect(10, e -> { dooropenlarge = new Effect(10, e -> {
Lines.stroke(e.fract() * 1.6f); Lines.stroke(e.fin() * 1.6f);
Lines.square(e.x, e.y, tilesize + e.ifract() * 2f); Lines.square(e.x, e.y, tilesize + e.fout() * 2f);
Draw.reset(); Draw.reset();
}), }),
doorcloselarge = new Effect(10, e -> { doorcloselarge = new Effect(10, e -> {
Lines.stroke(e.fract() * 1.6f); Lines.stroke(e.fin() * 1.6f);
Lines.square(e.x, e.y, tilesize + e.fract() * 2f); Lines.square(e.x, e.y, tilesize + e.fin() * 2f);
Draw.reset(); Draw.reset();
}), }),
purify = new Effect(10, e -> { purify = new Effect(10, e -> {
Draw.color(Color.ROYAL, Color.GRAY, e.ifract()); Draw.color(Color.ROYAL, Color.GRAY, e.fout());
Lines.stroke(2f); Lines.stroke(2f);
Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); Lines.spikes(e.x, e.y, e.fout() * 4f, 2, 6);
Draw.reset(); Draw.reset();
}), }),
purifyoil = new Effect(10, e -> { purifyoil = new Effect(10, e -> {
Draw.color(Color.BLACK, Color.GRAY, e.ifract()); Draw.color(Color.BLACK, Color.GRAY, e.fout());
Lines.stroke(2f); Lines.stroke(2f);
Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); Lines.spikes(e.x, e.y, e.fout() * 4f, 2, 6);
Draw.reset(); Draw.reset();
}), }),
purifystone = new Effect(10, e -> { purifystone = new Effect(10, e -> {
Draw.color(Color.ORANGE, Color.GRAY, e.ifract()); Draw.color(Color.ORANGE, Color.GRAY, e.fout());
Lines.stroke(2f); Lines.stroke(2f);
Lines.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); Lines.spikes(e.x, e.y, e.fout() * 4f, 2, 6);
Draw.reset(); Draw.reset();
}), }),
generate = new Effect(11, e -> { generate = new Effect(11, e -> {
Draw.color(Color.ORANGE, Color.YELLOW, e.ifract()); Draw.color(Color.ORANGE, Color.YELLOW, e.fout());
Lines.stroke(1f); Lines.stroke(1f);
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); Lines.spikes(e.x, e.y, e.fout() * 5f, 2, 8);
Draw.reset(); Draw.reset();
}), }),
spark = new Effect(10, e -> { spark = new Effect(10, e -> {
Lines.stroke(1f); Lines.stroke(1f);
Draw.color(Color.WHITE, Color.GRAY, e.ifract()); Draw.color(Color.WHITE, Color.GRAY, e.fout());
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); Lines.spikes(e.x, e.y, e.fout() * 5f, 2, 8);
Draw.reset(); Draw.reset();
}), }),
sparkbig = new Effect(11, e -> { sparkbig = new Effect(11, e -> {
Lines.stroke(1f); Lines.stroke(1f);
Draw.color(lightRed, Color.GRAY, e.ifract()); Draw.color(lightRed, Color.GRAY, e.fout());
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2.3f, 8); Lines.spikes(e.x, e.y, e.fout() * 5f, 2.3f, 8);
Draw.reset(); Draw.reset();
}), }),
smelt = new Effect(10, e -> { smelt = new Effect(10, e -> {
Lines.stroke(1f); Lines.stroke(1f);
Draw.color(Color.YELLOW, Color.RED, e.ifract()); Draw.color(Color.YELLOW, Color.RED, e.fout());
Lines.spikes(e.x, e.y, e.ifract() * 5f, 1f, 8); Lines.spikes(e.x, e.y, e.fout() * 5f, 1f, 8);
Draw.reset(); Draw.reset();
}), }),
breakBlock = new Effect(12, e -> { breakBlock = new Effect(12, e -> {
Lines.stroke(2f); Lines.stroke(2f);
Draw.color(Color.WHITE, Colors.get("break"), e.ifract()); Draw.color(Color.WHITE, Colors.get("break"), e.fout());
Lines.spikes(e.x, e.y, e.ifract() * 6f, 2, 5, 90); Lines.spikes(e.x, e.y, e.fout() * 6f, 2, 5, 90);
Draw.reset(); Draw.reset();
}), }),
hit = new Effect(10, e -> { hit = new Effect(10, e -> {
Lines.stroke(1f); Lines.stroke(1f);
Draw.color(Color.WHITE, Color.ORANGE, e.ifract()); Draw.color(Color.WHITE, Color.ORANGE, e.fout());
Lines.spikes(e.x, e.y, e.ifract() * 3f, 2, 8); Lines.spikes(e.x, e.y, e.fout() * 3f, 2, 8);
Draw.reset(); Draw.reset();
}), }),
laserhit = new Effect(10, e -> { laserhit = new Effect(10, e -> {
Lines.stroke(1f); Lines.stroke(1f);
Draw.color(Color.WHITE, Color.SKY, e.ifract()); Draw.color(Color.WHITE, Color.SKY, e.fout());
Lines.spikes(e.x, e.y, e.ifract() * 2f, 2, 6); Lines.spikes(e.x, e.y, e.fout() * 2f, 2, 6);
Draw.reset(); Draw.reset();
}), }),
shieldhit = new Effect(9, e -> { shieldhit = new Effect(9, e -> {
Lines.stroke(1f); Lines.stroke(1f);
Draw.color(Color.WHITE, Color.SKY, e.ifract()); Draw.color(Color.WHITE, Color.SKY, e.fout());
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 6); Lines.spikes(e.x, e.y, e.fout() * 5f, 2, 6);
Lines.stroke(4f*e.fract()); Lines.stroke(4f*e.fin());
Lines.circle(e.x, e.y, e.ifract()*14f); Lines.circle(e.x, e.y, e.fout()*14f);
Draw.reset(); Draw.reset();
}), }),
laserShoot = new Effect(8, e -> { laserShoot = new Effect(8, e -> {
Draw.color(Color.WHITE, lightOrange, e.ifract()); Draw.color(Color.WHITE, lightOrange, e.fout());
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 6f, 2f, 0.8f); Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fin(), 6f, 2f, 0.8f);
Draw.reset(); Draw.reset();
}), }),
spreadShoot = new Effect(12, e -> { spreadShoot = new Effect(12, e -> {
Draw.color(Color.WHITE, Color.PURPLE, e.ifract()); Draw.color(Color.WHITE, Color.PURPLE, e.fout());
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 9f, 3.5f, 0.8f); Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fin(), 9f, 3.5f, 0.8f);
Draw.reset(); Draw.reset();
}), }),
clusterShoot = new Effect(12, e -> { clusterShoot = new Effect(12, e -> {
Draw.color(Color.WHITE, lightOrange, e.ifract()); Draw.color(Color.WHITE, lightOrange, e.fout());
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2.5f, 0.7f); Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fin(), 10f, 2.5f, 0.7f);
Draw.reset(); Draw.reset();
}), }),
vulcanShoot = new Effect(8, e -> { vulcanShoot = new Effect(8, e -> {
Draw.color(lighterOrange, lightOrange, e.ifract()); Draw.color(lighterOrange, lightOrange, e.fout());
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2f, 0.7f); Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fin(), 10f, 2f, 0.7f);
Draw.reset(); Draw.reset();
}), }),
shockShoot = new Effect(8, e -> { shockShoot = new Effect(8, e -> {
Draw.color(Color.WHITE, Color.ORANGE, e.ifract()); Draw.color(Color.WHITE, Color.ORANGE, e.fout());
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 14f, 4f, 0.8f); Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fin(), 14f, 4f, 0.8f);
Draw.reset(); Draw.reset();
}), }),
beamShoot = new Effect(8, e -> { beamShoot = new Effect(8, e -> {
Draw.color(beamLight, beam, e.ifract()); Draw.color(beamLight, beam, e.fout());
Shapes.lineShot(e.x, e.y, e.rotation - 70, 3, e.fract(), 12f, 1f, 0.5f); Shapes.lineShot(e.x, e.y, e.rotation - 70, 3, e.fin(), 12f, 1f, 0.5f);
Shapes.lineShot(e.x, e.y, e.rotation + 70, 3, e.fract(), 12f, 1f, 0.5f); Shapes.lineShot(e.x, e.y, e.rotation + 70, 3, e.fin(), 12f, 1f, 0.5f);
Draw.reset(); Draw.reset();
}), }),
beamhit = new Effect(8, e -> { beamhit = new Effect(8, e -> {
Draw.color(beamLight, beam, e.ifract()); Draw.color(beamLight, beam, e.fout());
Lines.stroke(e.fract()*3f+0.5f); Lines.stroke(e.fin()*3f+0.5f);
Lines.circle(e.x, e.y, e.ifract()*8f); Lines.circle(e.x, e.y, e.fout()*8f);
Lines.spikes(e.x, e.y, e.ifract()*6f, 2f, 4, 45); Lines.spikes(e.x, e.y, e.fout()*6f, 2f, 4, 45);
Draw.reset(); Draw.reset();
}), }),
titanExplosion = new Effect(11, 48f, e -> { titanExplosion = new Effect(11, 48f, e -> {
Lines.stroke(2f*e.fract()+0.5f); Lines.stroke(2f*e.fin()+0.5f);
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract()); Draw.color(Color.WHITE, Color.DARK_GRAY, e.finpow());
Lines.circle(e.x, e.y, 5f + e.powfract() * 8f); Lines.circle(e.x, e.y, 5f + e.finpow() * 8f);
Draw.color(e.ifract() < 0.5f ? whiteOrange : Color.DARK_GRAY); Draw.color(e.fout() < 0.5f ? whiteOrange : Color.DARK_GRAY);
float rad = e.fract()*10f + 5f; float rad = e.fin()*10f + 5f;
Angles.randLenVectors(e.id, 5, 9f, (x, y)->{ Angles.randLenVectors(e.id, 5, 9f, (x, y)->{
Draw.rect("circle2", e.x + x, e.y + y, rad, rad); Draw.rect("circle2", e.x + x, e.y + y, rad, rad);
}); });
@@ -418,12 +418,12 @@ public class Fx{
}), }),
explosion = new Effect(11, e -> { explosion = new Effect(11, e -> {
Lines.stroke(2f*e.fract()+0.5f); Lines.stroke(2f*e.fin()+0.5f);
Draw.color(Color.WHITE, Color.DARK_GRAY, e.powfract()); Draw.color(Color.WHITE, Color.DARK_GRAY, e.finpow());
Lines.circle(e.x, e.y, 5f + e.powfract() * 6f); Lines.circle(e.x, e.y, 5f + e.finpow() * 6f);
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY); Draw.color(e.fout() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
float rad = e.fract()*10f + 5f; float rad = e.fin()*10f + 5f;
Angles.randLenVectors(e.id, 5, 8f, (x, y)->{ Angles.randLenVectors(e.id, 5, 8f, (x, y)->{
Draw.rect("circle2", e.x + x, e.y + y, rad, rad); Draw.rect("circle2", e.x + x, e.y + y, rad, rad);
}); });
@@ -433,19 +433,19 @@ public class Fx{
blockexplosion = new Effect(13, e -> { blockexplosion = new Effect(13, e -> {
Angles.randLenVectors(e.id+1, 8, 5f + e.ifract()*11f, (x, y)->{ Angles.randLenVectors(e.id+1, 8, 5f + e.fout()*11f, (x, y)->{
float size = 2f+e.fract()*8f; float size = 2f+e.fin()*8f;
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract()); Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.fout());
Draw.rect("circle", e.x + x, e.y + y, size, size); Draw.rect("circle", e.x + x, e.y + y, size, size);
Draw.reset(); Draw.reset();
}); });
Lines.stroke(2f*e.fract()+0.4f); Lines.stroke(2f*e.fin()+0.4f);
Draw.color(Color.WHITE, Color.ORANGE, e.powfract()); Draw.color(Color.WHITE, Color.ORANGE, e.finpow());
Lines.circle(e.x, e.y, 2f + e.powfract() * 9f); Lines.circle(e.x, e.y, 2f + e.finpow() * 9f);
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY); Draw.color(e.fout() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
float rad = e.fract()*10f + 2f; float rad = e.fin()*10f + 2f;
Angles.randLenVectors(e.id, 5, 8f, (x, y)->{ Angles.randLenVectors(e.id, 5, 8f, (x, y)->{
Draw.rect("circle2", e.x + x, e.y + y, rad, rad); Draw.rect("circle2", e.x + x, e.y + y, rad, rad);
}); });
@@ -454,53 +454,53 @@ public class Fx{
}), }),
clusterbomb = new Effect(10f, e -> { clusterbomb = new Effect(10f, e -> {
Draw.color(Color.WHITE, lightOrange, e.ifract()); Draw.color(Color.WHITE, lightOrange, e.fout());
Lines.stroke(e.fract()*1.5f); Lines.stroke(e.fin()*1.5f);
Lines.poly(e.x, e.y, 4, e.fract()*8f); Lines.poly(e.x, e.y, 4, e.fin()*8f);
Lines.circle(e.x, e.y, e.ifract()*14f); Lines.circle(e.x, e.y, e.fout()*14f);
Draw.reset(); Draw.reset();
}), }),
coreexplosion = new Effect(13, e -> { coreexplosion = new Effect(13, e -> {
Lines.stroke(3f-e.ifract()*2f); Lines.stroke(3f-e.fout()*2f);
Draw.color(Color.ORANGE, Color.WHITE, e.ifract()); Draw.color(Color.ORANGE, Color.WHITE, e.fout());
Lines.spikes(e.x, e.y, 5f + e.ifract() * 40f, 6, 6); Lines.spikes(e.x, e.y, 5f + e.fout() * 40f, 6, 6);
Lines.circle(e.x, e.y, 4f + e.ifract() * 40f); Lines.circle(e.x, e.y, 4f + e.fout() * 40f);
Draw.reset(); Draw.reset();
}), }),
smoke = new Effect(100, e -> { smoke = new Effect(100, e -> {
Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.ifract()); Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.fout());
float size = 7f-e.ifract()*7f; float size = 7f-e.fout()*7f;
Draw.rect("circle", e.x, e.y, size, size); Draw.rect("circle", e.x, e.y, size, size);
Draw.reset(); Draw.reset();
}), }),
railsmoke = new Effect(30, e -> { railsmoke = new Effect(30, e -> {
Draw.color(Color.LIGHT_GRAY, Color.WHITE, e.ifract()); Draw.color(Color.LIGHT_GRAY, Color.WHITE, e.fout());
float size = e.fract()*4f; float size = e.fin()*4f;
Draw.rect("circle", e.x, e.y, size, size); Draw.rect("circle", e.x, e.y, size, size);
Draw.reset(); Draw.reset();
}), }),
chainsmoke = new Effect(30, e -> { chainsmoke = new Effect(30, e -> {
Draw.color(lightGray); Draw.color(lightGray);
float size = e.fract()*4f; float size = e.fin()*4f;
Draw.rect("circle", e.x, e.y, size, size); Draw.rect("circle", e.x, e.y, size, size);
Draw.reset(); Draw.reset();
}), }),
dashsmoke = new Effect(30, e -> { dashsmoke = new Effect(30, e -> {
Draw.color(Color.CORAL, Color.GRAY, e.ifract()); Draw.color(Color.CORAL, Color.GRAY, e.fout());
float size = e.fract()*4f; float size = e.fin()*4f;
Draw.rect("circle", e.x, e.y, size, size); Draw.rect("circle", e.x, e.y, size, size);
Draw.reset(); Draw.reset();
}), }),
spawn = new Effect(23, e -> { spawn = new Effect(23, e -> {
Lines.stroke(2f); Lines.stroke(2f);
Draw.color(Color.DARK_GRAY, Color.SCARLET, e.ifract()); Draw.color(Color.DARK_GRAY, Color.SCARLET, e.fout());
Lines.circle(e.x, e.y, 7f - e.ifract() * 6f); Lines.circle(e.x, e.y, 7f - e.fout() * 6f);
Draw.reset(); Draw.reset();
}), }),
@@ -512,7 +512,7 @@ public class Fx{
Draw.reset(); Draw.reset();
}), }),
transfer = new Effect(20, e -> { transfer = new Effect(20, e -> {
Draw.color(Color.SCARLET, Color.CLEAR, e.fract()); Draw.color(Color.SCARLET, Color.CLEAR, e.fin());
Lines.square(e.x, e.y, 4); Lines.square(e.x, e.y, 4);
Lines.lineAngle(e.x, e.y, e.rotation, 5f); Lines.lineAngle(e.x, e.y, e.rotation, 5f);
Draw.reset(); Draw.reset();

View File

@@ -85,11 +85,11 @@ public enum PlaceMode{
if(tile != null && control.input().validBreak(tilex, tiley)){ if(tile != null && control.input().validBreak(tilex, tiley)){
if(tile.isLinked()) if(tile.isLinked())
tile = tile.getLinked(); tile = tile.getLinked();
float fract = control.input().breaktime / tile.getBreakTime(); float fin = control.input().breaktime / tile.getBreakTime();
if(android && control.input().breaktime > 0){ if(android && control.input().breaktime > 0){
Draw.color(Colors.get("breakStart"), Colors.get("break"), fract); Draw.color(Colors.get("breakStart"), Colors.get("break"), fin);
Lines.poly(tile.drawx(), tile.drawy(), 25, 4 + (1f - fract) * 26); Lines.poly(tile.drawx(), tile.drawy(), 25, 4 + (1f - fin) * 26);
} }
Draw.reset(); Draw.reset();
} }

View File

@@ -186,7 +186,7 @@ public class Save12 extends SaveFileVersion {
stream.writeFloat(Vars.player.x); //player x/y stream.writeFloat(Vars.player.x); //player x/y
stream.writeFloat(Vars.player.y); stream.writeFloat(Vars.player.y);
stream.writeInt(Vars.player.health); //player health stream.writeInt((int)Vars.player.health); //player health
stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons
@@ -228,7 +228,7 @@ public class Save12 extends SaveFileVersion {
stream.writeFloat(enemy.x); //x stream.writeFloat(enemy.x); //x
stream.writeFloat(enemy.y); //y stream.writeFloat(enemy.y); //y
stream.writeByte(enemy.tier); //tier stream.writeByte(enemy.tier); //tier
stream.writeInt(enemy.health); //health stream.writeInt((int)enemy.health); //health
} }
//--MAP DATA-- //--MAP DATA--

View File

@@ -200,7 +200,7 @@ public class Save13 extends SaveFileVersion {
stream.writeFloat(Vars.player.x); //player x/y stream.writeFloat(Vars.player.x); //player x/y
stream.writeFloat(Vars.player.y); stream.writeFloat(Vars.player.y);
stream.writeInt(Vars.player.health); //player health stream.writeInt((int)Vars.player.health); //player health
stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons
@@ -241,7 +241,7 @@ public class Save13 extends SaveFileVersion {
stream.writeFloat(enemy.x); //x stream.writeFloat(enemy.x); //x
stream.writeFloat(enemy.y); //y stream.writeFloat(enemy.y); //y
stream.writeByte(enemy.tier); //tier stream.writeByte(enemy.tier); //tier
stream.writeShort(enemy.health); //health stream.writeShort((short)enemy.health); //health
} }
//--MAP DATA-- //--MAP DATA--

View File

@@ -225,7 +225,7 @@ public class Save14 extends SaveFileVersion{
stream.writeFloat(Vars.player.x); //player x/y stream.writeFloat(Vars.player.x); //player x/y
stream.writeFloat(Vars.player.y); stream.writeFloat(Vars.player.y);
stream.writeInt(Vars.player.health); //player health stream.writeInt((int)Vars.player.health); //player health
stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons
@@ -267,7 +267,7 @@ public class Save14 extends SaveFileVersion{
stream.writeFloat(enemy.x); //x stream.writeFloat(enemy.x); //x
stream.writeFloat(enemy.y); //y stream.writeFloat(enemy.y); //y
stream.writeByte(enemy.tier); //tier stream.writeByte(enemy.tier); //tier
stream.writeShort(enemy.health); //health stream.writeShort((short)enemy.health); //health
} }
//--MAP DATA-- //--MAP DATA--

View File

@@ -244,7 +244,7 @@ public class Save15 extends SaveFileVersion {
stream.writeFloat(player.x); //player x/y stream.writeFloat(player.x); //player x/y
stream.writeFloat(player.y); stream.writeFloat(player.y);
stream.writeInt(player.health); //player health stream.writeInt((int)player.health); //player health
stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons stream.writeByte(control.upgrades().getWeapons().size - 1); //amount of weapons
@@ -292,7 +292,7 @@ public class Save15 extends SaveFileVersion {
stream.writeFloat(enemy.x); //x stream.writeFloat(enemy.x); //x
stream.writeFloat(enemy.y); //y stream.writeFloat(enemy.y); //y
stream.writeByte(enemy.tier); //tier stream.writeByte(enemy.tier); //tier
stream.writeShort(enemy.health); //health stream.writeShort((short)enemy.health); //health
} }
//--MAP DATA-- //--MAP DATA--

View File

@@ -63,10 +63,10 @@ public class ItemPowerGenerator extends Generator{
PowerEntity entity = tile.entity(); PowerEntity entity = tile.entity();
float maxPower = Math.min(powerCapacity - entity.power, powerOutput * Timers.delta()); float maxPower = Math.min(powerCapacity - entity.power, powerOutput * Timers.delta());
float mfract = maxPower/(powerOutput); float mfin = maxPower/(powerOutput);
if(entity.time > 0f){ if(entity.time > 0f){
entity.time -= 1f/itemDuration*mfract; entity.time -= 1f/itemDuration*mfin;
entity.power += maxPower; entity.power += maxPower;
entity.time = Mathf.clamp(entity.time); entity.time = Mathf.clamp(entity.time);
} }