diff options
| author | Cracker64 <cracker642@gmail.com> | 2010-11-28 21:58:57 (GMT) |
|---|---|---|
| committer | Cracker64 <cracker642@gmail.com> | 2010-11-28 21:58:57 (GMT) |
| commit | 77a17ecaeedb2e7e505527848e8bf4d1465ac529 (patch) | |
| tree | e56137a0ce7518c41b7188c532ec92a86e55c3ad /src | |
| parent | 3b4caf409dd6894650de0c4e2c806bcf59a806e1 (diff) | |
| download | powder-77a17ecaeedb2e7e505527848e8bf4d1465ac529.zip powder-77a17ecaeedb2e7e505527848e8bf4d1465ac529.tar.gz | |
VINE, plant grows up the side of WOOD. INST wire is now also a battery and will charge if it doesn't give off a spark right away. Will give spark to NSCN or SWCH that is on. found some more wall defines i missed. moved wall code up 100 numbers. INVS, solid that turns invisible to elements when under pressure.
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 38 | ||||
| -rw-r--r-- | src/interface.c | 38 | ||||
| -rw-r--r-- | src/powder.c | 150 |
3 files changed, 133 insertions, 93 deletions
diff --git a/src/graphics.c b/src/graphics.c index b63ea7b..d74651e 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -447,7 +447,7 @@ void draw_tool(pixel *vid_buf, int b, int sl, int sr, unsigned pc, unsigned iswa int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) { int i, j, c; - if(b>=121) + if(b>=UI_WALLSTART) { b = b-100; //x = (2+32*((b-22)/1)); @@ -470,7 +470,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 23: + case WL_EWALL: for(j=1; j<15; j++) { for(i=1; i<6+j; i++) @@ -489,7 +489,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 24: + case WL_DETECT: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -498,7 +498,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 25: + case WL_STREAM: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -512,7 +512,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) drawpixel(vid_buf, x+i, y+8+(int)(3.9f*cos(i*0.3f)), 255, 255, 255, 255); } break; - case 26: + case WL_SIGN: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -523,7 +523,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) drawtext(vid_buf, x+9, y+3, "\xA1", 32, 64, 128, 255); drawtext(vid_buf, x+9, y+3, "\xA0", 255, 255, 255, 255); break; - case 27: + case WL_FAN: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -532,7 +532,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 28: + case WL_ALLOWLIQUID: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -544,7 +544,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 29: + case WL_DESTROYALL: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -553,7 +553,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 30: + case WL_ERASE: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<13; i+=2) @@ -569,7 +569,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 32: + case WL_ALLOWAIR: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -578,7 +578,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 33: + case WL_ALLOWSOLID: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -587,7 +587,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 34: + case WL_ALLOWALLELEC: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -599,7 +599,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } break; - case 36: + case SPC_AIR-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -618,7 +618,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("AIR")/2, y+4, "AIR", c, c, c, 255); break; - case 37: + case SPC_HEAT-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -637,7 +637,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("HEAT")/2, y+4, "HEAT", c, c, c, 255); break; - case 38: + case SPC_COOL-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -656,7 +656,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("COOL")/2, y+4, "COOL", c, c, c, 255); break; - case 39: + case SPC_VACUUM-100: for(j=1; j<15; j++) { for(i=1; i<27; i++) @@ -675,7 +675,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } drawtext(vid_buf, x+14-textwidth("VAC")/2, y+4, "VAC", c, c, c, 255); break; - case 40: + case WL_ALLOWGAS: for(j=1; j<15; j+=2) { for(i=1+(1&(j>>1)); i<27; i+=2) @@ -693,7 +693,7 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) } } } - if(b==30) + if(b==WL_ERASE) { for(j=4; j<12; j++) { @@ -1586,6 +1586,8 @@ void draw_parts(pixel *vid) } + else if(t==PT_INVIS && (pv[ny/CELL][nx/CELL]>4.0f ||pv[ny/CELL][nx/CELL]<-4.0f)) + blendpixel(vid, nx, ny, 15, 0, 150, 100); else if(t==PT_ACID) { if(parts[i].life>255) parts[i].life = 255; diff --git a/src/interface.c b/src/interface.c index 6df2ae5..a4ecc8f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1646,9 +1646,9 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx, { drawtext(vid_buf, XRES-textwidth((char *)msections[i].name)-BARSIZE, sy-10, (char *)msections[i].name, 255, 255, 255, 255); } - else if(i==SC_WALL||(i==SC_SPECIAL&&h>=122)) + else if(i==SC_WALL||(i==SC_SPECIAL&&h>=UI_WALLSTART)) { - drawtext(vid_buf, XRES-textwidth((char *)mwalls[h-122].descs)-BARSIZE, sy-10, (char *)mwalls[h-122].descs, 255, 255, 255, 255); + drawtext(vid_buf, XRES-textwidth((char *)mwalls[h-UI_WALLSTART].descs)-BARSIZE, sy-10, (char *)mwalls[h-UI_WALLSTART].descs, 255, 255, 255, 255); } else { @@ -2756,15 +2756,16 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) //Draw the score bars if(info->voteup>0||info->votedown>0) { - lv = (info->voteup>info->votedown?info->voteup:info->votedown); - + lv = (info->voteup>info->votedown)?info->voteup:info->votedown; + lv = (lv>10)?lv:10; + if(50>lv) { ry = ((float)(50)/(float)lv); - if(lv<8) - { - ry = ry/(8-lv); - } + //if(lv<8) + //{ + // ry = ry/(8-lv); + //} nyu = info->voteup*ry; nyd = info->votedown*ry; } @@ -2774,11 +2775,13 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) nyu = info->voteup/ry; nyd = info->votedown/ry; } + nyu = nyu>50?50:nyu; + nyd = nyd>50?50:nyd; - fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 0, 107, 10, 255); - fillrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 107, 10, 0, 255); - drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+53, 54, 6, 128, 128, 128, 255); - drawrect(vid_buf, 46+(XRES/2)-51, (YRES/2)+59, 54, 6, 128, 128, 128, 255); + fillrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+53, 52, 6, 0, 107, 10, 255); + fillrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+59, 52, 6, 107, 10, 0, 255); + drawrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+53, 52, 6, 128, 128, 128, 255); + drawrect(vid_buf, 48+(XRES/2)-51, (YRES/2)+59, 52, 6, 128, 128, 128, 255); fillrect(vid_buf, 48+(XRES/2)-nyu, (YRES/2)+54, nyu, 4, 57, 187, 57, 255); fillrect(vid_buf, 48+(XRES/2)-nyd, (YRES/2)+60, nyd, 4, 187, 57, 57, 255); @@ -2790,7 +2793,9 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) 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; - draw_line(vid_buf, 50+(XRES/2)+2, ccy+52, XRES+BARSIZE-50, ccy+52, 100, 100, 100, XRES+BARSIZE); + 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); + } } hasdrawninfo = 1; myown = svf_login && !strcmp(info->author, svf_user); @@ -2917,8 +2922,7 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) execute_submit(vid_buf, save_id, ed.str); } } - - if(!(mx>50 && my>50 && mx<XRES+BARSIZE-50 && my<XRES+MENUSIZE-50) && b && !queue_open){ + if(!(mx>50 && my>50 && mx<XRES+BARSIZE-100 && my<YRES+MENUSIZE-100) && b && !queue_open){ retval = 0; break; } @@ -2971,7 +2975,9 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date) drawtext(vid_buf, 50+(XRES/4)-textwidth("Loading...")/2, 50+(YRES/4), "Loading...", 255, 255, 255, 128); } } - + if(!info_ready || !data_ready){ + info_box(vid_buf, "Loading"); + } sdl_blit(0, 0, (XRES+BARSIZE), YRES+MENUSIZE, vid_buf, (XRES+BARSIZE)); memcpy(vid_buf, old_vid, ((XRES+BARSIZE)*(YRES+MENUSIZE))*PIXELSIZE); if(info_ready && svf_login){ diff --git a/src/powder.c b/src/powder.c index 5a2ab1f..bd0b7e6 100644 --- a/src/powder.c +++ b/src/powder.c @@ -91,25 +91,21 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) return 0; if(bmap[ny/CELL][nx/CELL]==WL_EHOLE && !emap[ny/CELL][nx/CELL]) return 2; - if(bmap[ny/CELL][nx/CELL]==WL_ALLOWAIR) return 0; if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID) return 0; - if(r && (r&0xFF) < PT_NUM){ - //if(ptypes[pt].properties&TYPE_ENERGY && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&TYPE_ENERGY)))) - if(ptypes[pt].properties&TYPE_ENERGY && ptypes[(r&0xFF)].properties&TYPE_ENERGY) - return 2; + if(ptypes[pt].properties&TYPE_ENERGY && ptypes[(r&0xFF)].properties&TYPE_ENERGY) + return 2; - //if(pt==PT_NEUT && (r && ((r&0xFF) >= PT_NUM || (ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE)))) - if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPASS) - return 2; - if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE) - return 1; - if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) - return 0; + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPASS) + return 2; + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE) + return 1; + if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) + return 0; } if (r && ((r&0xFF) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&0xFF)].weight))) @@ -132,7 +128,8 @@ int try_move(int i, int x, int y, int nx, int ny) return 1; e = eval_move(parts[i].type, nx, ny, &r); - + if((pmap[ny][nx]&0xFF)==PT_INVIS && (pv[ny/CELL][nx/CELL]>4.0f ||pv[ny/CELL][nx/CELL]<-4.0f)) + return 1; /* half-silvered mirror */ if(!e && parts[i].type==PT_PHOT && (((r&0xFF)==PT_BMTL && rand()<RAND_MAX/2) || @@ -401,6 +398,25 @@ inline int create_part(int p, int x, int y, int t) return -1; } } + if(t==PT_INST2) + if((pmap[y][x]&0xFF)==PT_INST) + { + parts[pmap[y][x]>>8].type = PT_INST2; + parts[pmap[y][x]>>8].life += 5; + pmap[y][x] = (pmap[y][x]&~0xFF) | PT_INST2; + return pmap[y][x]>>8; + } + if(t==PT_INST3) + if((pmap[y][x]&0xFF)==PT_INST||(pmap[y][x]&0xFF)==PT_INST2) + { + parts[pmap[y][x]>>8].type = PT_INST3; + if(parts[pmap[y][x]>>8].life%4==0) + parts[pmap[y][x]>>8].life -=0; + else + parts[pmap[y][x]>>8].life -= 2; + pmap[y][x] = (pmap[y][x]&~0xFF) | PT_INST3; + return pmap[y][x]>>8; + } if(t==SPC_AIR) { pv[y/CELL][x/CELL] += 0.03f; @@ -444,8 +460,7 @@ inline int create_part(int p, int x, int y, int t) (pmap[y][x]&0xFF)!=PT_BRMT && (pmap[y][x]&0xFF)!=PT_NBLE && (pmap[y][x]&0xFF)!=PT_IRON && - (pmap[y][x]&0xFF)!=PT_INWR && - (pmap[y][x]&0xFF)!=PT_INST) + (pmap[y][x]&0xFF)!=PT_INWR) return -1; if(parts[pmap[y][x]>>8].life!=0) return -1; @@ -1043,7 +1058,7 @@ 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))) + 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)) 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) { @@ -1063,6 +1078,8 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = 64; if(t == PT_SLTW) parts[i].life = 54; + if(t == PT_SWCH) + parts[i].life = 15; } } @@ -1283,7 +1300,7 @@ void update_particles_i(pixel *vid, int start, int inc) { parts[i].pavg[0] = parts[i].pavg[1]; parts[i].pavg[1] = pv[y/CELL][x/CELL]; - if(parts[i].pavg[1]-parts[i].pavg[0] > 0.05f || parts[i].pavg[1]-parts[i].pavg[0] < -0.05f) + if(parts[i].pavg[1]-parts[i].pavg[0] > 0.25f || parts[i].pavg[1]-parts[i].pavg[0] < -0.25f) { parts[i].type = PT_BGLA; } @@ -1822,6 +1839,10 @@ void update_particles_i(pixel *vid, int start, int inc) parts[r>>8].type = PT_NONE; parts[i].life = rand()%60 + 60; } + else if((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2) + { + create_part(-1,(x+nx)+(rand()%3)-1,(y+ny)+(rand()%3)-1,PT_VINE); + } //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; } @@ -1841,6 +1862,25 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].life = 0; } } + else if(t==PT_VINE) + { + nx=(rand()%3)-1; + ny=(rand()%3)-1; + 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) + continue; + if(1>rand()%15) + parts[i].type=PT_PLNT; + else if(!r) + { + create_part(-1,x+nx,y+ny,PT_VINE); + parts[i].type=PT_PLNT; + } + } + } else if(t==PT_THRM) { for(nx=-2; nx<3; nx++) @@ -2656,31 +2696,6 @@ void update_particles_i(pixel *vid, int start, int inc) } else if(t==PT_INST) { - if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) - { - parts[i].tmp = 1;//x - //parts[i].flags = 1;//y - parts[pmap[y-1][x]].flags=1; - parts[pmap[y+1][x]].flags=1; - parts[pmap[y][x-1]].tmp = 1; - parts[pmap[y][x+1]].tmp =1; - } - /*else if(pmap[y-1][x]&0xFF!=t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) - { - parts[i].tmp = 1; - } - else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF!=t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF==t) - { - parts[i].tmp = 1; - } - else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF!=t&&pmap[y][x+1]&0xFF==t) - { - parts[i].flags = 1; - } - else if(pmap[y-1][x]&0xFF==t&&pmap[y+1][x]&0xFF==t&&pmap[y][x-1]&0xFF==t&&pmap[y][x+1]&0xFF!=t) - { - parts[i].flags = 1; - }*/ for(nx=-2; nx<3; nx++) for(ny=-2; ny<3; ny++) if(x+nx>=0 && y+ny>0 && @@ -2689,12 +2704,28 @@ 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_SPRK&&(parts[r>>8].ctype==PT_PSCN)) + 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); + } + else if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0&&(parts[i].life>=4)&&parts[i].life%4<=1) + { + create_part(-1,x+nx,y+ny,PT_SPRK); + flood_parts(x,y,PT_INST3,PT_INST,-1); + } + else if(parts[r>>8].type==PT_SWCH&&parts[r>>8].life==10&&(parts[i].life>=4)&&parts[i].life%4<=1) { - flood_parts(x,y,PT_SPRK,PT_INST,-1); + parts[r>>8].type=PT_SPRK; + parts[r>>8].ctype=PT_SWCH; + parts[r>>8].life=4; + flood_parts(x,y,PT_INST3,PT_INST,-1); } } } + else if(t==PT_INST2 || t==PT_INST3) + { + t = parts[pmap[y][x]>>8].type=PT_INST; + } else if(t==PT_PRTI) { int count =0; @@ -3146,7 +3177,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].temp = 3500; pv[y/CELL][x/CELL] += 1; } - if(t==PT_SPRK&&parts[i].ctype==PT_SWCH&&parts[i].life<=1) + if(t==PT_SPRK&&parts[i].ctype==PT_SWCH&&parts[i].life<=0) { parts[i].type = PT_SWCH; parts[i].life = 14; @@ -4474,8 +4505,8 @@ int flood_parts(int x, int y, int c, int cm, int bm) { int x1, x2, dy = (c<PT_NUM)?1:CELL; int co = c; - if(cm==PT_INST&&co==PT_SPRK) - if((pmap[y][x]&0xFF)==PT_SPRK) + if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3)) + if((pmap[y][x]&0xFF)==PT_INST2 || (pmap[y][x]&0xFF)==PT_INST3) return 0; if(c>=UI_WALLSTART&&c<=UI_WALLSTART+UI_WALLCOUNT) { @@ -4528,38 +4559,39 @@ int flood_parts(int x, int y, int c, int cm, int bm) // fill span for(x=x1; x<=x2; x++) + { if(!create_parts(x, y, 0, 0, co)) return 0; - + } // fill children - if(cm==PT_INST&&co==PT_SPRK) + if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3)) { if(y>=CELL+dy && x1==x2 && - ((pmap[y-1][x1-1]&0xFF)==PT_INST||(pmap[y-1][x1-1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1]&0xFF)==PT_INST||(pmap[y-1][x1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || (pmap[y-1][x1+1]&0xFF)==PT_SPRK) && - (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||(pmap[y-2][x1]&0xFF)==PT_SPRK) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) + ((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)) && + (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||((pmap[y-2][x1]&0xFF)==PT_INST3||(pmap[y-2][x1]&0xFF)==PT_INST2)) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) flood_parts(x1, y-2, co, cm, bm); else if(y>=CELL+dy) for(x=x1; x<=x2; x++) - if((pmap[y-1][x]&0xFF)!=PT_SPRK) + if((pmap[y-1][x]&0xFF)!=co) { if(x==x1 || x==x2 || y>=YRES-CELL-1 || (pmap[y-1][x-1]&0xFF)==PT_INST || (pmap[y-1][x+1]&0xFF)==PT_INST || - (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=PT_SPRK) || (pmap[y+1][x+1]&0xFF)==PT_INST) + (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=co) || (pmap[y+1][x+1]&0xFF)==PT_INST) flood_parts(x, y-dy, co, cm, bm); } if(y<YRES-CELL-dy && x1==x2 && - ((pmap[y+1][x1-1]&0xFF)==PT_INST||(pmap[y+1][x1-1]&0xFF)==PT_SPRK) && ((pmap[y+1][x1]&0xFF)==PT_INST||(pmap[y+1][x1]&0xFF)==PT_SPRK) && ((pmap[y+1][x1+1]&0xFF)==PT_INST || (pmap[y+1][x1+1]&0xFF)==PT_SPRK) && - (pmap[y+2][x1-1]&0xFF)!=PT_INST && ((pmap[y+2][x1]&0xFF)==PT_INST ||(pmap[y+2][x1]&0xFF)==PT_SPRK) && (pmap[y+2][x1+1]&0xFF)!=PT_INST) + ((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)) && + (pmap[y+2][x1-1]&0xFF)!=PT_INST && ((pmap[y+2][x1]&0xFF)==PT_INST ||((pmap[y+2][x1]&0xFF)==PT_INST3||(pmap[y+2][x1]&0xFF)==PT_INST2)) && (pmap[y+2][x1+1]&0xFF)!=PT_INST) flood_parts(x1, y+2, co, cm, bm); else if(y<YRES-CELL-dy) for(x=x1; x<=x2; x++) - if((pmap[y+1][x]&0xFF)!=PT_SPRK) + if((pmap[y+1][x]&0xFF)!=co) { if(x==x1 || x==x2 || y<0 || (pmap[y+1][x-1]&0xFF)==PT_INST || (pmap[y+1][x+1]&0xFF)==PT_INST || - (pmap[y-1][x-1]&0xFF)==PT_INST || ((pmap[y-1][x]&0xFF)!=PT_INST&&(pmap[y-1][x]&0xFF)!=PT_SPRK) || (pmap[y-1][x+1]&0xFF)==PT_INST) + (pmap[y-1][x-1]&0xFF)==PT_INST || ((pmap[y-1][x]&0xFF)!=PT_INST&&(pmap[y-1][x]&0xFF)!=co) || (pmap[y-1][x+1]&0xFF)==PT_INST) flood_parts(x, y+dy, co, cm, bm); } @@ -4577,7 +4609,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) if(!flood_parts(x, y+dy, co, cm, bm)) return 0; } - if(!(cm==PT_INST&&co==PT_SPRK)) + if(!(cm==PT_INST&&(co==PT_INST2||co==PT_INST3))) return 1; } @@ -4746,7 +4778,7 @@ void create_line(int x1, int y1, int x2, int y2, float rx, float ry, int c) if(e >= 0.5f) { y += sy; - if(c==135 || c==140 || c==134 || c==133 || c==132 || c==131 || c==129 || c==128 || c==127 || c==125 || c==124 || c==123 || c==122 || !(rx+ry)) + if(c==WL_EHOLE || c==WL_ALLOWGAS || c==WL_ALLOWALLELEC || c==WL_ALLOWSOLID || c==WL_ALLOWAIR || c==WL_WALL || c==WL_DESTROYALL || c==WL_ALLOWLIQUID || c==WL_FAN || c==WL_STREAM || c==WL_DETECT || c==WL_EWALL || c==WL_WALLELEC || !(rx+ry)) { if(cp) create_parts(y, x, rx, ry, c); |
