Merge all GOL types into PT_LIFE, behaviour is determined by ctype

This commit is contained in:
Simon Robertshaw 2011-07-09 18:22:25 +01:00
parent d2eb6f1cb3
commit d42e06f37a
6 changed files with 294 additions and 120 deletions

View File

@ -81,6 +81,7 @@ extern unsigned char ZSIZE;
#define STAMP_MAX 240
#define NGOL 25
#define NGOLALT 24 //NGOL should be 24, but use this var until I find out why
#define CIRCLE_BRUSH 0
#define SQUARE_BRUSH 1

View File

@ -130,18 +130,8 @@
#define PT_HSWC 75
#define PT_IRON 76
#define PT_MORT 77
#define PT_GOL 78
#define PT_HLIF 79
#define PT_ASIM 80
#define PT_2x2 81
#define PT_DANI 82
#define PT_AMOE 83
#define PT_MOVE 84
#define PT_PGOL 85
#define PT_DMOE 86
#define PT_34 87
#define PT_LLIF 88
#define PT_STAN 89
#define PT_LIFE 78
#define PT_SPNG 90
#define PT_RIME 91
#define PT_FOG 92
@ -186,6 +176,7 @@
#define PT_SING 131
#define PT_QRTZ 132
#define PT_PQRT 133
#define PT_SEED 134
#define PT_MAZE 135
#define PT_COAG 136
@ -194,11 +185,7 @@
#define PT_REPL 139
#define PT_MYST 140
#define PT_BOYL 141
#define PT_LOTE 142
#define PT_FRG2 143
#define PT_STAR 144
#define PT_FROG 145
#define PT_BRAN 146
#define OLD_PT_WIND 147
#define PT_H2 148
#define PT_SOAP 149
@ -473,18 +460,18 @@ 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_POWERED, R_TEMP+0.0f +273.15f, 251, "Heat switch. Conducts Heat only when activated", ST_NONE, TYPE_SOLID, &update_HSWC},
{"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, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Rusts with salt, can be used for electrolysis of WATR", ST_SOLID, TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW, &update_IRON},
{"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, 1, -1, SC_CRACKER2, R_TEMP+4.0f +273.15f, 60, "Steam Train.", ST_NONE, TYPE_PART, &update_MORT},
{"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! B3/S23", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! B36/S23", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! B345/S4567", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! B36/S125", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! B3678/S34678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! B357/S1358", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! Does not move things.. it is a life type B368/S245", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! B357/S238", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"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! B35678/S5678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"34", PIXPACK(0x500050), 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, "34! B34/S34)", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"LLIF", PIXPACK(0x505050), 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, "Long Life! B345/S5", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"STAN", PIXPACK(0x5000FF), 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, "Stains! B3678/S235678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"LIFE", 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, 0, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! B3/S23", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "High Life! B36/S23", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "Assimilation! B345/S4567", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "2x2! B36/S125", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "Day and Night! B3678/S34678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "Amoeba! B357/S1358", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "'Move' particles! Does not move things.. it is a life type B368/S245", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "Pseudo Life! B357/S238", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"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, 0, 100, SC_LIFE, 9000.0f, 40, "Diamoeba! B35678/S5678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"34", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "34! B34/S34)", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Long Life! B345/S5", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Stains! B3678/S235678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.", ST_SOLID, TYPE_SOLID, &update_SPNG},
{"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER2, 243.15f, 100, "Not quite Ice", ST_SOLID, TYPE_SOLID, &update_RIME},
{"FOG", PIXPACK(0xAAAAAA), 0.8f, 0.00f * CFDS, 0.4f, 0.70f, -0.1f, 0.0f, 0.99f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_CRACKER2, 243.15f, 100, "Not quite Steam", ST_GAS, TYPE_GAS|PROP_LIFE_DEC, &update_FOG},
@ -529,19 +516,19 @@ static const part_type ptypes[PT_NUM] =
{"SING", PIXPACK(0x242424), 0.7f, 0.36f * CFDS, 0.96f, 0.80f, 0.1f, 0.12f, 0.00f, -0.001f * CFDS, 1, 0, 0, 0, 0, 1, 86, SC_POWERED, R_TEMP+0.0f +273.15f, 70, "Singularity", ST_SOLID, TYPE_PART|PROP_LIFE_DEC, &update_SING},
{"QRTZ", PIXPACK(0xAADDDD), 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_SOLIDS, R_TEMP+0.0f +273.15f, 3, "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.", ST_SOLID, TYPE_SOLID|PROP_HOT_GLOW|PROP_LIFE_DEC, &update_QRTZ},
{"PQRT", PIXPACK(0x88BBBB), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.27f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 3, "Broken quartz.", ST_SOLID, TYPE_PART| PROP_HOT_GLOW, &update_QRTZ},
{"SEED", PIXPACK(0xFBEC7D), 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, "B2/S", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"MAZE", PIXPACK(0xA8E4A0), 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, "B3/S12345", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"COAG", PIXPACK(0x9ACD32), 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, "B378/S235678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"WALL", PIXPACK(0x0047AB), 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, "B45678/S2345", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"GNAR", PIXPACK(0xE5B73B), 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, "B1/S1", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"REPL", PIXPACK(0x259588), 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, "B1357/S1357", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"MYST", PIXPACK(0x0C3C00), 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, "B3458/S05678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"SEED", PIXPACK(0xFBEC7D), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B2/S", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"MAZE", PIXPACK(0xA8E4A0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B3/S12345", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"COAG", PIXPACK(0x9ACD32), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B378/S235678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"WALL", PIXPACK(0x0047AB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B45678/S2345", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"GNAR", PIXPACK(0xE5B73B), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B1/S1", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"REPL", PIXPACK(0x259588), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B1357/S1357", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"MYST", PIXPACK(0x0C3C00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "B3458/S05678", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"BOYL", PIXPACK(0x0A3200), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.18f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Boyle, variable pressure gas. Expands when heated.", ST_GAS, TYPE_GAS, &update_BOYL},
{"LOTE", 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, "Behaves kinda like Living on the Edge S3458/B37/4", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"FRG2", PIXPACK(0x00FF00), 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, "Like Frogs rule S124/B3/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"STAR", 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, "Like Star Wars rule S3456/B278/6", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"FROG", PIXPACK(0x00AA00), 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, "Frogs S12/B34/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"BRAN", PIXPACK(0xCCCC00), 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, "Brian 6 S6/B246/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"LOTE", 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, 0, 100, SC_LIFE, 9000.0f, 40, "Behaves kinda like Living on the Edge S3458/B37/4", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"FRG2", PIXPACK(0x00FF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Like Frogs rule S124/B3/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"STAR", 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, 0, 100, SC_LIFE, 9000.0f, 40, "Like Star Wars rule S3456/B278/6", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"FROG", PIXPACK(0x00AA00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Frogs S12/B34/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
/*FREE*/{"BRAN", PIXPACK(0xCCCC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Brian 6 S6/B246/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL},
{"WIND", PIXPACK(0x101010), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_SPECIAL, 0.0f, 40, "", ST_NONE, ST_NONE, NULL},
{"H2", PIXPACK(0x5070FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.10f, 0.00f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 251, "Combines with O2 to make WATR", ST_GAS, TYPE_GAS, &update_H2},
{"SOAP", PIXPACK(0xF5F5DC), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 35, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Soap. Creates bubbles.", ST_LIQUID, TYPE_LIQUID|PROP_NEUTPENETRATE|PROP_LIFE_DEC, &update_SOAP},
@ -729,6 +716,94 @@ static part_transition ptransitions[PT_NUM] =
#undef NT
#undef ST
//Old IDs for GOL types
#define GT_GOL 78
#define GT_HLIF 79
#define GT_ASIM 80
#define GT_2x2 81
#define GT_DANI 82
#define GT_AMOE 83
#define GT_MOVE 84
#define GT_PGOL 85
#define GT_DMOE 86
#define GT_34 87
#define GT_LLIF 88
#define GT_STAN 89
#define GT_SEED 134
#define GT_MAZE 135
#define GT_COAG 136
#define GT_WALL 137
#define GT_GNAR 138
#define GT_REPL 139
#define GT_MYST 140
#define GT_LOTE 142
#define GT_FRG2 143
#define GT_STAR 144
#define GT_FROG 145
#define GT_BRAN 146
//New IDs for GOL types
#define NGT_GOL 0
#define NGT_HLIF 1
#define NGT_ASIM 2
#define NGT_2x2 3
#define NGT_DANI 4
#define NGT_AMOE 5
#define NGT_MOVE 6
#define NGT_PGOL 7
#define NGT_DMOE 8
#define NGT_34 9
#define NGT_LLIF 10
#define NGT_STAN 11
#define NGT_SEED 12
#define NGT_MAZE 13
#define NGT_COAG 14
#define NGT_WALL 15
#define NGT_GNAR 16
#define NGT_REPL 17
#define NGT_MYST 18
#define NGT_LOTE 19
#define NGT_FRG2 20
#define NGT_STAR 21
#define NGT_FROG 22
#define NGT_BRAN 23
struct gol_menu
{
const char *name;
pixel colour;
int goltype;
const char *description;
};
typedef struct gol_menu gol_menu;
static gol_menu gmenu[NGOL] =
{
{"GOL", PIXPACK(0x0CAC00), 0, "GOL"},
{"HLIF", PIXPACK(0xFF0000), 1, "GOL"},
{"ASIM", PIXPACK(0x0000FF), 2, "GOL"},
{"2x2", PIXPACK(0xFFFF00), 3, "GOL"},
{"DANI", PIXPACK(0x00FFFF), 4, "GOL"},
{"AMOE", PIXPACK(0xFF00FF), 5, "GOL"},
{"MOVE", PIXPACK(0xFFFFFF), 6, "GOL"},
{"PGOL", PIXPACK(0xE05010), 7, "GOL"},
{"DMOE", PIXPACK(0x500000), 8, "GOL"},
{"34", PIXPACK(0x500050), 9, "GOL"},
{"LLIF", PIXPACK(0x505050), 10, "GOL"},
{"STAN", PIXPACK(0x5000FF), 11, "GOL"},
{"SEED", PIXPACK(0xFBEC7D), 12, "GOL"},
{"MAZE", PIXPACK(0xA8E4A0), 13, "GOL"},
{"COAG", PIXPACK(0x9ACD32), 14, "GOL"},
{"WALL", PIXPACK(0x0047AB), 15, "GOL"},
{"GNAR", PIXPACK(0xE5B73B), 16, "GOL"},
{"REPL", PIXPACK(0x259588), 17, "GOL"},
{"MYST", PIXPACK(0x0C3C00), 18, "GOL"},
{"LOTE", PIXPACK(0xFF0000), 19, "GOL"},
{"FRG2", PIXPACK(0x00FF00), 20, "GOL"},
{"STAR", PIXPACK(0x0000FF), 21, "GOL"},
{"FROG", PIXPACK(0x00AA00), 22, "GOL"},
{"BRAN", PIXPACK(0xCCCC00), 23, "GOL"}
};
static int grule[NGOL+1][10] =
{
@ -761,30 +836,30 @@ static int grule[NGOL+1][10] =
};
static int goltype[NGOL] =
{
PT_GOL,
PT_HLIF,
PT_ASIM,
PT_2x2,
PT_DANI,
PT_AMOE,
PT_MOVE,
PT_PGOL,
PT_DMOE,
PT_34,
PT_LLIF,
PT_STAN,
PT_SEED,
PT_MAZE,
PT_COAG,
PT_WALL,
PT_GNAR,
PT_REPL,
PT_MYST,
PT_LOTE,
PT_FRG2,
PT_STAR,
PT_FROG,
PT_BRAN,
GT_GOL,
GT_HLIF,
GT_ASIM,
GT_2x2,
GT_DANI,
GT_AMOE,
GT_MOVE,
GT_PGOL,
GT_DMOE,
GT_34,
GT_LLIF,
GT_STAN,
GT_SEED,
GT_MAZE,
GT_COAG,
GT_WALL,
GT_GNAR,
GT_REPL,
GT_MYST,
GT_LOTE,
GT_FRG2,
GT_STAR,
GT_FROG,
GT_BRAN,
};
static int loverule[9][9] =
{

View File

@ -709,7 +709,31 @@ int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc)
pixel gc;
if (x > XRES-26 || x < 0)
return 26;
if (b>=UI_WALLSTART)
if ((b&0xFF) == PT_LIFE)
{
#ifdef OpenGL
fillrect(vid_buf, x, y, 28, 16, PIXR(pc), PIXG(pc), PIXB(pc), 255);
#else
for (j=1; j<15; j++)
{
for (i=1; i<27; i++)
{
vid_buf[(XRES+BARSIZE)*(y+j)+(x+i)] = pc;
}
}
#endif
c = PIXB(pc) + 3*PIXG(pc) + 2*PIXR(pc);
if (c<544)
{
c = 255;
}
else
{
c = 0;
}
drawtext(vid_buf, x+14-textwidth((char *)gmenu[(b>>8)&0xFF].name)/2, y+4, (char *)gmenu[(b>>8)&0xFF].name, c, c, c, 255);
}
else if (b>=UI_WALLSTART)
{
int ds = 0;
if (b-UI_WALLSTART>=0 && b-UI_WALLSTART<UI_WALLCOUNT)
@ -2042,48 +2066,52 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
else if (t==PT_LOTE)//colors for life states
{
if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 255, 128, 0, 255);
else if (parts[i].tmp==1)
blendpixel(vid, nx, ny, 255, 255, 0, 255);
else
blendpixel(vid, nx, ny, 255, 0, 0, 255);
}
else if (t==PT_FRG2)//colors for life states
{
if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 0, 100, 50, 255);
else
blendpixel(vid, nx, ny, 0, 255, 90, 255);
}
else if (t==PT_STAR)//colors for life states
{
if (parts[i].tmp==4)
blendpixel(vid, nx, ny, 0, 0, 128, 255);
else if (parts[i].tmp==3)
blendpixel(vid, nx, ny, 0, 0, 150, 255);
else if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 0, 0, 190, 255);
else if (parts[i].tmp==1)
blendpixel(vid, nx, ny, 0, 0, 230, 255);
else
blendpixel(vid, nx, ny, 0, 0, 70, 255);
}
else if (t==PT_FROG)//colors for life states
{
if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 0, 100, 0, 255);
else
blendpixel(vid, nx, ny, 0, 255, 0, 255);
}
else if (t==PT_BRAN)//colors for life states
{
if (parts[i].tmp==1)
blendpixel(vid, nx, ny, 150, 150, 0, 255);
else
blendpixel(vid, nx, ny, 255, 255, 0, 255);
if(t==PT_LIFE && parts[i].ctype < NGOLALT){
if (parts[i].ctype==NGT_LOTE)//colors for life states
{
if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 255, 128, 0, 255);
else if (parts[i].tmp==1)
blendpixel(vid, nx, ny, 255, 255, 0, 255);
else
blendpixel(vid, nx, ny, 255, 0, 0, 255);
}
else if (parts[i].ctype==NGT_FRG2)//colors for life states
{
if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 0, 100, 50, 255);
else
blendpixel(vid, nx, ny, 0, 255, 90, 255);
}
else if (parts[i].ctype==NGT_STAR)//colors for life states
{
if (parts[i].tmp==4)
blendpixel(vid, nx, ny, 0, 0, 128, 255);
else if (parts[i].tmp==3)
blendpixel(vid, nx, ny, 0, 0, 150, 255);
else if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 0, 0, 190, 255);
else if (parts[i].tmp==1)
blendpixel(vid, nx, ny, 0, 0, 230, 255);
else
blendpixel(vid, nx, ny, 0, 0, 70, 255);
}
else if (parts[i].ctype==NGT_FROG)//colors for life states
{
if (parts[i].tmp==2)
blendpixel(vid, nx, ny, 0, 100, 0, 255);
else
blendpixel(vid, nx, ny, 0, 255, 0, 255);
}
else if (parts[i].ctype==NGT_BRAN)//colors for life states
{
if (parts[i].tmp==1)
blendpixel(vid, nx, ny, 150, 150, 0, 255);
else
blendpixel(vid, nx, ny, 255, 255, 0, 255);
} else {
blendpixel(vid, nx, ny, PIXR(gmenu[parts[i].ctype].colour), PIXG(gmenu[parts[i].ctype].colour), PIXB(gmenu[parts[i].ctype].colour), 255);
}
}
else if (t==PT_DEUT)
{

View File

@ -87,6 +87,7 @@ int drawgrav_enable = 0;
void menu_count(void)//puts the number of elements in each section into .itemcount
{
int i=0;
msections[SC_LIFE].itemcount = NGOLALT;
msections[SC_WALL].itemcount = UI_WALLCOUNT-4;
msections[SC_SPECIAL].itemcount = 4;
for (i=0; i<PT_NUM; i++)
@ -2013,6 +2014,41 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq
}
}
}
else if(i==SC_LIFE)
{
int n2;
if (fwidth > XRES-BARSIZE) { //fancy scrolling
float overflow = fwidth-(XRES-BARSIZE), location = ((float)XRES-BARSIZE)/((float)(mx-(XRES-BARSIZE)));
xoff = (int)(overflow / location);
}
for (n2 = 0; n2<NGOLALT; n2++)
{
n = PT_LIFE | (n2<<8);
x -= draw_tool_xy(vid_buf, x-xoff, y, n, gmenu[n2].colour)+5;
if (!bq && mx>=x+32-xoff && mx<x+58-xoff && my>=y && my< y+15)
{
drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 255, 55, 55, 255);
h = n;
}
if (!bq && mx>=x+32-xoff && mx<x+58-xoff && my>=y && my< y+15&&(sdl_mod & (KMOD_LALT) && sdl_mod & (KMOD_SHIFT)))
{
drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 0, 255, 255, 255);
h = n;
}
else if (n==SLALT)
{
drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 0, 255, 255, 255);
}
else if (n==*sl)
{
drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 255, 55, 55, 255);
}
else if (n==*sr)
{
drawrect(vid_buf, x+30-xoff, y-1, 29, 17, 55, 55, 255, 255);
}
}
}
else //all other menus
{
if (fwidth > XRES-BARSIZE) { //fancy scrolling
@ -2062,6 +2098,10 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq
{
drawtext(vid_buf, XRES-textwidth((char *)wtypes[h-UI_WALLSTART].descs)-BARSIZE, sy-10, (char *)wtypes[h-UI_WALLSTART].descs, 255, 255, 255, 255);
}
else if (i==SC_LIFE)
{
drawtext(vid_buf, XRES-textwidth((char *)gmenu[(h>>8)&0xFF].description)-BARSIZE, sy-10, (char *)gmenu[(h>>8)&0xFF].description, 255, 255, 255, 255);
}
else
{
drawtext(vid_buf, XRES-textwidth((char *)ptypes[h].descs)-BARSIZE, sy-10, (char *)ptypes[h].descs, 255, 255, 255, 255);

View File

@ -466,7 +466,7 @@ void *build_save(int *size, int x0, int y0, int w, int h, unsigned char bmap[YRE
for (j=0; j<w*h; j++)
{
i = m[j];
if (i && (parts[i-1].type==PT_CLNE || parts[i-1].type==PT_PCLN || parts[i-1].type==PT_BCLN || parts[i-1].type==PT_SPRK || parts[i-1].type==PT_LAVA || parts[i-1].type==PT_PIPE))
if (i && (parts[i-1].type==PT_CLNE || parts[i-1].type==PT_PCLN || parts[i-1].type==PT_BCLN || parts[i-1].type==PT_SPRK || parts[i-1].type==PT_LAVA || parts[i-1].type==PT_PIPE || parts[i-1].type==PT_LIFE))
d[p++] = parts[i-1].ctype;
}
@ -975,9 +975,10 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
}
for (j=0; j<w*h; j++)
{
int gnum = 0;
i = m[j];
ty = d[pty+j];
if (i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_BCLN && ver>=44) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43)))
if (i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_BCLN && ver>=44) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43) || (ty==PT_LIFE && ver>=51)))
{
if (p >= size)
goto corrupt;
@ -997,6 +998,15 @@ int parse_save(void *save, int size, int replace, int x0, int y0, unsigned char
parts[i-1].dcolour = 0xFF000000;
parts[i-1].type = PT_DMND;
}
if(ver<51 && ((ty>=78 && ty<=89) || (ty>=134 && ty<=146 && ty!=141))){
//Replace old GOL
parts[i-1].type = PT_LIFE;
for (gnum = 0; gnum<NGOLALT; gnum++){
if (ty==goltype[gnum])
parts[i-1].ctype = gnum;
}
ty = PT_LIFE;
}
}
}

