Some more function pointers

This commit is contained in:
jacksonmj 2011-01-07 20:03:58 +00:00
parent fa1868314c
commit b69712bbdb
18 changed files with 763 additions and 702 deletions

View File

@ -224,9 +224,15 @@
#define UPDATE_FUNC_ARGS int i, int x, int y, int nx, int ny, float lx, float ly
int update_ACID(UPDATE_FUNC_ARGS);
int update_AMTR(UPDATE_FUNC_ARGS);
int update_ARAY(UPDATE_FUNC_ARGS);
int update_BCLN(UPDATE_FUNC_ARGS);
int update_BCOL(UPDATE_FUNC_ARGS);
int update_BMTL(UPDATE_FUNC_ARGS);
int update_BOMB(UPDATE_FUNC_ARGS);
int update_BTRY(UPDATE_FUNC_ARGS);
int update_C5(UPDATE_FUNC_ARGS);
int update_CLNE(UPDATE_FUNC_ARGS);
int update_COAL(UPDATE_FUNC_ARGS);
int update_DEUT(UPDATE_FUNC_ARGS);
int update_DSTW(UPDATE_FUNC_ARGS);
@ -234,13 +240,23 @@ int update_FOG(UPDATE_FUNC_ARGS);
int update_FRZZ(UPDATE_FUNC_ARGS);
int update_FSEP(UPDATE_FUNC_ARGS);
int update_FUSE(UPDATE_FUNC_ARGS);
int update_FIRW(UPDATE_FUNC_ARGS);
int update_FWRK(UPDATE_FUNC_ARGS);
int update_GLOW(UPDATE_FUNC_ARGS);
int update_IRON(UPDATE_FUNC_ARGS);
int update_ISZ(UPDATE_FUNC_ARGS);
int update_PCLN(UPDATE_FUNC_ARGS);
int update_PHOT(UPDATE_FUNC_ARGS);
int update_PIPE(UPDATE_FUNC_ARGS);
int update_PLNT(UPDATE_FUNC_ARGS);
int update_PRTI(UPDATE_FUNC_ARGS);
int update_PRTO(UPDATE_FUNC_ARGS);
int update_RIME(UPDATE_FUNC_ARGS);
int update_SHLD1(UPDATE_FUNC_ARGS);
int update_SHLD2(UPDATE_FUNC_ARGS);
int update_SHLD3(UPDATE_FUNC_ARGS);
int update_SHLD4(UPDATE_FUNC_ARGS);
int update_SING(UPDATE_FUNC_ARGS);
int update_SLTW(UPDATE_FUNC_ARGS);
int update_SPAWN(UPDATE_FUNC_ARGS);
int update_SPAWN2(UPDATE_FUNC_ARGS);
@ -250,8 +266,11 @@ int update_STKM2(UPDATE_FUNC_ARGS);
int update_THDR(UPDATE_FUNC_ARGS);
int update_THRM(UPDATE_FUNC_ARGS);
int update_VINE(UPDATE_FUNC_ARGS);
int update_WARP(UPDATE_FUNC_ARGS);
int update_WATR(UPDATE_FUNC_ARGS);
int update_WIFI(UPDATE_FUNC_ARGS);
int update_WTRV(UPDATE_FUNC_ARGS);
int update_YEST(UPDATE_FUNC_ARGS);
struct particle
@ -342,7 +361,7 @@ static const part_type ptypes[PT_NUM] =
{"LAVA", PIXPACK(0xE05010), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.0003f * CFDS, 2, 0, 0, 0, 2, 1, 45, SC_LIQUID, R_TEMP+1500.0f+273.15f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold.", TYPE_LIQUID, NULL},
{"GUN", PIXPACK(0xC0C0D0), 0.7f, 0.02f * CFDS, 0.94f, 0.80f, -0.1f, 0.1f, 0.00f, 0.000f * CFDS, 1, 600, 1, 0, 10, 1, 85, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 97, "Light dust. Explosive.", TYPE_PART, NULL},
{"NITR", PIXPACK(0x20E010), 0.5f, 0.02f * CFDS, 0.92f, 0.97f, 0.0f, 0.2f, 0.00f, 0.000f * CFDS, 2, 1000, 2, 0, 3, 1, 23, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 50, "Liquid. Pressure sensitive explosive.", TYPE_LIQUID, NULL},
{"CLNE", PIXPACK(0xFFD010), 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_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches.", TYPE_SOLID, NULL},
{"CLNE", PIXPACK(0xFFD010), 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_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Solid. Duplicates any particles it touches.", TYPE_SOLID, &update_CLNE},
{"GAS", PIXPACK(0xE0FF20), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.75f, 0.001f * CFDS, 0, 600, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Gas. Diffuses. Flammable. Liquifies under pressure.", TYPE_GAS, NULL},
{"C-4", PIXPACK(0xD080E0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 1000, 2, 50, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Solid. Pressure sensitive explosive.", TYPE_SOLID | PROP_NEUTPENETRATE, NULL},
{"GOO", PIXPACK(0x804000), 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_SOLIDS, R_TEMP+0.0f +273.15f, 75, "Solid. Deforms and disappears under pressure.", TYPE_SOLID | PROP_NEUTPENETRATE, NULL},
@ -386,7 +405,7 @@ static const part_type ptypes[PT_NUM] =
{"ETRD", PIXPACK(0x404040), 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, "Electrode. Creates a surface that allows Plasma arcs. (Use sparingly)", TYPE_SOLID|PROP_CONDUCTS, NULL},
{"NICE", PIXPACK(0xC0E0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0005f* CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, 35.0f, 46, "Nitrogen Ice.", TYPE_SOLID, NULL},
{"NBLE", PIXPACK(0xEB4917), 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_GAS, R_TEMP+2.0f +273.15f, 106, "Noble Gas. Diffuses. Conductive. Ionizes into plasma when intruduced to electricity", TYPE_GAS|PROP_CONDUCTS, NULL},
{"BTRY", PIXPACK(0x858505), 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, "Solid. Generates Electricity.", TYPE_SOLID, NULL},
{"BTRY", PIXPACK(0x858505), 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, "Solid. Generates Electricity.", TYPE_SOLID, &update_BTRY},
{"LCRY", PIXPACK(0x505050), 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, "Liquid Crystal. Changes colour when charged. (PSCN Charges, NSCN Discharges)", TYPE_SOLID, NULL},
{"STKM", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", 0, &update_STKM},
{"SWCH", PIXPACK(0x103B11), 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. Only conducts when switched on. (PSCN switches on, NSCN switches off)", TYPE_SOLID, NULL},
@ -396,13 +415,13 @@ static const part_type ptypes[PT_NUM] =
{"LO2", PIXPACK(0x80A0EF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 5000, 0, 0, 0, 1, 30, SC_LIQUID, 80.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire", TYPE_LIQUID, NULL},
{"O2", PIXPACK(0x80A0FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 3.0f, 0.000f * CFDS, 0, 1000, 0, 0, 0, 1, 1, SC_GAS, R_TEMP+0.0f +273.15f, 70, "Gas. Ignites easily.", TYPE_GAS, NULL},
{"INWR", PIXPACK(0x544141), 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, "Insulated Wire. Doesn't conduct to metal or semiconductors.", TYPE_SOLID|PROP_CONDUCTS, NULL},
{"YEST", PIXPACK(0xEEE0C0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 15, 0, 0, 30, 1, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C).", TYPE_PART, NULL},
{"YEST", PIXPACK(0xEEE0C0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 15, 0, 0, 30, 1, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Yeast, grows when warm (~37C).", TYPE_PART, &update_YEST},
{"DYST", PIXPACK(0xBBB0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 20, 0, 0, 30, 0, 80, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Dead Yeast.", TYPE_PART, NULL},
{"THRM", PIXPACK(0xA08090), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 2, 2, 1, 90, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 211, "Thermite. Burns at extremly high temperature.", TYPE_PART, &update_THRM},
{"GLOW", PIXPACK(0x445544), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 2, 1, 40, SC_LIQUID, R_TEMP+20.0f+273.15f, 44, "Glow, Glows under pressure", TYPE_LIQUID, &update_GLOW},
{"BRCK", PIXPACK(0x808080), 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_SOLIDS, R_TEMP+0.0f +273.15f, 251, "Brick, breakable building material.", TYPE_SOLID|PROP_HOT_GLOW, NULL},
{"CFLM", PIXPACK(0x8080FF), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.0005f * CFDS, 1, 0, 0, 0, 1, 1, 2, SC_SPECIAL, 0.0f, 88, "Sub-zero flame.", TYPE_GAS, NULL},
{"FIRW", PIXPACK(0xFFA040), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, -0.99f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 55, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!", TYPE_PART, NULL},
{"FIRW", PIXPACK(0xFFA040), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, -0.99f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 55, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 70, "Fireworks!", TYPE_PART, &update_FIRW},
{"FUSE", PIXPACK(0x0A5706), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 200, "Solid. Burns slowly. Ignites at somewhat high temperatures and electricity.", TYPE_SOLID, &update_FUSE},
{"FSEP", PIXPACK(0x63AD5F), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 30, 1, 70, SC_POWDERS, R_TEMP+0.0f +273.15f, 70, "Fuse Powder. See FUSE.", TYPE_PART, &update_FSEP},
{"AMTR", PIXPACK(0x808080), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.00f, 0.10f, 1.00f, 0.0000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Anti-Matter, Destroys a majority of particles", TYPE_PART, NULL}, //Maybe TYPE_ENERGY?
@ -426,12 +445,12 @@ static const part_type ptypes[PT_NUM] =
{"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, &update_SPNG},
{"RIME", PIXPACK(0xCCCCCC), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 30, 1, 100, SC_CRACKER2, 243.15f, 100, "Not quite Ice",TYPE_SOLID, &update_FOG},
{"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, &update_RIME},
{"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, NULL},
{"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, &update_BCLN},
{"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, NULL},
{"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, &update_DEUT},
{"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, NULL},
{"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, &update_WARP},
{"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, NULL},
{"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, 1, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons.", TYPE_PART, NULL},
{"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, 1, 1, 97, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 100, "First fireworks made, activated by heat/neutrons.", TYPE_PART, &update_FWRK},
{"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, &update_PIPE},
{"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, &update_FRZZ},
{"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, NULL},
@ -440,10 +459,10 @@ static const part_type ptypes[PT_NUM] =
{"BIZG", 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, "Bizarre gas", TYPE_GAS, NULL},
{"BIZS", 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, "Bizarre solid", TYPE_SOLID, NULL},
{"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, PSCN to charge, NSCN to take.", TYPE_SOLID, NULL},
{"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, NULL},
{"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, NULL},
{"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, 0, "Portal IN. Things go in here. Alter temperature for channels", TYPE_SOLID, NULL},
{"PRTO", PIXPACK(0x0020EB), 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, 0, "Portal OUT. Things come out here. Alter temperature for channels", TYPE_SOLID, NULL},
{"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, &update_ISZ},
{"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, &update_ISZ},
{"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, 0, "Portal IN. Things go in here. Alter temperature for channels", TYPE_SOLID, &update_PRTI},
{"PRTO", PIXPACK(0x0020EB), 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, 0, "Portal OUT. Things come out here. Alter temperature for channels", TYPE_SOLID, &update_PRTO},
{"PSTE", PIXPACK(0xAA99AA), 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_LIQUID, R_TEMP-2.0f +273.15f, 29, "Colloid, Hardens under pressure", TYPE_LIQUID, NULL},
{"PSTS", PIXPACK(0x776677), 0.0f, 0.00f * CFDS, 0.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 20, 0, 100, SC_CRACKER, R_TEMP-2.0f +273.15f, 29, "Solid form of PSTE, temporary", TYPE_SOLID, NULL},
{"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, NULL},
@ -452,19 +471,19 @@ static const part_type ptypes[PT_NUM] =
{"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, NULL},
{"SPWN2", 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, &update_SPAWN2},
{"SPWN", 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, &update_SPAWN},
{"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, NULL},
{"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, NULL},
{"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, NULL},
{"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, NULL},
{"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, &update_SHLD1},
{"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, &update_SHLD2},
{"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, &update_SHLD3},
{"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, &update_SHLD4},
{"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, NULL},
{"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, 2, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID, NULL},
{"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, 2, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 0, "Wireless transmitter, color coded.", TYPE_SOLID, &update_WIFI},
{"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, NULL},
{"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, &update_ARAY},
{"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, NULL},
{"STK2", PIXPACK(0x000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, 0.0f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, 50, SC_SPECIAL, R_TEMP+14.6f+273.15f, 0, "Stickman. Don't kill him!", 0, &update_STKM2},
{"BOMB", PIXPACK(0xFFF288), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 1, 30, SC_EXPLOSIVE, R_TEMP-2.0f +273.15f, 29, "Bomb.", TYPE_PART, NULL},
{"C-5", PIXPACK(0x2050E0), 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_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Cold explosive", TYPE_SOLID | PROP_NEUTPENETRATE, NULL},
{"SING", PIXPACK(0x242424), 0.7f, 0.36f * CFDS, 0.96f, 0.80f, 0.1f, 0.12f, 0.00f, -0.001f * CFDS, 1, 0, 0, 0, 0, 1, 86, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Singularity", TYPE_PART, NULL},
{"BOMB", PIXPACK(0xFFF288), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 20, 1, 30, SC_EXPLOSIVE, R_TEMP-2.0f +273.15f, 29, "Bomb.", TYPE_PART, &update_BOMB},
{"C-5", PIXPACK(0x2050E0), 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_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Cold explosive", TYPE_SOLID | PROP_NEUTPENETRATE, &update_C5},
{"SING", PIXPACK(0x242424), 0.7f, 0.36f * CFDS, 0.96f, 0.80f, 0.1f, 0.12f, 0.00f, -0.001f * CFDS, 1, 0, 0, 0, 0, 1, 86, SC_NUCLEAR, R_TEMP+0.0f +273.15f, 70, "Singularity", TYPE_PART, &update_SING},
{"QRTZ", PIXPACK(0xAADDDD), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 3, "Quartz, breakable mineral. Conducts but becomes brittle at lower temperatures.", TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW, NULL},
{"PQRT", PIXPACK(0x88BBBB), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.27f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 3, "Broken quartz.", TYPE_PART| PROP_HOT_GLOW, NULL},
{"SEED", PIXPACK(0xFBEC7D), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B2/S", TYPE_SOLID|PROP_LIFE, NULL},

32
src/elements/amtr.c Normal file
View File

@ -0,0 +1,32 @@
#include <powder.h>
int update_AMTR(UPDATE_FUNC_ARGS) {
int r, rt;
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;
rt = parts[r>>8].type;
if ((r&0xFF)!=PT_AMTR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_NONE && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_BHOL && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO)
{
parts[i].life++;
if (parts[i].life==3)
{
parts[i].type = PT_NONE;
kill_part(i);
return 1;
}
parts[r>>8].life = 0;
parts[r>>8].type = PT_NONE;
kill_part(r>>8);
if (2>(rand()/(RAND_MAX/100)))
create_part(-1, x+nx, y+ny, PT_PHOT);
pv[y/CELL][x/CELL] -= 5.0f;
}
}
return 0;
}

23
src/elements/bcln.c Normal file
View File

@ -0,0 +1,23 @@
#include <powder.h>
int update_BCLN(UPDATE_FUNC_ARGS) {
if (!parts[i].ctype)
{
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 &&
pmap[y+ny][x+nx] &&
(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_STKM2 &&
(pmap[y+ny][x+nx]&0xFF)!=0xFF)
parts[i].ctype = pmap[y+ny][x+nx]&0xFF;
}
else {
create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
}
return 0;
}

64
src/elements/bomb.c Normal file
View File

@ -0,0 +1,64 @@
#include <powder.h>
int update_BOMB(UPDATE_FUNC_ARGS) {
int r, nb;
if (parts[i].tmp==1) {
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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 (parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB) {
parts[i].type = PT_NONE;
return 1;
}
}
} else if (parts[i].tmp==0) {
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; ny++)
if (x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES)
{
r = pmap[y+ny][x+nx];
if ((r>>8)>=NPART || !r)
continue;
if (parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB && parts[r>>8].type!=PT_DMND && parts[r>>8].type!=PT_CLNE && parts[r>>8].type!=PT_PCLN && parts[r>>8].type!=PT_BCLN) {
int rad = 8;
int nxi;
int nxj;
pmap[y][x] = 0;
for (nxj=-(rad+1); nxj<=(rad+1); nxj++)
for (nxi=-(rad+1); nxi<=(rad+1); nxi++)
if ((pow(nxi,2))/(pow((rad+1),2))+(pow(nxj,2))/(pow((rad+1),2))<=1) {
nb = create_part(-1, x+nxi, y+nxj, PT_BOMB);
if (nb!=-1) {
parts[nb].tmp = 1;
parts[nb].life = 50;
parts[nb].temp = MAX_TEMP;
parts[nb].vx = rand()%20-10;
parts[nb].vy = rand()%20-10;
}
}
for (nxj=-rad; nxj<=rad; nxj++)
for (nxi=-rad; nxi<=rad; nxi++)
if ((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1)
if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN) {
delete_part(x+nxi, y+nxj);
pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f;
nb = create_part(-1, x+nxi, y+nxj, PT_BOMB);
if (nb!=-1) {
parts[nb].tmp = 2;
parts[nb].life = 2;
parts[nb].temp = MAX_TEMP;
}
}
//create_parts(x, y, 9, 9, PT_BOMB);
//create_parts(x, y, 8, 8, PT_NONE);
parts[i].type = PT_NONE;
return 1;
}
}
}
return 0;
}

25
src/elements/btry.c Normal file
View File

@ -0,0 +1,25 @@
#include <powder.h>
int update_BTRY(UPDATE_FUNC_ARGS) {
int r, rt;
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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;
rt = parts[r>>8].type;
if (parts_avg(i,r>>8,PT_INSL) != PT_INSL)
{
if ((ptypes[rt].properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0 && abs(nx)+abs(ny) < 4)
{
parts[r>>8].life = 4;
parts[r>>8].ctype = rt;
parts[r>>8].type = PT_SPRK;
}
}
}
return 0;
}

24
src/elements/c5.c Normal file
View File

@ -0,0 +1,24 @@
#include <powder.h>
int update_C5(UPDATE_FUNC_ARGS) {
int r;
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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 ((parts[r>>8].temp<100 && parts[r>>8].type!=PT_C5)||parts[r>>8].type==PT_HFLM)
{
if (1>rand()%6)
{
parts[i].type = PT_HFLM;
parts[r>>8].temp = parts[i].temp = 0;
parts[i].life = rand()%150+50;
pv[y/CELL][x/CELL] += 1.5;
}
}
}
return 0;
}

23
src/elements/clne.c Normal file
View File

@ -0,0 +1,23 @@
#include <powder.h>
int update_CLNE(UPDATE_FUNC_ARGS) {
if (!parts[i].ctype)
{
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 &&
pmap[y+ny][x+nx] &&
(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_STKM2 &&
(pmap[y+ny][x+nx]&0xFF)!=0xFF)
parts[i].ctype = pmap[y+ny][x+nx]&0xFF;
}
else {
create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
}
return 0;
}

67
src/elements/firw.c Normal file
View File

@ -0,0 +1,67 @@
#include <powder.h>
int update_FIRW(UPDATE_FUNC_ARGS) {
int r, rt;
if (parts[i].tmp==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;
rt = parts[r>>8].type;
if (rt==PT_FIRE||rt==PT_PLSM||rt==PT_THDR)
{
parts[i].tmp = 1;
parts[i].life = rand()%50+60;
}
}
}
else if (parts[i].tmp==1) {
if (parts[i].life==0) {
parts[i].tmp=2;
} else {
float newVel = parts[i].life/25;
parts[i].flags = parts[i].flags&0xFFFFFFFE;
if ((pmap[(int)(ly-newVel)][(int)lx]&0xFF)==PT_NONE && ly-newVel>0) {
parts[i].vy = -newVel;
// TODO
//ly-=newVel;
//iy-=newVel;
}
}
}
else if (parts[i].tmp==2) {
int col = rand()%200+4;
for (nx=-2; nx<3; nx++) {
for (ny=-2; ny<3; ny++) {
if (x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
{
int tmul = rand()%7;
create_part(-1, x+nx, y+ny, PT_FIRW);
r = pmap[y+ny][x+nx];
if ((r>>8)>=NPART || !r)
continue;
if (parts[r>>8].type==PT_FIRW) {
parts[r>>8].vx = (rand()%3-1)*tmul;
parts[r>>8].vy = (rand()%3-1)*tmul;
parts[r>>8].tmp = col;
parts[r>>8].life = rand()%100+100;
parts[r>>8].temp = 6000.0f;
}
}
}
}
pv[y/CELL][x/CELL] += 20;
kill_part(i);
return 1;
} else if (parts[i].tmp>=3) {
if (parts[i].life<=0) {
kill_part(i);
return 1;
}
}
return 0;
}

55
src/elements/fwrk.c Normal file
View File

@ -0,0 +1,55 @@
#include <powder.h>
int update_FWRK(UPDATE_FUNC_ARGS) {
int r, a;
if ((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST)
{
create_part(-1, x , y-1 , PT_FWRK);
r = pmap[y-1][x];
if ((r&0xFF)==PT_FWRK)
{
parts[r>>8].vy = rand()%8-22;
parts[r>>8].vx = rand()%20-rand()%20;
parts[r>>8].life=rand()%15+25;
parts[i].type=PT_NONE;
}
}
if (parts[i].life>1)
{
if (parts[i].life>=45&&parts[i].type==PT_FWRK)
parts[i].life=0;
}
if ((parts[i].life<3&&parts[i].life>0)||parts[i].vy>6&&parts[i].life>0)
{
int q = (rand()%255+1);
int w = (rand()%255+1);
int e = (rand()%255+1);
for (nx=-1; nx<2; nx++)
for (ny=-2; ny<3; ny++)
if (x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES)
{
if (5>=rand()%8)
{
if (!pmap[y+ny][x+nx])
{
create_part(-1, x+nx, y+ny , PT_DUST);
pv[y/CELL][x/CELL] += 2.00f*CFDS;
a= pmap[y+ny][x+nx];
if (parts[a>>8].type==PT_DUST)
{
parts[a>>8].vy = -(rand()%10-1);
parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ;
parts[a>>8].life= rand()%37+18;
parts[a>>8].tmp=q;
parts[a>>8].flags=w;
parts[a>>8].ctype=e;
parts[a>>8].temp= rand()%20+6000;
}
}
}
}
parts[i].type=PT_NONE;
}
return 0;
}

17
src/elements/isz.c Normal file
View File

@ -0,0 +1,17 @@
#include <powder.h>
int update_ISZ(UPDATE_FUNC_ARGS) {
float rr, rrr;
if (1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000))
{
parts[i].type = PT_PHOT;
rr = (rand()%228+128)/127.0f;
rrr = (rand()%360)*3.14159f/180.0f;
parts[i].life = 680;
parts[i].ctype = 0x3FFFFFFF;
parts[i].vx = rr*cosf(rrr);
parts[i].vy = rr*sinf(rrr);
create_part(i, x, y, PT_PHOT);
}
return 0;
}

32
src/elements/prti.c Normal file
View File

@ -0,0 +1,32 @@
#include <powder.h>
int update_PRTI(UPDATE_FUNC_ARGS) {
int r, temp, nnx, temprange = 100;
int count =0;
for ( temp = 0; temp < MAX_TEMP; temp += temprange)
if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
for (ny=-1; ny<2; ny++)
for (nx=-1; nx<2; nx++)
if (x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
count ++;
r = pmap[y+ny][x+nx];
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 ( nnx=0; nnx<80; nnx++)
if (!portal[parts[i].tmp][count-1][nnx])
{
portal[parts[i].tmp][count-1][nnx] = parts[r>>8].type;
portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>8].temp;
if (parts[r>>8].type==PT_SPRK)
parts[r>>8].type = parts[r>>8].ctype;
else
parts[r>>8].type = PT_NONE;
break;
}
}
return 0;
}

53
src/elements/prto.c Normal file
View File

@ -0,0 +1,53 @@
#include <powder.h>
int update_PRTO(UPDATE_FUNC_ARGS) {
int r, temp, nnx, temprange = 100;
int count = 0;
for ( temp = 0; temp < MAX_TEMP; temp += temprange)
if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
for (ny=1; ny>-2; ny--)
for (nx=1; nx>-2; nx--)
if (x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
count ++;
r = pmap[y+ny][x+nx];
if ((r>>8)>=NPART || r)
continue;
if (!r)
{
for ( nnx =0 ; nnx<80; nnx++)
{
int randomness = count + rand()%3-1;
if (randomness<1)
randomness=1;
if (randomness>8)
randomness=8;
if (portal[parts[i].tmp][randomness-1][nnx]==PT_SPRK)//todo. make it look better
{
create_part(-1,x+1,y,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x+1,y+1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x+1,y-1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x,y-1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x,y+1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x-1,y+1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x-1,y,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x-1,y-1,portal[parts[i].tmp][randomness-1][nnx]);
portal[parts[i].tmp][randomness-1][nnx] = 0;
portaltemp[parts[i].tmp][randomness-1][nnx] = 0;
break;
}
else if (portal[parts[i].tmp][randomness-1][nnx])
{
create_part(-1,x+nx,y+ny,portal[parts[i].tmp][randomness-1][nnx]);
parts[pmap[y+ny][x+nx]>>8].temp = portaltemp[parts[i].tmp][randomness-1][nnx];
portal[parts[i].tmp][randomness-1][nnx] = 0;
portaltemp[parts[i].tmp][randomness-1][nnx] = 0;
break;
}
}
}
}
return 0;
}

160
src/elements/shld.c Normal file
View File

@ -0,0 +1,160 @@
#include <powder.h>
int update_SHLD1(UPDATE_FUNC_ARGS) {
int r, nnx, nny;
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;
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (7>rand()%200&&parts[i].life==0)
{
parts[i].type = PT_SHLD2;
parts[i].life = 7;
}
else if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
//parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
else if (parts[r>>8].type==PT_SHLD3&&4>rand()%10)
{
parts[i].type=PT_SHLD2;
parts[i].life = 7;
}
}
return 0;
}
int update_SHLD2(UPDATE_FUNC_ARGS) {
int r, nnx, nny;
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)
continue;
if (!r && parts[i].life>0)
create_part(-1,x+nx,y+ny,PT_SHLD1);
if (!r)
continue;
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (3>rand()%200&&parts[i].life==0)
{
parts[i].type = PT_SHLD3;
parts[i].life = 7;
}
else if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
else if (parts[r>>8].type==PT_SHLD4&&4>rand()%10)
{
parts[i].type=PT_SHLD3;
parts[i].life = 7;
}
}
return 0;
}
int update_SHLD3(UPDATE_FUNC_ARGS) {
int r, nnx, nny;
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)
continue;
if (!r)
{
if (1>rand()%2500)
{
create_part(-1,x+nx,y+ny,PT_SHLD1);
parts[pmap[y+ny][x+nx]>>8].life=7;
parts[i].type = PT_SHLD2;
}
else
continue;
}
if (parts[r>>8].type==PT_SHLD1 && parts[i].life>3)
{
parts[r>>8].type = PT_SHLD2;
parts[r>>8].life=7;
}
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (2>rand()%3000&&parts[i].life==0)
{
parts[i].type = PT_SHLD4;
parts[i].life = 7;
}
else if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
}
return 0;
}
int update_SHLD4(UPDATE_FUNC_ARGS) {
int r, nnx, nny;
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)
continue;
if (!r)
{
if (1>rand()%5500)
{
create_part(-1,x+nx,y+ny,PT_SHLD1);
parts[pmap[y+ny][x+nx]>>8].life=7;
parts[i].type = PT_SHLD2;
}
else
continue;
}
if (parts[r>>8].type==PT_SHLD2 && parts[i].life>3)
{
parts[r>>8].type = PT_SHLD3;
parts[r>>8].life = 7;
}
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
}
return 0;
}

59
src/elements/sing.c Normal file
View File

@ -0,0 +1,59 @@
#include <powder.h>
int update_SING(UPDATE_FUNC_ARGS) {
int r;
int singularity = -parts[i].life;
if (pv[y/CELL][x/CELL]<singularity)
pv[y/CELL][x/CELL] += 0.1f*(singularity-pv[y/CELL][x/CELL]);
if (y+CELL<YRES && pv[y/CELL+1][x/CELL]<singularity)
pv[y/CELL+1][x/CELL] += 0.1f*(singularity-pv[y/CELL+1][x/CELL]);
if (x+CELL<XRES)
{
pv[y/CELL][x/CELL+1] += 0.1f*(singularity-pv[y/CELL][x/CELL+1]);
if (y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += 0.1f*(singularity-pv[y/CELL+1][x/CELL+1]);
}
if (y+CELL>0 && pv[y/CELL-1][x/CELL]<singularity)
pv[y/CELL-1][x/CELL] += 0.1f*(singularity-pv[y/CELL-1][x/CELL]);
if (x+CELL>0)
{
pv[y/CELL][x/CELL-1] += 0.1f*(singularity-pv[y/CELL][x/CELL-1]);
if (y+CELL>0)
pv[y/CELL-1][x/CELL-1] += 0.1f*(singularity-pv[y/CELL-1][x/CELL-1]);
}
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 (parts[r>>8].type!=PT_DMND&&33>=rand()/(RAND_MAX/100)+1)
{
if (parts[r>>8].type==PT_SING && parts[r>>8].life >10)
{
if (parts[i].life+parts[r>>8].life > 255)
continue;
parts[i].life += parts[r>>8].life;
}
else
{
if (parts[i].life+3 > 255)
{
if (parts[r>>8].type!=PT_SING && 1>rand()%100)
{
parts[r>>8].type = PT_SING;
parts[r>>8].life = rand()%50+60;
}
continue;
}
parts[i].life += 3;
}
parts[i].temp = restrict_flt(parts[r>>8].temp+parts[i].temp, MIN_TEMP, MAX_TEMP);
parts[r>>8].type=PT_NONE;
}
}
return 0;
}

26
src/elements/warp.c Normal file
View File

@ -0,0 +1,26 @@
#include <powder.h>
int update_WARP(UPDATE_FUNC_ARGS) {
int trade, r;
for ( trade = 0; trade<5; trade ++)
{
nx = rand()%3-1;
ny = rand()%3-1;
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 (parts[r>>8].type!=PT_WARP&&parts[r>>8].type!=PT_STKM&&parts[r>>8].type!=PT_DMND&&parts[r>>8].type!=PT_CLNE&&parts[r>>8].type!=PT_BCLN&&parts[r>>8].type!=PT_PCLN&&(10>=rand()%200))
{
parts[i].x = parts[r>>8].x;
parts[i].y = parts[r>>8].y;
parts[r>>8].x = x;
parts[r>>8].y = y;
parts[i].life += 4;
trade = 5;
}
}
}
return 0;
}

43
src/elements/wifi.c Normal file
View File

@ -0,0 +1,43 @@
#include <powder.h>
int update_WIFI(UPDATE_FUNC_ARGS) {
int r, temp, temprange = 100;
for ( temp = 0; temp < MAX_TEMP; temp += temprange)
if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
for (ny=-1; ny<2; ny++)
for (nx=-1; nx<2; nx++)
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 (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_PSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
{
parts[r>>8].type = PT_SPRK;
parts[r>>8].ctype = PT_PSCN;
parts[r>>8].life = 4;
}
else if (parts[r>>8].type==PT_INWR&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
{
parts[r>>8].type = PT_SPRK;
parts[r>>8].ctype = PT_INWR;
parts[r>>8].life = 4;
}
else if (parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp][0])
{
//parts[r>>8].type = parts[r>>8].ctype;
wireless[parts[i].tmp][0] = 1;
wireless[parts[i].tmp][1] = 1;
ISWIRE = 1;
}
}
return 0;
}

22
src/elements/yest.c Normal file
View File

@ -0,0 +1,22 @@
#include <powder.h>
int update_YEST(UPDATE_FUNC_ARGS) {
int r;
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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_DYST && 1>(rand()%30) && !legacy_enable)
{
parts[i].type = PT_DYST;
}
}
if (parts[i].temp>303&&parts[i].temp<317) {
create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_YEST);
}
return 0;
}

View File

@ -1374,29 +1374,6 @@ void update_particles_i(pixel *vid, int start, int inc)
pv[y/CELL+1][x/CELL+1] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL+1]);
}
}
else if (t==PT_SING)
{
int singularity = -parts[i].life;
if (pv[y/CELL][x/CELL]<singularity)
pv[y/CELL][x/CELL] += 0.1f*(singularity-pv[y/CELL][x/CELL]);
if (y+CELL<YRES && pv[y/CELL+1][x/CELL]<singularity)
pv[y/CELL+1][x/CELL] += 0.1f*(singularity-pv[y/CELL+1][x/CELL]);
if (x+CELL<XRES)
{
pv[y/CELL][x/CELL+1] += 0.1f*(singularity-pv[y/CELL][x/CELL+1]);
if (y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += 0.1f*(singularity-pv[y/CELL+1][x/CELL+1]);
}
if (y+CELL>0 && pv[y/CELL-1][x/CELL]<singularity)
pv[y/CELL-1][x/CELL] += 0.1f*(singularity-pv[y/CELL-1][x/CELL]);
if (x+CELL>0)
{
pv[y/CELL][x/CELL-1] += 0.1f*(singularity-pv[y/CELL][x/CELL-1]);
if (y+CELL>0)
pv[y/CELL-1][x/CELL-1] += 0.1f*(singularity-pv[y/CELL-1][x/CELL-1]);
}
}
else
{
pv[y/CELL][x/CELL] += ptypes[t].hotair;
@ -1604,17 +1581,6 @@ void update_particles_i(pixel *vid, int start, int inc)
t = PT_NEUT;
create_part(i, x, y, t);
}
if ((t==PT_ISOZ||t==PT_ISZS) && 1>rand()%200 && ((int)(-4.0f*(pv[y/CELL][x/CELL])))>(rand()%1000))
{
t = PT_PHOT;
rr = (rand()%228+128)/127.0f;
rrr = (rand()%360)*3.14159f/180.0f;
parts[i].life = 680;
parts[i].ctype = 0x3FFFFFFF;
parts[i].vx = rr*cosf(rrr);
parts[i].vy = rr*sinf(rrr);
create_part(i, x, y, t);
}
if (!legacy_enable)
{
@ -1854,22 +1820,6 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
else if (t==PT_YEST)
{
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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_DYST && 1>(rand()%30) && !legacy_enable)
{
t = parts[i].type = PT_DYST;
}
}
}
else if (t==PT_NEUT)
{
rt = 3 + (int)pv[y/CELL][x/CELL];
@ -2033,165 +1983,6 @@ void update_particles_i(pixel *vid, int start, int inc)
ISLOLZ=1;
else if (t==PT_GRAV)
ISGRAV=1;
else if (t==PT_WARP)
{
for ( trade = 0; trade<5; trade ++)
{
nx = rand()%3-1;
ny = rand()%3-1;
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 (parts[r>>8].type!=PT_WARP&&parts[r>>8].type!=PT_STKM&&parts[r>>8].type!=PT_DMND&&parts[r>>8].type!=PT_CLNE&&parts[r>>8].type!=PT_BCLN&&parts[r>>8].type!=PT_PCLN&&(10>=rand()%200))
{
parts[i].x = parts[r>>8].x;
parts[i].y = parts[r>>8].y;
parts[r>>8].x = x;
parts[r>>8].y = y;
parts[i].life += 4;
trade = 5;
}
}
}
}
else if (t==PT_C5)
{
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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 ((parts[r>>8].temp<100 && parts[r>>8].type!=PT_C5)||parts[r>>8].type==PT_HFLM)
{
if (1>rand()%6)
{
t = parts[i].type = PT_HFLM;
parts[r>>8].temp = parts[i].temp = 0;
parts[i].life = rand()%150+50;
pv[y/CELL][x/CELL] += 1.5;
}
}
}
}
else if (t==PT_BOMB)
{
int nb;
if (parts[i].tmp==1) {
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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 (parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB) {
parts[i].type = PT_NONE;
goto killed;
}
}
} else if (parts[i].tmp==0) {
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; ny++)
if (x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES)
{
r = pmap[y+ny][x+nx];
if ((r>>8)>=NPART || !r)
continue;
if (parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB && parts[r>>8].type!=PT_DMND && parts[r>>8].type!=PT_CLNE && parts[r>>8].type!=PT_PCLN && parts[r>>8].type!=PT_BCLN) {
int rad = 8;
int nxi;
int nxj;
pmap[y][x] = 0;
for (nxj=-(rad+1); nxj<=(rad+1); nxj++)
for (nxi=-(rad+1); nxi<=(rad+1); nxi++)
if ((pow(nxi,2))/(pow((rad+1),2))+(pow(nxj,2))/(pow((rad+1),2))<=1) {
nb = create_part(-1, x+nxi, y+nxj, PT_BOMB);
if (nb!=-1) {
parts[nb].tmp = 1;
parts[nb].life = 50;
parts[nb].temp = MAX_TEMP;
parts[nb].vx = rand()%20-10;
parts[nb].vy = rand()%20-10;
}
}
for (nxj=-rad; nxj<=rad; nxj++)
for (nxi=-rad; nxi<=rad; nxi++)
if ((pow(nxi,2))/(pow(rad,2))+(pow(nxj,2))/(pow(rad,2))<=1)
if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN) {
delete_part(x+nxi, y+nxj);
pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f;
nb = create_part(-1, x+nxi, y+nxj, PT_BOMB);
if (nb!=-1) {
parts[nb].tmp = 2;
parts[nb].life = 2;
parts[nb].temp = MAX_TEMP;
}
}
//create_parts(x, y, 9, 9, PT_BOMB);
//create_parts(x, y, 8, 8, PT_NONE);
parts[i].type = PT_NONE;
goto killed;
}
}
}
}
else if (t==PT_FWRK)
{
if ((parts[i].temp>400&&(9+parts[i].temp/40)>rand()%100000&&parts[i].life==0&&!pmap[y-1][x])||parts[i].ctype==PT_DUST)
{
create_part(-1, x , y-1 , PT_FWRK);
r = pmap[y-1][x];
if ((r&0xFF)==PT_FWRK)
{
parts[r>>8].vy = rand()%8-22;
parts[r>>8].vx = rand()%20-rand()%20;
parts[r>>8].life=rand()%15+25;
t=parts[i].type=PT_NONE;
}
}
if (parts[i].life>1)
{
if (parts[i].life>=45&&parts[i].type==PT_FWRK)
parts[i].life=0;
}
if ((parts[i].life<3&&parts[i].life>0)||parts[i].vy>6&&parts[i].life>0)
{
int q = (rand()%255+1);
int w = (rand()%255+1);
int e = (rand()%255+1);
for (nx=-1; nx<2; nx++)
for (ny=-2; ny<3; ny++)
if (x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES)
{
if (5>=rand()%8)
{
if (!pmap[y+ny][x+nx])
{
create_part(-1, x+nx, y+ny , PT_DUST);
pv[y/CELL][x/CELL] += 2.00f*CFDS;
a= pmap[y+ny][x+nx];
if (parts[a>>8].type==PT_DUST)
{
parts[a>>8].vy = -(rand()%10-1);
parts[a>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ;
parts[a>>8].life= rand()%37+18;
parts[a>>8].tmp=q;
parts[a>>8].flags=w;
parts[a>>8].ctype=e;
parts[a>>8].temp= rand()%20+6000;
}
}
}
}
t=parts[i].type=PT_NONE;
}
}
else if (t==PT_FRZW)
{
for (nx=-1; nx<2; nx++)
@ -2241,430 +2032,6 @@ void update_particles_i(pixel *vid, int start, int inc)
}
}
}
else if (t==PT_PRTI)
{
int temprange = 100;
int count =0;
for ( temp = 0; temp < MAX_TEMP; temp += temprange)
if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
for (ny=-1; ny<2; ny++)
for (nx=-1; nx<2; nx++)
if (x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
count ++;
r = pmap[y+ny][x+nx];
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 ( nnx=0; nnx<80; nnx++)
if (!portal[parts[i].tmp][count-1][nnx])
{
portal[parts[i].tmp][count-1][nnx] = parts[r>>8].type;
portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>8].temp;
if (parts[r>>8].type==PT_SPRK)
parts[r>>8].type = parts[r>>8].ctype;
else
parts[r>>8].type = PT_NONE;
break;
}
}
}
else if (t==PT_PRTO)
{
int temprange = 100;
int count = 0;
for ( temp = 0; temp < MAX_TEMP; temp += temprange)
if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
for (ny=1; ny>-2; ny--)
for (nx=1; nx>-2; nx--)
if (x+nx>=0 && y+ny>0 &&
x+nx<XRES && y+ny<YRES && (nx || ny))
{
count ++;
r = pmap[y+ny][x+nx];
if ((r>>8)>=NPART || r)
continue;
if (!r)
{
for ( nnx =0 ; nnx<80; nnx++)
{
int randomness = count + rand()%3-1;
if (randomness<1)
randomness=1;
if (randomness>8)
randomness=8;
if (portal[parts[i].tmp][randomness-1][nnx]==PT_SPRK)//todo. make it look better
{
create_part(-1,x+1,y,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x+1,y+1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x+1,y-1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x,y-1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x,y+1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x-1,y+1,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x-1,y,portal[parts[i].tmp][randomness-1][nnx]);
create_part(-1,x-1,y-1,portal[parts[i].tmp][randomness-1][nnx]);
portal[parts[i].tmp][randomness-1][nnx] = 0;
portaltemp[parts[i].tmp][randomness-1][nnx] = 0;
break;
}
else if (portal[parts[i].tmp][randomness-1][nnx])
{
create_part(-1,x+nx,y+ny,portal[parts[i].tmp][randomness-1][nnx]);
parts[pmap[y+ny][x+nx]>>8].temp = portaltemp[parts[i].tmp][randomness-1][nnx];
portal[parts[i].tmp][randomness-1][nnx] = 0;
portaltemp[parts[i].tmp][randomness-1][nnx] = 0;
break;
}
}
}
}
}
else if (t==PT_WIFI)
{
int temprange = 100;
for ( temp = 0; temp < MAX_TEMP; temp += temprange)
if (parts[i].temp-73.15>temp&&parts[i].temp-73.15 <temp+temprange)
parts[i].tmp = temp/100;
for (ny=-1; ny<2; ny++)
for (nx=-1; nx<2; nx++)
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 (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_PSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
{
parts[r>>8].type = PT_SPRK;
parts[r>>8].ctype = PT_PSCN;
parts[r>>8].life = 4;
}
else if (parts[r>>8].type==PT_INWR&&parts[r>>8].life==0 && wireless[parts[i].tmp][0])
{
parts[r>>8].type = PT_SPRK;
parts[r>>8].ctype = PT_INWR;
parts[r>>8].life = 4;
}
else if (parts[r>>8].type==PT_SPRK && parts[r>>8].ctype!=PT_NSCN && parts[r>>8].life>=3 && !wireless[parts[i].tmp][0])
{
//parts[r>>8].type = parts[r>>8].ctype;
wireless[parts[i].tmp][0] = 1;
wireless[parts[i].tmp][1] = 1;
ISWIRE = 1;
}
}
}
else if (t==PT_SHLD1)
{
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;
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (7>rand()%200&&parts[i].life==0)
{
t = parts[i].type = PT_SHLD2;
parts[i].life = 7;
}
else if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
//parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
else if (parts[r>>8].type==PT_SHLD3&&4>rand()%10)
{
t = parts[i].type=PT_SHLD2;
parts[i].life = 7;
}
}
}
else if (t==PT_SHLD2)
{
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)
continue;
if (!r && parts[i].life>0)
create_part(-1,x+nx,y+ny,PT_SHLD1);
if (!r)
continue;
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (3>rand()%200&&parts[i].life==0)
{
t = parts[i].type = PT_SHLD3;
parts[i].life = 7;
}
else if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
else if (parts[r>>8].type==PT_SHLD4&&4>rand()%10)
{
t = parts[i].type=PT_SHLD3;
parts[i].life = 7;
}
}
}
else if (t==PT_SHLD3)
{
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)
continue;
if (!r)
{
if (1>rand()%2500)
{
create_part(-1,x+nx,y+ny,PT_SHLD1);
parts[pmap[y+ny][x+nx]>>8].life=7;
t = parts[i].type = PT_SHLD2;
}
else
continue;
}
if (parts[r>>8].type==PT_SHLD1 && parts[i].life>3)
{
parts[r>>8].type = PT_SHLD2;
parts[r>>8].life=7;
}
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (2>rand()%3000&&parts[i].life==0)
{
t = parts[i].type = PT_SHLD4;
parts[i].life = 7;
}
else if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
}
}
else if (t==PT_SHLD4)
{
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)
continue;
if (!r)
{
if (1>rand()%5500)
{
create_part(-1,x+nx,y+ny,PT_SHLD1);
parts[pmap[y+ny][x+nx]>>8].life=7;
t = parts[i].type = PT_SHLD2;
}
else
continue;
}
if (parts[r>>8].type==PT_SHLD2 && parts[i].life>3)
{
parts[r>>8].type = PT_SHLD3;
parts[r>>8].life = 7;
}
else if (parts[r>>8].type==PT_SPRK&&parts[i].life==0)
for ( nnx=-1; nnx<2; nnx++)
for ( nny=-1; nny<2; nny++)
{
if (!pmap[y+ny+nny][x+nx+nnx])
{
create_part(-1,x+nx+nnx,y+ny+nny,PT_SHLD1);
parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7;
}
}
}
}
else if (t==PT_AMTR)
{
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;
rt = parts[r>>8].type;
if ((r&0xFF)!=PT_AMTR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_NONE && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_BHOL && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO)
{
t = parts[i].life++;
if (parts[i].life==3)
{
parts[i].type = PT_NONE;
kill_part(i);
goto killed;
}
parts[r>>8].life = 0;
parts[r>>8].type = PT_NONE;
kill_part(r>>8);
if (2>(rand()/(RAND_MAX/100)))
create_part(-1, x+nx, y+ny, PT_PHOT);
pv[y/CELL][x/CELL] -= 5.0f;
//goto killed;
}
}
}
else if (t==PT_SING)
{
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 (parts[r>>8].type!=PT_DMND&&33>=rand()/(RAND_MAX/100)+1)
{
if (parts[r>>8].type==PT_SING && parts[r>>8].life >10)
{
if (parts[i].life+parts[r>>8].life > 255)
continue;
parts[i].life += parts[r>>8].life;
}
else
{
if (parts[i].life+3 > 255)
{
if (parts[r>>8].type!=PT_SING && 1>rand()%100)
{
parts[r>>8].type = PT_SING;
parts[r>>8].life = rand()%50+60;
}
continue;
}
parts[i].life += 3;
}
parts[i].temp = restrict_flt(parts[r>>8].temp+parts[i].temp, MIN_TEMP, MAX_TEMP);
parts[r>>8].type=PT_NONE;
}
}
}
else if (t==PT_FIRW) {
if (parts[i].tmp==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;
rt = parts[r>>8].type;
if (rt==PT_FIRE||rt==PT_PLSM||rt==PT_THDR)
{
parts[i].tmp = 1;
parts[i].life = rand()%50+60;
}
}
}
else if (parts[i].tmp==1) {
if (parts[i].life==0) {
parts[i].tmp=2;
} else {
float newVel = parts[i].life/25;
parts[i].flags = parts[i].flags&0xFFFFFFFE;
if ((pmap[(int)(ly-newVel)][(int)lx]&0xFF)==PT_NONE && ly-newVel>0) {
parts[i].vy = -newVel;
ly-=newVel;
iy-=newVel;
}
}
}
else if (parts[i].tmp==2) {
int col = rand()%200+4;
for (nx=-2; nx<3; nx++) {
for (ny=-2; ny<3; ny++) {
if (x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
{
int tmul = rand()%7;
create_part(-1, x+nx, y+ny, PT_FIRW);
r = pmap[y+ny][x+nx];
if ((r>>8)>=NPART || !r)
continue;
if (parts[r>>8].type==PT_FIRW) {
parts[r>>8].vx = (rand()%3-1)*tmul;
parts[r>>8].vy = (rand()%3-1)*tmul;
parts[r>>8].tmp = col;
parts[r>>8].life = rand()%100+100;
parts[r>>8].temp = 6000.0f;
}
}
}
}
pv[y/CELL][x/CELL] += 20;
kill_part(i);
goto killed;
} else if (parts[i].tmp>=3) {
if (parts[i].life<=0) {
kill_part(i);
goto killed;
}
}
}
else if (t==PT_BTRY)
{
rt = 3 + (int)pv[y/CELL][x/CELL];
for (nx=-2; nx<3; nx++)
for (ny=-2; ny<3; 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;
rt = parts[r>>8].type;
if (parts_avg(i,r>>8,PT_INSL) != PT_INSL)
{
if ((ptypes[rt].properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0 && abs(nx)+abs(ny) < 4)
{
parts[r>>8].life = 4;
parts[r>>8].ctype = rt;
parts[r>>8].type = PT_SPRK;
}
}
}
}
else if (t==PT_LCRY&&parts[i].life==10)
{
for (nx=-1; nx<2; nx++)
@ -2978,56 +2345,6 @@ killed:
if (parts[i].type == PT_NONE)
continue;
}
if (t==PT_CLNE)
{
if (!parts[i].ctype)
{
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 &&
pmap[y+ny][x+nx] &&
(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_STKM2 &&
(pmap[y+ny][x+nx]&0xFF)!=0xFF)
parts[i].ctype = pmap[y+ny][x+nx]&0xFF;
}
else {
create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
}
}
if (t==PT_BCLN)
{
if (!parts[i].ctype)
{
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 &&
pmap[y+ny][x+nx] &&
(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_STKM2 &&
(pmap[y+ny][x+nx]&0xFF)!=0xFF)
parts[i].ctype = pmap[y+ny][x+nx]&0xFF;
}
else {
create_part(-1, x+rand()%3-1, y+rand()%3-1, parts[i].ctype);
}
}
if (t==PT_YEST)
{
if (parts[i].temp>303&&parts[i].temp<317) {
create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_YEST);
}
}
if (t==PT_PLSM&&parts[i].ctype == PT_NBLE&&parts[i].life <=1)
{
parts[i].type = PT_NBLE;