Add DefaultProperties, replaces some of the case statements in create_part

The rest will will in a commit soon that adds the Create event and some other stuff
Lua events will come after that
PLSM default temp lowered to MAX_TEMP
This commit is contained in:
jacob1 2019-11-25 22:08:18 -05:00
parent 459790ffe0
commit 0078fb4c6f
193 changed files with 167 additions and 290 deletions

View File

@ -1803,7 +1803,7 @@ void GameSave::readPSv(char * saveDataChar, int dataLength)
} }
else else
{ {
particles[i-1].temp = elements[particles[i-1].type].Temperature; particles[i-1].temp = elements[particles[i-1].type].DefaultProperties.temp;
} }
} }
} }

View File

@ -1614,7 +1614,7 @@ int LuaScriptInterface::simulation_resetTemp(lua_State * l)
{ {
if (luacon_sim->parts[i].type && (luacon_sim->elements[luacon_sim->parts[i].type].HeatConduct || !onlyConductors)) if (luacon_sim->parts[i].type && (luacon_sim->elements[luacon_sim->parts[i].type].HeatConduct || !onlyConductors))
{ {
luacon_sim->parts[i].temp = luacon_sim->elements[luacon_sim->parts[i].type].Temperature; luacon_sim->parts[i].temp = luacon_sim->elements[luacon_sim->parts[i].type].DefaultProperties.temp;
} }
} }
return 0; return 0;

View File

@ -575,7 +575,7 @@ AnyType TPTScriptInterface::tptS_reset(std::deque<String> * words)
{ {
if (sim->parts[i].type) if (sim->parts[i].type)
{ {
sim->parts[i].temp = sim->elements[sim->parts[i].type].Temperature; sim->parts[i].temp = sim->elements[sim->parts[i].type].DefaultProperties.temp;
} }
} }
} }

View File

