diff options
| author | jacob1 <jfu614@gmail.com> | 2013-03-03 00:07:00 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-03-03 00:07:00 (GMT) |
| commit | 846d7d8064cf84c6b4e55a8a0417e7e605e0d144 (patch) | |
| tree | ff8006377ff9508734e34247347e6efe3c239ed1 /src/simulation/elements | |
| parent | 85cb4b37c93baa3e227fa6a93c8312b9ab0fb6c3 (diff) | |
| download | powder-846d7d8064cf84c6b4e55a8a0417e7e605e0d144.zip powder-846d7d8064cf84c6b4e55a8a0417e7e605e0d144.tar.gz | |
allow NEUT to travel through ICE and SNOW, and for it to turn OIL to GAS (both like inextremely old versions)
Diffstat (limited to 'src/simulation/elements')
| -rw-r--r-- | src/simulation/elements/GAS.cpp | 2 | ||||
| -rw-r--r-- | src/simulation/elements/ICEI.cpp | 2 | ||||
| -rw-r--r-- | src/simulation/elements/NEUT.cpp | 1 | ||||
| -rw-r--r-- | src/simulation/elements/OIL.cpp | 2 | ||||
| -rw-r--r-- | src/simulation/elements/SNOW.cpp | 2 | ||||
| -rw-r--r-- | src/simulation/elements/WOOD.cpp | 11 |
6 files changed, 13 insertions, 7 deletions
diff --git a/src/simulation/elements/GAS.cpp b/src/simulation/elements/GAS.cpp index 4e87b76..45aee8d 100644 --- a/src/simulation/elements/GAS.cpp +++ b/src/simulation/elements/GAS.cpp @@ -31,7 +31,7 @@ Element_GAS::Element_GAS() Description = "Gas. Diffuses. Flammable. Liquefies under pressure."; State = ST_GAS; - Properties = TYPE_GAS; + Properties = TYPE_GAS | PROP_NEUTPENETRATE; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp index 4e10c92..b3d64d1 100644 --- a/src/simulation/elements/ICEI.cpp +++ b/src/simulation/elements/ICEI.cpp @@ -31,7 +31,7 @@ Element_ICEI::Element_ICEI() Description = "Solid. Freezes water. Crushes under pressure. Cools down air."; State = ST_SOLID; - Properties = TYPE_SOLID|PROP_LIFE_DEC; + Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_NEUTPENETRATE; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/NEUT.cpp b/src/simulation/elements/NEUT.cpp index 471ae81..8a98ffa 100644 --- a/src/simulation/elements/NEUT.cpp +++ b/src/simulation/elements/NEUT.cpp @@ -134,6 +134,7 @@ int Element_NEUT::update(UPDATE_FUNC_ARGS) sim->create_part(r>>8, x+rx, y+ry, PT_WOOD); break; case PT_DESL: + case PT_OIL: if (3>(rand()%200)) sim->part_change_type(r>>8,x+rx,y+ry,PT_GAS); break; diff --git a/src/simulation/elements/OIL.cpp b/src/simulation/elements/OIL.cpp index 5dd7595..42be14e 100644 --- a/src/simulation/elements/OIL.cpp +++ b/src/simulation/elements/OIL.cpp @@ -31,7 +31,7 @@ Element_OIL::Element_OIL() Description = "Liquid. Flammable."; State = ST_LIQUID; - Properties = TYPE_LIQUID; + Properties = TYPE_LIQUID | PROP_NEUTPENETRATE; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/SNOW.cpp b/src/simulation/elements/SNOW.cpp index 4d46a6a..9e12e0a 100644 --- a/src/simulation/elements/SNOW.cpp +++ b/src/simulation/elements/SNOW.cpp @@ -31,7 +31,7 @@ Element_SNOW::Element_SNOW() Description = "Light particles."; State = ST_SOLID; - Properties = TYPE_PART|PROP_LIFE_DEC; + Properties = TYPE_PART|PROP_LIFE_DEC|PROP_NEUTPENETRATE; LowPressure = IPL; LowPressureTransition = NT; diff --git a/src/simulation/elements/WOOD.cpp b/src/simulation/elements/WOOD.cpp index 54e2e50..d15849e 100644 --- a/src/simulation/elements/WOOD.cpp +++ b/src/simulation/elements/WOOD.cpp @@ -42,10 +42,17 @@ Element_WOOD::Element_WOOD() HighTemperature = 873.0f; HighTemperatureTransition = PT_FIRE; - Update = NULL; + Update = &Element_WOOD::update; Graphics = &Element_WOOD::graphics; } +//#TPT-Directive ElementHeader Element_WOOD static int update(UPDATE_FUNC_ARGS) +int Element_WOOD::update(UPDATE_FUNC_ARGS) +{ + if (parts[i].temp > 450 && parts[i].temp > parts[i].tmp) + parts[i].tmp = (int)parts[i].temp; + return 0; +} //#TPT-Directive ElementHeader Element_WOOD static int graphics(GRAPHICS_FUNC_ARGS) int Element_WOOD::graphics(GRAPHICS_FUNC_ARGS) { @@ -55,8 +62,6 @@ int Element_WOOD::graphics(GRAPHICS_FUNC_ARGS) *colr -= (int)restrict_flt((maxtemp-400)/3,0,172); *colg -= (int)restrict_flt((maxtemp-400)/4,0,140); *colb -= (int)restrict_flt((maxtemp-400)/20,0,44); - if (maxtemp > 450) - cpart->tmp = (int)maxtemp; } if (maxtemp < 273) { |
