Added support for non-reactive liquids

This commit is contained in:
Anuken
2022-08-31 08:08:07 -04:00
parent 8f4251db3a
commit fb24953dc2
3 changed files with 16 additions and 11 deletions

View File

@@ -54,6 +54,7 @@ public class Liquids{
spreadTarget = Liquids.water; spreadTarget = Liquids.water;
moveThroughBlocks = true; moveThroughBlocks = true;
incinerable = true; incinerable = true;
blockReactive = false;
canStayOn.addAll(water, oil, cryofluid); canStayOn.addAll(water, oil, cryofluid);
colorFrom = Color.valueOf("e8803f"); colorFrom = Color.valueOf("e8803f");

View File

@@ -855,6 +855,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
float fx = (x + next.x) / 2f, fy = (y + next.y) / 2f; float fx = (x + next.x) / 2f, fy = (y + next.y) / 2f;
Liquid other = next.liquids.current(); Liquid other = next.liquids.current();
if(other.blockReactive && liquid.blockReactive){
//TODO liquid reaction handler for extensibility //TODO liquid reaction handler for extensibility
if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){ if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){
damageContinuous(1); damageContinuous(1);
@@ -870,6 +871,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
} }
} }
} }
}
return 0; return 0;
} }

View File

@@ -44,6 +44,8 @@ public class Liquid extends UnlockableContent implements Senseable{
public float viscosity = 0.5f; public float viscosity = 0.5f;
/** how prone to exploding this liquid is, when heated. 0 = nothing, 1 = nuke */ /** how prone to exploding this liquid is, when heated. 0 = nothing, 1 = nuke */
public float explosiveness; public float explosiveness;
/** whether this fluid reacts in blocks at all (e.g. slag with water) */
public boolean blockReactive = true;
/** if false, this liquid cannot be a coolant */ /** if false, this liquid cannot be a coolant */
public boolean coolant = true; public boolean coolant = true;
/** if true, this liquid can move through blocks as a puddle. */ /** if true, this liquid can move through blocks as a puddle. */