View File

@ -636,11 +636,14 @@ inline void part_change_type(int i, int x, int y, int t)//changes the type of pa
#if defined(WIN32) && !defined(__GNUC__)
_inline int create_part(int p, int x, int y, int t)
#else
inline int create_part(int p, int x, int y, int t)//the function for creating a particle, use p=-1 for creating a new particle, -2 is from a brush, or a particle number to replace a particle.
inline int create_part(int p, int x, int y, int tv)//the function for creating a particle, use p=-1 for creating a new particle, -2 is from a brush, or a particle number to replace a particle.
#endif
{
int i;
int t = tv & 0xFF;
int v = (tv >> 8) & 0xFF;
if (x<0 || y<0 || x>=XRES || y>=YRES || ((t<0 || t>=PT_NUM)&&t!=SPC_HEAT&&t!=SPC_COOL&&t!=SPC_AIR&&t!=SPC_VACUUM))
return -1;
if (t==OLD_PT_WIND)
@ -822,12 +825,18 @@ inline int create_part(int p, int x, int y, int t)//the function for creating a
parts[i].life = 50;
parts[i].tmp = 50;
}
if (ptypes[t].properties&PROP_LIFE) {
/*if (ptypes[t].properties&PROP_LIFE) {
int r;
for (r = 0; r<NGOL; r++)
if (t==goltype[r])
parts[i].tmp = grule[r+1][9] - 1;
}*/
if (t==PT_LIFE)
{
parts[i].tmp = grule[v+1][9] - 1;
parts[i].ctype = v;
}
if (t==PT_DEUT)
parts[i].life = 10;
if (t==PT_MERC)
@ -1458,7 +1467,8 @@ void update_particles_i(pixel *vid, int start, int inc)
int createdsomething = 0;
CGOL=0;
ISGOL=0;
for (nx=CELL; nx<XRES-CELL; nx++)//go through every particle and set neighbor map
for (nx=CELL; nx<XRES-CELL; nx++)
{//go through every particle and set neighbor map
for (ny=CELL; ny<YRES-CELL; ny++)
{
r = pmap[ny][nx];
@ -1468,41 +1478,50 @@ void update_particles_i(pixel *vid, int start, int inc)
continue;
}
else
for ( golnum=1; golnum<=NGOL; golnum++)
if (parts[r>>8].type==goltype[golnum-1])
{
//for ( golnum=1; golnum<=NGOL; golnum++) //This shouldn't be necessary any more.
//{
if (parts[r>>8].type==PT_LIFE/* && parts[r>>8].ctype==golnum-1*/)
{
golnum = parts[r>>8].ctype+1;
if (parts[r>>8].tmp == grule[golnum][9]-1) {
gol[nx][ny] = golnum;
for ( nnx=-1; nnx<2; nnx++)
{
for ( nny=-1; nny<2; nny++)//it will count itself as its own neighbor, which is needed, but will have 1 extra for delete check
{
rt = pmap[((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL];
if (!rt || ptypes[rt&0xFF].properties&PROP_LIFE)
if (!rt || (rt&0xFF)==PT_LIFE)
{
gol2[((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL][((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][golnum] ++;
gol2[((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL][((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][0] ++;
}
}
}
} else {
parts[r>>8].tmp --;
if (parts[r>>8].tmp<=0)
parts[r>>8].type = PT_NONE;//using kill_part makes it not work
}
}
//}
}
}
for (nx=CELL; nx<XRES-CELL; nx++)//go through every particle again, but check neighbor map, then update particles
}
for (nx=CELL; nx<XRES-CELL; nx++)
{ //go through every particle again, but check neighbor map, then update particles
for (ny=CELL; ny<YRES-CELL; ny++)
{
r = pmap[ny][nx];
neighbors = gol2[nx][ny][0];
if (neighbors==0 || !(ptypes[r&0xFF].properties&PROP_LIFE || !(r&0xFF)) || (r>>8)>=NPART)
if (neighbors==0 || !((r&0xFF)==PT_LIFE || !(r&0xFF)) || (r>>8)>=NPART)
continue;
for ( golnum = 1; golnum<=NGOL; golnum++)
{
goldelete = neighbors;
if (gol[nx][ny]==0&&grule[golnum][goldelete]>=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2)
{
if (create_part(-1,nx,ny,goltype[golnum-1]))
if (create_part(-1, nx, ny, PT_LIFE|((golnum-1)<<8)))
createdsomething = 1;
}
else if (gol[nx][ny]==golnum&&(grule[golnum][goldelete-1]==0||grule[golnum][goldelete-1]==2))//subtract 1 because it counted itself
@ -1516,6 +1535,7 @@ void update_particles_i(pixel *vid, int start, int inc)
for ( z = 0; z<=NGOL; z++)
gol2[nx][ny][z] = 0;//this improves performance A LOT compared to the memset, i was getting ~23 more fps with this.
}
}
if (createdsomething)
GENERATION ++;
//memset(gol2, 0, sizeof(gol2));
@ -1839,7 +1859,7 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
if (ptypes[t].properties&PROP_LIFE)
if (t==PT_LIFE)
{
parts[i].temp = restrict_flt(parts[i].temp-50.0f, MIN_TEMP, MAX_TEMP);
ISGOL=1;//means there is a life particle on screen