Changes by cracker

This commit is contained in:
Simon 2011-01-05 19:42:31 +00:00
commit 71c5d53f7f
3 changed files with 54 additions and 20 deletions

View File

@ -1516,8 +1516,19 @@ int main(int argc, char *argv[])
else else
GRID_MODE = (GRID_MODE+1)%10; GRID_MODE = (GRID_MODE+1)%10;
} }
if(sdl_key=='=')
{
int nx, ny;
for(nx = 0;nx<XRES/CELL;nx++)
for(ny = 0;ny<YRES/CELL;ny++)
{
pv[ny][nx] = 0;
vx[ny][nx] = 0;
vy[ny][nx] = 0;
}
}
if(sdl_key=='w') //Gravity, by Moach if(sdl_key=='w' && (!isplayer2 || (sdl_mod & (KMOD_SHIFT)))) //Gravity, by Moach
{ {
++gravityMode; // cycle gravity mode ++gravityMode; // cycle gravity mode
itc = 51; itc = 51;
@ -1621,7 +1632,7 @@ int main(int argc, char *argv[])
if(vs>=1) if(vs>=1)
vs = 0; vs = 0;
else else
vs = 2; vs = 3;//every other frame
} }
else else
{ {
@ -2060,6 +2071,10 @@ int main(int argc, char *argv[])
svf_tags[0] = 0; svf_tags[0] = 0;
svf_description[0] = 0; svf_description[0] = 0;
gravityMode = 1; gravityMode = 1;
isplayer2 = 0;
isplayer = 0;
ISSPAWN1 = 0;
ISSPAWN2 = 0;
memset(fire_bg, 0, XRES*YRES*PIXELSIZE); memset(fire_bg, 0, XRES*YRES*PIXELSIZE);
memset(fire_r, 0, sizeof(fire_r)); memset(fire_r, 0, sizeof(fire_r));

View File

@ -565,9 +565,15 @@ inline int create_part(int p, int x, int y, int t)
if(p==-1)//creating from anything but brush if(p==-1)//creating from anything but brush
{ {
if(pmap[y][x]) if(pmap[y][x])
{
if((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2) if((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2)
{
if(t!=PT_STKM&&t!=PT_STKM2) if(t!=PT_STKM&&t!=PT_STKM2)
{
return -1; return -1;
}
}
}
if(pfree == -1) if(pfree == -1)
return -1; return -1;
i = pfree; i = pfree;
@ -576,6 +582,8 @@ inline int create_part(int p, int x, int y, int t)
else if(p==-2)//creating from brush else if(p==-2)//creating from brush
{ {
if(pmap[y][x]) if(pmap[y][x])
{
if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN&&t!=PT_STKM&&t!=PT_STKM2))
{ {
if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN)) if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN))
{ {
@ -589,7 +597,10 @@ inline int create_part(int p, int x, int y, int t)
pfree = parts[i].life; pfree = parts[i].life;
} }
else else
{
i = p; i = p;
}
}
if(t==PT_GLAS) if(t==PT_GLAS)
{ {
@ -2129,7 +2140,7 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
else if(parts[r>>8].type==PT_FILT){ else if(parts[r>>8].type==PT_FILT){
colored = parts[r>>8].ctype; colored = parts[r>>8].ctype;
}else if(parts[r>>8].type!=PT_INWR && parts[r>>8].type!=PT_ARAY) { }else if(parts[r>>8].type!=PT_INWR && parts[r>>8].type!=PT_ARAY && parts[r>>8].type!=PT_WIFI) {
if(nyy!=0 || nxx!=0){ if(nyy!=0 || nxx!=0){
create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK); create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK);
} }
@ -2143,6 +2154,8 @@ void update_particles_i(pixel *vid, int start, int inc)
if(parts[r>>8].type==PT_BRAY){ if(parts[r>>8].type==PT_BRAY){
parts[r>>8].life = 1; parts[r>>8].life = 1;
docontinue = 1; docontinue = 1;
} else if(parts[r>>8].type==PT_INWR || parts[r>>8].type==PT_ARAY || parts[r>>8].type==PT_WIFI) {
docontinue = 1;
} else { } else {
docontinue = 0; docontinue = 0;
} }
@ -3376,6 +3389,12 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[r>>8].type = PT_SPRK; parts[r>>8].type = PT_SPRK;
parts[r>>8].ctype = PT_PSCN; parts[r>>8].ctype = PT_PSCN;
parts[r>>8].life = 4; parts[r>>8].life = 4;
}
else if(parts[r>>8].type==PT_INWR&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
{
parts[r>>8].type = PT_SPRK;
parts[r>>8].ctype = PT_INWR;
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]) else if(parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp][0])
{ {
@ -5051,7 +5070,7 @@ killed:
parts[i].vx *= ptypes[t].collision; parts[i].vx *= ptypes[t].collision;
parts[i].vy *= ptypes[t].collision; parts[i].vy *= ptypes[t].collision;
} }
else if(ptypes[t].falldown>1 && parts[i].vy>fabs(parts[i].vx)) else if(ptypes[t].falldown>1 && (parts[i].vy>fabs(parts[i].vx) || gravityMode==2))
{ {
s = 0; s = 0;
if(!rt || nt) //nt is if there is an something else besides the current particle type, around the particle if(!rt || nt) //nt is if there is an something else besides the current particle type, around the particle