From e493cf8a475baf2032f879b4c37a6b1ac1b51b54 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Wed, 13 Mar 2013 15:54:34 -0400 Subject: fix all tab spacing issues in all the element files diff --git a/src/simulation/Elements.h b/src/simulation/Elements.h index e0dfcee..73a7079 100644 --- a/src/simulation/Elements.h +++ b/src/simulation/Elements.h @@ -46,6 +46,8 @@ #define GRAPHICS_FUNC_ARGS Renderer * ren, Particle *cpart, int nx, int ny, int *pixel_mode, int* cola, int *colr, int *colg, int *colb, int *firea, int *firer, int *fireg, int *fireb #define GRAPHICS_FUNC_SUBCALL_ARGS ren, cpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb +#define BOUNDS_CHECK x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx= 0.23) // parts[i].temp --; for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rxphotons[y+ry][x+rx]; if (!r) @@ -71,9 +71,9 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS) continue; rt = r&0xFF; if (rt!=PT_CLNE && rt!=PT_PCLN && - rt!=PT_BCLN && rt!=PT_STKM && - rt!=PT_PBCN && rt!=PT_STKM2 && - rt=0 && y+ry>0 && x+rx>8].ctype == PT_IRON && !(rand()%500)) { parts[r>>8].ctype = PT_METL; sim->kill_part(i); - return 1; + return 1; } } } @@ -87,7 +87,7 @@ int Element_BCOL::update(UPDATE_FUNC_ARGS) { rx = rand()%5-2; ry = rand()%5-2; - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && - x+rxctype >> (x+18)) & 1; - *colb += (cpart->ctype >> x) & 1; + *colb += (cpart->ctype >> x) & 1; } for (x=0; x<12; x++) *colg += (cpart->ctype >> (x+9)) & 1; @@ -81,7 +81,7 @@ int Element_BRAY::graphics(GRAPHICS_FUNC_ARGS) *colr = 0; for (x=0; x<12; x++) { *colr += (cpart->ctype >> (x+18)) & 1; - *colb += (cpart->ctype >> x) & 1; + *colb += (cpart->ctype >> x) & 1; } for (x=0; x<12; x++) *colg += (cpart->ctype >> (x+9)) & 1; diff --git a/src/simulation/elements/BRCK.cpp b/src/simulation/elements/BRCK.cpp index 6769aa3..da96b87 100644 --- a/src/simulation/elements/BRCK.cpp +++ b/src/simulation/elements/BRCK.cpp @@ -2,64 +2,64 @@ //#TPT-Directive ElementClass Element_BRCK PT_BRCK 67 Element_BRCK::Element_BRCK() { - Identifier = "DEFAULT_PT_BRCK"; - Name = "BRCK"; - Colour = PIXPACK(0x808080); - MenuVisible = 1; - MenuSection = SC_SOLIDS; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "Brick, breakable building material."; - - State = ST_SOLID; - Properties = TYPE_SOLID|PROP_HOT_GLOW; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = 8.8f; - HighPressureTransition = PT_STNE; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 1223.0f; - HighTemperatureTransition = PT_LAVA; - - Update = NULL; - Graphics = &Element_BRCK::graphics; + Identifier = "DEFAULT_PT_BRCK"; + Name = "BRCK"; + Colour = PIXPACK(0x808080); + MenuVisible = 1; + MenuSection = SC_SOLIDS; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "Brick, breakable building material."; + + State = ST_SOLID; + Properties = TYPE_SOLID|PROP_HOT_GLOW; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = 8.8f; + HighPressureTransition = PT_STNE; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 1223.0f; + HighTemperatureTransition = PT_LAVA; + + Update = NULL; + Graphics = &Element_BRCK::graphics; } //#TPT-Directive ElementHeader Element_BRCK static int graphics(GRAPHICS_FUNC_ARGS) int Element_BRCK::graphics(GRAPHICS_FUNC_ARGS) { - if (cpart->tmp == 1) - { - *pixel_mode |= FIRE_ADD; - *colb += 100; + if (cpart->tmp == 1) + { + *pixel_mode |= FIRE_ADD; + *colb += 100; - *firea = 40; - *firer = *colr; - *fireg = *colg; - *fireb = *colb; - } - return 0; + *firea = 40; + *firer = *colr; + *fireg = *colg; + *fireb = *colb; + } + return 0; } Element_BRCK::~Element_BRCK() {} \ No newline at end of file diff --git a/src/simulation/elements/BREC.cpp b/src/simulation/elements/BREC.cpp index d1de90e..1c09c64 100644 --- a/src/simulation/elements/BREC.cpp +++ b/src/simulation/elements/BREC.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_BREC PT_BREC 135 Element_BREC::Element_BREC() { - Identifier = "DEFAULT_PT_BREC"; - Name = "BREL"; - Colour = PIXPACK(0x707060); - MenuVisible = 1; - MenuSection = SC_POWDERS; - Enabled = 1; - - Advection = 0.4f; - AirDrag = 0.04f * CFDS; - AirLoss = 0.94f; - Loss = 0.95f; - Collision = -0.1f; - Gravity = 0.18f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 1; - - Flammable = 0; - Explosive = 0; - Meltable = 2; - Hardness = 2; - - Weight = 90; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 211; - Description = "Broken electronics"; - - State = ST_SOLID; - Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_BREC::update; - + Identifier = "DEFAULT_PT_BREC"; + Name = "BREL"; + Colour = PIXPACK(0x707060); + MenuVisible = 1; + MenuSection = SC_POWDERS; + Enabled = 1; + + Advection = 0.4f; + AirDrag = 0.04f * CFDS; + AirLoss = 0.94f; + Loss = 0.95f; + Collision = -0.1f; + Gravity = 0.18f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 1; + + Flammable = 0; + Explosive = 0; + Meltable = 2; + Hardness = 2; + + Weight = 90; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 211; + Description = "Broken electronics"; + + State = ST_SOLID; + Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_BREC::update; + } //#TPT-Directive ElementHeader Element_BREC static int update(UPDATE_FUNC_ARGS) diff --git a/src/simulation/elements/BRMT.cpp b/src/simulation/elements/BRMT.cpp index 5ac2315..cf4f99d 100644 --- a/src/simulation/elements/BRMT.cpp +++ b/src/simulation/elements/BRMT.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_BRMT PT_BRMT 30 Element_BRMT::Element_BRMT() { - Identifier = "DEFAULT_PT_BRMT"; - Name = "BRMT"; - Colour = PIXPACK(0x705060); - MenuVisible = 1; - MenuSection = SC_POWDERS; - Enabled = 1; - - Advection = 0.4f; - AirDrag = 0.04f * CFDS; - AirLoss = 0.94f; - Loss = 0.95f; - Collision = -0.1f; - Gravity = 0.3f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 1; - - Flammable = 0; - Explosive = 0; - Meltable = 2; - Hardness = 2; - - Weight = 90; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 211; - Description = "Broken metal."; - - State = ST_SOLID; - Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 1273.0f; - HighTemperatureTransition = PT_LAVA; - - Update = &Element_BRMT::update; - + Identifier = "DEFAULT_PT_BRMT"; + Name = "BRMT"; + Colour = PIXPACK(0x705060); + MenuVisible = 1; + MenuSection = SC_POWDERS; + Enabled = 1; + + Advection = 0.4f; + AirDrag = 0.04f * CFDS; + AirLoss = 0.94f; + Loss = 0.95f; + Collision = -0.1f; + Gravity = 0.3f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 1; + + Flammable = 0; + Explosive = 0; + Meltable = 2; + Hardness = 2; + + Weight = 90; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 211; + Description = "Broken metal."; + + State = ST_SOLID; + Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 1273.0f; + HighTemperatureTransition = PT_LAVA; + + Update = &Element_BRMT::update; + } //#TPT-Directive ElementHeader Element_BRMT static int update(UPDATE_FUNC_ARGS) @@ -57,7 +57,7 @@ int Element_BRMT::update(UPDATE_FUNC_ARGS) tempFactor = 2; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rxphotons[y+ry][x+rx]; if (!r) @@ -63,9 +63,9 @@ int Element_CLNE::update(UPDATE_FUNC_ARGS) continue; rt = r&0xFF; if (rt!=PT_CLNE && rt!=PT_PCLN && - rt!=PT_BCLN && rt!=PT_STKM && - rt!=PT_PBCN && rt!=PT_STKM2 && - rt=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rxphotons[y+ry][x+rx]; if (!r) @@ -62,9 +62,9 @@ int Element_CONV::update(UPDATE_FUNC_ARGS) if (!r) continue; if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && - (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM && - (r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 && - (r&0xFF)!=PT_CONV && (r&0xFF)=0 && y+ry>=0 && x+rxphotons[y+ry][x+rx]; if (!r) @@ -71,7 +71,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS) } else if (parts[i].life==0) { // only fire when life is 0, but nothing sets the life right now for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=maxlife)) @@ -79,7 +79,7 @@ int Element_DEUT::update(UPDATE_FUNC_ARGS) else for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rxparts_avg(r>>8, i,PT_INSL)==PT_INSL) diff --git a/src/simulation/elements/DMG.cpp b/src/simulation/elements/DMG.cpp index 75ad494..8b0be40 100644 --- a/src/simulation/elements/DMG.cpp +++ b/src/simulation/elements/DMG.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_DMG PT_DMG 163 Element_DMG::Element_DMG() { - Identifier = "DEFAULT_PT_DMG"; - Name = "DMG"; - Colour = PIXPACK(0x88FF88); - MenuVisible = 1; - MenuSection = SC_FORCE; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.01f * CFDS; - AirLoss = 0.98f; - Loss = 0.95f; - Collision = 0.0f; - Gravity = 0.1f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 1; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 20; - - Weight = 30; - - Temperature = R_TEMP-2.0f +273.15f; - HeatConduct = 29; - Description = "DMG."; - - State = ST_NONE; - Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_DMG::update; - Graphics = &Element_DMG::graphics; + Identifier = "DEFAULT_PT_DMG"; + Name = "DMG"; + Colour = PIXPACK(0x88FF88); + MenuVisible = 1; + MenuSection = SC_FORCE; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.01f * CFDS; + AirLoss = 0.98f; + Loss = 0.95f; + Collision = 0.0f; + Gravity = 0.1f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 1; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 20; + + Weight = 30; + + Temperature = R_TEMP-2.0f +273.15f; + HeatConduct = 29; + Description = "DMG."; + + State = ST_NONE; + Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_DMG::update; + Graphics = &Element_DMG::graphics; } //#TPT-Directive ElementHeader Element_DMG static int update(UPDATE_FUNC_ARGS) @@ -55,7 +55,7 @@ int Element_DMG::update(UPDATE_FUNC_ARGS) for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rxphotons[y+ry][x+rx]; diff --git a/src/simulation/elements/EMBR.cpp b/src/simulation/elements/EMBR.cpp index 5ba37c2..754d0e5 100644 --- a/src/simulation/elements/EMBR.cpp +++ b/src/simulation/elements/EMBR.cpp @@ -2,125 +2,122 @@ //#TPT-Directive ElementClass Element_EMBR PT_EMBR 147 Element_EMBR::Element_EMBR() { - - //{"EMBR", PIXPACK(0xFFF288), 0.4f, 0.001f * CFDS, 0.99f, 0.90f, 0.0f, 0.07f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 0, 1, 30, SC_EXPLOSIVE, 500.0f +273.15f, 29, "Sparks. Formed by explosions.", ST_NONE, TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE, &update_EMBR, &graphics_EMBR}, - - Identifier = "DEFAULT_PT_EMBR"; - Name = "EMBR"; - Colour = PIXPACK(0xFFF288); - MenuVisible = 0; - MenuSection = SC_EXPLOSIVE; - Enabled = 1; - - Advection = 0.4f; - AirDrag = 0.001f * CFDS; - AirLoss = 0.99f; - Loss = 0.90f; - Collision = 0.0f; - Gravity = 0.07f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 1; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 20; - - Weight = 30; - - Temperature = 500.0f +273.15f; - HeatConduct = 29; - Description = "Sparks. Formed by explosions."; - - State = ST_NONE; - Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_EMBR::update; - Graphics = &Element_EMBR::graphics; + Identifier = "DEFAULT_PT_EMBR"; + Name = "EMBR"; + Colour = PIXPACK(0xFFF288); + MenuVisible = 0; + MenuSection = SC_EXPLOSIVE; + Enabled = 1; + + Advection = 0.4f; + AirDrag = 0.001f * CFDS; + AirLoss = 0.99f; + Loss = 0.90f; + Collision = 0.0f; + Gravity = 0.07f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 1; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 20; + + Weight = 30; + + Temperature = 500.0f +273.15f; + HeatConduct = 29; + Description = "Sparks. Formed by explosions."; + + State = ST_NONE; + Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL|PROP_SPARKSETTLE; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_EMBR::update; + Graphics = &Element_EMBR::graphics; } //#TPT-Directive ElementHeader Element_EMBR static int update(UPDATE_FUNC_ARGS) int Element_EMBR::update(UPDATE_FUNC_ARGS) { - int r, rx, ry, nb; - for (rx=-1; rx<2; rx++) - for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rxelements[r&0xFF].Properties & (TYPE_SOLID | TYPE_PART | TYPE_LIQUID)) && !(sim->elements[r&0xFF].Properties & PROP_SPARKSETTLE)) - { - sim->kill_part(i); - return 1; - } - } - return 0; + int r, rx, ry, nb; + for (rx=-1; rx<2; rx++) + for (ry=-1; ry<2; ry++) + if (BOUNDS_CHECK && (rx || ry)) + { + r = pmap[y+ry][x+rx]; + if (!r) + continue; + if ((sim->elements[r&0xFF].Properties & (TYPE_SOLID | TYPE_PART | TYPE_LIQUID)) && !(sim->elements[r&0xFF].Properties & PROP_SPARKSETTLE)) + { + sim->kill_part(i); + return 1; + } + } + return 0; } //#TPT-Directive ElementHeader Element_EMBR static int graphics(GRAPHICS_FUNC_ARGS) int Element_EMBR::graphics(GRAPHICS_FUNC_ARGS) { - if (cpart->ctype&0xFFFFFF) - { - int maxComponent; - *colr = (cpart->ctype&0xFF0000)>>16; - *colg = (cpart->ctype&0x00FF00)>>8; - *colb = (cpart->ctype&0x0000FF); - maxComponent = *colr; + if (cpart->ctype&0xFFFFFF) + { + int maxComponent; + *colr = (cpart->ctype&0xFF0000)>>16; + *colg = (cpart->ctype&0x00FF00)>>8; + *colb = (cpart->ctype&0x0000FF); + maxComponent = *colr; - if (*colg>maxComponent) maxComponent = *colg; - if (*colb>maxComponent) maxComponent = *colb; - if (maxComponent<60)//make sure it isn't too dark to see - { - float multiplier = 60.0f/maxComponent; - *colr *= multiplier; - *colg *= multiplier; - *colb *= multiplier; - } - } - else if (cpart->tmp != 0) - { - *colr = *colg = *colb = 255; - } + if (*colg>maxComponent) maxComponent = *colg; + if (*colb>maxComponent) maxComponent = *colb; + if (maxComponent<60)//make sure it isn't too dark to see + { + float multiplier = 60.0f/maxComponent; + *colr *= multiplier; + *colg *= multiplier; + *colb *= multiplier; + } + } + else if (cpart->tmp != 0) + { + *colr = *colg = *colb = 255; + } - if (ren->decorations_enable && cpart->dcolour) - { - int a = (cpart->dcolour>>24)&0xFF; - *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8; - *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8; - *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8; - } - *firer = *colr; - *fireg = *colg; - *fireb = *colb; - if (cpart->tmp==1) - { - *pixel_mode = FIRE_ADD | PMODE_BLEND | PMODE_GLOW; - *firea = (cpart->life-15)*4; - *cola = (cpart->life+15)*4; - } - else if (cpart->tmp==2) - { - *pixel_mode = PMODE_FLAT | FIRE_ADD; - *firea = 255; - } - else - { - *pixel_mode = PMODE_SPARK | PMODE_ADD; - if (cpart->life<64) *cola = 4*cpart->life; - } - return 0; + if (ren->decorations_enable && cpart->dcolour) + { + int a = (cpart->dcolour>>24)&0xFF; + *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8; + *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8; + *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8; + } + *firer = *colr; + *fireg = *colg; + *fireb = *colb; + if (cpart->tmp==1) + { + *pixel_mode = FIRE_ADD | PMODE_BLEND | PMODE_GLOW; + *firea = (cpart->life-15)*4; + *cola = (cpart->life+15)*4; + } + else if (cpart->tmp==2) + { + *pixel_mode = PMODE_FLAT | FIRE_ADD; + *firea = 255; + } + else + { + *pixel_mode = PMODE_SPARK | PMODE_ADD; + if (cpart->life<64) *cola = 4*cpart->life; + } + return 0; } Element_EMBR::~Element_EMBR() {} diff --git a/src/simulation/elements/EMP.cpp b/src/simulation/elements/EMP.cpp index 527f42d..395e015 100644 --- a/src/simulation/elements/EMP.cpp +++ b/src/simulation/elements/EMP.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_EMP PT_EMP 134 Element_EMP::Element_EMP() { - Identifier = "DEFAULT_PT_EMP"; - Name = "EMP"; - Colour = PIXPACK(0x66AAFF); - MenuVisible = 1; - MenuSection = SC_ELEC; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.0f; - HotAir = 0.0f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 3; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 121; - Description = "Breaks activated electronics."; - - State = ST_SOLID; - Properties = TYPE_SOLID|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_EMP::update; - Graphics = &Element_EMP::graphics; + Identifier = "DEFAULT_PT_EMP"; + Name = "EMP"; + Colour = PIXPACK(0x66AAFF); + MenuVisible = 1; + MenuSection = SC_ELEC; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.0f; + HotAir = 0.0f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 3; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 121; + Description = "Breaks activated electronics."; + + State = ST_SOLID; + Properties = TYPE_SOLID|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_EMP::update; + Graphics = &Element_EMP::graphics; } //#TPT-Directive ElementHeader Element_EMP static int update(UPDATE_FUNC_ARGS) @@ -77,7 +77,7 @@ int Element_EMP::update(UPDATE_FUNC_ARGS) { int is_elec=0; if (parts[r].ctype==PT_PSCN || parts[r].ctype==PT_NSCN || parts[r].ctype==PT_PTCT || - parts[r].ctype==PT_NTCT || parts[r].ctype==PT_INST || parts[r].ctype==PT_SWCH || t==PT_WIRE || t==PT_SWCH) + parts[r].ctype==PT_NTCT || parts[r].ctype==PT_INST || parts[r].ctype==PT_SWCH || t==PT_WIRE || t==PT_SWCH) { is_elec=1; if (!(rand()%100)) diff --git a/src/simulation/elements/ETRD.cpp b/src/simulation/elements/ETRD.cpp index 3a63f6f..3447f07 100644 --- a/src/simulation/elements/ETRD.cpp +++ b/src/simulation/elements/ETRD.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_ETRD PT_ETRD 50 Element_ETRD::Element_ETRD() { - Identifier = "DEFAULT_PT_ETRD"; - Name = "ETRD"; - Colour = PIXPACK(0x404040); - MenuVisible = 1; - MenuSection = SC_ELEC; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)"; - - State = ST_NONE; - Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = NULL; - + Identifier = "DEFAULT_PT_ETRD"; + Name = "ETRD"; + Colour = PIXPACK(0x404040); + MenuVisible = 1; + MenuSection = SC_ELEC; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)"; + + State = ST_NONE; + Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = NULL; + } Element_ETRD::~Element_ETRD() {} \ No newline at end of file diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp index 1b763ca..52bf462 100644 --- a/src/simulation/elements/EXOT.cpp +++ b/src/simulation/elements/EXOT.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_EXOT PT_EXOT 145 Element_EXOT::Element_EXOT() { - Identifier = "DEFAULT_PT_EXOT"; - Name = "EXOT"; - Colour = PIXPACK(0x404040); - MenuVisible = 1; - MenuSection = SC_NUCLEAR; - Enabled = 1; - - Advection = 0.3f; - AirDrag = 0.02f * CFDS; - AirLoss = 0.95f; - Loss = 0.80f; - Collision = 0.0f; - Gravity = 0.15f; - Diffusion = 0.00f; - HotAir = 0.0003f * CFDS; - Falldown = 2; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 2; - - Weight = 46; - - Temperature = R_TEMP-2.0f +273.15f; - HeatConduct = 250; - Description = "Exotic matter. Explodes with excess exposure to electrons."; - - State = ST_LIQUID; - Properties = TYPE_LIQUID|PROP_NEUTPASS; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_EXOT::update; - Graphics = &Element_EXOT::graphics; + Identifier = "DEFAULT_PT_EXOT"; + Name = "EXOT"; + Colour = PIXPACK(0x404040); + MenuVisible = 1; + MenuSection = SC_NUCLEAR; + Enabled = 1; + + Advection = 0.3f; + AirDrag = 0.02f * CFDS; + AirLoss = 0.95f; + Loss = 0.80f; + Collision = 0.0f; + Gravity = 0.15f; + Diffusion = 0.00f; + HotAir = 0.0003f * CFDS; + Falldown = 2; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 2; + + Weight = 46; + + Temperature = R_TEMP-2.0f +273.15f; + HeatConduct = 250; + Description = "Exotic matter. Explodes with excess exposure to electrons."; + + State = ST_LIQUID; + Properties = TYPE_LIQUID|PROP_NEUTPASS; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_EXOT::update; + Graphics = &Element_EXOT::graphics; } //#TPT-Directive ElementHeader Element_EXOT static int update(UPDATE_FUNC_ARGS) @@ -51,7 +51,7 @@ int Element_EXOT::update(UPDATE_FUNC_ARGS) { int r, rt, rx, ry, nb, rrx, rry, trade, tym; for (rx=-2; rx<=2; rx++) for (ry=-2; ry<=2; ry++) - if (x+rx>=0 && y+ry>=0 && x+rxplayer2.spwn) { if (sim->player.spwn && (pow((float)sim->player.legs[2]-x, 2) + pow((float)sim->player.legs[3]-y, 2))<= - (pow((float)sim->player2.legs[2]-x, 2) + pow((float)sim->player2.legs[3]-y, 2))) + (pow((float)sim->player2.legs[2]-x, 2) + pow((float)sim->player2.legs[3]-y, 2))) { tarx = (unsigned int)sim->player.legs[2]; tary = (unsigned int)sim->player.legs[3]; @@ -74,8 +74,8 @@ int Element_FIGH::update(UPDATE_FUNC_ARGS) else if (sim->player.spwn) { tarx = (unsigned int)sim->player.legs[2]; - tary = (unsigned int)sim->player.legs[3]; - parts[i].tmp2 = 1; + tary = (unsigned int)sim->player.legs[3]; + parts[i].tmp2 = 1; } switch (parts[i].tmp2) diff --git a/src/simulation/elements/FILT.cpp b/src/simulation/elements/FILT.cpp index 58501c2..d6b82f2 100644 --- a/src/simulation/elements/FILT.cpp +++ b/src/simulation/elements/FILT.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_FILT PT_FILT 125 Element_FILT::Element_FILT() { - Identifier = "DEFAULT_PT_FILT"; - Name = "FILT"; - Colour = PIXPACK(0x000056); - MenuVisible = 1; - MenuSection = SC_SOLIDS; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "Filter for photons, changes the color."; - - State = ST_SOLID; - Properties = TYPE_SOLID | PROP_NOAMBHEAT; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = NULL; - Graphics = &Element_FILT::graphics; + Identifier = "DEFAULT_PT_FILT"; + Name = "FILT"; + Colour = PIXPACK(0x000056); + MenuVisible = 1; + MenuSection = SC_SOLIDS; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "Filter for photons, changes the color."; + + State = ST_SOLID; + Properties = TYPE_SOLID | PROP_NOAMBHEAT; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = NULL; + Graphics = &Element_FILT::graphics; } //#TPT-Directive ElementHeader Element_FILT static int graphics(GRAPHICS_FUNC_ARGS) diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index 35c7758..6e3e01a 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_FIRE PT_FIRE 4 Element_FIRE::Element_FIRE() { - Identifier = "DEFAULT_PT_FIRE"; - Name = "FIRE"; - Colour = PIXPACK(0xFF1000); - MenuVisible = 1; - MenuSection = SC_EXPLOSIVE; - Enabled = 1; - - Advection = 0.9f; - AirDrag = 0.04f * CFDS; - AirLoss = 0.97f; - Loss = 0.20f; - Collision = 0.0f; - Gravity = -0.1f; - Diffusion = 0.00f; - HotAir = 0.001f * CFDS; - Falldown = 1; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 2; - - Temperature = R_TEMP+400.0f+273.15f; - HeatConduct = 88; - Description = "Ignites flammable materials. Heats air."; - - State = ST_GAS; - Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 2773.0f; - HighTemperatureTransition = PT_PLSM; - - Update = &Element_FIRE::update; - Graphics = &Element_FIRE::graphics; + Identifier = "DEFAULT_PT_FIRE"; + Name = "FIRE"; + Colour = PIXPACK(0xFF1000); + MenuVisible = 1; + MenuSection = SC_EXPLOSIVE; + Enabled = 1; + + Advection = 0.9f; + AirDrag = 0.04f * CFDS; + AirLoss = 0.97f; + Loss = 0.20f; + Collision = 0.0f; + Gravity = -0.1f; + Diffusion = 0.00f; + HotAir = 0.001f * CFDS; + Falldown = 1; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 2; + + Temperature = R_TEMP+400.0f+273.15f; + HeatConduct = 88; + Description = "Ignites flammable materials. Heats air."; + + State = ST_GAS; + Properties = TYPE_GAS|PROP_LIFE_DEC|PROP_LIFE_KILL; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 2773.0f; + HighTemperatureTransition = PT_PLSM; + + Update = &Element_FIRE::update; + Graphics = &Element_FIRE::graphics; } //#TPT-Directive ElementHeader Element_FIRE static int update(UPDATE_FUNC_ARGS) @@ -87,7 +87,7 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS) } for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rxelements[rt].Explosive) && - (t!=PT_SPRK || (rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL)) && - (t!=PT_PHOT || rt!=PT_INSL) && + (t!=PT_SPRK || (rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL)) && + (t!=PT_PHOT || rt!=PT_INSL) && (rt!=PT_SPNG || parts[r>>8].life==0) && - sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000)) + sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000)) { sim->part_change_type(r>>8,x+rx,y+ry,PT_FIRE); parts[r>>8].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP); @@ -118,7 +118,7 @@ int Element_FIRE::updateLegacy(UPDATE_FUNC_ARGS) { int r, rx, ry, rt, lpv, t = parts[i].type; for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx>8].x; dy = parts[i].y - parts[r>>8].y; - //Stickness + //Stickiness if ((dx*dx + dy*dy)>1.5 && (gel || !sim->elements[rt].Falldown || (fabs((float)rx)<2 && fabs((float)ry)<2))) { float per, nd; diff --git a/src/simulation/elements/GLAS.cpp b/src/simulation/elements/GLAS.cpp index b752a0b..5baa59c 100644 --- a/src/simulation/elements/GLAS.cpp +++ b/src/simulation/elements/GLAS.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_GLAS PT_GLAS 45 Element_GLAS::Element_GLAS() { - Identifier = "DEFAULT_PT_GLAS"; - Name = "GLAS"; - Colour = PIXPACK(0x404040); - MenuVisible = 1; - MenuSection = SC_SOLIDS; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 150; - Description = "Solid. Meltable. Shatters under pressure"; - - State = ST_SOLID; - Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_HOT_GLOW | PROP_SPARKSETTLE; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 1973.0f; - HighTemperatureTransition = PT_LAVA; - - Update = &Element_GLAS::update; - + Identifier = "DEFAULT_PT_GLAS"; + Name = "GLAS"; + Colour = PIXPACK(0x404040); + MenuVisible = 1; + MenuSection = SC_SOLIDS; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 150; + Description = "Solid. Meltable. Shatters under pressure"; + + State = ST_SOLID; + Properties = TYPE_SOLID | PROP_NEUTPASS | PROP_HOT_GLOW | PROP_SPARKSETTLE; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 1973.0f; + HighTemperatureTransition = PT_LAVA; + + Update = &Element_GLAS::update; + } //#TPT-Directive ElementHeader Element_GLAS static int update(UPDATE_FUNC_ARGS) diff --git a/src/simulation/elements/GLOW.cpp b/src/simulation/elements/GLOW.cpp index 373fc51..d8c07ba 100644 --- a/src/simulation/elements/GLOW.cpp +++ b/src/simulation/elements/GLOW.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_GLOW PT_GLOW 66 Element_GLOW::Element_GLOW() { - Identifier = "DEFAULT_PT_GLOW"; - Name = "GLOW"; - Colour = PIXPACK(0x445464); - MenuVisible = 1; - MenuSection = SC_LIQUID; - Enabled = 1; - - Advection = 0.3f; - AirDrag = 0.02f * CFDS; - AirLoss = 0.98f; - Loss = 0.80f; - Collision = 0.0f; - Gravity = 0.15f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 2; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 2; - - Weight = 40; - - Temperature = R_TEMP+20.0f+273.15f; - HeatConduct = 44; - Description = "Glow, Glows under pressure"; - - State = ST_LIQUID; - Properties = TYPE_LIQUID|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_GLOW::update; - Graphics = &Element_GLOW::graphics; + Identifier = "DEFAULT_PT_GLOW"; + Name = "GLOW"; + Colour = PIXPACK(0x445464); + MenuVisible = 1; + MenuSection = SC_LIQUID; + Enabled = 1; + + Advection = 0.3f; + AirDrag = 0.02f * CFDS; + AirLoss = 0.98f; + Loss = 0.80f; + Collision = 0.0f; + Gravity = 0.15f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 2; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 2; + + Weight = 40; + + Temperature = R_TEMP+20.0f+273.15f; + HeatConduct = 44; + Description = "Glow, Glows under pressure"; + + State = ST_LIQUID; + Properties = TYPE_LIQUID|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_GLOW::update; + Graphics = &Element_GLOW::graphics; } //#TPT-Directive ElementHeader Element_GLOW static int update(UPDATE_FUNC_ARGS) @@ -52,7 +52,7 @@ int Element_GLOW::update(UPDATE_FUNC_ARGS) int r, rx, ry; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rxgravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 0.2f*(parts[i].temp-273.15); for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>=0 && x+rxelements[rt].Explosive) && (rt!=PT_SPNG || parts[r>>8].life==0) && - sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000)) + sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000)) { sim->part_change_type(r>>8,x+rx,y+ry,PT_FIRE); parts[r>>8].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP); diff --git a/src/simulation/elements/LNTG.cpp b/src/simulation/elements/LNTG.cpp index ac97191..f5c08c0 100644 --- a/src/simulation/elements/LNTG.cpp +++ b/src/simulation/elements/LNTG.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_LNTG PT_LNTG 37 Element_LNTG::Element_LNTG() { - Identifier = "DEFAULT_PT_LNTG"; - Name = "LN2"; - Colour = PIXPACK(0x80A0DF); - MenuVisible = 1; - MenuSection = SC_LIQUID; - Enabled = 1; - - Advection = 0.6f; - AirDrag = 0.01f * CFDS; - AirLoss = 0.98f; - Loss = 0.95f; - Collision = 0.0f; - Gravity = 0.1f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 2; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 30; - - Temperature = 70.15f; - HeatConduct = 70; - Description = "Liquid Nitrogen. Very cold."; - - State = ST_SOLID; - Properties = TYPE_LIQUID; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = 63.0f; - LowTemperatureTransition = PT_NICE; - HighTemperature = 77.0f; - HighTemperatureTransition = PT_NONE; - - Update = NULL; - + Identifier = "DEFAULT_PT_LNTG"; + Name = "LN2"; + Colour = PIXPACK(0x80A0DF); + MenuVisible = 1; + MenuSection = SC_LIQUID; + Enabled = 1; + + Advection = 0.6f; + AirDrag = 0.01f * CFDS; + AirLoss = 0.98f; + Loss = 0.95f; + Collision = 0.0f; + Gravity = 0.1f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 2; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 30; + + Temperature = 70.15f; + HeatConduct = 70; + Description = "Liquid Nitrogen. Very cold."; + + State = ST_SOLID; + Properties = TYPE_LIQUID; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = 63.0f; + LowTemperatureTransition = PT_NICE; + HighTemperature = 77.0f; + HighTemperatureTransition = PT_NONE; + + Update = NULL; + } Element_LNTG::~Element_LNTG() {} \ No newline at end of file diff --git a/src/simulation/elements/LO2.cpp b/src/simulation/elements/LO2.cpp index e032b9e..2b291f3 100644 --- a/src/simulation/elements/LO2.cpp +++ b/src/simulation/elements/LO2.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_LO2 PT_LO2 60 Element_LO2::Element_LO2() { - Identifier = "DEFAULT_PT_LO2"; - Name = "LOXY"; - Colour = PIXPACK(0x80A0EF); - MenuVisible = 1; - MenuSection = SC_LIQUID; - Enabled = 1; - - Advection = 0.6f; - AirDrag = 0.01f * CFDS; - AirLoss = 0.98f; - Loss = 0.95f; - Collision = 0.0f; - Gravity = 0.1f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 2; - - Flammable = 5000; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 30; - - Temperature = 80.0f; - HeatConduct = 70; - Description = "Liquid Oxygen. Very cold. Reacts with fire"; - - State = ST_LIQUID; - Properties = TYPE_LIQUID; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 90.1f; - HighTemperatureTransition = PT_O2; - - Update = NULL; - + Identifier = "DEFAULT_PT_LO2"; + Name = "LOXY"; + Colour = PIXPACK(0x80A0EF); + MenuVisible = 1; + MenuSection = SC_LIQUID; + Enabled = 1; + + Advection = 0.6f; + AirDrag = 0.01f * CFDS; + AirLoss = 0.98f; + Loss = 0.95f; + Collision = 0.0f; + Gravity = 0.1f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 2; + + Flammable = 5000; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 30; + + Temperature = 80.0f; + HeatConduct = 70; + Description = "Liquid Oxygen. Very cold. Reacts with fire"; + + State = ST_LIQUID; + Properties = TYPE_LIQUID; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 90.1f; + HighTemperatureTransition = PT_O2; + + Update = NULL; + } Element_LO2::~Element_LO2() {} \ No newline at end of file diff --git a/src/simulation/elements/LOLZ.cpp b/src/simulation/elements/LOLZ.cpp index f1d4167..301e99a 100644 --- a/src/simulation/elements/LOLZ.cpp +++ b/src/simulation/elements/LOLZ.cpp @@ -2,60 +2,60 @@ //#TPT-Directive ElementClass Element_LOLZ PT_LOLZ 123 Element_LOLZ::Element_LOLZ() { - Identifier = "DEFAULT_PT_LOLZ"; - Name = "LOLZ"; - Colour = PIXPACK(0x569212); - MenuVisible = 1; - MenuSection = SC_CRACKER2; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.00f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.0f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 100; - - Temperature = 373.0f; - HeatConduct = 40; - Description = "Lolz"; - - State = ST_GAS; - Properties = TYPE_SOLID; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - + Identifier = "DEFAULT_PT_LOLZ"; + Name = "LOLZ"; + Colour = PIXPACK(0x569212); + MenuVisible = 1; + MenuSection = SC_CRACKER2; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.00f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.0f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 100; + + Temperature = 373.0f; + HeatConduct = 40; + Description = "Lolz"; + + State = ST_GAS; + Properties = TYPE_SOLID; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + } //#TPT-Directive ElementHeader Element_LOLZ static int RuleTable[9][9] int Element_LOLZ::RuleTable[9][9] = { - {0,0,0,0,0,0,0,0,0}, - {1,0,0,0,0,0,1,0,0}, - {1,0,0,0,0,0,1,0,0}, - {1,0,0,1,1,0,0,1,0}, - {1,0,1,0,0,1,0,1,0}, - {1,0,1,0,0,1,0,1,0}, - {0,1,0,1,1,0,0,1,0}, - {0,1,0,0,0,0,0,1,0}, - {0,1,0,0,0,0,0,1,0}, + {0,0,0,0,0,0,0,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,1,1,0,0,1,0}, + {1,0,1,0,0,1,0,1,0}, + {1,0,1,0,0,1,0,1,0}, + {0,1,0,1,1,0,0,1,0}, + {0,1,0,0,0,0,0,1,0}, + {0,1,0,0,0,0,0,1,0}, }; //#TPT-Directive ElementHeader Element_LOLZ static int lolz[XRES/9][YRES/9]; diff --git a/src/simulation/elements/LOVE.cpp b/src/simulation/elements/LOVE.cpp index c5ce789..f3b476a 100644 --- a/src/simulation/elements/LOVE.cpp +++ b/src/simulation/elements/LOVE.cpp @@ -2,60 +2,60 @@ //#TPT-Directive ElementClass Element_LOVE PT_LOVE 94 Element_LOVE::Element_LOVE() { - Identifier = "DEFAULT_PT_LOVE"; - Name = "LOVE"; - Colour = PIXPACK(0xFF30FF); - MenuVisible = 1; - MenuSection = SC_CRACKER2; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.00f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.0f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 100; - - Temperature = 373.0f; - HeatConduct = 40; - Description = "Love..."; - - State = ST_GAS; - Properties = TYPE_SOLID; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - + Identifier = "DEFAULT_PT_LOVE"; + Name = "LOVE"; + Colour = PIXPACK(0xFF30FF); + MenuVisible = 1; + MenuSection = SC_CRACKER2; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.00f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.0f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 100; + + Temperature = 373.0f; + HeatConduct = 40; + Description = "Love..."; + + State = ST_GAS; + Properties = TYPE_SOLID; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + } //#TPT-Directive ElementHeader Element_LOVE static int RuleTable[9][9] int Element_LOVE::RuleTable[9][9] = { - {0,0,1,1,0,0,0,0,0}, - {0,1,0,0,1,1,0,0,0}, - {1,0,0,0,0,0,1,0,0}, - {1,0,0,0,0,0,0,1,0}, - {0,1,0,0,0,0,0,0,1}, - {1,0,0,0,0,0,0,1,0}, - {1,0,0,0,0,0,1,0,0}, - {0,1,0,0,1,1,0,0,0}, - {0,0,1,1,0,0,0,0,0}, + {0,0,1,1,0,0,0,0,0}, + {0,1,0,0,1,1,0,0,0}, + {1,0,0,0,0,0,1,0,0}, + {1,0,0,0,0,0,0,1,0}, + {0,1,0,0,0,0,0,0,1}, + {1,0,0,0,0,0,0,1,0}, + {1,0,0,0,0,0,1,0,0}, + {0,1,0,0,1,1,0,0,0}, + {0,0,1,1,0,0,0,0,0}, }; //#TPT-Directive ElementHeader Element_LOVE static int love[XRES/9][YRES/9]; diff --git a/src/simulation/elements/LRBD.cpp b/src/simulation/elements/LRBD.cpp index f609cce..faf57cd 100644 --- a/src/simulation/elements/LRBD.cpp +++ b/src/simulation/elements/LRBD.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_LRBD PT_LRBD 42 Element_LRBD::Element_LRBD() { - Identifier = "DEFAULT_PT_LRBD"; - Name = "LRBD"; - Colour = PIXPACK(0xAAAAAA); - MenuVisible = 1; - MenuSection = SC_EXPLOSIVE; - Enabled = 1; - - Advection = 0.3f; - AirDrag = 0.02f * CFDS; - AirLoss = 0.95f; - Loss = 0.80f; - Collision = 0.0f; - Gravity = 0.15f; - Diffusion = 0.00f; - HotAir = 0.000001f* CFDS; - Falldown = 2; - - Flammable = 1000; - Explosive = 1; - Meltable = 0; - Hardness = 2; - - Weight = 45; - - Temperature = R_TEMP+45.0f+273.15f; - HeatConduct = 170; - Description = "Liquid Rubidium."; - - State = ST_LIQUID; - Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = 311.0f; - LowTemperatureTransition = PT_RBDM; - HighTemperature = 961.0f; - HighTemperatureTransition = PT_FIRE; - - Update = NULL; - + Identifier = "DEFAULT_PT_LRBD"; + Name = "LRBD"; + Colour = PIXPACK(0xAAAAAA); + MenuVisible = 1; + MenuSection = SC_EXPLOSIVE; + Enabled = 1; + + Advection = 0.3f; + AirDrag = 0.02f * CFDS; + AirLoss = 0.95f; + Loss = 0.80f; + Collision = 0.0f; + Gravity = 0.15f; + Diffusion = 0.00f; + HotAir = 0.000001f* CFDS; + Falldown = 2; + + Flammable = 1000; + Explosive = 1; + Meltable = 0; + Hardness = 2; + + Weight = 45; + + Temperature = R_TEMP+45.0f+273.15f; + HeatConduct = 170; + Description = "Liquid Rubidium."; + + State = ST_LIQUID; + Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = 311.0f; + LowTemperatureTransition = PT_RBDM; + HighTemperature = 961.0f; + HighTemperatureTransition = PT_FIRE; + + Update = NULL; + } Element_LRBD::~Element_LRBD() {} \ No newline at end of file diff --git a/src/simulation/elements/MERC.cpp b/src/simulation/elements/MERC.cpp index 57c6481..d14cdab 100644 --- a/src/simulation/elements/MERC.cpp +++ b/src/simulation/elements/MERC.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_MERC PT_MERC 152 Element_MERC::Element_MERC() { - Identifier = "DEFAULT_PT_MERC"; - Name = "MERC"; - Colour = PIXPACK(0x736B6D); - MenuVisible = 1; - MenuSection = SC_ELEC; - Enabled = 1; - - Advection = 0.4f; - AirDrag = 0.04f * CFDS; - AirLoss = 0.94f; - Loss = 0.80f; - Collision = 0.0f; - Gravity = 0.3f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 2; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 20; - - Weight = 91; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "Mercury. Volume changes with temperature, Conductive."; - - State = ST_LIQUID; - Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTABSORB|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_MERC::update; - + Identifier = "DEFAULT_PT_MERC"; + Name = "MERC"; + Colour = PIXPACK(0x736B6D); + MenuVisible = 1; + MenuSection = SC_ELEC; + Enabled = 1; + + Advection = 0.4f; + AirDrag = 0.04f * CFDS; + AirLoss = 0.94f; + Loss = 0.80f; + Collision = 0.0f; + Gravity = 0.3f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 2; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 20; + + Weight = 91; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "Mercury. Volume changes with temperature, Conductive."; + + State = ST_LIQUID; + Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTABSORB|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_MERC::update; + } //#TPT-Directive ElementHeader Element_MERC static int update(UPDATE_FUNC_ARGS) @@ -57,7 +57,7 @@ int Element_MERC::update(UPDATE_FUNC_ARGS) { for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=maxtmp)) @@ -75,7 +75,7 @@ int Element_MERC::update(UPDATE_FUNC_ARGS) else for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rxpv[y/CELL][x/CELL]; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rxSetPixel(j+6, j, 0xFF, 0, 0, 255); - newTexture->SetPixel(j+7, j, 0xFF, 0, 0, 255); - newTexture->SetPixel(-j+19, j, 0xFF, 0, 0, 255); - newTexture->SetPixel(-j+20, j, 0xFF, 0, 0, 255); - } + for (int j=3; j<(width-4)/2; j++) + { + newTexture->SetPixel(j+6, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(j+7, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(-j+19, j, 0xFF, 0, 0, 255); + newTexture->SetPixel(-j+20, j, 0xFF, 0, 0, 255); + } - return newTexture; + return newTexture; } diff --git a/src/simulation/elements/NSCN.cpp b/src/simulation/elements/NSCN.cpp index c16e9c4..1e71f10 100644 --- a/src/simulation/elements/NSCN.cpp +++ b/src/simulation/elements/NSCN.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_NSCN PT_NSCN 36 Element_NSCN::Element_NSCN() { - Identifier = "DEFAULT_PT_NSCN"; - Name = "NSCN"; - Colour = PIXPACK(0x505080); - MenuVisible = 1; - MenuSection = SC_ELEC; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 1; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "N-Type Silicon, Will not transfer current to P-Type Silicon."; - - State = ST_SOLID; - Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 1687.0f; - HighTemperatureTransition = PT_LAVA; - - Update = NULL; - + Identifier = "DEFAULT_PT_NSCN"; + Name = "NSCN"; + Colour = PIXPACK(0x505080); + MenuVisible = 1; + MenuSection = SC_ELEC; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 1; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "N-Type Silicon, Will not transfer current to P-Type Silicon."; + + State = ST_SOLID; + Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 1687.0f; + HighTemperatureTransition = PT_LAVA; + + Update = NULL; + } Element_NSCN::~Element_NSCN() {} \ No newline at end of file diff --git a/src/simulation/elements/NTCT.cpp b/src/simulation/elements/NTCT.cpp index 2241468..c6c065e 100644 --- a/src/simulation/elements/NTCT.cpp +++ b/src/simulation/elements/NTCT.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_NTCT PT_NTCT 43 Element_NTCT::Element_NTCT() { - Identifier = "DEFAULT_PT_NTCT"; - Name = "NTCT"; - Colour = PIXPACK(0x505040); - MenuVisible = 1; - MenuSection = SC_ELEC; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 1; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "Semi-conductor. Only conducts electricity when hot (More than 100C)"; - - State = ST_SOLID; - Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 1687.0f; - HighTemperatureTransition = PT_LAVA; - - Update = &Element_NTCT::update; - + Identifier = "DEFAULT_PT_NTCT"; + Name = "NTCT"; + Colour = PIXPACK(0x505040); + MenuVisible = 1; + MenuSection = SC_ELEC; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 1; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "Semi-conductor. Only conducts electricity when hot (More than 100C)"; + + State = ST_SOLID; + Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 1687.0f; + HighTemperatureTransition = PT_LAVA; + + Update = &Element_NTCT::update; + } //#TPT-Directive ElementHeader Element_NTCT static int update(UPDATE_FUNC_ARGS) diff --git a/src/simulation/elements/NWHL.cpp b/src/simulation/elements/NWHL.cpp index 7fcda4a..7db070c 100644 --- a/src/simulation/elements/NWHL.cpp +++ b/src/simulation/elements/NWHL.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_NWHL PT_NWHL 151 Element_NWHL::Element_NWHL() { - Identifier = "DEFAULT_PT_NWHL"; - Name = "WHOL"; - Colour = PIXPACK(0xFFFFFF); - MenuVisible = 1; - MenuSection = SC_SPECIAL; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 186; - Description = "White hole (Requires newtonian gravity)"; - - State = ST_SOLID; - Properties = TYPE_SOLID; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_NWHL::update; - + Identifier = "DEFAULT_PT_NWHL"; + Name = "WHOL"; + Colour = PIXPACK(0xFFFFFF); + MenuVisible = 1; + MenuSection = SC_SPECIAL; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 186; + Description = "White hole (Requires newtonian gravity)"; + + State = ST_SOLID; + Properties = TYPE_SOLID; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_NWHL::update; + } //#TPT-Directive ElementHeader Element_NWHL static int update(UPDATE_FUNC_ARGS) diff --git a/src/simulation/elements/O2.cpp b/src/simulation/elements/O2.cpp index d446834..9f543a1 100644 --- a/src/simulation/elements/O2.cpp +++ b/src/simulation/elements/O2.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_O2 PT_O2 61 Element_O2::Element_O2() { - Identifier = "DEFAULT_PT_O2"; - Name = "OXYG"; - Colour = PIXPACK(0x80A0FF); - MenuVisible = 1; - MenuSection = SC_GAS; - Enabled = 1; - - Advection = 2.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.99f; - Loss = 0.30f; - Collision = -0.1f; - Gravity = 0.0f; - Diffusion = 3.0f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 1; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 70; - Description = "Gas. Ignites easily."; - - State = ST_GAS; - Properties = TYPE_GAS; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = 90.0f; - LowTemperatureTransition = PT_LO2; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_O2::update; - + Identifier = "DEFAULT_PT_O2"; + Name = "OXYG"; + Colour = PIXPACK(0x80A0FF); + MenuVisible = 1; + MenuSection = SC_GAS; + Enabled = 1; + + Advection = 2.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.99f; + Loss = 0.30f; + Collision = -0.1f; + Gravity = 0.0f; + Diffusion = 3.0f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 1; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 70; + Description = "Gas. Ignites easily."; + + State = ST_GAS; + Properties = TYPE_GAS; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = 90.0f; + LowTemperatureTransition = PT_LO2; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_O2::update; + } //#TPT-Directive ElementHeader Element_O2 static int update(UPDATE_FUNC_ARGS) @@ -52,7 +52,7 @@ int Element_O2::update(UPDATE_FUNC_ARGS) int r,rx,ry; for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>=0 && x+rx=PT_NUM || !sim->elements[parts[i].ctype].Enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOL))) for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>=0 && x+rxphotons[y+ry][x+rx]; if (!r) @@ -75,10 +75,10 @@ int Element_PBCN::update(UPDATE_FUNC_ARGS) continue; rt = r&0xFF; if (rt!=PT_CLNE && rt!=PT_PCLN && - rt!=PT_BCLN && rt!=PT_SPRK && - rt!=PT_NSCN && rt!=PT_PSCN && - rt!=PT_STKM && rt!=PT_STKM2 && - rt!=PT_PBCN && rt=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=PT_NUM || !sim->elements[parts[i].ctype].Enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOL))) for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>=0 && x+rxphotons[y+ry][x+rx]; if (!r) @@ -89,10 +89,10 @@ int Element_PCLN::update(UPDATE_FUNC_ARGS) continue; rt = r&0xFF; if (rt!=PT_CLNE && rt!=PT_PCLN && - rt!=PT_BCLN && rt!=PT_SPRK && - rt!=PT_NSCN && rt!=PT_PSCN && - rt!=PT_STKM && rt!=PT_STKM2 && - rt!=PT_PBCN && rt=0 && y+ry>=0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx>3; rx = pos_1_rx[rnd]; ry = pos_1_ry[rnd]; - if (x+rx>=0 && y+ry>=0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rxbmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_ALLOWAIR && sim->bmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_WALL && sim->bmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_WALLELEC && (sim->bmap[(y+ry)/CELL][(x+rx)/CELL]!=WL_EWALL || sim->emap[(y+ry)/CELL][(x+rx)/CELL])) parts[i].life=50; @@ -262,7 +262,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS) int issingle = 1; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rxtmp&0xFF)>0 && (cpart->tmp&0xFF)=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx>3; ry = (rnd%5)-2; sry = (rnd%3)-1; - if (x+rx>=0 && y+ry>0 && x+rxportal_rx[count]; ry = sim->portal_ry[count]; - if (x+rx>=0 && y+ry>0 && x+rxportal_rx[count]; ry = sim->portal_ry[count]; - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx>= 3; ry = (rnd%5)-2; sry = (rnd%3)-1; - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rxbmap[(y+ry)/CELL][(x+rx)/CELL]) @@ -139,7 +139,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS) { if (sim->bmap[(y+ry)/CELL][(x+rx)/CELL] || (r && sim->elements[r&0xFF].State != ST_GAS - && (r&0xFF) != PT_SOAP && (r&0xFF) != PT_GLAS)) + && (r&0xFF) != PT_SOAP && (r&0xFF) != PT_GLAS)) { sim->detach(i); continue; @@ -202,7 +202,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS) } for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=1)//if nothing then create water @@ -115,7 +115,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS) { rx = rand()%5-2; ry = rand()%5-2; - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=374) for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=1)//if nothing then create steam diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index 3939bd8..8122385 100644 --- a/src/simulation/elements/SPRK.cpp +++ b/src/simulation/elements/SPRK.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_SPRK PT_SPRK 15 Element_SPRK::Element_SPRK() { - Identifier = "DEFAULT_PT_SPRK"; - Name = "SPRK"; - Colour = PIXPACK(0xFFFF80); - MenuVisible = 1; - MenuSection = SC_ELEC; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.001f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "Electricity. Conducted by metal and water."; - - State = ST_SOLID; - Properties = TYPE_SOLID|PROP_LIFE_DEC; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_SPRK::update; - Graphics = &Element_SPRK::graphics; + Identifier = "DEFAULT_PT_SPRK"; + Name = "SPRK"; + Colour = PIXPACK(0xFFFF80); + MenuVisible = 1; + MenuSection = SC_ELEC; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.001f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "Electricity. Conducted by metal and water."; + + State = ST_SOLID; + Properties = TYPE_SOLID|PROP_LIFE_DEC; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_SPRK::update; + Graphics = &Element_SPRK::graphics; } //#TPT-Directive ElementHeader Element_SPRK static int update(UPDATE_FUNC_ARGS) @@ -112,7 +112,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS) parts[i].tmp=300; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rxlegs[15] = playerp->legs[13]; playerp->legs[13] = pp; - //Setting accseleration to 0 + //Setting acceleration to 0 playerp->accs[0] = 0; playerp->accs[1] = 0; diff --git a/src/simulation/elements/STKM2.cpp b/src/simulation/elements/STKM2.cpp index a2c0073..0621d75 100644 --- a/src/simulation/elements/STKM2.cpp +++ b/src/simulation/elements/STKM2.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_STKM2 PT_STKM2 128 Element_STKM2::Element_STKM2() { - Identifier = "DEFAULT_PT_STKM2"; - Name = "STK2"; - Colour = PIXPACK(0x6464FF); - MenuVisible = 1; - MenuSection = SC_SPECIAL; - Enabled = 1; - - Advection = 0.5f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.2f; - Loss = 1.0f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.0f; - HotAir = 0.00f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 0; - - Weight = 50; - - Temperature = R_TEMP+14.6f+273.15f; - HeatConduct = 0; - Description = "Stickman. Don't kill him!"; - - State = ST_NONE; - Properties = 0; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 620.0f; - HighTemperatureTransition = PT_FIRE; - - Update = &Element_STKM2::update; - Graphics = &Element_STKM::graphics; + Identifier = "DEFAULT_PT_STKM2"; + Name = "STK2"; + Colour = PIXPACK(0x6464FF); + MenuVisible = 1; + MenuSection = SC_SPECIAL; + Enabled = 1; + + Advection = 0.5f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.2f; + Loss = 1.0f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.0f; + HotAir = 0.00f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 0; + + Weight = 50; + + Temperature = R_TEMP+14.6f+273.15f; + HeatConduct = 0; + Description = "Stickman. Don't kill him!"; + + State = ST_NONE; + Properties = 0; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 620.0f; + HighTemperatureTransition = PT_FIRE; + + Update = &Element_STKM2::update; + Graphics = &Element_STKM::graphics; } //#TPT-Directive ElementHeader Element_STKM2 static int update(UPDATE_FUNC_ARGS) diff --git a/src/simulation/elements/STNE.cpp b/src/simulation/elements/STNE.cpp index ff5251d..c2197c5 100644 --- a/src/simulation/elements/STNE.cpp +++ b/src/simulation/elements/STNE.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_STNE PT_STNE 5 Element_STNE::Element_STNE() { - Identifier = "DEFAULT_PT_STNE"; - Name = "STNE"; - Colour = PIXPACK(0xA0A0A0); - MenuVisible = 1; - MenuSection = SC_POWDERS; - Enabled = 1; - - Advection = 0.4f; - AirDrag = 0.04f * CFDS; - AirLoss = 0.94f; - Loss = 0.95f; - Collision = -0.1f; - Gravity = 0.3f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 1; - - Flammable = 0; - Explosive = 0; - Meltable = 5; - Hardness = 1; - - Weight = 90; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 150; - Description = "Heavy particles. Meltable."; - - State = ST_SOLID; - Properties = TYPE_PART; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = 983.0f; - HighTemperatureTransition = PT_LAVA; - - Update = NULL; - + Identifier = "DEFAULT_PT_STNE"; + Name = "STNE"; + Colour = PIXPACK(0xA0A0A0); + MenuVisible = 1; + MenuSection = SC_POWDERS; + Enabled = 1; + + Advection = 0.4f; + AirDrag = 0.04f * CFDS; + AirLoss = 0.94f; + Loss = 0.95f; + Collision = -0.1f; + Gravity = 0.3f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 1; + + Flammable = 0; + Explosive = 0; + Meltable = 5; + Hardness = 1; + + Weight = 90; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 150; + Description = "Heavy particles. Meltable."; + + State = ST_SOLID; + Properties = TYPE_PART; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = 983.0f; + HighTemperatureTransition = PT_LAVA; + + Update = NULL; + } Element_STNE::~Element_STNE() {} \ No newline at end of file diff --git a/src/simulation/elements/STOR.cpp b/src/simulation/elements/STOR.cpp index a9f5d94..5b51677 100644 --- a/src/simulation/elements/STOR.cpp +++ b/src/simulation/elements/STOR.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_STOR PT_STOR 83 Element_STOR::Element_STOR() { - Identifier = "DEFAULT_PT_STOR"; - Name = "STOR"; - Colour = PIXPACK(0x50DFDF); - MenuVisible = 1; - MenuSection = SC_POWERED; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 0; - Description = "Solid. Stores a single particle, releases when charged with PSCN, also passes to PIPE"; - - State = ST_NONE; - Properties = TYPE_SOLID; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_STOR::update; - Graphics = &Element_STOR::graphics; + Identifier = "DEFAULT_PT_STOR"; + Name = "STOR"; + Colour = PIXPACK(0x50DFDF); + MenuVisible = 1; + MenuSection = SC_POWERED; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 0; + Description = "Solid. Stores a single particle, releases when charged with PSCN, also passes to PIPE"; + + State = ST_NONE; + Properties = TYPE_SOLID; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_STOR::update; + Graphics = &Element_STOR::graphics; } //#TPT-Directive ElementHeader Element_STOR static int update(UPDATE_FUNC_ARGS) @@ -54,7 +54,7 @@ int Element_STOR::update(UPDATE_FUNC_ARGS) parts[i].life--; for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx>8)>=NPART || !r) diff --git a/src/simulation/elements/SWCH.cpp b/src/simulation/elements/SWCH.cpp index 422b7b5..fd8fd26 100644 --- a/src/simulation/elements/SWCH.cpp +++ b/src/simulation/elements/SWCH.cpp @@ -2,48 +2,48 @@ //#TPT-Directive ElementClass Element_SWCH PT_SWCH 56 Element_SWCH::Element_SWCH() { - Identifier = "DEFAULT_PT_SWCH"; - Name = "SWCH"; - Colour = PIXPACK(0x103B11); - MenuVisible = 1; - MenuSection = SC_ELEC; - Enabled = 1; - - Advection = 0.0f; - AirDrag = 0.00f * CFDS; - AirLoss = 0.90f; - Loss = 0.00f; - Collision = 0.0f; - Gravity = 0.0f; - Diffusion = 0.00f; - HotAir = 0.000f * CFDS; - Falldown = 0; - - Flammable = 0; - Explosive = 0; - Meltable = 0; - Hardness = 1; - - Weight = 100; - - Temperature = R_TEMP+0.0f +273.15f; - HeatConduct = 251; - Description = "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)"; - - State = ST_SOLID; - Properties = TYPE_SOLID; - - LowPressure = IPL; - LowPressureTransition = NT; - HighPressure = IPH; - HighPressureTransition = NT; - LowTemperature = ITL; - LowTemperatureTransition = NT; - HighTemperature = ITH; - HighTemperatureTransition = NT; - - Update = &Element_SWCH::update; - Graphics = &Element_SWCH::graphics; + Identifier = "DEFAULT_PT_SWCH"; + Name = "SWCH"; + Colour = PIXPACK(0x103B11); + MenuVisible = 1; + MenuSection = SC_ELEC; + Enabled = 1; + + Advection = 0.0f; + AirDrag = 0.00f * CFDS; + AirLoss = 0.90f; + Loss = 0.00f; + Collision = 0.0f; + Gravity = 0.0f; + Diffusion = 0.00f; + HotAir = 0.000f * CFDS; + Falldown = 0; + + Flammable = 0; + Explosive = 0; + Meltable = 0; + Hardness = 1; + + Weight = 100; + + Temperature = R_TEMP+0.0f +273.15f; + HeatConduct = 251; + Description = "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)"; + + State = ST_SOLID; + Properties = TYPE_SOLID; + + LowPressure = IPL; + LowPressureTransition = NT; + HighPressure = IPH; + HighPressureTransition = NT; + LowTemperature = ITL; + LowTemperatureTransition = NT; + HighTemperature = ITH; + HighTemperatureTransition = NT; + + Update = &Element_SWCH::update; + Graphics = &Element_SWCH::graphics; } bool isRedBRAY(UPDATE_FUNC_ARGS, int xc, int yc) @@ -59,7 +59,7 @@ int Element_SWCH::update(UPDATE_FUNC_ARGS) parts[i].life--; for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ny>=0 && x+nx>3)%7-3; - if(x+rx>=0 && y+ry>0 && x+rxelements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10)) @@ -133,7 +133,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { //Neighbor check loop for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx>3)%7-3; - if (x+rx>=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx=0 && y+ry>0 && x+rx Date: Wed, 13 Mar 2013 15:56:40 -0400 Subject: change BOUNDS_CHECK define to just be true, it isn't needed since an element can never update when it's closer than 3 pixels away from the edges of a save. diff --git a/src/simulation/Elements.h b/src/simulation/Elements.h index 73a7079..cb13216 100644 --- a/src/simulation/Elements.h +++ b/src/simulation/Elements.h @@ -46,7 +46,7 @@ #define GRAPHICS_FUNC_ARGS Renderer * ren, Particle *cpart, int nx, int ny, int *pixel_mode, int* cola, int *colr, int *colg, int *colb, int *firea, int *firer, int *fireg, int *fireb #define GRAPHICS_FUNC_SUBCALL_ARGS ren, cpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb -#define BOUNDS_CHECK x+rx>=0 && y+ry>0 && x+rx