PUMP is now powered and blue, fixed some wall probems, portals are more random, maybe fixed love for mac?

This commit is contained in:
Cracker64 2010-11-29 22:42:36 -05:00
parent 77a17ecaee
commit bb16ffa2bb
4 changed files with 89 additions and 20 deletions

View File

@ -353,7 +353,7 @@ static const part_type ptypes[PT_NUM] =
{"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},
{"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_GAS, R_TEMP +273.15f, 100, "This is what happens to your mind when catelite descibes an element.",TYPE_GAS},
{"PUMP", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.1f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, 273.15f, 0, "Changes pressure to its temp (use HEAT/COOL).", TYPE_SOLID},
{"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_SPECIAL, 273.15f, 0, "Changes pressure to its temp (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."},
{"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, 273.15f, 0, "Moves elements around, read the post on how to use.", TYPE_SOLID},
{"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},
@ -370,7 +370,7 @@ static const part_type ptypes[PT_NUM] =
{"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_CRACKER, R_TEMP-2.0f +273.15f, 29, "Colloid", TYPE_LIQUID},
{"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, "blah blah solid not in the menu", TYPE_SOLID},
{"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", TYPE_PART},
{"VINE", PIXPACK(0x0A9C00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, not in menu", TYPE_SOLID},
{"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_CRACKER, R_TEMP+0.0f +273.15f, 65, "Vine, not in menu", TYPE_SOLID},
{"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_CRACKER, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID},
{"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_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART},
{"INST", 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_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0},

View File

@ -2086,6 +2086,22 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx-1, ny+1, GR, 10, 10, 112);
}
}
else if(t==PT_PUMP)
{
uint8 GR = 0x3B+(parts[i].life*19);
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(10, 10, GR);
if(cmode == CM_BLOB) {
blendpixel(vid, nx+1, ny, 10, 10, GR, 223);
blendpixel(vid, nx-1, ny, 10, 10, GR, 223);
blendpixel(vid, nx, ny+1, 10, 10, GR, 223);
blendpixel(vid, nx, ny-1, 10, 10, GR, 223);
blendpixel(vid, nx+1, ny-1, 10, 10, GR, 112);
blendpixel(vid, nx-1, ny-1, 10, 10, GR, 112);
blendpixel(vid, nx+1, ny+1, 10, 10, GR, 112);
blendpixel(vid, nx-1, ny+1, 10, 10, GR, 112);
}
}
else if(t==PT_PLSM)
{
float ttemp = (float)parts[i].life;

View File

@ -1895,7 +1895,7 @@ int main(int argc, char *argv[])
{
c = (b&1) ? sl : sr;
su = c;
if(c==126)
if(c==WL_SIGN+100)
{
if(!bq)
add_sign_ui(vid_buf, x, y);
@ -1905,7 +1905,7 @@ int main(int argc, char *argv[])
if(lm == 1)
{
xor_line(lx, ly, x, y, vid_buf);
if(c==127 && lx>=0 && ly>=0 && lx<XRES && ly<YRES && bmap[ly/CELL][lx/CELL]==WL_FAN)
if(c==WL_FAN+100 && lx>=0 && ly>=0 && lx<XRES && ly<YRES && bmap[ly/CELL][lx/CELL]==WL_FAN)
{
nfvx = (x-lx)*0.005f;
nfvy = (y-ly)*0.005f;
@ -2022,7 +2022,7 @@ int main(int argc, char *argv[])
su = c;
if(lm == 1)
{
if(c!=127 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=WL_FAN)
if(c!=WL_FAN+100 || lx<0 || ly<0 || lx>=XRES || ly>=YRES || bmap[ly/CELL][lx/CELL]!=WL_FAN)
create_line(lx, ly, x, y, bsx, bsy, c);
}
else

View File

@ -515,6 +515,8 @@ inline int create_part(int p, int x, int y, int t)
parts[i].life = 50;
parts[i].tmp = 50;
}
if(t==PT_PUMP)
parts[i].life= 10;
if(t==PT_FSEP)
parts[i].life = 50;
if(t==PT_COAL) {
@ -954,7 +956,7 @@ void update_particles_i(pixel *vid, int start, int inc)
}
if(!rt&&loverule[nnx][nny]==1)
create_part(-1,nx+nnx,ny+nny,PT_LOVE);
if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0)
else if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0)
parts[rt>>8].type=PT_NONE;
}
@ -1058,9 +1060,9 @@ void update_particles_i(pixel *vid, int start, int inc)
if(parts[i].life && t!=PT_ACID && t!=PT_COAL && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM && t!=PT_FUSE && t!=PT_FSEP && t!=PT_BCOL && t!=PT_GOL && t!=PT_CRAC && t!=PT_DEUT)
{
if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC)) && !(parts[i].life%4==0 && parts[i].type==PT_INST))
if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC||parts[i].type==PT_PUMP)) && !(parts[i].life%4==0 && parts[i].type==PT_INST))
parts[i].life--;
if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST)
if(parts[i].life<=0 && t!=PT_METL && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && t!=PT_WATR && t!=PT_RBDM && t!=PT_LRBD && t!=PT_SLTW && t!=PT_BRMT && t!=PT_PSCN && t!=PT_NSCN && t!=PT_NTCT && t!=PT_PTCT && t!=PT_BMTL && t!=PT_SPRK && t!=PT_LAVA && t!=PT_ETRD&&t!=PT_LCRY && t!=PT_INWR && t!=PT_GLOW && t!= PT_FOG && t!=PT_PIPE && t!=PT_FRZW &&(t!=PT_ICEI&&parts[i].ctype!=PT_FRZW)&&t!=PT_INST)
{
kill_part(i);
continue;
@ -1122,7 +1124,7 @@ void update_particles_i(pixel *vid, int start, int inc)
}
if(t==PT_GAS||t==PT_NBLE||t==PT_PUMP)
{
if(t==PT_PUMP)
if(t==PT_PUMP && parts[i].life==10)
{
if(parts[i].temp>=256.0+273.15)
parts[i].temp=256.0+273.15;
@ -1130,14 +1132,14 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[i].temp = -256.0+273.15;
if(pv[y/CELL][x/CELL]<(parts[i].temp-273.15))
pv[y/CELL][x/CELL] += ptypes[t].hotair*((parts[i].temp-273.15)-pv[y/CELL][x/CELL]);
pv[y/CELL][x/CELL] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL][x/CELL]);
if(y+CELL<YRES && pv[y/CELL+1][x/CELL]<(parts[i].temp-273.15))
pv[y/CELL+1][x/CELL] += ptypes[t].hotair*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL]);
pv[y/CELL+1][x/CELL] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL]);
if(x+CELL<XRES)
{
pv[y/CELL][x/CELL+1] += ptypes[t].hotair*((parts[i].temp-273.15)-pv[y/CELL][x/CELL+1]);
pv[y/CELL][x/CELL+1] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL][x/CELL+1]);
if(y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += ptypes[t].hotair*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL+1]);
pv[y/CELL+1][x/CELL+1] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL+1]);
}
}
else
@ -2707,6 +2709,7 @@ void update_particles_i(pixel *vid, int start, int inc)
else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life%4==0)
{
flood_parts(x,y,PT_INST2,PT_INST,-1);
parts[r>>8].type==parts[r>>8].ctype;
}
else if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0&&(parts[i].life>=4)&&parts[i].life%4<=1)
{
@ -2720,11 +2723,19 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[r>>8].life=4;
flood_parts(x,y,PT_INST3,PT_INST,-1);
}
//else if(parts[r>>8].type==PT_INST&&parts[r>>8].life%4==0&&parts[r>>8].life>parts[i].life)
//parts[i].life --;
}
}
else if(t==PT_INST2 || t==PT_INST3)
else if(t==PT_INST2)
{
t = parts[pmap[y][x]>>8].type=PT_INST;
if(parts[i].life%4==0)
t = parts[pmap[y][x]>>8].type=PT_INST;
}
else if(t==PT_INST3)
{
if(parts[i].life%4!=0)
t = parts[pmap[y][x]>>8].type=PT_INST;
}
else if(t==PT_PRTI)
{
@ -2740,9 +2751,9 @@ void update_particles_i(pixel *vid, int start, int inc)
continue;
if(parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS))
for(int nnx=0;nnx<8;nnx++)
if(!portal[count][nnx])
if(!portal[count-1][nnx])
{
portal[count][nnx] = parts[r>>8].type;
portal[count-1][nnx] = parts[r>>8].type;
parts[r>>8].type = PT_NONE;
break;
}
@ -2763,12 +2774,19 @@ void update_particles_i(pixel *vid, int start, int inc)
if(!r)
{
for(int nnx =0 ;nnx<8;nnx++)
if(portal[count][nnx])
{
int randomness = count + rand()%3-1;
if(randomness<1)
randomness=1;
if(randomness>8)
randomness=8;
if(portal[randomness-1][nnx])
{
create_part(-1,x+nx,y+ny,portal[count][nnx]);
portal[count][nnx] = 0;
create_part(-1,x+nx,y+ny,portal[randomness-1][nnx]);
portal[randomness-1][nnx] = 0;
break;
}
}
}
}
}
@ -2842,6 +2860,41 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
else if(t==PT_PUMP)
{
for(nx=-2; nx<3; nx++)
for(ny=-2; ny<3; ny++)
if(x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
r = pmap[y+ny][x+nx];
if((r>>8)>=NPART || !r)
continue;
rt = parts[r>>8].type;
if(rt==PT_SPRK)
{
if(parts[r>>8].ctype==PT_PSCN)
{
parts[i].life = 10;
}
else if(parts[r>>8].ctype==PT_NSCN)
{
parts[i].life = 9;
}
}
if(rt==PT_PUMP)
{
if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0)
{
parts[i].life = 9;
}
else if(parts[i].life==0&&parts[r>>8].life==10)
{
parts[i].life = 10;
}
}
}
}
else if(t==PT_AMTR)
{
for(nx=-1; nx<2; nx++)