diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-11-17 19:44:09 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-11-17 19:44:09 (GMT) |
| commit | 058a2edd75debbd0297f92572316daa704bd379f (patch) | |
| tree | ad303f091f9a08b209b91eb34a9fcad996a3de69 /src/simulation/elements/NBLE.cpp | |
| parent | e3594aba9e05c6865d396418c028049cda92c2f3 (diff) | |
| parent | 7a21ae192fe19868539956f3fe28e62b2c7c4429 (diff) | |
| download | powder-058a2edd75debbd0297f92572316daa704bd379f.zip powder-058a2edd75debbd0297f92572316daa704bd379f.tar.gz | |
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/simulation/elements/NBLE.cpp')
| -rw-r--r-- | src/simulation/elements/NBLE.cpp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/simulation/elements/NBLE.cpp b/src/simulation/elements/NBLE.cpp new file mode 100644 index 0000000..3093d45 --- /dev/null +++ b/src/simulation/elements/NBLE.cpp @@ -0,0 +1,93 @@ +#include "simulation/Elements.h" +//#TPT-Directive ElementClass Element_NBLE PT_NBLE 52 +Element_NBLE::Element_NBLE() +{ + Identifier = "DEFAULT_PT_NBLE"; + Name = "NBLE"; + Colour = PIXPACK(0xEB4917); + MenuVisible = 1; + MenuSection = SC_GAS; + Enabled = 1; + + Advection = 1.0f; + AirDrag = 0.01f * CFDS; + AirLoss = 0.99f; + Loss = 0.30f; + Collision = -0.1f; + Gravity = 0.0f; + Diffusion = 0.75f; + HotAir = 0.001f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 1; + + Temperature = R_TEMP+2.0f +273.15f; + HeatConduct = 106; + Description = "Noble Gas. Diffuses. Conductive. Ionizes into plasma when introduced to electricity"; + + State = ST_GAS; + Properties = TYPE_GAS|PROP_CONDUCTS|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_NBLE::update; + +} + +//#TPT-Directive ElementHeader Element_NBLE static int update(UPDATE_FUNC_ARGS) +int Element_NBLE::update(UPDATE_FUNC_ARGS) + +{ + if (parts[i].temp > 5273.15 && sim->pv[y/CELL][x/CELL] > 100.0f) + { + parts[i].tmp = 1; + if (rand()%5 < 1) + { + int j; + float temp = parts[i].temp; + sim->create_part(i,x,y,PT_CO2); + + j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); + if (j != -1) + parts[j].temp = temp; + if (!(rand()%25)) + { + j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); + if (j != -1) + parts[j].temp = temp; + } + j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT); + if (j != -1) + { + parts[j].ctype = 0xF800000; + parts[j].temp = temp; + } + + j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PLSM); + if (j != -1) + { + parts[j].temp = temp; + parts[j].tmp |= 4; + } + + parts[i].temp = temp+1750+rand()%500; + sim->pv[y/CELL][x/CELL] += 50; + } + } + return 0; +} + + +Element_NBLE::~Element_NBLE() {}
\ No newline at end of file |