@ -3281,45 +3281,21 @@ int Simulation::create_part(int p, int x, int y, int t, int v)
if (i>parts_lastActiveIndex) parts_lastActiveIndex = i; if (i>parts_lastActiveIndex) parts_lastActiveIndex = i;
parts[i] = elements[t].DefaultProperties;
parts[i].type = t;
parts[i].x = (float)x; parts[i].x = (float)x;
parts[i].y = (float)y; parts[i].y = (float)y;
parts[i].type = t;
parts[i].vx = 0;
parts[i].vy = 0;
parts[i].life = 0;
parts[i].ctype = 0;
parts[i].temp = elements[t].Temperature;
parts[i].tmp = 0;
parts[i].tmp2 = 0;
parts[i].dcolour = 0;
parts[i].flags = 0;
if (t == PT_GLAS || t == PT_QRTZ || t == PT_TUNG) if (t == PT_GLAS || t == PT_QRTZ || t == PT_TUNG)
{ {
parts[i].pavg[0] = 0.0f; parts[i].pavg[0] = 0.0f;
parts[i].pavg[1] = pv[y/CELL][x/CELL]; parts[i].pavg[1] = pv[y/CELL][x/CELL];
} }
else
{
parts[i].pavg[0] = 0.0f;
parts[i].pavg[1] = 0.0f;
}
switch (t) switch (t)
{ {
case PT_SOAP:
parts[i].tmp = -1;
parts[i].tmp2 = -1;
break;
case PT_ACID: case PT_CAUS:
parts[i].life = 75;
break;
case PT_WARP: case PT_WARP:
parts[i].life = RNG::Ref().between(70, 164); parts[i].life = RNG::Ref().between(70, 164);
break; break;
case PT_FUSE:
parts[i].life = 50;
parts[i].tmp = 50;
break;
case PT_LIFE: case PT_LIFE:
if (v < NGOL) if (v < NGOL)
{ {
@ -3327,18 +3303,6 @@ int Simulation::create_part(int p, int x, int y, int t, int v)
parts[i].ctype = v; parts[i].ctype = v;
} }
break; break;
case PT_DEUT:
parts[i].life = 10;
break;
case PT_MERC:
parts[i].tmp = 10;
break;
case PT_BRAY:
parts[i].life = 30;
break;
case PT_GPMP: case PT_PUMP:
parts[i].life = 10;
break;
case PT_SING: case PT_SING:
parts[i].life = RNG::Ref().between(60, 109); parts[i].life = RNG::Ref().between(60, 109);
break; break;
@ -3349,26 +3313,6 @@ int Simulation::create_part(int p, int x, int y, int t, int v)
case PT_CLST: case PT_CLST:
parts[i].tmp = RNG::Ref().between(0, 6); parts[i].tmp = RNG::Ref().between(0, 6);
break; break;
case PT_FSEP:
parts[i].life = 50;
break;
case PT_COAL:
parts[i].life = 110;
parts[i].tmp = 50;
break;
case PT_IGNT:
parts[i].life = 3;
break;
case PT_FRZW:
parts[i].life = 100;
break;
case PT_PPIP:
case PT_PIPE:
parts[i].life = 60;
break;
case PT_BCOL:
parts[i].life = 110;
break;
case PT_FIRE: case PT_FIRE:
parts[i].life = RNG::Ref().between(120, 169); parts[i].life = RNG::Ref().between(120, 169);
break; break;
@ -3381,43 +3325,11 @@ int Simulation::create_part(int p, int x, int y, int t, int v)
case PT_LAVA: case PT_LAVA:
parts[i].life = RNG::Ref().between(240, 359); parts[i].life = RNG::Ref().between(240, 359);
break; break;
case PT_NBLE:
parts[i].life = 0;
break;
case PT_ICEI:
parts[i].ctype = PT_WATR;
break;
case PT_MORT:
parts[i].vx = 2;
break;
case PT_EXOT:
parts[i].life = 1000;
parts[i].tmp = 244;
break;
case PT_EMBR:
parts[i].life = 50;
break;
case PT_TESC: case PT_TESC:
parts[i].tmp = v; parts[i].tmp = v;
if (parts[i].tmp > 300) if (parts[i].tmp > 300)
parts[i].tmp=300; parts[i].tmp=300;
break; break;
case PT_BIZR: case PT_BIZRG: case PT_BIZRS:
parts[i].ctype = 0x47FFFF;
break;
case PT_DTEC:
case PT_TSNS:
case PT_LSNS:
parts[i].tmp2 = 2;
break;
case PT_VINE:
parts[i].tmp = 1;
break;
case PT_VIRS:
case PT_VRSS:
case PT_VRSG:
parts[i].pavg[1] = 250;
break;
case PT_CRMC: case PT_CRMC:
parts[i].tmp2 = RNG::Ref().between(0, 4); parts[i].tmp2 = RNG::Ref().between(0, 4);
break; break;
@ -4299,7 +4211,7 @@ void Simulation::UpdateParticles(int start, int end)
if ((elements[t].Explosive&2) && pv[y/CELL][x/CELL]>2.5f) if ((elements[t].Explosive&2) && pv[y/CELL][x/CELL]>2.5f)
{ {
parts[i].life = RNG::Ref().between(180, 259); parts[i].life = RNG::Ref().between(180, 259);
parts[i].temp = restrict_flt(elements[PT_FIRE].Temperature + (elements[t].Flammable/2), MIN_TEMP, MAX_TEMP); parts[i].temp = restrict_flt(elements[PT_FIRE].DefaultProperties.temp + (elements[t].Flammable/2), MIN_TEMP, MAX_TEMP);
t = PT_FIRE; t = PT_FIRE;
part_change_type(i,x,y,t); part_change_type(i,x,y,t);
pv[y/CELL][x/CELL] += 0.25f * CFDS; pv[y/CELL][x/CELL] += 0.25f * CFDS;

View File

@ -26,7 +26,6 @@ Element_116::Element_116()
Weight = 85; Weight = 85;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "A failed shared velocity test."; Description = "A failed shared velocity test.";

View File

@ -26,7 +26,7 @@ Element_146::Element_146()
Weight = 100; Weight = 100;
Temperature = 9000.0f; DefaultProperties.temp = 9000.0f;
HeatConduct = 40; HeatConduct = 40;
Description = "Brian 6 S6/B246/3"; Description = "Brian 6 S6/B246/3";

View File

@ -26,7 +26,6 @@ Element_ACEL::Element_ACEL()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Accelerator, speeds up nearby elements."; Description = "Accelerator, speeds up nearby elements.";

View File

@ -27,7 +27,6 @@ Element_ACID::Element_ACID()
Weight = 10; Weight = 10;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 34; HeatConduct = 34;
Description = "Dissolves almost everything."; Description = "Dissolves almost everything.";
@ -42,6 +41,8 @@ Element_ACID::Element_ACID()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 75;
Update = &Element_ACID::update; Update = &Element_ACID::update;
Graphics = &Element_ACID::graphics; Graphics = &Element_ACID::graphics;
} }

View File

@ -26,7 +26,6 @@ Element_AMTR::Element_AMTR()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Anti-Matter, destroys a majority of particles."; Description = "Anti-Matter, destroys a majority of particles.";

View File

@ -27,7 +27,6 @@ Element_ANAR::Element_ANAR()
Weight = 85; Weight = 85;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Anti-air. Very light dust, which behaves opposite gravity."; Description = "Anti-air. Very light dust, which behaves opposite gravity.";

View File

@ -26,7 +26,6 @@ Element_ARAY::Element_ARAY()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Ray Emitter. Rays create points when they collide."; Description = "Ray Emitter. Rays create points when they collide.";

View File

@ -26,7 +26,6 @@ Element_BANG::Element_BANG()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 88; HeatConduct = 88;
Description = "TNT, explodes all at once."; Description = "TNT, explodes all at once.";

View File

@ -26,7 +26,6 @@ Element_BCLN::Element_BCLN()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Breakable Clone."; Description = "Breakable Clone.";

View File

@ -27,7 +27,6 @@ Element_BCOL::Element_BCOL()
Weight = 90; Weight = 90;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 150; HeatConduct = 150;
Description = "Broken Coal. Heavy particles, burns slowly."; Description = "Broken Coal. Heavy particles, burns slowly.";
@ -42,6 +41,8 @@ Element_BCOL::Element_BCOL()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 110;
Update = &Element_COAL::update; Update = &Element_COAL::update;
Graphics = &Element_COAL::graphics; Graphics = &Element_COAL::graphics;
} }

View File

@ -26,7 +26,6 @@ Element_BGLA::Element_BGLA()
Weight = 90; Weight = 90;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 150; HeatConduct = 150;
Description = "Broken Glass, heavy particles formed when glass breaks under pressure. Meltable. Bagels."; Description = "Broken Glass, heavy particles formed when glass breaks under pressure. Meltable. Bagels.";

View File

@ -26,7 +26,7 @@ Element_BHOL::Element_BHOL()
Weight = 100; Weight = 100;
Temperature = R_TEMP+70.0f+273.15f; DefaultProperties.temp = R_TEMP + 70.0f + 273.15f;
HeatConduct = 255; HeatConduct = 255;
Description = "Vacuum, sucks in other particles and heats up."; Description = "Vacuum, sucks in other particles and heats up.";

View File

@ -26,7 +26,6 @@ Element_BIZR::Element_BIZR()
Weight = 30; Weight = 30;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Bizarre... contradicts the normal state changes. Paints other elements with its deco color."; Description = "Bizarre... contradicts the normal state changes. Paints other elements with its deco color.";
@ -41,6 +40,8 @@ Element_BIZR::Element_BIZR()
HighTemperature = 400.0f; HighTemperature = 400.0f;
HighTemperatureTransition = PT_BIZRS; HighTemperatureTransition = PT_BIZRS;
DefaultProperties.ctype = 0x47FFFF;
Update = &Element_BIZR::update; Update = &Element_BIZR::update;
Graphics = &Element_BIZR::graphics; Graphics = &Element_BIZR::graphics;
} }

