mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-13 19:39:04 +07:00
Added nuclear drill / Broke various things
This commit is contained in:
parent
c14fb51eb8
commit
8a80e82b5d
BIN
core/assets-raw/sprites/blocks/production/nucleardrill-rim.png
Normal file
BIN
core/assets-raw/sprites/blocks/production/nucleardrill-rim.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 219 B |
Binary file not shown.
After Width: | Height: | Size: 298 B |
BIN
core/assets-raw/sprites/blocks/production/nucleardrill-top.png
Normal file
BIN
core/assets-raw/sprites/blocks/production/nucleardrill-top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 289 B |
BIN
core/assets-raw/sprites/blocks/production/nucleardrill.png
Normal file
BIN
core/assets-raw/sprites/blocks/production/nucleardrill.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 574 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: 99 KiB |
@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sat Mar 31 11:53:45 EDT 2018
|
#Sat Mar 31 13:42:41 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=751
|
androidBuildCode=757
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.4
|
code=3.4
|
||||||
build=custom build
|
build=custom build
|
||||||
|
@ -74,13 +74,15 @@ public class Recipes {
|
|||||||
new Recipe(production, ProductionBlocks.reinforcedDrill, stack(Items.iron, 25)),
|
new Recipe(production, ProductionBlocks.reinforcedDrill, stack(Items.iron, 25)),
|
||||||
new Recipe(production, ProductionBlocks.steelDrill, stack(Items.iron, 25)),
|
new Recipe(production, ProductionBlocks.steelDrill, stack(Items.iron, 25)),
|
||||||
new Recipe(production, ProductionBlocks.titaniumDrill, stack(Items.iron, 25)),
|
new Recipe(production, ProductionBlocks.titaniumDrill, stack(Items.iron, 25)),
|
||||||
|
new Recipe(production, ProductionBlocks.laserdrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
||||||
|
new Recipe(production, ProductionBlocks.nucleardrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
||||||
|
new Recipe(production, ProductionBlocks.plasmadrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
||||||
//new Recipe(production, ProductionBlocks.leaddrill, stack(Items.iron, 25)),
|
//new Recipe(production, ProductionBlocks.leaddrill, stack(Items.iron, 25)),
|
||||||
//new Recipe(production, ProductionBlocks.coaldrill, stack(Items.iron, 25), stack(Items.iron, 40)),
|
//new Recipe(production, ProductionBlocks.coaldrill, stack(Items.iron, 25), stack(Items.iron, 40)),
|
||||||
//new Recipe(production, ProductionBlocks.titaniumdrill, stack(Items.iron, 50), stack(Items.steel, 50)),
|
//new Recipe(production, ProductionBlocks.titaniumdrill, stack(Items.iron, 50), stack(Items.steel, 50)),
|
||||||
//new Recipe(production, ProductionBlocks.thoriumdrill, stack(Items.iron, 40), stack(Items.steel, 40)),
|
//new Recipe(production, ProductionBlocks.thoriumdrill, stack(Items.iron, 40), stack(Items.steel, 40)),
|
||||||
//new Recipe(production, ProductionBlocks.quartzextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
//new Recipe(production, ProductionBlocks.quartzextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
||||||
new Recipe(production, ProductionBlocks.cultivator, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
new Recipe(production, ProductionBlocks.cultivator, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
||||||
new Recipe(production, ProductionBlocks.laserdrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
|
||||||
new Recipe(production, ProductionBlocks.waterextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
new Recipe(production, ProductionBlocks.waterextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
||||||
new Recipe(production, ProductionBlocks.oilextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
new Recipe(production, ProductionBlocks.oilextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)),
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ public class CraftingBlocks {
|
|||||||
output = Items.sand;
|
output = Items.sand;
|
||||||
health = 80;
|
health = 80;
|
||||||
craftEffect = Fx.pulverize;
|
craftEffect = Fx.pulverize;
|
||||||
craftTime = 70f;
|
craftTime = 60f;
|
||||||
updateEffect = Fx.pulverizeSmall;
|
updateEffect = Fx.pulverizeSmall;
|
||||||
hasInventory = hasPower = true;
|
hasInventory = hasPower = true;
|
||||||
}},
|
}},
|
||||||
|
@ -45,11 +45,15 @@ public class ProductionBlocks {
|
|||||||
nucleardrill = new Drill("nucleardrill") {{
|
nucleardrill = new Drill("nucleardrill") {{
|
||||||
drillTime = 170;
|
drillTime = 170;
|
||||||
size = 3;
|
size = 3;
|
||||||
powerUse = 0.32f;
|
powerUse = 0.5f;
|
||||||
|
drawRim = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
tier = 5;
|
tier = 5;
|
||||||
updateEffect = Fx.pulverizeMedium;
|
updateEffect = Fx.pulverizeRed;
|
||||||
drillEffect = Fx.mineBig;
|
updateEffectChance = 0.03f;
|
||||||
|
drillEffect = Fx.mineHuge;
|
||||||
|
rotateSpeed = 6f;
|
||||||
|
warmupSpeed = 0.01f;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
plasmadrill = new Drill("plasmadrill") {{
|
plasmadrill = new Drill("plasmadrill") {{
|
||||||
@ -57,12 +61,15 @@ public class ProductionBlocks {
|
|||||||
liquidRequired = true;
|
liquidRequired = true;
|
||||||
drillTime = 110;
|
drillTime = 110;
|
||||||
size = 4;
|
size = 4;
|
||||||
powerUse = 0.16f;
|
powerUse = 0.7f;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
tier = 5;
|
tier = 5;
|
||||||
updateEffect = Fx.pulverizeMedium;
|
rotateSpeed = 8f;
|
||||||
drillEffect = Fx.mineBig;
|
drawRim = true;
|
||||||
|
updateEffect = Fx.pulverizeRed;
|
||||||
|
updateEffectChance = 0.03f;
|
||||||
|
drillEffect = Fx.mineHuge;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
waterextractor = new SolidPump("waterextractor") {{
|
waterextractor = new SolidPump("waterextractor") {{
|
||||||
|
5
core/src/io/anuke/mindustry/graphics/BlockFx.java
Normal file
5
core/src/io/anuke/mindustry/graphics/BlockFx.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package io.anuke.mindustry.graphics;
|
||||||
|
|
||||||
|
public class BlockFx {
|
||||||
|
//TODO
|
||||||
|
}
|
5
core/src/io/anuke/mindustry/graphics/ExplosionFx.java
Normal file
5
core/src/io/anuke/mindustry/graphics/ExplosionFx.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package io.anuke.mindustry.graphics;
|
||||||
|
|
||||||
|
public class ExplosionFx {
|
||||||
|
//TODO
|
||||||
|
}
|
@ -196,6 +196,14 @@ public class Fx{
|
|||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
pulverizeRed = new Effect(40, e -> {
|
||||||
|
Angles.randLenVectors(e.id, 5, 3f + e.ifract()*8f, (x, y)->{
|
||||||
|
Draw.color(Color.valueOf("ffa480"), stoneGray, e.ifract());
|
||||||
|
Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45);
|
||||||
|
Draw.reset();
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
|
||||||
pulverizeSmall = new Effect(30, e -> {
|
pulverizeSmall = new Effect(30, e -> {
|
||||||
Angles.randLenVectors(e.id, 3, e.ifract()*5f, (x, y)->{
|
Angles.randLenVectors(e.id, 3, e.ifract()*5f, (x, y)->{
|
||||||
Draw.color(stoneGray);
|
Draw.color(stoneGray);
|
||||||
@ -384,6 +392,14 @@ public class Fx{
|
|||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
mineHuge = new Effect(40, e -> {
|
||||||
|
Angles.randLenVectors(e.id, 8, 5f + e.ifract()*10f, (x, y)->{
|
||||||
|
Draw.color(e.color, Color.LIGHT_GRAY, e.ifract());
|
||||||
|
Fill.poly(e.x + x, e.y + y, 4, e.fract() * 2f + 0.5f, 45);
|
||||||
|
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.ifract());
|
||||||
|
5
core/src/io/anuke/mindustry/graphics/TurretFx.java
Normal file
5
core/src/io/anuke/mindustry/graphics/TurretFx.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package io.anuke.mindustry.graphics;
|
||||||
|
|
||||||
|
public class TurretFx {
|
||||||
|
//TODO
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.world.blocks.types.production;
|
package io.anuke.mindustry.world.blocks.types.production;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import io.anuke.mindustry.content.Liquids;
|
import io.anuke.mindustry.content.Liquids;
|
||||||
@ -13,6 +14,7 @@ import io.anuke.mindustry.world.BlockGroup;
|
|||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Effects.Effect;
|
import io.anuke.ucore.core.Effects.Effect;
|
||||||
|
import io.anuke.ucore.core.Graphics;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
@ -39,6 +41,8 @@ public class Drill extends Block{
|
|||||||
protected boolean liquidRequired = false;
|
protected boolean liquidRequired = false;
|
||||||
/**How many times faster the drill will progress when booster by liquid.*/
|
/**How many times faster the drill will progress when booster by liquid.*/
|
||||||
protected float liquidBoostIntensity = 1.3f;
|
protected float liquidBoostIntensity = 1.3f;
|
||||||
|
/**Speed at which the drill speeds up.*/
|
||||||
|
protected float warmupSpeed = 0.02f;
|
||||||
|
|
||||||
/**Effect played when an item is produced. This is colored.*/
|
/**Effect played when an item is produced. This is colored.*/
|
||||||
protected Effect drillEffect = Fx.mine;
|
protected Effect drillEffect = Fx.mine;
|
||||||
@ -49,6 +53,10 @@ public class Drill extends Block{
|
|||||||
/**Chance the update effect will appear.*/
|
/**Chance the update effect will appear.*/
|
||||||
protected float updateEffectChance = 0.02f;
|
protected float updateEffectChance = 0.02f;
|
||||||
|
|
||||||
|
protected boolean drawRim = false;
|
||||||
|
|
||||||
|
protected Color heatColor = Color.valueOf("ff5512");
|
||||||
|
|
||||||
public Drill(String name) {
|
public Drill(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
update = true;
|
update = true;
|
||||||
@ -62,10 +70,24 @@ public class Drill extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile) {
|
public void draw(Tile tile) {
|
||||||
|
float s = 0.3f;
|
||||||
|
float ts = 0.6f;
|
||||||
|
|
||||||
DrillEntity entity = tile.entity();
|
DrillEntity entity = tile.entity();
|
||||||
|
|
||||||
Draw.rect(name, tile.drawx(), tile.drawy());
|
Draw.rect(name, tile.drawx(), tile.drawy());
|
||||||
|
|
||||||
|
if(drawRim) {
|
||||||
|
Graphics.setAdditiveBlending();
|
||||||
|
Draw.color(heatColor);
|
||||||
|
Draw.alpha(entity.warmup * ts * (1f-s + Mathf.absin(Timers.time(), 3f, s)));
|
||||||
|
Draw.rect(name + "-rim", tile.drawx(), tile.drawy());
|
||||||
|
Draw.color();
|
||||||
|
Graphics.setNormalBlending();
|
||||||
|
}
|
||||||
|
|
||||||
Draw.rect(name + "-rotator", tile.drawx(), tile.drawy(), entity.drillTime * rotateSpeed);
|
Draw.rect(name + "-rotator", tile.drawx(), tile.drawy(), entity.drillTime * rotateSpeed);
|
||||||
|
|
||||||
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
|
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
|
||||||
|
|
||||||
if(!isMultiblock() && isValid(tile)) {
|
if(!isMultiblock() && isValid(tile)) {
|
||||||
@ -127,13 +149,13 @@ public class Drill extends Block{
|
|||||||
speed = liquidBoostIntensity;
|
speed = liquidBoostIntensity;
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, speed, 0.02f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, speed, warmupSpeed);
|
||||||
entity.progress += Timers.delta() * multiplier * speed;
|
entity.progress += Timers.delta() * multiplier * speed;
|
||||||
|
|
||||||
if(Mathf.chance(Timers.delta() * updateEffectChance))
|
if(Mathf.chance(Timers.delta() * updateEffectChance))
|
||||||
Effects.effect(updateEffect, entity.x + Mathf.range(size*2f), entity.y + Mathf.range(size*2f));
|
Effects.effect(updateEffect, entity.x + Mathf.range(size*2f), entity.y + Mathf.range(size*2f));
|
||||||
}else{
|
}else{
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.02f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, warmupSpeed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user