Lots of small changes/fixes mentioned in my mod post.
This commit is contained in:
parent
d017764fbe
commit
95c4e49f53
@ -136,6 +136,7 @@ int REPLACE_MODE;
|
||||
int CURRENT_BRUSH;
|
||||
int GRID_MODE;
|
||||
int VINE_MODE;
|
||||
int DEBUG_MODE;
|
||||
extern sign signs[MAXSIGNS];
|
||||
extern stamp stamps[STAMP_MAX];
|
||||
extern int stamp_count;
|
||||
|
@ -173,10 +173,9 @@
|
||||
#define PT_LOLZ 123
|
||||
#define PT_WIFI 124
|
||||
#define PT_FILT 125
|
||||
#define PT_XEON 126//radioactive gas
|
||||
#define PT_ARAY 127
|
||||
#define PT_BRAY 128
|
||||
#define PT_NUM 129
|
||||
#define PT_ARAY 126
|
||||
#define PT_BRAY 127
|
||||
#define PT_NUM 128
|
||||
|
||||
#define R_TEMP 22
|
||||
#define MAX_TEMP 9999
|
||||
@ -393,11 +392,9 @@ static const part_type ptypes[PT_NUM] =
|
||||
{"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_CRACKER2, 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_ELEC, 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_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID},
|
||||
{"XEON", PIXPACK(0xEB7917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER2, R_TEMP+2.0f +273.15f, 106, "Radioactive gas, absorbs neutrons.", TYPE_GAS},
|
||||
{"ARAY", PIXPACK(0xFFBB00), 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, "Ray Emmitter. Rays create points when they collide", TYPE_SOLID},
|
||||
{"BRAY", PIXPACK(0xFFFFFF), 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_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", TYPE_SOLID}
|
||||
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description
|
||||
//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
|
||||
};
|
||||
|
||||
static part_state pstates[PT_NUM] =
|
||||
@ -529,7 +526,6 @@ static part_state pstates[PT_NUM] =
|
||||
/* 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},
|
||||
/* RGAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* ARAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* BRAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}
|
||||
|
||||
@ -577,7 +573,7 @@ static int lolzrule[9][9] =
|
||||
};
|
||||
int portal[8][8];
|
||||
float portaltemp[8][8];
|
||||
int wireless[25][2];
|
||||
int wireless[MAX_TEMP/100][2];
|
||||
|
||||
extern int isplayer;
|
||||
extern float player[27];
|
||||
|
@ -1402,7 +1402,7 @@ void draw_parts(pixel *vid)
|
||||
|
||||
isplayer = 1; //It's a secret. Tssss...
|
||||
}
|
||||
if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_FILT)//nothing display but show needed color changes
|
||||
if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP && t!=PT_FILT && t!=PT_HSWC && t!=PT_PCLN && t!=PT_DEUT && t!=PT_WIFI)//nothing display but show needed color changes
|
||||
{
|
||||
if(t==PT_PHOT)
|
||||
{
|
||||
@ -1587,12 +1587,23 @@ void draw_parts(pixel *vid)
|
||||
}
|
||||
else if(t==PT_WIFI)
|
||||
{
|
||||
float frequency = 0.25;
|
||||
float frequency = 0.0628;
|
||||
int q = parts[i].tmp;
|
||||
cr = sin(frequency*q + 0) * 127 + 128;
|
||||
cg = sin(frequency*q + 2) * 127 + 128;
|
||||
cb = sin(frequency*q + 4) * 127 + 128;
|
||||
blendpixel(vid, nx, ny, cr, cg, cb, 255);
|
||||
blendpixel(vid, nx, ny, cr, cg, cb, 255);
|
||||
if(mousex==(nx) && mousey==(ny))
|
||||
{
|
||||
int z;
|
||||
for(z = 0; z<NPART; z++) {
|
||||
if(parts[z].type)
|
||||
{
|
||||
if(parts[z].type==PT_WIFI&&parts[z].tmp==parts[i].tmp)
|
||||
xor_line(nx,ny,(int)(parts[z].x+0.5f),(int)(parts[z].y+0.5f),vid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(t==PT_PIPE)
|
||||
{
|
||||
@ -2859,7 +2870,7 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
|
||||
if(!(j%2) && !(i%2))
|
||||
fb[(ry+j)*w+(rx+i)] = PIXPACK(0xC0C0C0);
|
||||
break;
|
||||
case WL_STREAM:
|
||||
case WL_FAN:
|
||||
for(j=0; j<CELL; j+=2)
|
||||
for(i=(j>>1)&1; i<CELL; i+=2)
|
||||
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF);
|
||||
|
23
src/main.c
23
src/main.c
@ -1461,6 +1461,19 @@ int main(int argc, char *argv[])
|
||||
bsy = 0;
|
||||
}
|
||||
}
|
||||
if(sdl_key=='d')
|
||||
DEBUG_MODE = !DEBUG_MODE;
|
||||
if(sdl_key=='i')
|
||||
{
|
||||
int nx, ny;
|
||||
for(nx = 0;nx<XRES/CELL;nx++)
|
||||
for(ny = 0;ny<YRES/CELL;ny++)
|
||||
{
|
||||
pv[ny][nx] = -pv[ny][nx];
|
||||
vx[ny][nx] = -vx[ny][nx];
|
||||
vy[ny][nx] = -vy[ny][nx];
|
||||
}
|
||||
}
|
||||
if((sdl_mod & (KMOD_RCTRL) )&&( sdl_mod & (KMOD_RALT)))
|
||||
active_menu = 11;
|
||||
if(sdl_key==SDLK_INSERT)
|
||||
@ -1614,7 +1627,10 @@ int main(int argc, char *argv[])
|
||||
#ifdef BETA
|
||||
sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life);
|
||||
#else
|
||||
sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f);
|
||||
if(DEBUG_MODE)
|
||||
sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life);
|
||||
else
|
||||
sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -2247,7 +2263,10 @@ int main(int argc, char *argv[])
|
||||
#ifdef BETA
|
||||
sprintf(uitext, "Version %d Beta %d FPS:%d Parts:%d", SAVE_VERSION, MINOR_VERSION, FPSB, NUM_PARTS);
|
||||
#else
|
||||
sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB);
|
||||
if(DEBUG_MODE)
|
||||
sprintf(uitext, "Version %d Beta %d FPS:%d Parts:%d", SAVE_VERSION, MINOR_VERSION, FPSB, NUM_PARTS);
|
||||
else
|
||||
sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB);
|
||||
#endif
|
||||
if(REPLACE_MODE)
|
||||
strappend(uitext, " [REPLACE MODE]");
|
||||
|
21
src/powder.c
21
src/powder.c
@ -505,7 +505,7 @@ inline int create_part(int p, int x, int y, int t)
|
||||
parts[i].tmp = 50;
|
||||
}
|
||||
if(t==PT_DEUT)
|
||||
parts[i].life = 20;
|
||||
parts[i].life = 10;
|
||||
if(t==PT_BRAY)
|
||||
parts[i].life = 30;
|
||||
if(t==PT_PUMP)
|
||||
@ -1173,7 +1173,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
(bmap[y/CELL][x/CELL]==WL_DESTROYALL) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && ptypes[t].falldown!=2) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWSOLID && ptypes[t].falldown!=1) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWGAS && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWGAS && ptypes[t].falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE && parts[i].type!=PT_HFLM) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_DETECT && (t==PT_METL || t==PT_SPRK)) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_EWALL && !emap[y/CELL][x/CELL])) && (t!=PT_STKM)))
|
||||
{
|
||||
@ -1972,6 +1972,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
t = parts[i].type = PT_PLNT;
|
||||
parts[r>>8].type = PT_PLNT;
|
||||
parts[r>>8].life = 0;
|
||||
}
|
||||
else if((r&0xFF)==PT_LAVA && 1>(rand()%250))
|
||||
{
|
||||
@ -1989,8 +1990,12 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
int nny = rand()%3 -1;
|
||||
if(x+nx+nnx>=0 && y+ny+nny>0 &&
|
||||
x+nx+nnx<XRES && y+ny+nny<YRES && (nnx || nny))
|
||||
{
|
||||
if((pmap[y+ny+nny][x+nx+nnx]>>8)>=NPART||pmap[y+ny+nny][x+nx+nnx])
|
||||
continue;
|
||||
if(create_part(-1,x+nx+nnx,y+ny+nny,PT_VINE))
|
||||
parts[pmap[y+ny+nny][x+nx+nnx]>>8].temp = parts[i].temp;
|
||||
}
|
||||
}
|
||||
//if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000))
|
||||
//t = parts[i].type = PT_WATR;
|
||||
@ -2940,8 +2945,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
else if(t==PT_WIFI)
|
||||
{
|
||||
int temprange = 100;
|
||||
for( temp = 0; temp < 2500; temp += temprange)
|
||||
if(parts[i].temp-273.15>temp&&parts[i].temp-273.15<temp+temprange)
|
||||
for( temp = 0; temp < MAX_TEMP; temp += temprange)
|
||||
if(parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
|
||||
parts[i].tmp = temp/100;
|
||||
for(ny=-1; ny<2; ny++)
|
||||
for(nx=-1; nx<2; nx++)
|
||||
@ -2957,9 +2962,15 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
parts[r>>8].ctype = PT_NSCN;
|
||||
parts[r>>8].life = 4;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_PSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
|
||||
{
|
||||
parts[r>>8].type = PT_SPRK;
|
||||
parts[r>>8].ctype = PT_PSCN;
|
||||
parts[r>>8].life = 4;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp][0])
|
||||
{
|
||||
parts[r>>8].type = parts[r>>8].ctype;
|
||||
//parts[r>>8].type = parts[r>>8].ctype;
|
||||
wireless[parts[i].tmp][0] = 1;
|
||||
wireless[parts[i].tmp][1] = 1;
|
||||
ISWIRE = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user