View File

@ -26,7 +26,7 @@ Element_BIZRG::Element_BIZRG()
Weight = 1; Weight = 1;
Temperature = R_TEMP-200.0f+273.15f; DefaultProperties.temp = R_TEMP - 200.0f + 273.15f;
HeatConduct = 42; HeatConduct = 42;
Description = "Bizarre gas."; Description = "Bizarre gas.";
@ -41,6 +41,8 @@ Element_BIZRG::Element_BIZRG()
HighTemperature = 100.0f; HighTemperature = 100.0f;
HighTemperatureTransition = PT_BIZR; HighTemperatureTransition = PT_BIZR;
DefaultProperties.ctype = 0x47FFFF;
Update = &Element_BIZR::update; Update = &Element_BIZR::update;
Graphics = &Element_BIZR::graphics; Graphics = &Element_BIZR::graphics;
} }

View File

@ -26,7 +26,7 @@ Element_BIZRS::Element_BIZRS()
Weight = 100; Weight = 100;
Temperature = R_TEMP+300.0f+273.15f; DefaultProperties.temp = R_TEMP + 300.0f + 273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Bizarre solid."; Description = "Bizarre solid.";
@ -41,6 +41,8 @@ Element_BIZRS::Element_BIZRS()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.ctype = 0x47FFFF;
Update = &Element_BIZR::update; Update = &Element_BIZR::update;
Graphics = &Element_BIZR::graphics; Graphics = &Element_BIZR::graphics;
} }

View File

@ -26,7 +26,6 @@ Element_BMTL::Element_BMTL()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Breakable metal. Common conductive building material, can melt and break under pressure."; Description = "Breakable metal. Common conductive building material, can melt and break under pressure.";

View File

@ -26,7 +26,7 @@ Element_BOMB::Element_BOMB()
Weight = 30; Weight = 30;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Bomb. Explodes and destroys all surrounding particles when it touches something."; Description = "Bomb. Explodes and destroys all surrounding particles when it touches something.";

View File

@ -26,7 +26,7 @@ Element_BOYL::Element_BOYL()
Weight = 1; Weight = 1;
Temperature = R_TEMP+2.0f +273.15f; DefaultProperties.temp = R_TEMP + 2.0f + 273.15f;
HeatConduct = 42; HeatConduct = 42;
Description = "Boyle, variable pressure gas. Expands when heated."; Description = "Boyle, variable pressure gas. Expands when heated.";

View File

@ -26,7 +26,6 @@ Element_BRAY::Element_BRAY()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Ray Point. Rays create points when they collide."; Description = "Ray Point. Rays create points when they collide.";
@ -41,6 +40,8 @@ Element_BRAY::Element_BRAY()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 30;
Update = NULL; Update = NULL;
Graphics = &Element_BRAY::graphics; Graphics = &Element_BRAY::graphics;
} }

View File

@ -26,7 +26,6 @@ Element_BRCK::Element_BRCK()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Brick, breakable building material."; Description = "Brick, breakable building material.";

View File

@ -26,7 +26,6 @@ Element_BREC::Element_BREC()
Weight = 90; Weight = 90;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 211; HeatConduct = 211;
Description = "Broken electronics. Formed from EMP blasts, and when constantly sparked while under pressure, turns to EXOT."; Description = "Broken electronics. Formed from EMP blasts, and when constantly sparked while under pressure, turns to EXOT.";

View File

@ -26,7 +26,6 @@ Element_BRMT::Element_BRMT()
Weight = 90; Weight = 90;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 211; HeatConduct = 211;
Description = "Broken metal. Created when iron rusts or when metals break from pressure."; Description = "Broken metal. Created when iron rusts or when metals break from pressure.";

View File

@ -26,7 +26,6 @@ Element_BTRY::Element_BTRY()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Battery. Generates infinite electricity."; Description = "Battery. Generates infinite electricity.";

View File

@ -26,7 +26,7 @@ Element_BVBR::Element_BVBR()
Weight = 67; Weight = 67;
Temperature = 273.15f; DefaultProperties.temp = 273.15f;
HeatConduct = 164; HeatConduct = 164;
Description = "Broken vibranium."; Description = "Broken vibranium.";

View File

@ -26,7 +26,6 @@ Element_C5::Element_C5()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 88; HeatConduct = 88;
Description = "Cold explosive, set off by anything cold."; Description = "Cold explosive, set off by anything cold.";

View File

@ -26,7 +26,6 @@ Element_CAUS::Element_CAUS()
Weight = 1; Weight = 1;
Temperature = R_TEMP+273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Caustic Gas, acts like ACID."; Description = "Caustic Gas, acts like ACID.";
@ -41,6 +40,8 @@ Element_CAUS::Element_CAUS()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 75;
Update = &Element_CAUS::update; Update = &Element_CAUS::update;
} }

View File

@ -26,7 +26,7 @@ Element_CBNW::Element_CBNW()
Weight = 30; Weight = 30;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Carbonated water. Slowly releases CO2."; Description = "Carbonated water. Slowly releases CO2.";

View File

@ -28,7 +28,7 @@ Element_CFLM::Element_CFLM()
Weight = 2; Weight = 2;
Temperature = 0.0f; DefaultProperties.temp = 0.0f;
HeatConduct = 88; HeatConduct = 88;
Description = "Sub-zero flame."; Description = "Sub-zero flame.";

View File

@ -26,7 +26,6 @@ Element_CLNE::Element_CLNE()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Clone. Duplicates any particles it touches."; Description = "Clone. Duplicates any particles it touches.";

View File

@ -26,7 +26,6 @@ Element_CLST::Element_CLST()
Weight = 55; Weight = 55;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Clay dust. Produces paste when mixed with water."; Description = "Clay dust. Produces paste when mixed with water.";

View File

