cracker merge

This commit is contained in:
Simon 2010-12-11 03:46:21 +00:00
commit d8cd71f912
7 changed files with 238 additions and 165 deletions

View File

@ -17,10 +17,10 @@ powder-debug-64: $(SOURCES)
$(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES) -Iincludes/ $(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES) -Iincludes/
powder-debug: $(SOURCES) powder-debug: $(SOURCES)
$(COMPILER) -m32 -o$@ $(FLAGS_DBUG) -DLIN32 $(SOURCES) -Iincludes/ $(COMPILER) -m32 -o$@ $(FLAGS_DBUG) -DLIN32 $(SOURCES) -Iincludes/
powder-sse3: $(SOURCES) powder-sse3: $(SOURCES)
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32 $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32
strip $@ strip $@
mv $@ build
powder-sse2: $(SOURCES) powder-sse2: $(SOURCES)
$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN32 $(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN32
strip $@ strip $@
@ -33,7 +33,6 @@ powder-64-sse3-opengl: $(SOURCES)
powder-64-sse3: $(SOURCES) powder-64-sse3: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64
strip $@ strip $@
mv $@ build
powder-64-sse2: $(SOURCES) powder-64-sse2: $(SOURCES)
$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN64 $(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN64
strip $@ strip $@

View File

@ -136,6 +136,7 @@ int REPLACE_MODE;
int CURRENT_BRUSH; int CURRENT_BRUSH;
int GRID_MODE; int GRID_MODE;
int VINE_MODE; int VINE_MODE;
int DEBUG_MODE;
extern sign signs[MAXSIGNS]; extern sign signs[MAXSIGNS];
extern stamp stamps[STAMP_MAX]; extern stamp stamps[STAMP_MAX];
extern int stamp_count; extern int stamp_count;

View File

@ -53,6 +53,7 @@ static menu_wall mwalls[] =
#define SC_NUCLEAR 7 #define SC_NUCLEAR 7
#define SC_LIFE 9 #define SC_LIFE 9
#define SC_CRACKER 10 #define SC_CRACKER 10
#define SC_CRACKER2 11
#define SC_TOTAL 10 #define SC_TOTAL 10
static menu_section msections[] = static menu_section msections[] =
@ -68,6 +69,7 @@ static menu_section msections[] =
{"\xCC", "Special", 0, 1}, {"\xCC", "Special", 0, 1},
{"\xC8", "Life", 0, 1}, {"\xC8", "Life", 0, 1},
{"\xC8", "Cracker", 0, 0}, {"\xC8", "Cracker", 0, 0},
{"\xC8", "Cracker!", 0, 0},
}; };
struct ui_edit struct ui_edit

View File

