summaryrefslogtreecommitdiff
path: root/src/simulation/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-25 14:32:05 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-25 14:32:05 (GMT)
commit2189d298a7ae718b9d483cc3925bcb8fee854281 (patch)
treeb5922ae28bb578b926c2856f1681f1b08392777f /src/simulation/elements
parentfad383f3923cc04fb8b2ecd7a72cf5406832cf5d (diff)
downloadpowder-2189d298a7ae718b9d483cc3925bcb8fee854281.zip
powder-2189d298a7ae718b9d483cc3925bcb8fee854281.tar.gz
TPT: Move INST flood fill into a separate function 36de2f19f5
Diffstat (limited to 'src/simulation/elements')
-rw-r--r--src/simulation/elements/FRZW.cpp2
-rw-r--r--src/simulation/elements/FRZZ.cpp16
-rw-r--r--src/simulation/elements/ICEI.cpp2
-rw-r--r--src/simulation/elements/PLNT.cpp2
-rw-r--r--src/simulation/elements/SPRK.cpp2
-rw-r--r--src/simulation/elements/VINE.cpp1
6 files changed, 14 insertions, 11 deletions
diff --git a/src/simulation/elements/FRZW.cpp b/src/simulation/elements/FRZW.cpp
index 8ba954a..5bdbb21 100644
--- a/src/simulation/elements/FRZW.cpp
+++ b/src/simulation/elements/FRZW.cpp
@@ -28,7 +28,7 @@ Element_FRZW::Element_FRZW()
Temperature = 120.0f;
HeatConduct = 29;
- Description = "FREEZE WATER";
+ Description = "Freeze water. Hybrid liquid formed when Freeze powder melts.";
State = ST_LIQUID;
Properties = TYPE_LIQUID||PROP_LIFE_DEC;
diff --git a/src/simulation/elements/FRZZ.cpp b/src/simulation/elements/FRZZ.cpp
index 8162672..47a5c0f 100644
--- a/src/simulation/elements/FRZZ.cpp
+++ b/src/simulation/elements/FRZZ.cpp
@@ -26,21 +26,21 @@ Element_FRZZ::Element_FRZZ()
Weight = 50;
- Temperature = 90.0f;
+ Temperature = 253.15f;
HeatConduct = 46;
- Description = "FREEZE";
+ Description = "Freeze powder. When melted, forms ice that always cools. Spreads with regular water.";
State = ST_SOLID;
Properties = TYPE_PART;
LowPressure = IPL;
LowPressureTransition = NT;
- HighPressure = IPH;
- HighPressureTransition = NT;
- LowTemperature = ITL;
- LowTemperatureTransition = NT;
- HighTemperature = ITH;
- HighTemperatureTransition = NT;
+ HighPressure = 1.8f;
+ HighPressureTransition = PT_SNOW;
+ LowTemperature = 50.0f;
+ LowTemperatureTransition = PT_ICEI;
+ HighTemperature = 273.15;
+ HighTemperatureTransition = PT_WATR;
Update = &Element_FRZZ::update;
diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp
index 852b646..c1d4e54 100644
--- a/src/simulation/elements/ICEI.cpp
+++ b/src/simulation/elements/ICEI.cpp
@@ -66,6 +66,8 @@ int Element_ICEI::update(UPDATE_FUNC_ARGS)
sim->part_change_type(i,x,y,PT_SLTW);
sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
}
+ if (((r&0xFF)==PT_FRZZ) && (parts[i].ctype=PT_FRZW) && 1>(rand()%1000))
+ sim->part_change_type(r>>8,x+rx,y+ry,PT_ICEI);
}
return 0;
}
diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp
index 91d29d0..62178af 100644
--- a/src/simulation/elements/PLNT.cpp
+++ b/src/simulation/elements/PLNT.cpp
@@ -73,7 +73,7 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS)
sim->kill_part(r>>8);
parts[i].life = rand()%60 + 60;
}
- else if ((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(rx+ry)<=2 && sim->VINE_MODE)
+ else if ( ((r&0xFF)==PT_WOOD) && (1>rand()%20) && (abs(rx+ry)<=2) && (sim->VINE_MODE || parts[i].tmp==1) )
{
int nnx = rand()%3 -1;
int nny = rand()%3 -1;
diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp
index feb825b..e670cae 100644
--- a/src/simulation/elements/SPRK.cpp
+++ b/src/simulation/elements/SPRK.cpp
@@ -243,7 +243,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
else if (rt==PT_INST) {
if (parts[r>>8].life==0 && parts[i].life<4)
{
- sim->FloodParts(x+rx,y+ry,PT_SPRK,PT_INST,-1, 0);//spark the wire
+ sim->FloodINST(x+rx,y+ry,PT_SPRK,PT_INST);//spark the wire
}
}
else if (parts[r>>8].life==0 && parts[i].life<4) {
diff --git a/src/simulation/elements/VINE.cpp b/src/simulation/elements/VINE.cpp
index 991dfc4..04c90bf 100644
--- a/src/simulation/elements/VINE.cpp
+++ b/src/simulation/elements/VINE.cpp
@@ -60,6 +60,7 @@ int Element_VINE::update(UPDATE_FUNC_ARGS)
np = sim->create_part(-1,x+rx,y+ry,PT_VINE);
if (np<0) return 0;
parts[np].temp = parts[i].temp;
+ parts[i].tmp = 1;
sim->part_change_type(i,x,y,PT_PLNT);
}
}