@ -26,7 +26,6 @@ Element_CNCT::Element_CNCT()
Weight = 55; Weight = 55;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 100; HeatConduct = 100;
Description = "Concrete, stronger than stone."; Description = "Concrete, stronger than stone.";

View File

@ -26,7 +26,6 @@ Element_CO2::Element_CO2()
Weight = 1; Weight = 1;
Temperature = R_TEMP+273.15f;
HeatConduct = 88; HeatConduct = 88;
Description = "Carbon Dioxide. Heavy gas, drifts downwards. Carbonates water and turns to dry ice when cold."; Description = "Carbon Dioxide. Heavy gas, drifts downwards. Carbonates water and turns to dry ice when cold.";

View File

@ -27,7 +27,6 @@ Element_COAL::Element_COAL()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 200; HeatConduct = 200;
Description = "Coal, Burns very slowly. Gets red when hot."; Description = "Coal, Burns very slowly. Gets red when hot.";
@ -42,6 +41,9 @@ Element_COAL::Element_COAL()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 110;
DefaultProperties.tmp = 50;
Update = &Element_COAL::update; Update = &Element_COAL::update;
Graphics = &Element_COAL::graphics; Graphics = &Element_COAL::graphics;
} }

View File

@ -26,7 +26,6 @@ Element_CONV::Element_CONV()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Converter. Converts everything into whatever it first touches."; Description = "Converter. Converts everything into whatever it first touches.";

View File

@ -26,7 +26,6 @@ Element_CRAY::Element_CRAY()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Particle Ray Emitter. Creates a beam of particles set by its ctype, with a range set by tmp."; Description = "Particle Ray Emitter. Creates a beam of particles set by its ctype, with a range set by tmp.";
@ -166,7 +165,7 @@ bool Element_CRAY::ctypeDraw(CTYPEDRAW_FUNC_ARGS)
{ {
sim->parts[i].ctype |= PMAPID(30); sim->parts[i].ctype |= PMAPID(30);
} }
sim->parts[i].temp = sim->elements[t].Temperature; sim->parts[i].temp = sim->elements[t].DefaultProperties.temp;
return true; return true;
} }

View File

@ -26,7 +26,6 @@ Element_CRMC::Element_CRMC()
Weight = 100; Weight = 100;
Temperature = R_TEMP+273.15f;
HeatConduct = 35; HeatConduct = 35;
Description = "Ceramic. Gets stronger under pressure."; Description = "Ceramic. Gets stronger under pressure.";

View File

@ -26,7 +26,6 @@ Element_DCEL::Element_DCEL()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Decelerator, slows down nearby elements."; Description = "Decelerator, slows down nearby elements.";

View File

@ -26,7 +26,6 @@ Element_DESL::Element_DESL()
Weight = 15; Weight = 15;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 42; HeatConduct = 42;
Description = "Liquid diesel. Explodes under high pressure and temperatures."; Description = "Liquid diesel. Explodes under high pressure and temperatures.";

View File

@ -26,7 +26,6 @@ Element_DEST::Element_DEST()
Weight = 101; Weight = 101;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 150; HeatConduct = 150;
Description = "More destructive Bomb, can break through virtually anything."; Description = "More destructive Bomb, can break through virtually anything.";

View File

@ -26,7 +26,7 @@ Element_DEUT::Element_DEUT()
Weight = 31; Weight = 31;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Deuterium oxide. Volume changes with temp, radioactive with neutrons."; Description = "Deuterium oxide. Volume changes with temp, radioactive with neutrons.";
@ -41,6 +41,8 @@ Element_DEUT::Element_DEUT()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 10;
Update = &Element_DEUT::update; Update = &Element_DEUT::update;
Graphics = &Element_DEUT::graphics; Graphics = &Element_DEUT::graphics;
} }

View File

@ -26,7 +26,7 @@ Element_DLAY::Element_DLAY()
Weight = 100; Weight = 100;
Temperature = 4.0f+273.15f; DefaultProperties.temp = 4.0f + 273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Conducts with temperature-dependent delay. (use HEAT/COOL)."; Description = "Conducts with temperature-dependent delay. (use HEAT/COOL).";

View File

@ -26,7 +26,7 @@ Element_DMG::Element_DMG()
Weight = 30; Weight = 30;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Generates damaging pressure and breaks any elements it hits."; Description = "Generates damaging pressure and breaks any elements it hits.";

View File

@ -26,7 +26,6 @@ Element_DMND::Element_DMND()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 186; HeatConduct = 186;
Description = "Diamond. Indestructible."; Description = "Diamond. Indestructible.";

View File

@ -26,7 +26,6 @@ Element_DRAY::Element_DRAY()
Weight = 100; Weight = 100;
Temperature = R_TEMP + 273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Duplicator ray. Replicates a line of particles in front of it."; Description = "Duplicator ray. Replicates a line of particles in front of it.";

View File

@ -26,7 +26,7 @@ Element_DRIC::Element_DRIC()
Weight = 100; Weight = 100;
Temperature = 172.65f; DefaultProperties.temp = 172.65f;
HeatConduct = 2; HeatConduct = 2;
Description = "Dry Ice, formed when CO2 is cooled."; Description = "Dry Ice, formed when CO2 is cooled.";

View File

@ -26,7 +26,7 @@ Element_DSTW::Element_DSTW()
Weight = 30; Weight = 30;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 23; HeatConduct = 23;
Description = "Distilled water, does not conduct electricity."; Description = "Distilled water, does not conduct electricity.";

View File

@ -26,7 +26,6 @@ Element_DTEC::Element_DTEC()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Detector, creates a spark when something with its ctype is nearby."; Description = "Detector, creates a spark when something with its ctype is nearby.";
@ -41,6 +40,8 @@ Element_DTEC::Element_DTEC()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.tmp2 = 2;
Update = &Element_DTEC::update; Update = &Element_DTEC::update;
CtypeDraw = &Element::ctypeDrawVInTmp; CtypeDraw = &Element::ctypeDrawVInTmp;
} }

