Boiling point implementation
This commit is contained in:
@@ -32,6 +32,13 @@ public class Puddles{
|
||||
public static void deposit(Tile tile, Tile source, Liquid liquid, float amount, boolean initial){
|
||||
if(tile == null) return;
|
||||
|
||||
if(liquid.willBoil()){
|
||||
if(Mathf.chanceDelta(0.16f)){
|
||||
liquid.vaporEffect.at((tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f, liquid.gasColor);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(tile.floor().isLiquid && !canStayOn(liquid, tile.floor().liquidDrop)){
|
||||
reactPuddle(tile.floor().liquidDrop, liquid, amount, tile,
|
||||
(tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f);
|
||||
|
||||
@@ -2,6 +2,7 @@ package mindustry.entities.bullet;
|
||||
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
@@ -16,6 +17,7 @@ public class LiquidBulletType extends BulletType{
|
||||
public Liquid liquid;
|
||||
public float puddleSize = 6f;
|
||||
public float orbSize = 3f;
|
||||
public float boilTime = 15f;
|
||||
|
||||
public LiquidBulletType(@Nullable Liquid liquid){
|
||||
super(3.5f, 0);
|
||||
@@ -52,6 +54,12 @@ public class LiquidBulletType extends BulletType{
|
||||
public void update(Bullet b){
|
||||
super.update(b);
|
||||
|
||||
if(liquid.willBoil() && b.time >= Mathf.randomSeed(b.id, boilTime)){
|
||||
Fx.vaporSmall.at(b.x, b.y, liquid.gasColor);
|
||||
b.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
if(liquid.canExtinguish()){
|
||||
Tile tile = world.tileWorld(b.x, b.y);
|
||||
if(tile != null && Fires.has(tile.x, tile.y)){
|
||||
@@ -65,8 +73,14 @@ public class LiquidBulletType extends BulletType{
|
||||
@Override
|
||||
public void draw(Bullet b){
|
||||
super.draw(b);
|
||||
Draw.color(liquid.color, Color.white, b.fout() / 100f);
|
||||
Fill.circle(b.x, b.y, orbSize);
|
||||
if(liquid.willBoil()){
|
||||
Draw.color(liquid.color, Tmp.c3.set(liquid.gasColor).a(0.4f), b.time / Mathf.randomSeed(b.id, boilTime));
|
||||
Fill.circle(b.x, b.y, orbSize * (b.fin() * 1.1f + 1f));
|
||||
}else{
|
||||
Draw.color(liquid.color, Color.white, b.fout() / 100f);
|
||||
Fill.circle(b.x, b.y, orbSize);
|
||||
}
|
||||
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
@@ -75,7 +89,9 @@ public class LiquidBulletType extends BulletType{
|
||||
super.despawned(b);
|
||||
|
||||
//don't create liquids when the projectile despawns
|
||||
hitEffect.at(b.x, b.y, b.rotation(), liquid.color);
|
||||
if(!liquid.willBoil()){
|
||||
hitEffect.at(b.x, b.y, b.rotation(), liquid.color);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user