diff --git a/includes/powder.h b/includes/powder.h index 3872655a2..5d71e8f19 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -236,6 +236,7 @@ #define UPDATE_FUNC_SUBCALL_ARGS i, x, y, surround_space int update_ACID(UPDATE_FUNC_ARGS); +int update_ANAR(UPDATE_FUNC_ARGS); int update_AMTR(UPDATE_FUNC_ARGS); int update_ARAY(UPDATE_FUNC_ARGS); int update_BCLN(UPDATE_FUNC_ARGS); @@ -490,7 +491,7 @@ static const part_type ptypes[PT_NUM] = {"PRTO", PIXPACK(0x0020EB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Portal OUT. Things come out here, now with channels (same as WIFI)", ST_SOLID, TYPE_SOLID, &update_PRTO}, {"PSTE", PIXPACK(0xAA99AA), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Colloid, Hardens under pressure", ST_LIQUID, TYPE_LIQUID, NULL}, {"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Solid form of PSTE, temporary", ST_SOLID, TYPE_SOLID, NULL}, - {"ANAR", PIXPACK(0xFFFFEE), -0.7f, -0.02f * CFDS, 0.96f, 0.80f, 0.1f, -0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", ST_SOLID, TYPE_PART, NULL}, + {"ANAR", PIXPACK(0xFFFFEE), -0.7f, -0.02f * CFDS, 0.96f, 0.80f, 0.1f, -0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", ST_SOLID, TYPE_PART, &update_ANAR}, {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", ST_SOLID, TYPE_SOLID, &update_VINE}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", ST_SOLID, TYPE_SOLID | PROP_NEUTPASS, NULL}, {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER2, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", ST_SOLID, TYPE_PART, NULL}, diff --git a/src/elements/anar.c b/src/elements/anar.c new file mode 100644 index 000000000..4a30cc20d --- /dev/null +++ b/src/elements/anar.c @@ -0,0 +1,27 @@ +#include + +int update_ANAR(UPDATE_FUNC_ARGS) { + int r, rx, ry; + + //if (parts[i].temp >= 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>8)>=NPART || !r) + continue; + if ((r&0xFF)==PT_HFLM) + { + if (1>rand()%22) + { + part_change_type(i,x,y,PT_HFLM); + parts[i].life = rand()%150+50; + parts[r>>8].temp = parts[i].temp = 0; + pv[y/CELL][x/CELL] -= 0.5; + } + } + } + return 0; +} diff --git a/src/powder.c b/src/powder.c index 84845c27b..f31e1159b 100644 --- a/src/powder.c +++ b/src/powder.c @@ -79,6 +79,9 @@ int eval_move(int pt, int nx, int ny, unsigned *rr) if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) return 1; + if ((r&0xFF)==PT_WHOL && pt==PT_ANAR) + return 1; + if (pt==PT_SPRK)//spark shouldn't move return 0; @@ -237,7 +240,17 @@ int try_move(int i, int x, int y, int nx, int ny) return 0; } - if ((pmap[ny][nx]&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles + if ((r&0xFF)==PT_WHOL && parts[i].type==PT_ANAR) //whitehole eats anar + { + parts[i].type=PT_NONE; + if (!legacy_enable) + { + parts[r>>8].temp = restrict_flt(parts[r>>8].temp- (MAX_TEMP-parts[i].temp)/2, MIN_TEMP, MAX_TEMP); + } + + return 0; + } + if ((r&0xFF)==PT_CNCT)//stops CNCT being displaced by other particles return 0; if (parts[i].type==PT_CNCT && y