View File

@ -27,7 +27,6 @@ Element_DUST::Element_DUST()
Weight = 85; Weight = 85;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Very light dust. Flammable."; Description = "Very light dust. Flammable.";

View File

@ -26,7 +26,6 @@ Element_DYST::Element_DYST()
Weight = 80; Weight = 80;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Dead Yeast."; Description = "Dead Yeast.";

View File

@ -26,7 +26,7 @@ Element_ELEC::Element_ELEC()
Weight = -1; Weight = -1;
Temperature = R_TEMP+200.0f+273.15f; DefaultProperties.temp = R_TEMP + 200.0f + 273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Electrons. Sparks electronics, reacts with NEUT and WATR."; Description = "Electrons. Sparks electronics, reacts with NEUT and WATR.";

View File

@ -26,7 +26,7 @@ Element_EMBR::Element_EMBR()
Weight = 30; Weight = 30;
Temperature = 500.0f +273.15f; DefaultProperties.temp = 500.0f + 273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Sparks. Formed by explosions."; Description = "Sparks. Formed by explosions.";
@ -41,6 +41,8 @@ Element_EMBR::Element_EMBR()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 50;
Update = &Element_EMBR::update; Update = &Element_EMBR::update;
Graphics = &Element_EMBR::graphics; Graphics = &Element_EMBR::graphics;
} }

View File

@ -28,7 +28,6 @@ Element_EMP::Element_EMP()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 121; HeatConduct = 121;
Description = "Electromagnetic pulse. Breaks activated electronics."; Description = "Electromagnetic pulse. Breaks activated electronics.";

View File

@ -28,7 +28,6 @@ Element_ETRD::Element_ETRD()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)"; Description = "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)";

View File

@ -26,7 +26,7 @@ Element_EXOT::Element_EXOT()
Weight = 46; Weight = 46;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 250; HeatConduct = 250;
Description = "Exotic matter. Explodes with excess exposure to electrons. Has many other odd reactions."; Description = "Exotic matter. Explodes with excess exposure to electrons. Has many other odd reactions.";
@ -41,6 +41,9 @@ Element_EXOT::Element_EXOT()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 1000;
DefaultProperties.tmp = 244;
Update = &Element_EXOT::update; Update = &Element_EXOT::update;
Graphics = &Element_EXOT::graphics; Graphics = &Element_EXOT::graphics;
} }

View File

@ -28,7 +28,6 @@ Element::Element():
Weight(50), Weight(50),
Temperature(273.15f),
HeatConduct(128), HeatConduct(128),
Description("No description"), Description("No description"),
@ -48,6 +47,8 @@ Element::Element():
CtypeDraw(nullptr), CtypeDraw(nullptr),
IconGenerator(nullptr) IconGenerator(nullptr)
{ {
memset(&DefaultProperties, 0, sizeof(Particle));
DefaultProperties.temp = R_TEMP + 273.15f;
} }
std::vector<StructProperty> const &Element::GetProperties() std::vector<StructProperty> const &Element::GetProperties()
@ -75,7 +76,7 @@ std::vector<StructProperty> const &Element::GetProperties()
{ "Hardness", StructProperty::Integer, offsetof(Element, Hardness ) }, { "Hardness", StructProperty::Integer, offsetof(Element, Hardness ) },
{ "PhotonReflectWavelengths", StructProperty::UInteger, offsetof(Element, PhotonReflectWavelengths ) }, { "PhotonReflectWavelengths", StructProperty::UInteger, offsetof(Element, PhotonReflectWavelengths ) },
{ "Weight", StructProperty::Integer, offsetof(Element, Weight ) }, { "Weight", StructProperty::Integer, offsetof(Element, Weight ) },
{ "Temperature", StructProperty::Float, offsetof(Element, Temperature ) }, { "Temperature", StructProperty::Float, offsetof(Element, DefaultProperties.temp ) },
{ "HeatConduct", StructProperty::UChar, offsetof(Element, HeatConduct ) }, { "HeatConduct", StructProperty::UChar, offsetof(Element, HeatConduct ) },
{ "Description", StructProperty::String, offsetof(Element, Description ) }, { "Description", StructProperty::String, offsetof(Element, Description ) },
{ "State", StructProperty::Removed, 0 }, { "State", StructProperty::Removed, 0 },

View File

@ -2,8 +2,9 @@
#define ELEMENTCLASS_H #define ELEMENTCLASS_H
#include "graphics/Pixel.h" #include "graphics/Pixel.h"
#include "simulation/StructProperty.h"
#include "simulation/ElementDefs.h" #include "simulation/ElementDefs.h"
#include "simulation/Particle.h"
#include "simulation/StructProperty.h"
class Simulation; class Simulation;
class Renderer; class Renderer;
@ -36,7 +37,6 @@ public:
// Photon wavelengths are ANDed with this value when a photon hits an element, meaning that only wavelengths present in both this value and the original photon will remain in the reflected photon // Photon wavelengths are ANDed with this value when a photon hits an element, meaning that only wavelengths present in both this value and the original photon will remain in the reflected photon
unsigned int PhotonReflectWavelengths; unsigned int PhotonReflectWavelengths;
int Weight; int Weight;
float Temperature;
unsigned char HeatConduct; unsigned char HeatConduct;
String Description; String Description;
unsigned int Properties; unsigned int Properties;
@ -56,6 +56,8 @@ public:
VideoBuffer * (*IconGenerator)(int, int, int); VideoBuffer * (*IconGenerator)(int, int, int);
Particle DefaultProperties;
Element(); Element();
virtual ~Element() {} virtual ~Element() {}
static int defaultGraphics(GRAPHICS_FUNC_ARGS); static int defaultGraphics(GRAPHICS_FUNC_ARGS);

View File

