diff --git a/includes/powder.h b/includes/powder.h index cd1024472..1e727d3f9 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -343,6 +343,7 @@ int update_ARAY(UPDATE_FUNC_ARGS); int update_BCLN(UPDATE_FUNC_ARGS); int update_BCOL(UPDATE_FUNC_ARGS); int update_BMTL(UPDATE_FUNC_ARGS); +int update_BRMT(UPDATE_FUNC_ARGS); int update_BOMB(UPDATE_FUNC_ARGS); int update_BOYL(UPDATE_FUNC_ARGS); int update_BTRY(UPDATE_FUNC_ARGS); diff --git a/src/elementdata.c b/src/elementdata.c index d1d9fae32..46891204f 100644 --- a/src/elementdata.c +++ b/src/elementdata.c @@ -40,7 +40,7 @@ part_type ptypes[PT_NUM] = {"SLTW", PIXPACK(0x4050F0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 35, SC_LIQUID, R_TEMP+0.0f +273.15f, 75, "Saltwater, conducts electricity, difficult to freeze.", ST_LIQUID, TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_SLTW, NULL}, {"DMND", PIXPACK(0xCCFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 186, "Diamond. Indestructible.", ST_SOLID, TYPE_SOLID, NULL, NULL}, {"BMTL", PIXPACK(0x505070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Breakable metal.", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, &update_BMTL, NULL}, - {"BRMT", PIXPACK(0x705060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal.", ST_SOLID, TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, NULL, NULL}, + {"BRMT", PIXPACK(0x705060), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal.", ST_SOLID, TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, &update_BRMT, NULL}, {"PHOT", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, -1, SC_NUCLEAR, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines.", ST_GAS, TYPE_ENERGY|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC, &update_PHOT, &graphics_PHOT}, {"URAN", PIXPACK(0x707020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 1, 90, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure.", ST_SOLID, TYPE_PART | PROP_RADIOACTIVE, &update_URAN, NULL}, {"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", ST_SOLID, TYPE_SOLID, NULL, NULL}, diff --git a/src/elements/bmtl.c b/src/elements/bmtl.c index 04d9f3acd..97ad699e4 100644 --- a/src/elements/bmtl.c +++ b/src/elements/bmtl.c @@ -1,8 +1,9 @@ #include int update_BMTL(UPDATE_FUNC_ARGS) { - int r, rx, ry, rt; - if (parts[i].tmp>1) { + int r, rx, ry, rt, tempFactor; + if (parts[i].tmp>1) + { parts[i].tmp--; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) @@ -18,7 +19,9 @@ int update_BMTL(UPDATE_FUNC_ARGS) { parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100; } } - } else if (parts[i].tmp==1 && 1>rand()%1000) { + } + else if (parts[i].tmp==1 && 1>rand()%1000) + { parts[i].tmp = 0; part_change_type(i,x,y,PT_BRMT); } diff --git a/src/elements/brmt.c b/src/elements/brmt.c new file mode 100644 index 000000000..ca785c844 --- /dev/null +++ b/src/elements/brmt.c @@ -0,0 +1,35 @@ +#include + +int update_BRMT(UPDATE_FUNC_ARGS) { + int r, rx, ry, rt, tempFactor; + if (parts[i].temp > (250.0f+273.15f)) + { + printf("%f\n", (250.0f+273.15f)-parts[i].temp); + for (rx=-1; rx<2; rx++) + for (ry=-1; ry<2; ry++) + if (x+rx>=0 && y+ry>0 && x+rx>8].type; + tempFactor = 1000 - (((250.0f+273.15f)-parts[i].temp)*2); + if(tempFactor < 2) + tempFactor = 2; + if ((rt==PT_BREC) && 1 > (rand()%tempFactor)) + { + if(rand()%2) + { + create_part(r>>8, x+rx, y+ry, PT_THRM); + } + else + { create_part(i, x, y, PT_THRM); + } + return 1; + //part_change_type(r>>8,x+rx,y+ry,PT_BMTL); + //parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100; + } + } + } + return 0; +}