From 1e4e7ea4751f2890a4b594e47d3074a69a63cfd1 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 19 Dec 2010 19:07:23 +0000 Subject: [PATCH] Invis can now be used to turn photons into neutrons --- includes/powder.h | 2 +- src/powder.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/includes/powder.h b/includes/powder.h index dcc041df5..79d78aaca 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -384,7 +384,7 @@ static const part_type ptypes[PT_NUM] = {"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", 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", TYPE_PART, NULL}, {"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", TYPE_SOLID, NULL}, - {"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.", TYPE_SOLID, NULL}, + {"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.", 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", TYPE_PART, NULL}, {"int2", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0, NULL}, {"int3", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0, NULL}, diff --git a/src/powder.c b/src/powder.c index f881804af..be1c7cd49 100644 --- a/src/powder.c +++ b/src/powder.c @@ -78,7 +78,7 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) (r&0xFF)==PT_GLOW || (r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || (r&0xFF)==PT_ISOZ || (r&0xFF)==PT_ISZS || - (r&0xFF)==PT_FILT || + (r&0xFF)==PT_FILT || (r&0xFF)==PT_INVIS || ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) return 2; @@ -163,16 +163,20 @@ int try_move(int i, int x, int y, int nx, int ny) create_gain_photon(i); } if(parts[i].type == PT_PHOT && (r&0xFF)==PT_FILT) - { + { int temp_bin = (int)((parts[r>>8].temp-273.0f)*0.025f); if(temp_bin < 0) temp_bin = 0; if(temp_bin > 25) temp_bin = 25; parts[i].ctype = 0x1F << temp_bin; - } - if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { - if(rand() < RAND_MAX/10) - create_cherenkov_photon(i); - } + } + if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { + if(rand() < RAND_MAX/10) + create_cherenkov_photon(i); + } + if(parts[i].type == PT_PHOT && (r&0xFF)==PT_INVIS) { + parts[i].type = PT_NEUT; + parts[i].ctype = 0; + } if((parts[i].type==PT_BIZR||parts[i].type==PT_BIZRG) && (r&0xFF)==PT_FILT) { int temp_bin = (int)((parts[r>>8].temp-273.0f)*0.025f);