@ -27,7 +27,7 @@ Element_FIGH::Element_FIGH()
Weight = 50; Weight = 50;
Temperature = R_TEMP+14.6f+273.15f; DefaultProperties.temp = R_TEMP + 14.6f + 273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Fighter. Tries to kill stickmen. You must first give it an element to kill him with."; Description = "Fighter. Tries to kill stickmen. You must first give it an element to kill him with.";
@ -42,6 +42,8 @@ Element_FIGH::Element_FIGH()
HighTemperature = 620.0f; HighTemperature = 620.0f;
HighTemperatureTransition = PT_FIRE; HighTemperatureTransition = PT_FIRE;
DefaultProperties.life = 100;
Update = &Element_FIGH::update; Update = &Element_FIGH::update;
Graphics = &Element_STKM::graphics; Graphics = &Element_STKM::graphics;
} }
@ -89,8 +91,8 @@ int Element_FIGH::update(UPDATE_FUNC_ARGS)
if ((pow(float(tarx-x), 2) + pow(float(tary-y), 2))<600) if ((pow(float(tarx-x), 2) + pow(float(tary-y), 2))<600)
{ {
if (figh->elem == PT_LIGH || figh->elem == PT_NEUT if (figh->elem == PT_LIGH || figh->elem == PT_NEUT
|| sim->elements[figh->elem].Properties&(PROP_DEADLY|PROP_RADIOACTIVE) || sim->elements[figh->elem].Properties & (PROP_DEADLY | PROP_RADIOACTIVE)
|| sim->elements[figh->elem].Temperature>=323 || sim->elements[figh->elem].Temperature<=243) || sim->elements[figh->elem].DefaultProperties.temp >= 323 || sim->elements[figh->elem].DefaultProperties.temp <= 243)
figh->comm = (int)figh->comm | 0x08; figh->comm = (int)figh->comm | 0x08;
} }
else if (tarx<x) else if (tarx<x)

View File

@ -26,7 +26,6 @@ Element_FILT::Element_FILT()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Filter for photons, changes the color."; Description = "Filter for photons, changes the color.";

View File

@ -28,7 +28,7 @@ Element_FIRE::Element_FIRE()
Weight = 2; Weight = 2;
Temperature = R_TEMP+400.0f+273.15f; DefaultProperties.temp = R_TEMP + 400.0f + 273.15f;
HeatConduct = 88; HeatConduct = 88;
Description = "Ignites flammable materials. Heats air."; Description = "Ignites flammable materials. Heats air.";
@ -160,7 +160,7 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS)
(rt != PT_SPNG || parts[ID(r)].life == 0)) (rt != PT_SPNG || parts[ID(r)].life == 0))
{ {
sim->part_change_type(ID(r), x+rx, y+ry, PT_FIRE); sim->part_change_type(ID(r), x+rx, y+ry, PT_FIRE);
parts[ID(r)].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP); parts[ID(r)].temp = restrict_flt(sim->elements[PT_FIRE].DefaultProperties.temp + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP);
parts[ID(r)].life = RNG::Ref().between(180, 259); parts[ID(r)].life = RNG::Ref().between(180, 259);
parts[ID(r)].tmp = parts[ID(r)].ctype = 0; parts[ID(r)].tmp = parts[ID(r)].ctype = 0;
if (sim->elements[rt].Explosive) if (sim->elements[rt].Explosive)

View File

@ -27,7 +27,6 @@ Element_FIRW::Element_FIRW()
Weight = 55; Weight = 55;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Fireworks! Colorful, set off by fire."; Description = "Fireworks! Colorful, set off by fire.";

View File

@ -26,7 +26,7 @@ Element_FOG::Element_FOG()
Weight = 1; Weight = 1;
Temperature = 243.15f; DefaultProperties.temp = 243.15f;
HeatConduct = 100; HeatConduct = 100;
Description = "Fog, created when an electric current is passed through RIME."; Description = "Fog, created when an electric current is passed through RIME.";

View File

@ -26,7 +26,7 @@ Element_FRAY::Element_FRAY()
Weight = 100; Weight = 100;
Temperature = 20.0f+0.0f +273.15f; DefaultProperties.temp = 20.0f + 273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Force Emitter. Pushes or pulls objects based on its temperature. Use like ARAY."; Description = "Force Emitter. Pushes or pulls objects based on its temperature. Use like ARAY.";

View File

@ -26,7 +26,6 @@ Element_FRME::Element_FRME()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Frame, can be used with pistons to push many particles."; Description = "Frame, can be used with pistons to push many particles.";

View File

@ -26,7 +26,7 @@ Element_FRZW::Element_FRZW()
Weight = 30; Weight = 30;
Temperature = 120.0f; DefaultProperties.temp = 120.0f;
HeatConduct = 29; HeatConduct = 29;
Description = "Freeze water. Hybrid liquid formed when Freeze powder melts."; Description = "Freeze water. Hybrid liquid formed when Freeze powder melts.";
@ -41,6 +41,8 @@ Element_FRZW::Element_FRZW()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 100;
Update = &Element_FRZW::update; Update = &Element_FRZW::update;
} }

View File

@ -26,7 +26,7 @@ Element_FRZZ::Element_FRZZ()
Weight = 50; Weight = 50;
Temperature = 253.15f; DefaultProperties.temp = 253.15f;
HeatConduct = 46; HeatConduct = 46;
Description = "Freeze powder. When melted, forms ice that always cools. Spreads with regular water."; Description = "Freeze powder. When melted, forms ice that always cools. Spreads with regular water.";

View File

@ -26,7 +26,6 @@ Element_FSEP::Element_FSEP()
Weight = 70; Weight = 70;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Fuse Powder. Burns slowly like FUSE."; Description = "Fuse Powder. Burns slowly like FUSE.";
@ -41,6 +40,8 @@ Element_FSEP::Element_FSEP()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 50;
Update = &Element_FSEP::update; Update = &Element_FSEP::update;
} }

View File

