Added plasma drill

This commit is contained in:
Anuken 2018-03-31 14:51:24 -04:00
parent 4ff3517343
commit dd0ad495f7
10 changed files with 449 additions and 400 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify.
#Sat Mar 31 13:42:41 EDT 2018
#Sat Mar 31 14:50:44 EDT 2018
version=release
androidBuildCode=757
androidBuildCode=766
name=Mindustry
code=3.4
build=custom build

View File

@ -1,5 +1,6 @@
package io.anuke.mindustry.content.blocks;
import com.badlogic.gdx.graphics.Color;
import io.anuke.mindustry.content.Items;
import io.anuke.mindustry.content.Liquids;
import io.anuke.mindustry.graphics.Fx;
@ -43,7 +44,7 @@ public class ProductionBlocks {
}},
nucleardrill = new Drill("nucleardrill") {{
drillTime = 170;
drillTime = 160;
size = 3;
powerUse = 0.5f;
drawRim = true;
@ -57,19 +58,22 @@ public class ProductionBlocks {
}},
plasmadrill = new Drill("plasmadrill") {{
inputLiquid = Liquids.plasma;
liquidRequired = true;
heatColor = Color.valueOf("ff461b");
//TODO
//inputLiquid = Liquids.plasma;
//liquidRequired = true;
drillTime = 110;
size = 4;
powerUse = 0.7f;
hasLiquids = true;
hasPower = true;
tier = 5;
rotateSpeed = 8f;
rotateSpeed = 9f;
drawRim = true;
updateEffect = Fx.pulverizeRed;
updateEffectChance = 0.03f;
updateEffect = Fx.pulverizeRedder;
updateEffectChance = 0.04f;
drillEffect = Fx.mineHuge;
warmupSpeed = 0.005f;
}},
waterextractor = new SolidPump("waterextractor") {{

View File

@ -204,6 +204,14 @@ public class Fx{
});
}),
pulverizeRedder = new Effect(40, e -> {
Angles.randLenVectors(e.id, 5, 3f + e.ifract()*9f, (x, y)->{
Draw.color(Color.valueOf("ff7b69"), stoneGray, e.ifract());
Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2.5f + 0.5f, 45);
Draw.reset();
});
}),
pulverizeSmall = new Effect(30, e -> {
Angles.randLenVectors(e.id, 3, e.ifract()*5f, (x, y)->{
Draw.color(stoneGray);
@ -400,6 +408,14 @@ public class Fx{
});
}),
mineMassive = new Effect(50, e -> {
Angles.randLenVectors(e.id, 8, 5f + e.ifract()*14f, (x, y)->{
Draw.color(e.color, Color.LIGHT_GRAY, e.ifract());
Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2.5f + 0.5f, 45);
Draw.reset();
});
}),
sparkbig = new Effect(11, e -> {
Lines.stroke(1f);
Draw.color(lightRed, Color.GRAY, e.ifract());

View File

@ -150,16 +150,16 @@ public class Drill extends Block{
}
entity.warmup = Mathf.lerpDelta(entity.warmup, speed, warmupSpeed);
entity.progress += Timers.delta() * multiplier * speed;
entity.progress += Timers.delta() * multiplier * speed * entity.warmup;
if(Mathf.chance(Timers.delta() * updateEffectChance))
if(Mathf.chance(Timers.delta() * updateEffectChance * entity.warmup))
Effects.effect(updateEffect, entity.x + Mathf.range(size*2f), entity.y + Mathf.range(size*2f));
}else{
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, warmupSpeed);
return;
}
if(toAdd.size > 0 && entity.progress >= drillTime + hardnessDrillMultiplier*totalHardness
if(toAdd.size > 0 && entity.progress >= drillTime + hardnessDrillMultiplier*Math.max(totalHardness, 1f)/multiplier
&& tile.entity.inventory.totalItems() < itemCapacity){
int index = entity.index % toAdd.size;
@ -168,7 +168,8 @@ public class Drill extends Block{
entity.index ++;
entity.progress = 0f;
Effects.effect(drillEffect, toAdd.get(index).color, tile.drawx(), tile.drawy());
Effects.effect(drillEffect, toAdd.get(index).color,
entity.x + Mathf.range(size), entity.y + Mathf.range(size));
}
}