@ -342,8 +342,8 @@ static const part_type ptypes[PT_NUM] =
{"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL", TYPE_PART}, {"BCOL", PIXPACK(0x333333), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 2, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Broken Coal. Heavy particles. See COAL", TYPE_PART},
{"PCLN", PIXPACK(0x3B3B10), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches.", TYPE_SOLID}, {"PCLN", PIXPACK(0x3B3B10), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Solid. When actived, duplicates any particles it touches.", TYPE_SOLID},
{"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}, {"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}, {"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_CRACKER2, 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}, {"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.", 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! (23/3)", 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}, {"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}, {"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},
@ -357,22 +357,22 @@ static const part_type ptypes[PT_NUM] =
{"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! (5/345)", TYPE_SOLID}, {"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! (5/345)", TYPE_SOLID},
{"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! (235678/3678)", TYPE_SOLID}, {"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! (235678/3678)", TYPE_SOLID},
{"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.",TYPE_SOLID}, {"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.",TYPE_SOLID},
{"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_CRACKER, 243.15f, 100, "Not quite Ice",TYPE_SOLID}, {"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",TYPE_SOLID},
{"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_CRACKER, 243.15f, 100, "Not quite Steam",TYPE_GAS}, {"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",TYPE_GAS},
{"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID}, {"BCLN", PIXPACK(0xFFD040), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 12, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Breakable Clone.", TYPE_SOLID},
{"LOVE", PIXPACK(0xFF30FF), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.0f, 0.000f * CFDS, 0, 0, 0, 0, 0, 0, 100, SC_LIFE, 373.0f, 40, "Love...", TYPE_SOLID}, {"LOVE", PIXPACK(0xFF30FF), 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, "Love...", TYPE_SOLID},
{"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"DEUT", PIXPACK(0x00153F), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 31, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 251, "Deuterium oxide. Volume changes with temp, radioactive with neutrons.", TYPE_LIQUID|PROP_NEUTPENETRATE},
{"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_NUCLEAR, R_TEMP +273.15f, 100, "Displaces other elements.",TYPE_GAS}, {"WARP", PIXPACK(0x000000), 0.8f, 0.00f * CFDS, 0.9f, 0.70f, -0.1f, 0.0f, 3.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 1, SC_NUCLEAR, R_TEMP +273.15f, 100, "Displaces other elements.",TYPE_GAS},
{"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID}, {"PUMP", PIXPACK(0x10103B), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_ELEC, 273.15f, 0, "Changes pressure to its temp when activated. (use HEAT/COOL).", TYPE_SOLID},
{"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons."}, {"FWRK", PIXPACK(0x666666), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons."},
{"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SOLIDS, 273.15f, 0, "Moves elements around, read FAQ on website for help.", TYPE_SOLID}, {"PIPE", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SOLIDS, 273.15f, 0, "Moves elements around, read FAQ on website for help.", TYPE_SOLID},
{"FRZZ", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 0, 50, SC_CRACKER, 90.0f, 46, "FREEZE", TYPE_PART}, {"FRZZ", PIXPACK(0xC0E0FF), 0.7f, 0.01f * CFDS, 0.96f, 0.90f, -0.1f, 0.05f, 0.01f, -0.00005f* CFDS,1, 0, 0, 0, 20, 1, 50, SC_CRACKER2, 90.0f, 46, "FREEZE", TYPE_PART},
{"FRZW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 0, 30, SC_CRACKER, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID}, {"FRZW", PIXPACK(0x1020C0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_CRACKER2, 120.0f, 29, "FREEZE WATER", TYPE_LIQUID},
{"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Changes colour based on velocity.", TYPE_PART}, {"GRAV", PIXPACK(0xFFE0A0), 0.7f, 0.00f * CFDS, 1.00f, 1.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Changes colour based on velocity.", TYPE_PART},
{"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID}, {"@_@", PIXPACK(0x00FF77), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 30, SC_LIQUID, R_TEMP+0.0f +273.15f, 29, "@_@, contradicts the normal state changes.", TYPE_LIQUID},
{"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 1, SC_CRACKER, R_TEMP-200.0f+273.15f, 42, "@_@ gas", TYPE_GAS}, {"@_@G", PIXPACK(0x00FFBB), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 2.75f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_CRACKER2, R_TEMP-200.0f+273.15f, 42, "@_@ gas", TYPE_GAS},
{"@_@S", PIXPACK(0x00E455), 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_CRACKER, R_TEMP+300.0f+273.15f, 251, "@_@ solid", TYPE_SOLID}, {"@_@S", PIXPACK(0x00E455), 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_CRACKER2, R_TEMP+300.0f+273.15f, 251, "@_@ solid", TYPE_SOLID},
{"INST", PIXPACK(0x404039), 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, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS}, {"INST", PIXPACK(0x404039), 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_CRACKER2, R_TEMP+0.0f +273.15f, 251, "Instantly conducts, like walls, is now also a battery, PSCN to charge, NSCN to take.", TYPE_SOLID|PROP_CONDUCTS},
{"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE}, {"ISOZ", PIXPACK(0xAA30D0), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 24, SC_NUCLEAR, R_TEMP-2.0f +273.15f, 29, "Radioactive liquid", TYPE_LIQUID|PROP_NEUTPENETRATE},
{"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID}, {"ISZS", PIXPACK(0x662089), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0007f* CFDS, 0, 0, 0, 1, 1, 1, 100, SC_NUCLEAR, 140.00f, 251, "Solid form of ISOZ, slowly decays.", TYPE_SOLID},
{"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID}, {"PRTI", PIXPACK(0xEB5917), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.005f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 40, "Portal IN. Things go in here", TYPE_SOLID},
@ -382,14 +382,14 @@ static const part_type ptypes[PT_NUM] =
{"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", TYPE_PART}, {"ANAR", PIXPACK(0xFFFFEE), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 10, 0, 0, 30, 1, 85, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Very light dust. Behaves opposite gravity", TYPE_PART},
{"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID}, {"VINE", PIXPACK(0x079A00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 65, "Vine, grows", TYPE_SOLID},
{"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID}, {"INVS", PIXPACK(0x00CCCC), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 15, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 164, "Invisible to everything while under pressure.", TYPE_SOLID},
{"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 85, SC_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART}, {"EQVE", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 0, 85, SC_CRACKER2, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART},
{"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, {"int2", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0},
{"INST", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 251, "helper for INST", 0}, {"int3", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0},
{"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0}, {"SHLD", PIXPACK(0xAAAAAA), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 0},
{"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0}, {"SHD2", PIXPACK(0x777777), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 2", 0},
{"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0}, {"SHD3", PIXPACK(0x444444), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 3", 0},
{"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0}, {"SHD4", PIXPACK(0x212121), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 0, 100, SC_CRACKER2, R_TEMP+0.0f +273.15f, 0, "Shield lvl 4", 0},
{"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, 0, 100, SC_LIFE, 373.0f, 40, "Lolz", TYPE_SOLID}, {"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}, {"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}, {"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},
{"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}, {"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},
@ -517,8 +517,8 @@ static part_state pstates[PT_NUM] =
/* VINE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f}, /* VINE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f},
/* INVS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* INVS */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* EQVE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* EQVE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* INST2*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* INST2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* INST3*/ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* INST3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SHLD1*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD1*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SHLD2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD2*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SHLD3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* SHLD3*/ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
@ -572,7 +572,8 @@ static int lolzrule[9][9] =
{0,1,0,0,0,0,0,1,0}, {0,1,0,0,0,0,0,1,0},
}; };
int portal[8][8]; int portal[8][8];
int wireless[25]; float portaltemp[8][8];
int wireless[MAX_TEMP/100][2];
extern int isplayer; extern int isplayer;
extern float player[27]; extern float player[27];

View File

@ -1402,14 +1402,37 @@ void draw_parts(pixel *vid)
isplayer = 1; //It's a secret. Tssss... isplayer = 1; //It's a secret. Tssss...
} }
if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP)//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)
{
cg = 0;
cb = 0;
cr = 0;
for(x=0; x<12; x++) {
cr += (parts[i].ctype >> (x+18)) & 1;
cb += (parts[i].ctype >> x) & 1;
}
for(x=0; x<14; x++)
cg += (parts[i].ctype >> (x+9)) & 1;
x = 624/(cr+cg+cb+1);
cr *= x;
cg *= x;
cb *= x;
cr = cr>255?255:cr;
cg = cg>255?255:cg;
cb = cb>255?255:cb;
blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
else
{ {
cr = PIXR(ptypes[t].pcolors); cr = PIXR(ptypes[t].pcolors);
cg = PIXG(ptypes[t].pcolors); cg = PIXG(ptypes[t].pcolors);
cb = PIXB(ptypes[t].pcolors); cb = PIXB(ptypes[t].pcolors);
blendpixel(vid, nx, ny, cr, cg, cb, 255); blendpixel(vid, nx, ny, cr, cg, cb, 255);
} }
else if(cmode==CM_GRAD) }
else if(cmode==CM_GRAD)//forgot to put else, broke nothing view
{ {
float frequency = 0.05; float frequency = 0.05;
int q = parts[i].temp; int q = parts[i].temp;
@ -1564,12 +1587,23 @@ void draw_parts(pixel *vid)
} }
else if(t==PT_WIFI) else if(t==PT_WIFI)
{ {
float frequency = 0.25; float frequency = 0.0628;
int q = parts[i].tmp; int q = parts[i].tmp;
cr = sin(frequency*q + 0) * 127 + 128; cr = sin(frequency*q + 0) * 127 + 128;
cg = sin(frequency*q + 2) * 127 + 128; cg = sin(frequency*q + 2) * 127 + 128;
cb = sin(frequency*q + 4) * 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) else if(t==PT_PIPE)
{ {
@ -2801,12 +2835,6 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF); fb[(ry+j)*w+(rx+i)] = PIXPACK(0x8080FF);
k++; k++;
break; break;
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);
k++;
break;
case 6: case 6:
for(j=0; j<CELL; j+=2) for(j=0; j<CELL; j+=2)
for(i=(j>>1)&1; i<CELL; i+=2) for(i=(j>>1)&1; i<CELL; i+=2)
@ -2826,6 +2854,47 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
else else
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080); fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080);
break; break;
case WL_WALL:
for(j=0; j<CELL; j++)
for(i=0; i<CELL; i++)
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080);
break;
case WL_DESTROYALL:
for(j=0; j<CELL; j+=2)
for(i=(j>>1)&1; i<CELL; i+=2)
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080);
break;
case WL_ALLOWLIQUID:
for(j=0; j<CELL; j++)
for(i=0; i<CELL; i++)
if(!(j%2) && !(i%2))
fb[(ry+j)*w+(rx+i)] = PIXPACK(0xC0C0C0);
break;
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);
k++;
break;
case WL_DETECT:
for(j=0; j<CELL; j+=2)
for(i=(j>>1)&1; i<CELL; i+=2)
fb[(ry+j)*w+(rx+i)] = PIXPACK(0xFF8080);
break;
case WL_EWALL:
for(j=0; j<CELL; j++)
for(i=0; i<CELL; i++)
if(!(i&j&1))
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080);
break;
case WL_WALLELEC:
for(j=0; j<CELL; j++)
for(i=0; i<CELL; i++)
if(!(j%2) && !(i%2))
fb[(ry+j)*w+(rx+i)] = PIXPACK(0xC0C0C0);
else
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080);
break;
} }
p++; p++;
} }

View File

@ -1461,6 +1461,21 @@ int main(int argc, char *argv[])
bsy = 0; 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) if(sdl_key==SDLK_INSERT)
REPLACE_MODE = !REPLACE_MODE; REPLACE_MODE = !REPLACE_MODE;
if(sdl_key=='g') if(sdl_key=='g')
@ -1612,6 +1627,9 @@ int main(int argc, char *argv[])
#ifdef BETA #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); 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 #else
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); 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 #endif
} }
@ -2245,6 +2263,9 @@ int main(int argc, char *argv[])
#ifdef BETA #ifdef BETA
sprintf(uitext, "Version %d Beta %d FPS:%d Parts:%d", SAVE_VERSION, MINOR_VERSION, FPSB, NUM_PARTS); sprintf(uitext, "Version %d Beta %d FPS:%d Parts:%d", SAVE_VERSION, MINOR_VERSION, FPSB, NUM_PARTS);
#else #else
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); sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB);
#endif #endif
if(REPLACE_MODE) if(REPLACE_MODE)

View File

@ -144,7 +144,7 @@ int try_move(int i, int x, int y, int nx, int ny)
if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL) if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL)
parts[r>>8].temp = parts[i].temp; parts[r>>8].temp = parts[i].temp;
if((r & 0xFF) < PT_NUM) if((r & 0xFF) < PT_NUM && ptypes[r&0xFF].hconduct)
parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP);
} }
return 0; return 0;
@ -405,25 +405,6 @@ inline int create_part(int p, int x, int y, int t)
return -1; 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) if(t==SPC_AIR)
{ {
pv[y/CELL][x/CELL] += 0.03f; pv[y/CELL][x/CELL] += 0.03f;
@ -467,6 +448,7 @@ inline int create_part(int p, int x, int y, int t)
(pmap[y][x]&0xFF)!=PT_BRMT && (pmap[y][x]&0xFF)!=PT_BRMT &&
(pmap[y][x]&0xFF)!=PT_NBLE && (pmap[y][x]&0xFF)!=PT_NBLE &&
(pmap[y][x]&0xFF)!=PT_IRON && (pmap[y][x]&0xFF)!=PT_IRON &&
(pmap[y][x]&0xFF)!=PT_INST &&
(pmap[y][x]&0xFF)!=PT_INWR) (pmap[y][x]&0xFF)!=PT_INWR)
return -1; return -1;
if(parts[pmap[y][x]>>8].life!=0) if(parts[pmap[y][x]>>8].life!=0)
@ -522,6 +504,8 @@ inline int create_part(int p, int x, int y, int t)
parts[i].life = 50; parts[i].life = 50;
parts[i].tmp = 50; parts[i].tmp = 50;
} }
if(t==PT_DEUT)
parts[i].life = 10;
if(t==PT_BRAY) if(t==PT_BRAY)
parts[i].life = 30; parts[i].life = 30;
if(t==PT_PUMP) if(t==PT_PUMP)
@ -883,8 +867,8 @@ int nearest_part(int ci, int t)
void update_particles_i(pixel *vid, int start, int inc) void update_particles_i(pixel *vid, int start, int inc)
{ {
int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg; int i, j, x, y, t, nx, ny, r, a, s, lt, rt, fe, nt, lpv, nearp, pavg, nnx, nny, q, golnum, goldelete, z, ctype, temp, trade, docontinue, nxx, nyy, nxi, nyi;
float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp; float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp, rr, rrr;
float nn, ct1, ct2; float nn, ct1, ct2;
float pt = R_TEMP; float pt = R_TEMP;
float c_heat = 0.0f; float c_heat = 0.0f;
@ -902,7 +886,7 @@ void update_particles_i(pixel *vid, int start, int inc)
GRAV_R2 = 30; GRAV_R2 = 30;
GRAV_G2 = 30; GRAV_G2 = 30;
GRAV_B2 = 0; GRAV_B2 = 0;
for(int q = 0;q <= GRAV;q++) for( q = 0;q <= GRAV;q++)
{ {
if(GRAV_R >0 && GRAV_G==0) if(GRAV_R >0 && GRAV_G==0)
{ {
@ -965,8 +949,8 @@ void update_particles_i(pixel *vid, int start, int inc)
{ {
if(love[nx/9][ny/9]==1) if(love[nx/9][ny/9]==1)
{ {
for(int nnx=0;nnx<9;nnx++) for( nnx=0;nnx<9;nnx++)
for(int nny=0;nny<9;nny++) for( nny=0;nny<9;nny++)
{ {
if(ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES) if(ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
{ {
@ -1016,8 +1000,8 @@ void update_particles_i(pixel *vid, int start, int inc)
{ {
if(lolz[nx/9][ny/9]==1) if(lolz[nx/9][ny/9]==1)
{ {
for(int nnx=0;nnx<9;nnx++) for( nnx=0;nnx<9;nnx++)
for(int nny=0;nny<9;nny++) for( nny=0;nny<9;nny++)
{ {
if(ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES) if(ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
{ {
@ -1054,12 +1038,12 @@ void update_particles_i(pixel *vid, int start, int inc)
continue; continue;
} }
else else
for(int golnum=1;golnum<NGOL;golnum++) for( golnum=1;golnum<NGOL;golnum++)
if(parts[r>>8].type==golnum+77) if(parts[r>>8].type==golnum+77)
{ {
gol[nx][ny] = golnum; gol[nx][ny] = golnum;
for(int nnx=-1;nnx<2;nnx++) for( nnx=-1;nnx<2;nnx++)
for(int nny=-1;nny<2;nny++)//it will count itself as its own neighbor, which is needed, but will have 1 extra for delete check 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
{ {
if(ny+nny<4&&nx+nnx<4){//any way to make wrapping code smaller? if(ny+nny<4&&nx+nnx<4){//any way to make wrapping code smaller?
gol2[XRES-5][YRES-5][golnum] ++; gol2[XRES-5][YRES-5][golnum] ++;
@ -1106,8 +1090,8 @@ void update_particles_i(pixel *vid, int start, int inc)
int neighbors = gol2[nx][ny][0]; int neighbors = gol2[nx][ny][0];
if(neighbors==0) if(neighbors==0)
continue; continue;
for(int golnum = 1;golnum<NGOL;golnum++) for( golnum = 1;golnum<NGOL;golnum++)
for(int goldelete = 0;goldelete<9;goldelete++) for( goldelete = 0;goldelete<9;goldelete++)
{ {
if(neighbors==goldelete&&gol[nx][ny]==0&&grule[golnum][goldelete]>=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2) if(neighbors==goldelete&&gol[nx][ny]==0&&grule[golnum][goldelete]>=2&&gol2[nx][ny][golnum]>=(goldelete%2)+goldelete/2)
{ {
@ -1117,19 +1101,24 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[pmap[ny][nx]>>8].type = PT_NONE; parts[pmap[ny][nx]>>8].type = PT_NONE;
} }
gol2[nx][ny][0] = 0; gol2[nx][ny][0] = 0;
for(int z = 1;z<NGOL;z++) for( z = 1;z<NGOL;z++)
gol2[nx][ny][z] = 0; gol2[nx][ny][z] = 0;
} }
} }
//if(ISWIRE==1)
//{
// CGOL = 0;
// ISWIRE = 0;
//}
if(ISWIRE==1) if(ISWIRE==1)
{ {
CGOL = 0; for( q = 0;q<99;q++)
ISWIRE = 0; if(!wireless[q][1])
}
if(CGOL==1)
{ {
for(int q = 0;q<25;q++) wireless[q][0] = 0;
wireless[q] = 0; }
else
wireless[q][1] = 0;
} }
for(i=start; i<(NPART-starti); i+=inc) for(i=start; i<(NPART-starti); i+=inc)
if(parts[i].type) if(parts[i].type)
@ -1142,7 +1131,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 && 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||parts[i].type==PT_PUMP)) && !(parts[i].life%4==0 && parts[i].type==PT_INST)) if(!(parts[i].life==10&&(parts[i].type==PT_LCRY||parts[i].type==PT_PCLN||parts[i].type==PT_HSWC||parts[i].type==PT_PUMP)))
parts[i].life--; parts[i].life--;
if(parts[i].life<=0 && t!=PT_METL && t!=PT_ARAY && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && 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 && t!=PT_SHLD1&& t!=PT_SHLD2&& t!=PT_SHLD3&& t!=PT_SHLD4) if(parts[i].life<=0 && t!=PT_METL && t!=PT_ARAY && t!=PT_IRON && t!=PT_FIRW && t!=PT_PCLN && t!=PT_HSWC && t!=PT_PUMP && 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 && t!=PT_SHLD1&& t!=PT_SHLD2&& t!=PT_SHLD3&& t!=PT_SHLD4)
{ {
@ -1184,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_DESTROYALL) ||
(bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && ptypes[t].falldown!=2) || (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_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_DETECT && (t==PT_METL || t==PT_SPRK)) ||
(bmap[y/CELL][x/CELL]==WL_EWALL && !emap[y/CELL][x/CELL])) && (t!=PT_STKM))) (bmap[y/CELL][x/CELL]==WL_EWALL && !emap[y/CELL][x/CELL])) && (t!=PT_STKM)))
{ {
@ -1416,8 +1405,8 @@ void update_particles_i(pixel *vid, int start, int inc)
if((t==PT_ISOZ||t==PT_ISZS) && 1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000)) if((t==PT_ISOZ||t==PT_ISZS) && 1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000))
{ {
t = PT_PHOT; t = PT_PHOT;
float rr = (rand()%228+128)/127.0f; rr = (rand()%228+128)/127.0f;
float a = (rand()%8) * 0.78540f; rrr = (rand()%8) * 0.78540f;
parts[i].life = 680; parts[i].life = 680;
parts[i].ctype = 0x3FFFFFFF; parts[i].ctype = 0x3FFFFFFF;
parts[i].vx = rr*cosf(a); parts[i].vx = rr*cosf(a);
@ -1832,7 +1821,7 @@ void update_particles_i(pixel *vid, int start, int inc)
continue; continue;
if((r&0xFF)==PT_SPRK){ if((r&0xFF)==PT_SPRK){
int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0; int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0;
for (int docontinue = 1, nxx = 0, nyy = 0, nxi = nx*-1, nyi = ny*-1; docontinue; nyy+=nyi, nxx+=nxi) { for (docontinue = 1, nxx = 0, nyy = 0, nxi = nx*-1, nyi = ny*-1; docontinue; nyy+=nyi, nxx+=nxi) {
if(!(x+nxi+nxx<XRES && y+nyi+nyy<YRES && x+nxi+nxx >= 0 && y+nyi+nyy >= 0)){ if(!(x+nxi+nxx<XRES && y+nyi+nyy<YRES && x+nxi+nxx >= 0 && y+nyi+nyy >= 0)){
break; break;
} }
@ -1983,6 +1972,7 @@ void update_particles_i(pixel *vid, int start, int inc)
{ {
t = parts[i].type = PT_PLNT; t = parts[i].type = PT_PLNT;
parts[r>>8].type = PT_PLNT; parts[r>>8].type = PT_PLNT;
parts[r>>8].life = 0;
} }
else if((r&0xFF)==PT_LAVA && 1>(rand()%250)) else if((r&0xFF)==PT_LAVA && 1>(rand()%250))
{ {
@ -2000,9 +1990,13 @@ void update_particles_i(pixel *vid, int start, int inc)
int nny = rand()%3 -1; int nny = rand()%3 -1;
if(x+nx+nnx>=0 && y+ny+nny>0 && if(x+nx+nnx>=0 && y+ny+nny>0 &&
x+nx+nnx<XRES && y+ny+nny<YRES && (nnx || nny)) 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)) 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; parts[pmap[y+ny+nny][x+nx+nnx]>>8].temp = parts[i].temp;
} }
}
//if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000))
//t = parts[i].type = PT_WATR; //t = parts[i].type = PT_WATR;
} }
@ -2335,8 +2329,8 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[i].vx *= 0.90; parts[i].vx *= 0.90;
parts[i].vy *= 0.90; parts[i].vy *= 0.90;
parts[r>>8].type = PT_PHOT; parts[r>>8].type = PT_PHOT;
float a = (rand()%8) * 0.78540f; rrr = (rand()%8) * 0.78540f;
float rr = (rand()%128+128)/127.0f; rr = (rand()%128+128)/127.0f;
parts[r>>8].life = 680; parts[r>>8].life = 680;
parts[r>>8].ctype = 0x3FFFFFFF; parts[r>>8].ctype = 0x3FFFFFFF;
parts[r>>8].vx = rr*cosf(a); parts[r>>8].vx = rr*cosf(a);
@ -2348,8 +2342,8 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[i].vx *= 0.90; parts[i].vx *= 0.90;
parts[i].vy *= 0.90; parts[i].vy *= 0.90;
parts[r>>8].type = PT_PHOT; parts[r>>8].type = PT_PHOT;
float rr = (rand()%228+128)/127.0f; rr = (rand()%228+128)/127.0f;
float a = (rand()%8) * 0.78540f; rrr = (rand()%8) * 0.78540f;
parts[r>>8].life = 680; parts[r>>8].life = 680;
parts[r>>8].ctype = 0x3FFFFFFF; parts[r>>8].ctype = 0x3FFFFFFF;
parts[r>>8].vx = rr*cosf(a); parts[r>>8].vx = rr*cosf(a);
@ -2408,7 +2402,7 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[i].life--; parts[i].life--;
} }
} }
for(int trade = 0; trade<9;trade ++) for( trade = 0; trade<9;trade ++)
{ {
nx = rand()%5-2; nx = rand()%5-2;
ny = rand()%5-2; ny = rand()%5-2;
@ -2554,9 +2548,10 @@ void update_particles_i(pixel *vid, int start, int inc)
create_part(-1,x+nx,y+ny,PT_DEUT); create_part(-1,x+nx,y+ny,PT_DEUT);
parts[i].life--; parts[i].life--;
parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp;
parts[pmap[y+ny][x+nx]>>8].life = 0;
} }
} }
for(int trade = 0; trade<4;trade ++) for( trade = 0; trade<4;trade ++)
{ {
nx = rand()%5-2; nx = rand()%5-2;
ny = rand()%5-2; ny = rand()%5-2;
@ -2584,7 +2579,7 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
else if(t==PT_WARP) else if(t==PT_WARP)
{ {
for(int trade = 0; trade<5;trade ++) for( trade = 0; trade<5;trade ++)
{ {
nx = rand()%3-1; nx = rand()%3-1;
ny = rand()%3-1; ny = rand()%3-1;
@ -2753,8 +2748,8 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
} }
if(parts[i].ctype>1) if(parts[i].ctype>1)
for(int o = 0;o<3;o++) for( q = 0;q<3;q++)
for(int ctype = 2;ctype<5;ctype++) for( ctype = 2;ctype<5;ctype++)
{ {
if(parts[i].ctype==ctype) if(parts[i].ctype==ctype)
{ {
@ -2869,32 +2864,10 @@ void update_particles_i(pixel *vid, int start, int inc)
continue; continue;
else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life%4==0) 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);//add life flood_parts(x,y,PT_SPRK,PT_INST,-1);//add life
parts[r>>8].type==parts[r>>8].ctype; parts[r>>8].type==parts[r>>8].ctype;
} }
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);//sub life
} }
else if(parts[r>>8].type==PT_SWCH&&parts[r>>8].life==10&&(parts[i].life>=4)&&parts[i].life%4<=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);//sub life
}
}
}
else if(t==PT_INST2)
{
if(parts[i].life%4<=1)
t = parts[pmap[y][x]>>8].type=PT_INST;
}
else if(t==PT_INST3)
{
if(parts[i].life%4<=1)
t = parts[pmap[y][x]>>8].type=PT_INST;
} }
else if(t==PT_PRTI) else if(t==PT_PRTI)
{ {
@ -2909,10 +2882,11 @@ void update_particles_i(pixel *vid, int start, int inc)
if((r>>8)>=NPART || !r) if((r>>8)>=NPART || !r)
continue; continue;
if(parts[r>>8].type==PT_SPRK || (parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS))) if(parts[r>>8].type==PT_SPRK || (parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)))
for(int nnx=0;nnx<8;nnx++) for( nnx=0;nnx<8;nnx++)
if(!portal[count-1][nnx]) if(!portal[count-1][nnx])
{ {
portal[count-1][nnx] = parts[r>>8].type; portal[count-1][nnx] = parts[r>>8].type;
portaltemp[count-1][nnx] = parts[r>>8].temp;
if(parts[r>>8].type==PT_SPRK) if(parts[r>>8].type==PT_SPRK)
parts[r>>8].type = parts[r>>8].ctype; parts[r>>8].type = parts[r>>8].ctype;
else else
@ -2935,7 +2909,7 @@ void update_particles_i(pixel *vid, int start, int inc)
continue; continue;
if(!r) if(!r)
{ {
for(int nnx =0 ;nnx<8;nnx++) for( nnx =0 ;nnx<8;nnx++)
{ {
int randomness = count + rand()%3-1; int randomness = count + rand()%3-1;
if(randomness<1) if(randomness<1)
@ -2953,12 +2927,15 @@ void update_particles_i(pixel *vid, int start, int inc)
create_part(-1,x-1,y,portal[randomness-1][nnx]); create_part(-1,x-1,y,portal[randomness-1][nnx]);
create_part(-1,x-1,y-1,portal[randomness-1][nnx]); create_part(-1,x-1,y-1,portal[randomness-1][nnx]);
portal[randomness-1][nnx] = 0; portal[randomness-1][nnx] = 0;
portaltemp[randomness-1][nnx] = 0;
break; break;
} }
else if(portal[randomness-1][nnx]) else if(portal[randomness-1][nnx])
{ {
create_part(-1,x+nx,y+ny,portal[randomness-1][nnx]); create_part(-1,x+nx,y+ny,portal[randomness-1][nnx]);
parts[pmap[y+ny][x+nx]>>8].temp = portaltemp[randomness-1][nnx];
portal[randomness-1][nnx] = 0; portal[randomness-1][nnx] = 0;
portaltemp[randomness-1][nnx] = 0;
break; break;
} }
} }
@ -2967,10 +2944,9 @@ void update_particles_i(pixel *vid, int start, int inc)
} }
else if(t==PT_WIFI) else if(t==PT_WIFI)
{ {
CGOL = 1;
int temprange = 100; int temprange = 100;
for(int temp = 0; temp < 2500; temp += temprange) for( temp = 0; temp < MAX_TEMP; temp += temprange)
if(parts[i].temp-273.15>temp&&parts[i].temp-273.15<temp+temprange) if(parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100; parts[i].tmp = temp/100;
for(ny=-1; ny<2; ny++) for(ny=-1; ny<2; ny++)
for(nx=-1; nx<2; nx++) for(nx=-1; nx<2; nx++)
@ -2980,16 +2956,23 @@ void update_particles_i(pixel *vid, int start, int inc)
r = pmap[y+ny][x+nx]; r = pmap[y+ny][x+nx];
if((r>>8)>=NPART || !r) if((r>>8)>=NPART || !r)
continue; continue;
if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp]) if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
{ {
parts[r>>8].type = PT_SPRK; parts[r>>8].type = PT_SPRK;
parts[r>>8].ctype = PT_NSCN; parts[r>>8].ctype = PT_NSCN;
parts[r>>8].life = 4; 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]) else if(parts[r>>8].type==PT_PSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
{ {
parts[r>>8].type = parts[r>>8].ctype; parts[r>>8].type = PT_SPRK;
wireless[parts[i].tmp] = 1; 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;
wireless[parts[i].tmp][0] = 1;
wireless[parts[i].tmp][1] = 1;
ISWIRE = 1; ISWIRE = 1;
} }
} }
@ -3110,8 +3093,8 @@ void update_particles_i(pixel *vid, int start, int inc)
if((r>>8)>=NPART || !r) if((r>>8)>=NPART || !r)
continue; continue;
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for(int nnx=-1;nnx<2;nnx++) for( nnx=-1;nnx<2;nnx++)
for(int nny=-1;nny<2;nny++) for( nny=-1;nny<2;nny++)
{ {
if(7>rand()%200&&parts[i].life==0) if(7>rand()%200&&parts[i].life==0)
{ {
@ -3146,8 +3129,8 @@ void update_particles_i(pixel *vid, int start, int inc)
if(!r) if(!r)
continue; continue;
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for(int nnx=-1;nnx<2;nnx++) for( nnx=-1;nnx<2;nnx++)
for(int nny=-1;nny<2;nny++) for( nny=-1;nny<2;nny++)
{ {
if(3>rand()%200&&parts[i].life==0) if(3>rand()%200&&parts[i].life==0)
{ {
@ -3195,8 +3178,8 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[r>>8].life=7; parts[r>>8].life=7;
} }
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for(int nnx=-1;nnx<2;nnx++) for( nnx=-1;nnx<2;nnx++)
for(int nny=-1;nny<2;nny++) for( nny=-1;nny<2;nny++)
{ {
if(2>rand()%3000&&parts[i].life==0) if(2>rand()%3000&&parts[i].life==0)
{ {
@ -3239,8 +3222,8 @@ void update_particles_i(pixel *vid, int start, int inc)
parts[r>>8].life = 7; parts[r>>8].life = 7;
} }
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for(int nnx=-1;nnx<2;nnx++) for( nnx=-1;nnx<2;nnx++)
for(int nny=-1;nny<2;nny++) for( nny=-1;nny<2;nny++)
{ {
if(!pmap[y+ny+nny][x+nx+nnx]) if(!pmap[y+ny+nny][x+nx+nnx])
{ {
@ -3997,6 +3980,8 @@ killed:
x+nx<XRES && y+ny<YRES && x+nx<XRES && y+ny<YRES &&
pmap[y+ny][x+nx] && pmap[y+ny][x+nx] &&
(pmap[y+ny][x+nx]&0xFF)!=PT_CLNE && (pmap[y+ny][x+nx]&0xFF)!=PT_CLNE &&
(pmap[y+ny][x+nx]&0xFF)!=PT_BCLN &&
(pmap[y+ny][x+nx]&0xFF)!=PT_PCLN &&
(pmap[y+ny][x+nx]&0xFF)!=PT_STKM && (pmap[y+ny][x+nx]&0xFF)!=PT_STKM &&
(pmap[y+ny][x+nx]&0xFF)!=0xFF) (pmap[y+ny][x+nx]&0xFF)!=0xFF)
parts[i].ctype = pmap[y+ny][x+nx]&0xFF; parts[i].ctype = pmap[y+ny][x+nx]&0xFF;
@ -4037,6 +4022,7 @@ killed:
pmap[y+ny][x+nx] && pmap[y+ny][x+nx] &&
(pmap[y+ny][x+nx]&0xFF)!=PT_CLNE && (pmap[y+ny][x+nx]&0xFF)!=PT_CLNE &&
(pmap[y+ny][x+nx]&0xFF)!=PT_PCLN && (pmap[y+ny][x+nx]&0xFF)!=PT_PCLN &&
(pmap[y+ny][x+nx]&0xFF)!=PT_BCLN &&
(pmap[y+ny][x+nx]&0xFF)!=PT_SPRK && (pmap[y+ny][x+nx]&0xFF)!=PT_SPRK &&
(pmap[y+ny][x+nx]&0xFF)!=PT_NSCN && (pmap[y+ny][x+nx]&0xFF)!=PT_NSCN &&
(pmap[y+ny][x+nx]&0xFF)!=PT_PSCN && (pmap[y+ny][x+nx]&0xFF)!=PT_PSCN &&
@ -4091,7 +4077,7 @@ killed:
if(parts[i].type == PT_PHOT) { if(parts[i].type == PT_PHOT) {
rt = pmap[ny][nx] & 0xFF; rt = pmap[ny][nx] & 0xFF;
if(rt==PT_CLNE || rt==PT_PCLN) { if(rt==PT_CLNE || rt==PT_PCLN || rt==PT_BCLN) {
lt = pmap[ny][nx] >> 8; lt = pmap[ny][nx] >> 8;
if(!parts[lt].ctype) if(!parts[lt].ctype)
parts[lt].ctype = PT_PHOT; parts[lt].ctype = PT_PHOT;
@ -4913,8 +4899,8 @@ int flood_parts(int x, int y, int c, int cm, int bm)
{ {
int x1, x2, dy = (c<PT_NUM)?1:CELL; int x1, x2, dy = (c<PT_NUM)?1:CELL;
int co = c; int co = c;
if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3)) if(cm==PT_INST&&co==PT_SPRK)
if((pmap[y][x]&0xFF)==PT_INST2 || (pmap[y][x]&0xFF)==PT_INST3) if((pmap[y][x]&0xFF)==PT_SPRK)
return 0; return 0;
if(c>=UI_WALLSTART&&c<=UI_WALLSTART+UI_WALLCOUNT) if(c>=UI_WALLSTART&&c<=UI_WALLSTART+UI_WALLCOUNT)
{ {
@ -4956,9 +4942,6 @@ int flood_parts(int x, int y, int c, int cm, int bm)
{ {
if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm) if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm)
{ {
if(cm!=PT_INST)
break;
else if((pmap[y][x1-1]&0xFF)!=PT_INST2&&(pmap[y][x1-1]&0xFF)!=PT_INST3)
break; break;
} }
x1--; x1--;
@ -4967,9 +4950,6 @@ int flood_parts(int x, int y, int c, int cm, int bm)
{ {
if((pmap[y][x2+1]&0xFF)!=cm || bmap[y/CELL][(x2+1)/CELL]!=bm) if((pmap[y][x2+1]&0xFF)!=cm || bmap[y/CELL][(x2+1)/CELL]!=bm)
{ {
if(cm!=PT_INST)
break;
else if((pmap[y][x1+1]&0xFF)!=PT_INST2&&(pmap[y][x1+1]&0xFF)!=PT_INST3)
break; break;
} }
x2++; x2++;
@ -4982,34 +4962,34 @@ int flood_parts(int x, int y, int c, int cm, int bm)
return 0; return 0;
} }
// fill children // fill children
if(cm==PT_INST&&(co==PT_INST2||co==PT_INST3))//crossings for inst wire, same as walls if(cm==PT_INST&&co==PT_SPRK)//wire crossing for INST
{ {
if(y>=CELL+dy && x1==x2 && if(y>=CELL+dy && x1==x2 &&
((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-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_INST3||(pmap[y-2][x1]&0xFF)==PT_INST2)) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) (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)
flood_parts(x1, y-2, co, cm, bm); flood_parts(x1, y-2, co, cm, bm);
else if(y>=CELL+dy) else if(y>=CELL+dy)
for(x=x1; x<=x2; x++) for(x=x1; x<=x2; x++)
if((pmap[y-1][x]&0xFF)!=co) if((pmap[y-1][x]&0xFF)!=PT_SPRK)
{ {
if(x==x1 || x==x2 || y>=YRES-CELL-1 || 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+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) (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)
flood_parts(x, y-dy, co, cm, bm); flood_parts(x, y-dy, co, cm, bm);
} }
if(y<YRES-CELL-dy && x1==x2 && if(y<YRES-CELL-dy && x1==x2 &&
((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+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_INST3||(pmap[y+2][x1]&0xFF)==PT_INST2)) && (pmap[y+2][x1+1]&0xFF)!=PT_INST) (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)
flood_parts(x1, y+2, co, cm, bm); flood_parts(x1, y+2, co, cm, bm);
else if(y<YRES-CELL-dy) else if(y<YRES-CELL-dy)
for(x=x1; x<=x2; x++) for(x=x1; x<=x2; x++)
if((pmap[y+1][x]&0xFF)!=co) if((pmap[y+1][x]&0xFF)!=PT_SPRK)
{ {
if(x==x1 || x==x2 || y<0 || 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+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) (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)
flood_parts(x, y+dy, co, cm, bm); flood_parts(x, y+dy, co, cm, bm);
} }
@ -5027,16 +5007,16 @@ int flood_parts(int x, int y, int c, int cm, int bm)
if(!flood_parts(x, y+dy, co, cm, bm)) if(!flood_parts(x, y+dy, co, cm, bm))
return 0; return 0;
} }
if(!(cm==PT_INST&&(co==PT_INST2||co==PT_INST3))) if(!(cm==PT_INST&&co==PT_SPRK))
return 1; return 1;
} }
int create_parts(int x, int y, int rx, int ry, int c) int create_parts(int x, int y, int rx, int ry, int c)
{ {
int i, j, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0;//n; int i, j, r, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0;//n;
int wall = c - 100; int wall = c - 100;
for(int r=UI_ACTUALSTART;r<=UI_ACTUALSTART+UI_WALLCOUNT;r++) for(r=UI_ACTUALSTART;r<=UI_ACTUALSTART+UI_WALLCOUNT;r++)
{ {
if(wall==r) if(wall==r)
{ {