@ -26,7 +26,6 @@ Element_FUSE::Element_FUSE()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 200; HeatConduct = 200;
Description = "Burns slowly. Ignites at somewhat high temperatures or with electricity."; Description = "Burns slowly. Ignites at somewhat high temperatures or with electricity.";
@ -41,6 +40,9 @@ Element_FUSE::Element_FUSE()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 50;
DefaultProperties.tmp = 50;
Update = &Element_FUSE::update; Update = &Element_FUSE::update;
} }

View File

@ -28,7 +28,6 @@ Element_FWRK::Element_FWRK()
Weight = 97; Weight = 97;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 100; HeatConduct = 100;
Description = "Original version of fireworks, activated by heat/neutrons."; Description = "Original version of fireworks, activated by heat/neutrons.";

View File

@ -26,7 +26,7 @@ Element_GAS::Element_GAS()
Weight = 1; Weight = 1;
Temperature = R_TEMP+2.0f +273.15f; DefaultProperties.temp = R_TEMP + 2.0f + 273.15f;
HeatConduct = 42; HeatConduct = 42;
Description = "Diffuses quickly and is flammable. Liquefies into OIL under pressure."; Description = "Diffuses quickly and is flammable. Liquefies into OIL under pressure.";

View File

@ -26,7 +26,7 @@ Element_GBMB::Element_GBMB()
Weight = 30; Weight = 30;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Gravity bomb. Sticks to the first object it touches then produces a strong gravity push."; Description = "Gravity bomb. Sticks to the first object it touches then produces a strong gravity push.";

View File

@ -26,7 +26,7 @@ Element_GEL::Element_GEL()
Weight = 35; Weight = 35;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Gel. A liquid with variable viscosity and heat conductivity."; Description = "Gel. A liquid with variable viscosity and heat conductivity.";

View File

@ -26,7 +26,6 @@ Element_GLAS::Element_GLAS()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 150; HeatConduct = 150;
Description = "Glass. Meltable. Shatters under pressure, and refracts photons."; Description = "Glass. Meltable. Shatters under pressure, and refracts photons.";

View File

@ -26,7 +26,7 @@ Element_GLOW::Element_GLOW()
Weight = 40; Weight = 40;
Temperature = R_TEMP+20.0f+273.15f; DefaultProperties.temp = R_TEMP + 20.0f + 273.15f;
HeatConduct = 44; HeatConduct = 44;
Description = "Glow, Glows under pressure."; Description = "Glow, Glows under pressure.";

View File

@ -28,7 +28,6 @@ Element_GOLD::Element_GOLD()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Corrosion resistant metal, will reverse corrosion of iron."; Description = "Corrosion resistant metal, will reverse corrosion of iron.";

View File

@ -27,7 +27,6 @@ Element_GOO::Element_GOO()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 75; HeatConduct = 75;
Description = "Deforms and disappears under pressure."; Description = "Deforms and disappears under pressure.";

View File

@ -26,7 +26,6 @@ Element_GPMP::Element_GPMP()
Weight = 100; Weight = 100;
Temperature = 0.0f +273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Gravity pump. Changes gravity to its temp when activated. (use HEAT/COOL)"; Description = "Gravity pump. Changes gravity to its temp when activated. (use HEAT/COOL)";
@ -41,6 +40,8 @@ Element_GPMP::Element_GPMP()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.life = 10;
Update = &Element_GPMP::update; Update = &Element_GPMP::update;
Graphics = &Element_GPMP::graphics; Graphics = &Element_GPMP::graphics;
} }

View File

@ -28,7 +28,6 @@ Element_GRAV::Element_GRAV()
Weight = 85; Weight = 85;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70; HeatConduct = 70;
Description = "Very light dust. Changes colour based on velocity."; Description = "Very light dust. Changes colour based on velocity.";

View File

@ -26,7 +26,6 @@ Element_GRVT::Element_GRVT()
Weight = -1; Weight = -1;
Temperature = R_TEMP+273.15f;
HeatConduct = 61; HeatConduct = 61;
Description = "Gravitons. Create Newtonian Gravity."; Description = "Gravitons. Create Newtonian Gravity.";
@ -41,6 +40,8 @@ Element_GRVT::Element_GRVT()
HighTemperature = ITH; HighTemperature = ITH;
HighTemperatureTransition = NT; HighTemperatureTransition = NT;
DefaultProperties.tmp = 7;
Update = &Element_GRVT::update; Update = &Element_GRVT::update;
Graphics = &Element_GRVT::graphics; Graphics = &Element_GRVT::graphics;
} }

View File

@ -26,7 +26,6 @@ Element_GUNP::Element_GUNP()
Weight = 85; Weight = 85;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 97; HeatConduct = 97;
Description = "Gunpowder. Light dust, explodes on contact with fire or spark."; Description = "Gunpowder. Light dust, explodes on contact with fire or spark.";

View File

@ -26,7 +26,6 @@ Element_H2::Element_H2()
Weight = 1; Weight = 1;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Hydrogen. Combusts with OXYG to make WATR. Undergoes fusion at high temperature and pressure."; Description = "Hydrogen. Combusts with OXYG to make WATR. Undergoes fusion at high temperature and pressure.";

View File

@ -29,7 +29,6 @@ Element_HEAC::Element_HEAC()
Weight = 100; Weight = 100;
Temperature = R_TEMP+273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Rapid heat conductor."; Description = "Rapid heat conductor.";

View File

@ -26,7 +26,6 @@ Element_HSWC::Element_HSWC()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Heat switch. Conducts heat only when activated."; Description = "Heat switch. Conducts heat only when activated.";

View File

