FILT, a photon color filter, not really a filter right now, but it changes the color. Other small changes
This commit is contained in:
parent
d56684312d
commit
2cf25c8a6a
@ -7,7 +7,7 @@
|
||||
#define PATH_SEP "/"
|
||||
#endif
|
||||
|
||||
#define SAVE_VERSION 43
|
||||
#define SAVE_VERSION 44
|
||||
#define MINOR_VERSION 1
|
||||
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
|
||||
#define BETA
|
||||
|
@ -172,7 +172,8 @@
|
||||
#define PT_SHLD4 122
|
||||
#define PT_LOLZ 123
|
||||
#define PT_WIFI 124
|
||||
#define PT_NUM 125
|
||||
#define PT_FILT 125
|
||||
#define PT_NUM 126
|
||||
|
||||
#define R_TEMP 22
|
||||
#define MAX_TEMP 9999
|
||||
@ -358,7 +359,7 @@ static const part_type ptypes[PT_NUM] =
|
||||
{"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS},
|
||||
{"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID},
|
||||
{"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID},
|
||||
{"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE},
|
||||
{"DEUT", PIXPACK(0x00153F), 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_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE},
|
||||
{"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS},
|
||||
{"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID},
|
||||
{"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f+273.15f, 100, "First fireworks made, activated by heat/neutrons."},
|
||||
@ -366,11 +367,11 @@ static const part_type ptypes[PT_NUM] =
|
||||
{"FRZZ", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 1, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART},
|
||||
{"FRZW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID},
|
||||
{"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Very light dust. Flammable.", TYPE_PART},
|
||||
{"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID},
|
||||
{"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID},
|
||||
{"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, SC_CRACKER, R_TEMP-200.0f +273.15f, 42, "@_@ gas", TYPE_GAS},
|
||||
{"@_@S", PIXPACK(0x00E455), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_CRACKER, R_TEMP+300.0f +273.15f, 251, "@_@ solid", TYPE_SOLID},
|
||||
{"INST", PIXPACK(0x404039), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS},
|
||||
{"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE},
|
||||
{"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE},
|
||||
{"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID},
|
||||
{"PRTI", PIXPACK(0xEB5917), 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_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID},
|
||||
{"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_CRACKER, R_TEMP+0.0f +273.15f, 40, "Portal OUT. Things come out here", TYPE_SOLID},
|
||||
@ -387,7 +388,8 @@ static const part_type ptypes[PT_NUM] =
|
||||
{"SHD3", PIXPACK(0x444444), 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_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0},
|
||||
{"SHD4", PIXPACK(0x212121), 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_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0},
|
||||
{"LOLZ", PIXPACK(0x569212), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID},
|
||||
{"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID|PROP_CONDUCTS},
|
||||
{"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID},
|
||||
{"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID},
|
||||
|
||||
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description
|
||||
};
|
||||
@ -520,6 +522,7 @@ static part_state pstates[PT_NUM] =
|
||||
/* SHLD4*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* LOlZ */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* WIFI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* FILT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
|
||||
};
|
||||
static int grule[NGOL][9] =
|
||||
|
@ -1765,6 +1765,30 @@ void draw_parts(pixel *vid)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(t==PT_FILT)
|
||||
{
|
||||
int temp_bin = (int)((parts[i].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;
|
||||
cg = 0;
|
||||
cb = 0;
|
||||
cr = 0;
|
||||
for(x=0; x<12; x++) {
|
||||
cr += (parts[i].ctype >> (x+18)) & 1;
|
||||
cb += (parts[i].ctype >> x) & 1;
|
||||
}
|
||||
for(x=0; x<14; x++)
|
||||
cg += (parts[i].ctype >> (x+9)) & 1;
|
||||
x = 624/(cr+cg+cb+1);
|
||||
cr *= x;
|
||||
cg *= x;
|
||||
cb *= x;
|
||||
cr = cr>255?255:cr;
|
||||
cg = cg>255?255:cg;
|
||||
cb = cb>255?255:cb;
|
||||
blendpixel(vid, nx, ny, cr, cg, cb, 127);
|
||||
}
|
||||
else if(t==PT_PHOT)
|
||||
{
|
||||
if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
|
||||
|
@ -2796,12 +2796,14 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
|
||||
ccy = 0;
|
||||
for(cc=0; cc<info->comment_count; cc++) {
|
||||
drawtext(vid_buf, 60+(XRES/2)+1, ccy+60, info->commentauthors[cc], 255, 255, 255, 255);
|
||||
ccy += 12;
|
||||
ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185);
|
||||
ccy += 10;
|
||||
if(ccy+52<YRES+MENUSIZE){ //Try not to draw off the screen.
|
||||
draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE);
|
||||
if((ccy + 72 + ((textwidth(info->comments[cc])/(XRES+BARSIZE-100-((XRES/2)+1)-20)))*12)<(YRES+MENUSIZE-50)){
|
||||
drawtext(vid_buf, 60+(XRES/2)+1, ccy+60, info->commentauthors[cc], 255, 255, 255, 255);
|
||||
ccy += 12;
|
||||
ccy += drawtextwrap(vid_buf, 60+(XRES/2)+1, ccy+60, XRES+BARSIZE-100-((XRES/2)+1)-20, info->comments[cc], 255, 255, 255, 185);
|
||||
ccy += 10;
|
||||
if(ccy+52<YRES+MENUSIZE-50){ //Try not to draw off the screen.
|
||||
draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
hasdrawninfo = 1;
|
||||
@ -2927,9 +2929,10 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
fillrect(vid_buf, -1, -1, XRES+BARSIZE, YRES+MENUSIZE, 0, 0, 0, 192);
|
||||
info_box(vid_buf, "Submitting Comment...");
|
||||
execute_submit(vid_buf, save_id, ed.str);
|
||||
ed.str[0] = 0;
|
||||
}
|
||||
}
|
||||
if(!(mx>50 && my>50 && mx<XRES+BARSIZE-100 && my<YRES+MENUSIZE-100) && b && !queue_open){
|
||||
if(!(mx>50 && my>50 && mx<XRES+BARSIZE-50 && my<YRES+MENUSIZE-50) && b && !queue_open){
|
||||
retval = 0;
|
||||
break;
|
||||
}
|
||||
|
34
src/main.c
34
src/main.c
@ -308,8 +308,13 @@ void *build_save(int *size, int x0, int y0, int w, int h)
|
||||
for(j=0; j<w*h; j++)
|
||||
{
|
||||
i = m[j];
|
||||
if(i)
|
||||
d[p++] = (parts[i-1].life+3)/4;
|
||||
if(i){
|
||||
//Everybody loves a 16bit int
|
||||
//d[p++] = (parts[i-1].life+3)/4;
|
||||
int ttlife = (int)parts[i-1].life;
|
||||
d[p++] = ((ttlife&0xFF00)>>8);
|
||||
d[p++] = (ttlife&0x00FF);
|
||||
}
|
||||
}
|
||||
for(j=0; j<w*h; j++)
|
||||
{
|
||||
@ -623,12 +628,25 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
i = m[j];
|
||||
if(i)
|
||||
{
|
||||
if(p >= size)
|
||||
goto corrupt;
|
||||
if(i <= NPART)
|
||||
parts[i-1].life = d[p++]*4;
|
||||
else
|
||||
p++;
|
||||
if(ver>=44){
|
||||
if(p >= size) {
|
||||
goto corrupt;
|
||||
}
|
||||
if(i <= NPART) {
|
||||
ttv = (d[p++])<<8;
|
||||
ttv |= (d[p++]);
|
||||
parts[i-1].life = ttv;
|
||||
} else {
|
||||
p+=2;
|
||||
}
|
||||
} else {
|
||||
if(p >= size)
|
||||
goto corrupt;
|
||||
if(i <= NPART)
|
||||
parts[i-1].life = d[p++]*4;
|
||||
else
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(j=0; j<w*h; j++)
|
||||
|
31
src/powder.c
31
src/powder.c
@ -77,6 +77,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_LCRY&&parts[r>>8].life > 5)))
|
||||
return 2;
|
||||
|
||||
@ -157,7 +158,13 @@ int try_move(int i, int x, int y, int nx, int ny)
|
||||
parts[r>>8].life = 120;
|
||||
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);
|
||||
@ -1451,7 +1458,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
r = pmap[y+ny][x+nx];
|
||||
if((r>>8)>=NPART || !r)
|
||||
continue;
|
||||
if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10))
|
||||
if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)&&!(parts[i].type==PT_PHOT&&parts[r>>8].type==PT_FILT))
|
||||
{
|
||||
h_count++;
|
||||
c_heat += parts[r>>8].temp;
|
||||
@ -1469,7 +1476,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
r = pmap[y+ny][x+nx];
|
||||
if((r>>8)>=NPART || !r)
|
||||
continue;
|
||||
if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10))
|
||||
if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)&&!(parts[i].type==PT_PHOT&&parts[r>>8].type==PT_FILT))
|
||||
{
|
||||
parts[r>>8].temp = parts[i].temp;
|
||||
}
|
||||
@ -4892,15 +4899,23 @@ int flood_parts(int x, int y, int c, int cm, int bm)
|
||||
while(x1>=CELL)
|
||||
{
|
||||
if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm)
|
||||
if(((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3))
|
||||
break;
|
||||
{
|
||||
if(cm!=PT_INST)
|
||||
break;
|
||||
else if((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3)
|
||||
break;
|
||||
}
|
||||
x1--;
|
||||
}
|
||||
while(x2<XRES-CELL)
|
||||
{
|
||||
if((pmap[y][x2+1]&0xFF)!=cm || bmap[y/CELL][(x2+1)/CELL]!=bm)
|
||||
if(((pmap[y][x2+1]&0xFF)!=PT_INST2&&(pmap[y][x2+1]&0xFF)!=PT_INST3))
|
||||
break;
|
||||
{
|
||||
if(cm!=PT_INST)
|
||||
break;
|
||||
else if((pmap[y][x1+1]&0xFF)!=PT_INST2&&(pmap[y][x1+1]&0xFF)!=PT_INST3)
|
||||
break;
|
||||
}
|
||||
x2++;
|
||||
}
|
||||
|
||||
@ -4911,7 +4926,7 @@ int flood_parts(int x, int y, int c, int cm, int bm)
|
||||
return 0;
|
||||
}
|
||||
// fill children
|
||||
if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3))
|
||||
if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3))//crossings for inst wire, same as walls
|
||||
{
|
||||
if(y>=CELL+dy && x1==x2 &&
|
||||
((pmap[y-1][x1-1]&0xFF)==PT_INST||((pmap[y-1][x1-1]&0xFF)==PT_INST3||(pmap[y-1][x1-1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1]&0xFF)==PT_INST||((pmap[y-1][x1]&0xFF)==PT_INST3||(pmap[y-1][x1]&0xFF)==PT_INST2)) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || ((pmap[y-1][x1+1]&0xFF)==PT_INST3||(pmap[y-1][x1+1]&0xFF)==PT_INST2)) &&
|
||||
|
Reference in New Issue
Block a user