mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-09 07:17:36 +07:00
Dormany cyst item
This commit is contained in:
BIN
core/assets-raw/sprites/items/item-dormant-cyst.png
Normal file
BIN
core/assets-raw/sprites/items/item-dormant-cyst.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 317 B |
@ -401,3 +401,4 @@
|
||||
63308=beryllium|item-beryllium-ui
|
||||
63307=fissile-matter|item-fissile-matter-ui
|
||||
63306=neoplasm|liquid-neoplasm-ui
|
||||
63305=dormant-cyst|item-dormant-cyst-ui
|
||||
|
Binary file not shown.
@ -8,7 +8,7 @@ public class Items implements ContentList{
|
||||
public static Item
|
||||
scrap, copper, lead, graphite, coal, titanium, thorium, silicon, plastanium,
|
||||
phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass,
|
||||
beryllium, fissileMatter;
|
||||
beryllium, fissileMatter, dormantCyst;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
@ -94,7 +94,7 @@ public class Items implements ContentList{
|
||||
}};
|
||||
|
||||
beryllium = new Item("beryllium", Color.valueOf("3a8f64")){{
|
||||
hardness = 4;
|
||||
hardness = 5;
|
||||
cost = 1.3f;
|
||||
}};
|
||||
|
||||
@ -102,5 +102,9 @@ public class Items implements ContentList{
|
||||
hardness = 4;
|
||||
radioactivity = 1.5f;
|
||||
}};
|
||||
|
||||
dormantCyst = new Item("dormant-cyst", Color.valueOf("a5221c")){{
|
||||
flammability = 0.1f;
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,17 @@
|
||||
package mindustry.content;
|
||||
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
|
||||
import static arc.graphics.g2d.Draw.*;
|
||||
|
||||
public class Liquids implements ContentList{
|
||||
public static Liquid water, slag, oil, cryofluid, neoplasm, rovazide;
|
||||
public static Liquid water, slag, oil, cryofluid, neoplasm;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
@ -44,11 +50,17 @@ public class Liquids implements ContentList{
|
||||
temperature = 0.54f;
|
||||
viscosity = 0.65f;
|
||||
flammability = 0.1f;
|
||||
}};
|
||||
|
||||
//rovazide = new Liquid("rovafuel", Color.valueOf("9dde68")){{
|
||||
// flammability = 1.5f;
|
||||
// explosiveness = 3f;
|
||||
//}};
|
||||
Color from = Color.valueOf("f98f4a"), to = Color.valueOf("9e172c");
|
||||
|
||||
//TODO could probably be improved...
|
||||
particleSpacing = 65f;
|
||||
particleEffect = new Effect(40f, e -> {
|
||||
e.lifetime = Mathf.randomSeed(e.id + 2, 80f, 200f) * 3.2f;
|
||||
color(from, to, Mathf.randomSeed(e.id, 1f));
|
||||
|
||||
Fill.circle(e.x, e.y, e.fslope() * Mathf.randomSeed(e.id + 1, 0.6f, 2.4f));
|
||||
}).layer(Layer.debris - 0.5f);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
|
||||
@Import float x, y;
|
||||
@Import boolean added;
|
||||
|
||||
transient float accepting, updateTime, lastRipple = Time.time + Mathf.random(40f);
|
||||
transient float accepting, updateTime, lastRipple = Time.time + Mathf.random(40f), effectTime = Mathf.random(50f);
|
||||
float amount;
|
||||
Tile tile;
|
||||
Liquid liquid;
|
||||
@ -101,6 +101,14 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
|
||||
updateTime = 40f;
|
||||
}
|
||||
|
||||
if(!headless && liquid.particleEffect != Fx.none){
|
||||
if((effectTime += Time.delta) >= liquid.particleSpacing){
|
||||
float size = Mathf.clamp(amount / (maxLiquid / 1.5f)) * 4f;
|
||||
liquid.particleEffect.at(x + Mathf.range(size), y + Mathf.range(size));
|
||||
effectTime = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
updateTime -= Time.delta;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import arc.graphics.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
public class Liquid extends UnlockableContent{
|
||||
@ -25,6 +26,10 @@ public class Liquid extends UnlockableContent{
|
||||
public float explosiveness;
|
||||
/** The associated status effect. */
|
||||
public StatusEffect effect = StatusEffects.none;
|
||||
/** Effect shown in puddles. */
|
||||
public Effect particleEffect = Fx.none;
|
||||
/** Particle effect rate spacing in ticks. */
|
||||
public float particleSpacing = 60f;
|
||||
|
||||
public Liquid(String name, Color color){
|
||||
super(name);
|
||||
|
Reference in New Issue
Block a user