@ -26,7 +26,7 @@ Element_ICEI::Element_ICEI()
Weight = 100; Weight = 100;
Temperature = R_TEMP-50.0f+273.15f; DefaultProperties.temp = R_TEMP - 50.0f + 273.15f;
HeatConduct = 46; HeatConduct = 46;
Description = "Crushes under pressure. Cools down air."; Description = "Crushes under pressure. Cools down air.";
@ -41,6 +41,8 @@ Element_ICEI::Element_ICEI()
HighTemperature = 252.05f; HighTemperature = 252.05f;
HighTemperatureTransition = ST; HighTemperatureTransition = ST;
DefaultProperties.ctype = PT_WATR;
Update = &Element_ICEI::update; Update = &Element_ICEI::update;
} }

View File

@ -26,7 +26,6 @@ Element_IGNT::Element_IGNT()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 88; HeatConduct = 88;
Description = "Ignition cord. Burns slowly with fire and sparks."; Description = "Ignition cord. Burns slowly with fire and sparks.";
@ -41,6 +40,8 @@ Element_IGNT::Element_IGNT()
HighTemperature = 673.0f; HighTemperature = 673.0f;
HighTemperatureTransition = PT_FIRE; HighTemperatureTransition = PT_FIRE;
DefaultProperties.life = 3;
Update = &Element_IGNT::update; Update = &Element_IGNT::update;
} }

View File

@ -26,7 +26,6 @@ Element_INSL::Element_INSL()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Insulator, does not conduct heat and blocks electricity."; Description = "Insulator, does not conduct heat and blocks electricity.";

View File

@ -26,7 +26,6 @@ Element_INST::Element_INST()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Instantly conducts, PSCN to charge, NSCN to take."; Description = "Instantly conducts, PSCN to charge, NSCN to take.";

View File

@ -26,7 +26,6 @@ Element_INVIS::Element_INVIS()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 164; HeatConduct = 164;
Description = "Invisible to particles while under pressure."; Description = "Invisible to particles while under pressure.";

View File

@ -26,7 +26,6 @@ Element_INWR::Element_INWR()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Insulated Wire. Doesn't conduct to metal or semiconductors."; Description = "Insulated Wire. Doesn't conduct to metal or semiconductors.";

View File

@ -26,7 +26,6 @@ Element_IRON::Element_IRON()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Rusts with salt, can be used for electrolysis of WATR."; Description = "Rusts with salt, can be used for electrolysis of WATR.";

View File

@ -26,7 +26,7 @@ Element_ISOZ::Element_ISOZ()
Weight = 24; Weight = 24;
Temperature = R_TEMP-2.0f +273.15f; DefaultProperties.temp = R_TEMP - 2.0f + 273.15f;
HeatConduct = 29; HeatConduct = 29;
Description = "Isotope-Z. Radioactive liquid, decays into photons when touching PHOT or under negative pressure."; Description = "Isotope-Z. Radioactive liquid, decays into photons when touching PHOT or under negative pressure.";

View File

@ -26,7 +26,7 @@ Element_ISZS::Element_ISZS()
Weight = 100; Weight = 100;
Temperature = 140.00f; DefaultProperties.temp = 140.00f;
HeatConduct = 251; HeatConduct = 251;
Description = "Solid form of ISOZ, slowly decays into PHOT."; Description = "Solid form of ISOZ, slowly decays into PHOT.";

View File

@ -27,7 +27,7 @@ Element_LAVA::Element_LAVA()
Weight = 45; Weight = 45;
Temperature = R_TEMP+1500.0f+273.15f; DefaultProperties.temp = R_TEMP + 1500.0f + 273.15f;
HeatConduct = 60; HeatConduct = 60;
Description = "Molten lava. Ignites flammable materials. Generated when metals and other materials melt, solidifies when cold."; Description = "Molten lava. Ignites flammable materials. Generated when metals and other materials melt, solidifies when cold.";

View File

@ -26,7 +26,6 @@ Element_LCRY::Element_LCRY()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251; HeatConduct = 251;
Description = "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)"; Description = "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)";

View File

@ -28,7 +28,6 @@ Element_LDTC::Element_LDTC()
Weight = 100; Weight = 100;
Temperature = R_TEMP + 273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Linear detector. Scans in 8 directions for particles with its ctype and creates a spark on the opposite side."; Description = "Linear detector. Scans in 8 directions for particles with its ctype and creates a spark on the opposite side.";

View File

@ -30,7 +30,7 @@ Element_LIFE::Element_LIFE()
Weight = 100; Weight = 100;
Temperature = 9000.0f; DefaultProperties.temp = 9000.0f;
HeatConduct = 40; HeatConduct = 40;
Description = "Game Of Life! B3/S23"; Description = "Game Of Life! B3/S23";

View File

@ -27,7 +27,6 @@ Element_LIGH::Element_LIGH()
Weight = 100; Weight = 100;
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0; HeatConduct = 0;
Description = "Lightning. Change the brush size to set the size of the lightning."; Description = "Lightning. Change the brush size to set the size of the lightning.";
@ -94,7 +93,7 @@ int Element_LIGH::update(UPDATE_FUNC_ARGS)
sim->elements[rt].Flammable && RNG::Ref().chance(sim->elements[rt].Flammable + sim->pv[(y+ry)/CELL][(x+rx)/CELL] * 10.0f, 1000)) sim->elements[rt].Flammable && RNG::Ref().chance(sim->elements[rt].Flammable + sim->pv[(y+ry)/CELL][(x+rx)/CELL] * 10.0f, 1000))
{ {
sim->part_change_type(ID(r),x+rx,y+ry,PT_FIRE); sim->part_change_type(ID(r),x+rx,y+ry,PT_FIRE);
parts[ID(r)].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP); parts[ID(r)].temp = restrict_flt(sim->elements[PT_FIRE].DefaultProperties.temp + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP);
parts[ID(r)].life = RNG::Ref().between(180, 259); parts[ID(r)].life = RNG::Ref().between(180, 259);
parts[ID(r)].tmp = parts[ID(r)].ctype = 0; parts[ID(r)].tmp = parts[ID(r)].ctype = 0;
if (sim->elements[rt].Explosive) if (sim->elements[rt].Explosive)

Some files were not shown because too many files have changed in this diff Show More