added amoeba, move, pseudo life, and diamoeba particles
This commit is contained in:
parent
75922ae31d
commit
3ad216f953
@ -18,7 +18,7 @@
|
||||
|
||||
#define THUMB_CACHE_SIZE 256
|
||||
|
||||
#define NGOL 6
|
||||
#define NGOL 10
|
||||
|
||||
#define IMGCONNS 3
|
||||
#define TIMEOUT 100
|
||||
|
@ -121,7 +121,11 @@
|
||||
#define PT_ASIM 80
|
||||
#define PT_2x2 81
|
||||
#define PT_DANI 82
|
||||
#define PT_NUM 83
|
||||
#define PT_AMOE 83
|
||||
#define PT_MOVE 84
|
||||
#define PT_PGOL 85
|
||||
#define PT_DMOE 86
|
||||
#define PT_NUM 87
|
||||
|
||||
#define R_TEMP 22
|
||||
#define MAX_TEMP 9999
|
||||
@ -289,11 +293,15 @@ static const part_type ptypes[PT_NUM] =
|
||||
{"HSWC", PIXPACK(0x3B1010), 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, "Heat switch. Conducts Heat only when activated", TYPE_SOLID},
|
||||
{"IRON", PIXPACK(0x707070), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 50, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrlosis of WATR", TYPE_SOLID},
|
||||
{"MORT", PIXPACK(0xE0E0E0), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 0, -1, SC_NUCLEAR, R_TEMP+4.0f +273.15f, 60, "Steam Train.", TYPE_PART},
|
||||
{"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life!", TYPE_SOLID},
|
||||
{"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL)", TYPE_SOLID},
|
||||
{"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (like GOL)", TYPE_SOLID},
|
||||
{"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (like GOL)", TYPE_SOLID},
|
||||
{"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (like GOL)", TYPE_SOLID},
|
||||
{"GOL", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! (23/3)", TYPE_SOLID},
|
||||
{"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! (like GOL 23/36)", TYPE_SOLID},
|
||||
{"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! (4567/345)", TYPE_SOLID},
|
||||
{"2x2", PIXPACK(0xFFFF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "2x2! (125/36)", TYPE_SOLID},
|
||||
{"DANI", PIXPACK(0x00FFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Day and Night! (34678/3678)", TYPE_SOLID},
|
||||
{"AMOE", PIXPACK(0xFF00FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Amoeba! (1358/357)", TYPE_SOLID},
|
||||
{"MOVE", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Move particles! (245/368)", TYPE_SOLID},
|
||||
{"PGOL", PIXPACK(0xE05010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! (238/357)", TYPE_SOLID},
|
||||
{"DMOE", PIXPACK(0x500000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! (5678/35678)", 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
|
||||
};
|
||||
|
||||
|
@ -530,6 +530,14 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
gol[x][y] = 4;
|
||||
if(j == PT_DANI)
|
||||
gol[x][y] = 5;
|
||||
if(j == PT_AMOE)
|
||||
gol[x][y] = 6;
|
||||
if(j == PT_MOVE)
|
||||
gol[x][y] = 7;
|
||||
if(j == PT_PGOL)
|
||||
gol[x][y] = 8;
|
||||
if(j == PT_DMOE)
|
||||
gol[x][y] = 9;
|
||||
if(j == PT_PHOT)
|
||||
parts[k].ctype = 0x3fffffff;
|
||||
parts[k].x = (float)x;
|
||||
|
146
src/powder.c
146
src/powder.c
@ -855,6 +855,22 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
gol[nx][ny] = 5;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_AMOE)
|
||||
{
|
||||
gol[nx][ny] = 6;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_MOVE)
|
||||
{
|
||||
gol[nx][ny] = 7;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_PGOL)
|
||||
{
|
||||
gol[nx][ny] = 8;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_DMOE)
|
||||
{
|
||||
gol[nx][ny] = 9;
|
||||
}
|
||||
}
|
||||
for(nx=4;nx<XRES-4;nx++)
|
||||
for(ny=4;ny<YRES-4;ny++)
|
||||
@ -893,6 +909,12 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
int v = 0;
|
||||
for(int z = 1;z<NGOL;z++)
|
||||
v += gol2[nx][ny][z];
|
||||
//creation rules for number of neighbors , v
|
||||
//1
|
||||
|
||||
//2
|
||||
|
||||
//3
|
||||
if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][1]>=2)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_GOL);
|
||||
@ -913,6 +935,22 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DANI);
|
||||
}
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][6]>=2)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_AMOE);
|
||||
}
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][7]>=2)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_MOVE);
|
||||
}
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][8]>=2)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_PGOL);
|
||||
}
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][9]>=2)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DMOE);
|
||||
}
|
||||
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][1]==1)
|
||||
{
|
||||
@ -926,16 +964,41 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_2x2);
|
||||
}
|
||||
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][6]==1)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_AMOE);
|
||||
}
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][7]==1)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_MOVE);
|
||||
}
|
||||
else if(v==3&&gol[nx][ny]==0&&gol2[nx][ny][8]==1)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_PGOL);
|
||||
}
|
||||
//4
|
||||
else if(v==4&&gol[nx][ny]==0&&gol2[nx][ny][3]>=2)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_ASIM);
|
||||
}
|
||||
//5
|
||||
else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][3]>=3)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_ASIM);
|
||||
}
|
||||
|
||||
else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][6]>=3)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_AMOE);
|
||||
}
|
||||
else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][8]>=3)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_PGOL);
|
||||
}
|
||||
else if(v==5&&gol[nx][ny]==0&&gol2[nx][ny][9]>=3)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DMOE);
|
||||
}
|
||||
//6
|
||||
else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][2]>=3)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_HLIF);
|
||||
@ -948,33 +1011,62 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DANI);
|
||||
}
|
||||
|
||||
else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][7]>=3)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_MOVE);
|
||||
}
|
||||
else if(v==6&&gol[nx][ny]==0&&gol2[nx][ny][9]>=3)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DMOE);
|
||||
}
|
||||
//7
|
||||
else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DANI);
|
||||
}
|
||||
|
||||
else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][6]>=4)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_AMOE);
|
||||
}
|
||||
else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][8]>=4)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_PGOL);
|
||||
}
|
||||
else if(v==7&&gol[nx][ny]==0&&gol2[nx][ny][9]>=4)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DMOE);
|
||||
}
|
||||
//8
|
||||
else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][5]>=4)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DANI);
|
||||
}
|
||||
|
||||
else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][7]>=4)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_MOVE);
|
||||
}
|
||||
else if(v==8&&gol[nx][ny]==0&&gol2[nx][ny][9]>=4)
|
||||
{
|
||||
create_part(-1,nx,ny,PT_DMOE);
|
||||
}
|
||||
//rules to kill particle
|
||||
//GOL
|
||||
else if(v>=5&&gol[nx][ny]==1)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v<=2&&gol[nx][ny]==1)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
|
||||
//HLIF
|
||||
else if(v>=5&&gol[nx][ny]==2)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v<=2&&gol[nx][ny]==2)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
|
||||
|
||||
//ASIM
|
||||
else if(v<=4&&gol[nx][ny]==3)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v>=9&&gol[nx][ny]==3)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
|
||||
//2x2
|
||||
else if(v>=7&&gol[nx][ny]==4)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v==4&&gol[nx][ny]==4)
|
||||
@ -983,17 +1075,41 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v<=1&&gol[nx][ny]==4)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
|
||||
//DANI
|
||||
else if(v==6&&gol[nx][ny]==5)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v<=3&&gol[nx][ny]==5)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
//AMOE
|
||||
else if(v==8&&gol[nx][ny]==6)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v==7&&gol[nx][ny]==6)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v==5&&gol[nx][ny]==6)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v==3&&gol[nx][ny]==6)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v==1&&gol[nx][ny]==6)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
//MOVE
|
||||
else if(v>=7&&gol[nx][ny]==7)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v==4&&gol[nx][ny]==7)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v<=2&&gol[nx][ny]==7)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
//PGOL
|
||||
else if((v<=8&&v>=5)&&gol[nx][ny]==8)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
else if(v<=2&&gol[nx][ny]==8)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
|
||||
gol2[nx][ny][1]=0;
|
||||
gol2[nx][ny][2]=0;
|
||||
gol2[nx][ny][3]=0;
|
||||
gol2[nx][ny][4]=0;
|
||||
gol2[nx][ny][5]=0;
|
||||
//DMOE
|
||||
else if(v<=5&&gol[nx][ny]==9)
|
||||
parts[r>>8].type = PT_NONE;
|
||||
|
||||
for(int z = 1;z<NGOL;z++)
|
||||
gol2[nx][ny][z] = 0;
|
||||
}
|
||||
CGOL++;
|
||||
for(i=start; i<(NPART-starti); i+=inc)
|
||||
@ -1960,7 +2076,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
else if(t==PT_MORT) {
|
||||
create_part(-1, x, y-1, PT_SMKE);
|
||||
}
|
||||
else if(t==PT_GOL||t==PT_HLIF||t==PT_ASIM||t==PT_2x2)
|
||||
else if(t==PT_GOL||t==PT_HLIF||t==PT_ASIM||t==PT_2x2||t==PT_DANI||t==PT_AMOE||t==PT_MOVE||t==PT_PGOL||t==PT_DMOE)
|
||||
{
|
||||
if(parts[i].temp>0)
|
||||
parts[i].temp -= 50.0f;
|
||||
|
Reference in New Issue
Block a user