mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-04-23 08:14:51 +02:00
Bugfix for wifi, would cause a double spark if timed just right. updated to
This commit is contained in:
parent
fff7ecedf8
commit
cbf41389a2
@ -8,7 +8,7 @@
|
||||
#endif
|
||||
|
||||
#define SAVE_VERSION 44
|
||||
#define MINOR_VERSION 1
|
||||
#define MINOR_VERSION 2
|
||||
#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
|
||||
#define BETA
|
||||
|
||||
|
@ -53,7 +53,8 @@ static menu_wall mwalls[] =
|
||||
#define SC_NUCLEAR 7
|
||||
#define SC_LIFE 9
|
||||
#define SC_CRACKER 10
|
||||
#define SC_TOTAL 10
|
||||
#define SC_CRACKER2 11
|
||||
#define SC_TOTAL 11
|
||||
|
||||
static menu_section msections[] =
|
||||
{
|
||||
@ -67,7 +68,8 @@ static menu_section msections[] =
|
||||
{"\xC6", "Radioactive", 0, 1},
|
||||
{"\xCC", "Special", 0, 1},
|
||||
{"\xC8", "Life", 0, 1},
|
||||
{"\xC8", "Cracker", 0, 0},
|
||||
{"\xC8", "Cracker", 0, 1},
|
||||
{"\xC8", "Cracker!", 0, 0},
|
||||
};
|
||||
|
||||
struct ui_edit
|
||||
|
@ -164,15 +164,19 @@
|
||||
#define PT_VINE 114
|
||||
#define PT_INVIS 115
|
||||
#define PT_EQUALVEL 116//all particles equal their velocities
|
||||
#define PT_SHLD1 117
|
||||
#define PT_SHLD2 118
|
||||
#define PT_SHLD3 119
|
||||
#define PT_SHLD4 120
|
||||
#define PT_LOLZ 121
|
||||
#define PT_WIFI 122
|
||||
#define PT_FILT 123
|
||||
#define PT_XEON 124//radioactive gas
|
||||
#define PT_NUM 125
|
||||
#define PT_INST2 117
|
||||
#define PT_INST3 118
|
||||
#define PT_SHLD1 119
|
||||
#define PT_SHLD2 120
|
||||
#define PT_SHLD3 121
|
||||
#define PT_SHLD4 122
|
||||
#define PT_LOLZ 123
|
||||
#define PT_WIFI 124
|
||||
#define PT_FILT 125
|
||||
#define PT_XEON 126//radioactive gas
|
||||
#define PT_ARAY 127
|
||||
#define PT_BRAY 128
|
||||
#define PT_NUM 129
|
||||
|
||||
#define R_TEMP 22
|
||||
#define MAX_TEMP 9999
|
||||
@ -339,8 +343,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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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, 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},
|
||||
{"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},
|
||||
@ -354,21 +358,21 @@ 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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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_CRACKER, 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, 1, 30, SC_CRACKER, 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},
|
||||
{"@_@", 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},
|
||||
{"@_@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},
|
||||
{"@_@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, 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, 1, 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},
|
||||
{"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},
|
||||
@ -379,33 +383,37 @@ 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},
|
||||
{"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},
|
||||
{"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_CRACKER, R_TEMP+0.0f +273.15f, 70, "Shared velocity test", TYPE_PART},
|
||||
{"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, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 0, "Shield, spark it to grow", 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, 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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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},
|
||||
{"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_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_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, 1, 100, SC_CRACKER2, 373.0f, 40, "Lolz", TYPE_SOLID},
|
||||
{"WIFI", PIXPACK(0x40A060), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID},
|
||||
{"FILT", PIXPACK(0x000056), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Filter for photons, changes the color.", TYPE_SOLID},
|
||||
{"XEON", PIXPACK(0xEB7917), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_NUCLEAR, R_TEMP+2.0f +273.15f, 106, "Radioactive gas, absorbs neutrons.", TYPE_GAS},
|
||||
|
||||
{"ARAY", PIXPACK(0xFFBB00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Emmitter. Rays create points when they collide", TYPE_SOLID},
|
||||
{"BRAY", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 1, 1, 0, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Ray Point. Rays create points when they collide", TYPE_SOLID}
|
||||
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins Description
|
||||
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weights Section H Ins(real world, by triclops200) Description
|
||||
};
|
||||
|
||||
static part_state pstates[PT_NUM] =
|
||||
{
|
||||
// Name Solid Frzp Liquid Mpnt Gas Bpoint
|
||||
// Name State Solid Frzp Liquid Mpnt Gas Bpoint 'Plasma' Flashpoint
|
||||
/* NONE */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* DUST */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* WATR */ {ST_LIQUID, PT_ICEI, 273.15f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f},
|
||||
/* OIL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_GAS, 333.0f, PT_NONE, 0.0f},
|
||||
/* FIRE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2773.0f},
|
||||
/* FIRE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2773.0f},
|
||||
/* STNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 983.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* LAVA */ {ST_LIQUID, PT_STNE, 973.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* GUN */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
|
||||
/* NITR */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
|
||||
/* CLNE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 50.0f, PT_FIRE, 573.0f},
|
||||
/* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 50.0f, PT_FIRE, 573.0f},
|
||||
/* C-4 */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
|
||||
/* GOO */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* ICE */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 274.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
@ -413,12 +421,12 @@ static part_state pstates[PT_NUM] =
|
||||
/* SPRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* SNOW */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* WOOD */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 873.0f},
|
||||
/* NEUT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* NEUT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* PLUT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* PLNT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 573.0f},
|
||||
/* ACID */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* VOID */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* WTRV */ {ST_GAS, PT_RIME, 273.0f, PT_DSTW, 371.0f, PT_NONE, 373.0f, PT_NONE, 0.0f},
|
||||
/* WTRV */ {ST_GAS, PT_RIME, 273.0f, PT_DSTW, 371.0f, PT_NONE, 373.0f, PT_NONE, 0.0f},
|
||||
/* CNCT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1123.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* DSTW */ {ST_LIQUID, PT_ICEI, 273.15f, PT_NONE, 0.0f, PT_WTRV, 373.0f, PT_NONE, 0.0f},
|
||||
/* SALT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1173.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
@ -426,7 +434,7 @@ static part_state pstates[PT_NUM] =
|
||||
/* DMND */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* BMTL */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* BRMT */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* PHOT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* PHOT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* URAN */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 2373.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* WAX */ {ST_SOLID, PT_NONE, 0.0f, PT_MWAX, 319.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* MWAX */ {ST_LIQUID, PT_WAX, 318.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 673.0f},
|
||||
@ -447,7 +455,7 @@ static part_state pstates[PT_NUM] =
|
||||
/* PLSM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* ETRD */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* NICE */ {ST_SOLID, PT_NONE, 0.0f, PT_LNTG, 63.1f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* NBLE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* NBLE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* BTRY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2273.0f},
|
||||
/* LCRY */ {ST_SOLID, PT_NONE, 0.0f, PT_BGLA, 1273.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* STKM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 620.0f},
|
||||
@ -456,14 +464,14 @@ static part_state pstates[PT_NUM] =
|
||||
/* DESL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 335.0f},
|
||||
/* COAL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* LO2 */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, 90.1f, PT_NONE, 0.0f},
|
||||
/* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 90.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LO2, 90.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* INWR */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1687.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* YEST */ {ST_SOLID, PT_NONE, 0.0f, PT_DYST, 373.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* DYST */ {ST_SOLID, PT_NONE, 0.0f, PT_DUST, 473.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* THRM */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* GLOW */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* BRCK */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1223.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* HFLM */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* HFLM */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* FIRW */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* FUSE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* FSEP */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
@ -512,6 +520,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},
|
||||
/* 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},
|
||||
/* INST2*/ {ST_SOLID, 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},
|
||||
/* 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},
|
||||
@ -520,6 +530,8 @@ static part_state pstates[PT_NUM] =
|
||||
/* WIFI */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* FILT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* RGAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* ARAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
|
||||
/* BRAY */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}
|
||||
|
||||
};
|
||||
static int grule[NGOL][9] =
|
||||
@ -564,7 +576,8 @@ static int lolzrule[9][9] =
|
||||
{0,1,0,0,0,0,0,1,0},
|
||||
};
|
||||
int portal[8][8];
|
||||
int wireless[25];
|
||||
float portaltemp[8][8];
|
||||
int wireless[25][2];
|
||||
|
||||
extern int isplayer;
|
||||
extern float player[27];
|
||||
|
@ -1402,12 +1402,35 @@ void draw_parts(pixel *vid)
|
||||
|
||||
isplayer = 1; //It's a secret. Tssss...
|
||||
}
|
||||
if(cmode==CM_NOTHING && t!=PT_PIPE && t!=PT_SWCH && t!=PT_LCRY && t!=PT_PUMP)//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)//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);
|
||||
cg = PIXG(ptypes[t].pcolors);
|
||||
cb = PIXB(ptypes[t].pcolors);
|
||||
blendpixel(vid, nx, ny, cr, cg, cb, 255);
|
||||
}
|
||||
}
|
||||
else if(cmode==CM_GRAD)//forgot to put else, broke nothing view
|
||||
{
|
||||
@ -1789,6 +1812,21 @@ void draw_parts(pixel *vid)
|
||||
cb = cb>255?255:cb;
|
||||
blendpixel(vid, nx, ny, cr, cg, cb, 127);
|
||||
}
|
||||
else if(t==PT_BRAY && parts[i].tmp==0)
|
||||
{
|
||||
int trans = parts[i].life * 7;
|
||||
blendpixel(vid, nx, ny, PIXR(ptypes[t].pcolors), PIXG(ptypes[t].pcolors), PIXB(ptypes[t].pcolors), trans);
|
||||
}
|
||||
else if(t==PT_BRAY && parts[i].tmp==1)
|
||||
{
|
||||
int trans = parts[i].life/4;
|
||||
blendpixel(vid, nx, ny, PIXR(ptypes[t].pcolors), PIXG(ptypes[t].pcolors), PIXB(ptypes[t].pcolors), trans);
|
||||
}
|
||||
else if(t==PT_BRAY && parts[i].tmp==2)
|
||||
{
|
||||
int trans = parts[i].life*100;
|
||||
blendpixel(vid, nx, ny, 255, 150, 50, trans);
|
||||
}
|
||||
else if(t==PT_PHOT)
|
||||
{
|
||||
if(cmode == CM_FIRE||cmode==CM_BLOB || cmode==CM_FANCY)
|
||||
@ -2805,6 +2843,47 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
|
||||
else
|
||||
fb[(ry+j)*w+(rx+i)] = PIXPACK(0x808080);
|
||||
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_STREAM:
|
||||
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++;
|
||||
}
|
||||
@ -2820,7 +2899,7 @@ pixel *prerender_save(void *save, int size, int *width, int *height)
|
||||
j=d[p++];
|
||||
if(j<PT_NUM && j>0)
|
||||
{
|
||||
if(j==PT_STKM) //Stickman should be drawed another way
|
||||
if(j==PT_STKM)
|
||||
{
|
||||
//Stickman drawing
|
||||
for(k=-2; k<=1; k++)
|
||||
|
@ -1500,7 +1500,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx,
|
||||
{
|
||||
if(n!=SPC_AIR&&n!=SPC_HEAT&&n!=SPC_COOL&&n!=SPC_VACUUM)
|
||||
{
|
||||
if(x-18<=20)
|
||||
if(x-18<=2)
|
||||
{
|
||||
x = XRES-BARSIZE-18;
|
||||
y += 19;
|
||||
@ -1537,7 +1537,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx,
|
||||
{
|
||||
if(n==SPC_AIR||n==SPC_HEAT||n==SPC_COOL||n==SPC_VACUUM)
|
||||
{
|
||||
if(x-18<=20)
|
||||
if(x-18<=0)
|
||||
{
|
||||
x = XRES-BARSIZE-18;
|
||||
y += 19;
|
||||
@ -1571,7 +1571,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx,
|
||||
{
|
||||
if(ptypes[n].menusection==i&&ptypes[n].menu==1)
|
||||
{
|
||||
if(x-18<=20)
|
||||
if(x-18<=0)
|
||||
{
|
||||
x = XRES-BARSIZE-18;
|
||||
y += 19;
|
||||
@ -1608,7 +1608,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int b, int bq, int mx,
|
||||
{
|
||||
if(ptypes[n].menusection==i&&ptypes[n].menu==1)
|
||||
{
|
||||
if(x-18<=20)
|
||||
if(x-18<=0)
|
||||
{
|
||||
x = XRES-BARSIZE-18;
|
||||
y += 19;
|
||||
@ -2190,7 +2190,7 @@ int search_ui(pixel *vid_buf)
|
||||
drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 160, 160, 192, 255);
|
||||
else
|
||||
drawrect(vid_buf, gx-2, gy-2, XRES/GRID_S+3, YRES/GRID_S+3, 128, 128, 128, 255);
|
||||
if(own)
|
||||
if(own && search_fav!=1)
|
||||
{
|
||||
if(dp == pos)
|
||||
drawtext(vid_buf, gx+XRES/GRID_S-4, gy-6, "\x86", 255, 48, 32, 255);
|
||||
@ -2321,7 +2321,7 @@ int search_ui(pixel *vid_buf)
|
||||
lasttime = TIMEOUT;
|
||||
}
|
||||
|
||||
if(b && !bq && dp!=-1)
|
||||
if(b && !bq && dp!=-1 && search_fav!=0)
|
||||
if(confirm_ui(vid_buf, "Do you want to delete?", search_names[dp], "Delete"))
|
||||
{
|
||||
execute_delete(vid_buf, search_ids[dp]);
|
||||
@ -2720,9 +2720,14 @@ int open_ui(pixel *vid_buf, char *save_id, char *save_date)
|
||||
if(status == 200)
|
||||
{
|
||||
pixel *full_save = prerender_save(data, data_size, &imgw, &imgh);
|
||||
save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2);
|
||||
data_ready = 1;
|
||||
free(full_save);
|
||||
if(full_save!=NULL){
|
||||
save_pic = rescale_img(full_save, imgw, imgh, &thumb_w, &thumb_h, 2);
|
||||
data_ready = 1;
|
||||
free(full_save);
|
||||
} else {
|
||||
error_ui(vid_buf, 0, "Save may be from a newer version");
|
||||
break;
|
||||
}
|
||||
}
|
||||
active = 0;
|
||||
free(http);
|
||||
|
90
src/main.c
90
src/main.c
@ -233,7 +233,7 @@ void *build_thumb(int *size, int bzip2)
|
||||
|
||||
void *build_save(int *size, int x0, int y0, int w, int h)
|
||||
{
|
||||
unsigned char *d=calloc(1,3*(XRES/CELL)*(YRES/CELL)+(XRES*YRES)*8+MAXSIGNS*262), *c;
|
||||
unsigned char *d=calloc(1,3*(XRES/CELL)*(YRES/CELL)+(XRES*YRES)*11+MAXSIGNS*262), *c;
|
||||
int i,j,x,y,p=0,*m=calloc(XRES*YRES, sizeof(int));
|
||||
int bx0=x0/CELL, by0=y0/CELL, bw=(w+CELL-1)/CELL, bh=(h+CELL-1)/CELL;
|
||||
|
||||
@ -249,7 +249,7 @@ void *build_save(int *size, int x0, int y0, int w, int h)
|
||||
d[p++] = bmap[y][x];
|
||||
for(y=by0; y<by0+bh; y++)
|
||||
for(x=bx0; x<bx0+bw; x++)
|
||||
if(bmap[y][x]==WL_FAN)
|
||||
if(bmap[y][x]==WL_FAN||bmap[y][x]==4)
|
||||
{
|
||||
i = (int)(fvx[y][x]*64.0f+127.5f);
|
||||
if(i<0) i=0;
|
||||
@ -258,7 +258,7 @@ void *build_save(int *size, int x0, int y0, int w, int h)
|
||||
}
|
||||
for(y=by0; y<by0+bh; y++)
|
||||
for(x=bx0; x<bx0+bw; x++)
|
||||
if(bmap[y][x]==WL_FAN)
|
||||
if(bmap[y][x]==WL_FAN||bmap[y][x]==4)
|
||||
{
|
||||
i = (int)(fvy[y][x]*64.0f+127.5f);
|
||||
if(i<0) i=0;
|
||||
@ -314,6 +314,17 @@ void *build_save(int *size, int x0, int y0, int w, int h)
|
||||
d[p++] = ((ttlife&0xFF00)>>8);
|
||||
d[p++] = (ttlife&0x00FF);
|
||||
}
|
||||
}
|
||||
for(j=0; j<w*h; j++)
|
||||
{
|
||||
i = m[j];
|
||||
if(i){
|
||||
//Now saving tmp!
|
||||
//d[p++] = (parts[i-1].life+3)/4;
|
||||
int tttmp = (int)parts[i-1].tmp;
|
||||
d[p++] = ((tttmp&0xFF00)>>8);
|
||||
d[p++] = (tttmp&0x00FF);
|
||||
}
|
||||
}
|
||||
for(j=0; j<w*h; j++)
|
||||
{
|
||||
@ -329,7 +340,7 @@ void *build_save(int *size, int x0, int y0, int w, int h)
|
||||
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))
|
||||
d[p++] = parts[i-1].ctype;
|
||||
}
|
||||
|
||||
@ -365,7 +376,7 @@ void *build_save(int *size, int x0, int y0, int w, int h)
|
||||
c[0] = 0x50; //0x66;
|
||||
c[1] = 0x53; //0x75;
|
||||
c[2] = 0x76; //0x43;
|
||||
c[3] = legacy_enable;
|
||||
c[3] = legacy_enable|((sys_pause<<1)&0x02);
|
||||
c[4] = SAVE_VERSION;
|
||||
c[5] = CELL;
|
||||
c[6] = bw;
|
||||
@ -416,10 +427,18 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
}
|
||||
else
|
||||
{
|
||||
if(c[3]==1||c[3]==0)
|
||||
legacy_enable = c[3];
|
||||
else
|
||||
legacy_beta = 1;
|
||||
if(ver>=44){
|
||||
legacy_enable = c[3]&0x01;
|
||||
if(!sys_pause){
|
||||
sys_pause = (c[3]>>1)&0x01;
|
||||
}
|
||||
} else {
|
||||
if(c[3]==1||c[3]==0){
|
||||
legacy_enable = c[3];
|
||||
} else {
|
||||
legacy_beta = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bw = c[6];
|
||||
@ -519,7 +538,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
}
|
||||
for(y=by0; y<by0+bh; y++)
|
||||
for(x=bx0; x<bx0+bw; x++)
|
||||
if(d[(y-by0)*bw+(x-bx0)]==4)
|
||||
if(d[(y-by0)*bw+(x-bx0)]==4||d[(y-by0)*bw+(x-bx0)]==WL_FAN)
|
||||
{
|
||||
if(p >= size)
|
||||
goto corrupt;
|
||||
@ -527,7 +546,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
}
|
||||
for(y=by0; y<by0+bh; y++)
|
||||
for(x=bx0; x<bx0+bw; x++)
|
||||
if(d[(y-by0)*bw+(x-bx0)]==4)
|
||||
if(d[(y-by0)*bw+(x-bx0)]==4||d[(y-by0)*bw+(x-bx0)]==WL_FAN)
|
||||
{
|
||||
if(p >= size)
|
||||
goto corrupt;
|
||||
@ -648,6 +667,25 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ver>=44){
|
||||
for(j=0; j<w*h; j++)
|
||||
{
|
||||
i = m[j];
|
||||
if(i)
|
||||
{
|
||||
if(p >= size) {
|
||||
goto corrupt;
|
||||
}
|
||||
if(i <= NPART) {
|
||||
ttv = (d[p++])<<8;
|
||||
ttv |= (d[p++]);
|
||||
parts[i-1].tmp = ttv;
|
||||
} else {
|
||||
p+=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(j=0; j<w*h; j++)
|
||||
{
|
||||
i = m[j];
|
||||
@ -692,7 +730,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0)
|
||||
{
|
||||
i = m[j];
|
||||
ty = d[pty+j];
|
||||
if(i && (ty==PT_CLNE || (ty==PT_PCLN && ver>=43) || (ty==PT_SPRK && ver>=21) || (ty==PT_LAVA && ver>=34) || (ty==PT_PIPE && ver>=43) || (ty==PT_BCLN && 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)))
|
||||
{
|
||||
if(p >= size)
|
||||
goto corrupt;
|
||||
@ -1027,8 +1065,8 @@ int main(int argc, char *argv[])
|
||||
#ifdef BETA
|
||||
int is_beta = 0;
|
||||
#endif
|
||||
char uitext[48] = "";
|
||||
char heattext[64] = "";
|
||||
char uitext[255] = "";
|
||||
char heattext[128] = "";
|
||||
int currentTime = 0;
|
||||
int FPS = 0;
|
||||
int pastFPS = 0;
|
||||
@ -1187,6 +1225,17 @@ int main(int argc, char *argv[])
|
||||
memset(vid_buf, 0, (XRES+BARSIZE)*YRES*PIXELSIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
//Can't be too sure...
|
||||
if(bsx>1180)
|
||||
bsx = 1180;
|
||||
if(bsx<0)
|
||||
bsx = 0;
|
||||
if(bsy>1180)
|
||||
bsy = 1180;
|
||||
if(bsy<0)
|
||||
bsy = 0;
|
||||
|
||||
update_particles(vid_buf);
|
||||
draw_parts(vid_buf);
|
||||
|
||||
@ -1412,6 +1461,8 @@ int main(int argc, char *argv[])
|
||||
bsy = 0;
|
||||
}
|
||||
}
|
||||
if((sdl_mod & (KMOD_RCTRL) )&&( sdl_mod & (KMOD_RALT)))
|
||||
active_menu = 11;
|
||||
if(sdl_key==SDLK_INSERT)
|
||||
REPLACE_MODE = !REPLACE_MODE;
|
||||
if(sdl_key=='g')
|
||||
@ -1901,8 +1952,11 @@ int main(int argc, char *argv[])
|
||||
memset(fire_g, 0, sizeof(fire_g));
|
||||
memset(fire_b, 0, sizeof(fire_b));
|
||||
}
|
||||
if(x>=19 && x<=35 && svf_last && svf_open && !bq)
|
||||
parse_save(svf_last, svf_lsize, 1, 0, 0);
|
||||
if(x>=19 && x<=35 && svf_last && svf_open && !bq){
|
||||
//int tpval = sys_pause;
|
||||
parse_save(svf_last, svf_lsize, 1, 0, 0);
|
||||
//sys_pause = tpval;
|
||||
}
|
||||
if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq)
|
||||
{
|
||||
if(b & SDL_BUTTON_LMASK)
|
||||
@ -2195,12 +2249,12 @@ int main(int argc, char *argv[])
|
||||
#else
|
||||
sprintf(uitext, "Version %d.%d FPS:%d", SAVE_VERSION, MINOR_VERSION, FPSB);
|
||||
#endif
|
||||
if(GRID_MODE)
|
||||
sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE);
|
||||
if(REPLACE_MODE)
|
||||
strappend(uitext, " [REPLACE MODE]");
|
||||
if(sdl_mod&(KMOD_CAPS))
|
||||
strappend(uitext, " [CAP LOCKS]");
|
||||
if(GRID_MODE)
|
||||
sprintf(uitext, "%s [GRID: %d]", uitext, GRID_MODE);
|
||||
|
||||
if(sdl_zoom_trig||zoom_en)
|
||||
{
|
||||
|
156
src/powder.c
156
src/powder.c
@ -504,8 +504,12 @@ inline int create_part(int p, int x, int y, int t)
|
||||
parts[i].life = 50;
|
||||
parts[i].tmp = 50;
|
||||
}
|
||||
if(t==PT_PUMP)
|
||||
parts[i].life= 10;
|
||||
if(t==PT_DEUT)
|
||||
parts[i].life = 20;
|
||||
if(t==PT_BRAY)
|
||||
parts[i].life = 30;
|
||||
if(t==PT_PUMP)
|
||||
parts[i].life= 10;
|
||||
if(t==PT_FSEP)
|
||||
parts[i].life = 50;
|
||||
if(t==PT_COAL) {
|
||||
@ -863,7 +867,7 @@ int nearest_part(int ci, int t)
|
||||
|
||||
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;
|
||||
float mv, dx, dy, ix, iy, lx, ly, d, pp, nrx, nry, dp;
|
||||
float nn, ct1, ct2;
|
||||
float pt = R_TEMP;
|
||||
@ -882,7 +886,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
GRAV_R2 = 30;
|
||||
GRAV_G2 = 30;
|
||||
GRAV_B2 = 0;
|
||||
for(int q = 0;q <= GRAV;q++)
|
||||
for( q = 0;q <= GRAV;q++)
|
||||
{
|
||||
if(GRAV_R >0 && GRAV_G==0)
|
||||
{
|
||||
@ -945,8 +949,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
if(love[nx/9][ny/9]==1)
|
||||
{
|
||||
for(int nnx=0;nnx<9;nnx++)
|
||||
for(int nny=0;nny<9;nny++)
|
||||
for( nnx=0;nnx<9;nnx++)
|
||||
for( nny=0;nny<9;nny++)
|
||||
{
|
||||
if(ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
|
||||
{
|
||||
@ -996,8 +1000,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
if(lolz[nx/9][ny/9]==1)
|
||||
{
|
||||
for(int nnx=0;nnx<9;nnx++)
|
||||
for(int nny=0;nny<9;nny++)
|
||||
for( nnx=0;nnx<9;nnx++)
|
||||
for( nny=0;nny<9;nny++)
|
||||
{
|
||||
if(ny+nny>0&&ny+nny<YRES&&nx+nnx>=0&&nx+nnx<XRES)
|
||||
{
|
||||
@ -1034,12 +1038,12 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
for(int golnum=1;golnum<NGOL;golnum++)
|
||||
for( golnum=1;golnum<NGOL;golnum++)
|
||||
if(parts[r>>8].type==golnum+77)
|
||||
{
|
||||
gol[nx][ny] = golnum;
|
||||
for(int 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( 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
|
||||
{
|
||||
if(ny+nny<4&&nx+nnx<4){//any way to make wrapping code smaller?
|
||||
gol2[XRES-5][YRES-5][golnum] ++;
|
||||
@ -1086,8 +1090,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
int neighbors = gol2[nx][ny][0];
|
||||
if(neighbors==0)
|
||||
continue;
|
||||
for(int golnum = 1;golnum<NGOL;golnum++)
|
||||
for(int goldelete = 0;goldelete<9;goldelete++)
|
||||
for( golnum = 1;golnum<NGOL;golnum++)
|
||||
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)
|
||||
{
|
||||
@ -1097,19 +1101,24 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
parts[pmap[ny][nx]>>8].type = PT_NONE;
|
||||
}
|
||||
gol2[nx][ny][0] = 0;
|
||||
for(int z = 1;z<NGOL;z++)
|
||||
for( z = 1;z<NGOL;z++)
|
||||
gol2[nx][ny][z] = 0;
|
||||
}
|
||||
}
|
||||
//if(ISWIRE==1)
|
||||
//{
|
||||
// CGOL = 0;
|
||||
// ISWIRE = 0;
|
||||
//}
|
||||
if(ISWIRE==1)
|
||||
{
|
||||
CGOL = 0;
|
||||
ISWIRE = 0;
|
||||
}
|
||||
if(CGOL==1)
|
||||
{
|
||||
for(int q = 0;q<25;q++)
|
||||
wireless[q] = 0;
|
||||
for( q = 0;q<25;q++)
|
||||
if(!wireless[q][1])
|
||||
{
|
||||
wireless[q][0] = 0;
|
||||
}
|
||||
else
|
||||
wireless[q][1] = 0;
|
||||
}
|
||||
for(i=start; i<(NPART-starti); i+=inc)
|
||||
if(parts[i].type)
|
||||
@ -1124,7 +1133,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
{
|
||||
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--;
|
||||
if(parts[i].life<=0 && t!=PT_METL && 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)
|
||||
{
|
||||
kill_part(i);
|
||||
continue;
|
||||
@ -1803,6 +1812,60 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(t==PT_ARAY && parts[i].life==0){
|
||||
for(nx=-1; nx<2; nx++){
|
||||
for(ny=-1; ny<2; ny++){
|
||||
if(x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny)){
|
||||
r = pmap[y+ny][x+nx];
|
||||
if((r>>8)>=NPART || !r)
|
||||
continue;
|
||||
if((r&0xFF)==PT_SPRK){
|
||||
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) {
|
||||
if(!(x+nxi+nxx<XRES && y+nyi+nyy<YRES && x+nxi+nxx >= 0 && y+nyi+nyy >= 0)){
|
||||
break;
|
||||
}
|
||||
r = pmap[y+nyi+nyy][x+nxi+nxx];
|
||||
if(!((r>>8)>=NPART)) {
|
||||
if(!r){
|
||||
int nr = create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_BRAY);
|
||||
if(nr!=-1&&destroy){
|
||||
parts[nr].tmp = 2;
|
||||
parts[nr].life = 2;
|
||||
}
|
||||
} else if(!destroy) {
|
||||
if(parts[r>>8].type==PT_BRAY&&parts[r>>8].tmp==0){
|
||||
if(nyy!=0 || nxx!=0){
|
||||
parts[r>>8].type = PT_BRAY;
|
||||
parts[r>>8].life = 1020;
|
||||
parts[r>>8].tmp = 1;
|
||||
}
|
||||
docontinue = 0;
|
||||
} else if(parts[r>>8].type==PT_BRAY&&parts[r>>8].tmp==1){
|
||||
parts[r>>8].life = 1020;
|
||||
//docontinue = 1;
|
||||
} else {
|
||||
if(nyy!=0 || nxx!=0){
|
||||
create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK);
|
||||
}
|
||||
docontinue = 0;
|
||||
}
|
||||
} else if(destroy) {
|
||||
if(parts[r>>8].type==PT_BRAY){
|
||||
parts[r>>8].life = 1;
|
||||
docontinue = 1;
|
||||
} else {
|
||||
docontinue = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//parts[i].life = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(t==PT_FUSE)
|
||||
{
|
||||
if(parts[i].life<=0) {
|
||||
@ -2334,7 +2397,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
parts[i].life--;
|
||||
}
|
||||
}
|
||||
for(int trade = 0; trade<9;trade ++)
|
||||
for( trade = 0; trade<9;trade ++)
|
||||
{
|
||||
nx = rand()%5-2;
|
||||
ny = rand()%5-2;
|
||||
@ -2480,9 +2543,10 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
create_part(-1,x+nx,y+ny,PT_DEUT);
|
||||
parts[i].life--;
|
||||
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;
|
||||
ny = rand()%5-2;
|
||||
@ -2510,7 +2574,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
}
|
||||
else if(t==PT_WARP)
|
||||
{
|
||||
for(int trade = 0; trade<5;trade ++)
|
||||
for( trade = 0; trade<5;trade ++)
|
||||
{
|
||||
nx = rand()%3-1;
|
||||
ny = rand()%3-1;
|
||||
@ -2679,8 +2743,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
}
|
||||
}
|
||||
if(parts[i].ctype>1)
|
||||
for(int o = 0;o<3;o++)
|
||||
for(int ctype = 2;ctype<5;ctype++)
|
||||
for( q = 0;q<3;q++)
|
||||
for( ctype = 2;ctype<5;ctype++)
|
||||
{
|
||||
if(parts[i].ctype==ctype)
|
||||
{
|
||||
@ -2813,10 +2877,11 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
if((r>>8)>=NPART || !r)
|
||||
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)))
|
||||
for(int nnx=0;nnx<8;nnx++)
|
||||
for( nnx=0;nnx<8;nnx++)
|
||||
if(!portal[count-1][nnx])
|
||||
{
|
||||
portal[count-1][nnx] = parts[r>>8].type;
|
||||
portaltemp[count-1][nnx] = parts[r>>8].temp;
|
||||
if(parts[r>>8].type==PT_SPRK)
|
||||
parts[r>>8].type = parts[r>>8].ctype;
|
||||
else
|
||||
@ -2839,7 +2904,7 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
continue;
|
||||
if(!r)
|
||||
{
|
||||
for(int nnx =0 ;nnx<8;nnx++)
|
||||
for( nnx =0 ;nnx<8;nnx++)
|
||||
{
|
||||
int randomness = count + rand()%3-1;
|
||||
if(randomness<1)
|
||||
@ -2857,12 +2922,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-1,portal[randomness-1][nnx]);
|
||||
portal[randomness-1][nnx] = 0;
|
||||
portaltemp[randomness-1][nnx] = 0;
|
||||
break;
|
||||
}
|
||||
else if(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;
|
||||
portaltemp[randomness-1][nnx] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2871,9 +2939,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
}
|
||||
else if(t==PT_WIFI)
|
||||
{
|
||||
CGOL = 1;
|
||||
int temprange = 100;
|
||||
for(int temp = 0; temp < 2500; temp += temprange)
|
||||
for( temp = 0; temp < 2500; temp += temprange)
|
||||
if(parts[i].temp-273.15>temp&&parts[i].temp-273.15<temp+temprange)
|
||||
parts[i].tmp = temp/100;
|
||||
for(ny=-1; ny<2; ny++)
|
||||
@ -2884,16 +2951,17 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
r = pmap[y+ny][x+nx];
|
||||
if((r>>8)>=NPART || !r)
|
||||
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].ctype = PT_NSCN;
|
||||
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_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] = 1;
|
||||
wireless[parts[i].tmp][0] = 1;
|
||||
wireless[parts[i].tmp][1] = 1;
|
||||
ISWIRE = 1;
|
||||
}
|
||||
}
|
||||
@ -3014,8 +3082,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
if((r>>8)>=NPART || !r)
|
||||
continue;
|
||||
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
|
||||
for(int nnx=-1;nnx<2;nnx++)
|
||||
for(int nny=-1;nny<2;nny++)
|
||||
for( nnx=-1;nnx<2;nnx++)
|
||||
for( nny=-1;nny<2;nny++)
|
||||
{
|
||||
if(7>rand()%200&&parts[i].life==0)
|
||||
{
|
||||
@ -3050,8 +3118,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
if(!r)
|
||||
continue;
|
||||
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
|
||||
for(int nnx=-1;nnx<2;nnx++)
|
||||
for(int nny=-1;nny<2;nny++)
|
||||
for( nnx=-1;nnx<2;nnx++)
|
||||
for( nny=-1;nny<2;nny++)
|
||||
{
|
||||
if(3>rand()%200&&parts[i].life==0)
|
||||
{
|
||||
@ -3099,8 +3167,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
parts[r>>8].life=7;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
|
||||
for(int nnx=-1;nnx<2;nnx++)
|
||||
for(int nny=-1;nny<2;nny++)
|
||||
for( nnx=-1;nnx<2;nnx++)
|
||||
for( nny=-1;nny<2;nny++)
|
||||
{
|
||||
if(2>rand()%3000&&parts[i].life==0)
|
||||
{
|
||||
@ -3143,8 +3211,8 @@ void update_particles_i(pixel *vid, int start, int inc)
|
||||
parts[r>>8].life = 7;
|
||||
}
|
||||
else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0)
|
||||
for(int nnx=-1;nnx<2;nnx++)
|
||||
for(int nny=-1;nny<2;nny++)
|
||||
for( nnx=-1;nnx<2;nnx++)
|
||||
for( nny=-1;nny<2;nny++)
|
||||
{
|
||||
if(!pmap[y+ny+nny][x+nx+nnx])
|
||||
{
|
||||
@ -4934,10 +5002,10 @@ int flood_parts(int x, int y, int c, int cm, int bm)
|
||||
|
||||
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;
|
||||
for(int r=UI_ACTUALSTART;r<=UI_ACTUALSTART+UI_WALLCOUNT;r++)
|
||||
for(r=UI_ACTUALSTART;r<=UI_ACTUALSTART+UI_WALLCOUNT;r++)
|
||||
{
|
||||
if(wall==r)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user