From 1b35811bd4fe026ff270c25f0aaf063e3eb45dd6 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Wed, 19 Jan 2011 14:25:56 -0500 Subject: [PATCH] revert all limit changes, a little too glitchy, can be done later when current limit is reached. --- includes/defines.h | 3 - includes/powder.h | 84 +-- src/graphics.c | 32 +- src/interface.c | 2 +- src/main.c | 38 +- src/powder.c | 1699 ++++++++++++++++++++++---------------------- 6 files changed, 935 insertions(+), 923 deletions(-) diff --git a/includes/defines.h b/includes/defines.h index d44eb76ed..562ee0dc6 100644 --- a/includes/defines.h +++ b/includes/defines.h @@ -36,9 +36,6 @@ #define MAXSIGNS 16 #define TAG_MAX 256 -#define PS 8 //the particle number shift that also determines element limit -#define TYPE (int)pow(2,PS)-1 //where the type of the particle is stored in pmap - #define ZSIZE_D 16 #define ZFACTOR_D 8 extern unsigned char ZFACTOR; diff --git a/includes/powder.h b/includes/powder.h index baa7f679a..843ac0542 100644 --- a/includes/powder.h +++ b/includes/powder.h @@ -195,7 +195,7 @@ #define PT_TEST3 144 #define PT_FROG 145 #define PT_BRAN 146 -#define PT_NUM 147 //note for future elements, please SKIP numbers 222-240 and 255, these are walls. Element limit is now 4096 (experimental) +#define PT_NUM 147 #define R_TEMP 22 #define MAX_TEMP 9999 @@ -222,7 +222,7 @@ #define PROP_NEUTPASS 0x0200 //512 Neutrons pass through, such as with glass #define PROP_DEADLY 0x0400 //1024 Is deadly for stickman. #define PROP_HOT_GLOW 0x0800 //2048 Hot Metal Glow -#define PROP_LIFE 0x1000 //4096 Is a GoL type +#define PROP_LIFE 0x1000 //4096 Is a GoL type #define PROP_RADIOACTIVE 0x2000 //8192 Radioactive #define FLAG_STAGNANT 1 @@ -262,7 +262,7 @@ struct part_type unsigned char hconduct; const char *descs; const unsigned short properties; - int (*update_func) (int); + int (*update_func) (int); }; typedef struct part_type part_type; @@ -278,6 +278,7 @@ struct part_state int burn; float btemp; }; + typedef struct part_state part_state; //Should probably be const. /* Weight Help @@ -289,21 +290,21 @@ typedef struct part_state part_state; */ static const part_type ptypes[PT_NUM] = { - //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weight Section H Ins(real world, by triclops200) Description + //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Weight Section H Ins Description {"", PIXPACK(0x000000), 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_SPECIAL, R_TEMP+0.0f +273.15f, 251, "Erases particles.", 0, NULL}, {"DUST", PIXPACK(0xFFE0A0), 0.7f, 0.02f * CFDS, 0.96f, 0.80f, 0.0f, 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. Flammable.", TYPE_PART, NULL}, {"WATR", PIXPACK(0x2030D0), 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-2.0f +273.15f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires.", TYPE_LIQUID|PROP_CONDUCTS|PROP_NEUTPENETRATE, NULL}, - {"OIL", PIXPACK(0x404010), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 20, 0, 0, 5, 1, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", TYPE_LIQUID, NULL}, + {"OIL", PIXPACK(0x404010), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 20, 0, 0, 5, 1, 20, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Flammable.", TYPE_LIQUID, NULL}, {"FIRE", PIXPACK(0xFF1000), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, 2, SC_EXPLOSIVE, R_TEMP+400.0f+273.15f, 88, "Ignites flammable materials. Heats air.", TYPE_GAS, NULL}, {"STNE", PIXPACK(0xA0A0A0), 0.4f, 0.04f * CFDS, 0.94f, 0.95f, -0.1f, 0.3f, 0.00f, 0.000f * CFDS, 1, 0, 0, 5, 1, 1, 90, SC_POWDERS, R_TEMP+0.0f +273.15f, 150, "Heavy particles. Meltable.", TYPE_PART, NULL}, {"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}, + {"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}, - {"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}, - {"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", TYPE_SOLID, NULL}, + {"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}, + {"ICE", PIXPACK(0xA0C0FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, -0.0003f* CFDS, 0, 0, 0, 0, 20, 1, 100, SC_SOLIDS, R_TEMP-50.0f+273.15f, 46, "Solid. Freezes water. Crushes under pressure. Cools down air.", TYPE_SOLID, NULL}, {"METL", PIXPACK(0x404060), 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. Conducts electricity. Meltable.", TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW, NULL}, {"SPRK", PIXPACK(0xFFFF80), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.001f * CFDS, 0, 0, 0, 0, 1, 1, 100, SC_ELEC, R_TEMP+0.0f +273.15f, 251, "Electricity. Conducted by metal and water.", TYPE_SOLID, NULL}, {"SNOW", 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_POWDERS, R_TEMP-30.0f+273.15f, 46, "Light particles.", TYPE_PART, NULL}, @@ -323,11 +324,11 @@ static const part_type ptypes[PT_NUM] = {"BRMT", PIXPACK(0x705060), 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_POWDERS, R_TEMP+0.0f +273.15f, 211, "Broken metal.", TYPE_PART|PROP_CONDUCTS|PROP_HOT_GLOW, NULL}, {"PHOT", PIXPACK(0xFFFFFF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, -1, SC_ELEC, R_TEMP+900.0f+273.15f, 251, "Photons. Travel in straight lines.", TYPE_ENERGY, NULL}, {"URAN", PIXPACK(0x707020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, 90, SC_NUCLEAR, R_TEMP+30.0f+273.15f, 251, "Heavy particles. Generates heat under pressure.", TYPE_PART | PROP_RADIOACTIVE, NULL}, - {"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", TYPE_SOLID, NULL}, + {"WAX", PIXPACK(0xF0F0BB), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 10, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 44, "Wax. Melts at moderately high temperatures.", TYPE_SOLID, NULL}, {"MWAX", PIXPACK(0xE0E0AA), 0.3f, 0.02f * CFDS, 0.95f, 0.80f, 0.0f, 0.15f, 0.00f, 0.000001f* CFDS,2, 5, 0, 0, 2, 1, 25, SC_LIQUID, R_TEMP+28.0f+273.15f, 44, "Liquid Wax.", TYPE_LIQUID, NULL}, {"PSCN", PIXPACK(0x805050), 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, "P-Type Silicon, Will transfer current to any conductor.", TYPE_SOLID | PROP_CONDUCTS, NULL}, {"NSCN", PIXPACK(0x505080), 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, "N-Type Silicon, Will only transfer current to P-Type Silicon.", TYPE_SOLID | PROP_CONDUCTS, NULL}, - {"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", TYPE_LIQUID, NULL}, + {"LN2", PIXPACK(0x80A0DF), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 0, 1, 30, SC_LIQUID, 70.15f, 70, "Liquid Nitrogen. Very cold.", TYPE_LIQUID, NULL}, {"INSL", PIXPACK(0x9EA3B6), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 7, 0, 0, 10, 1, 100, SC_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Insulator, does not conduct heat or electricity.", TYPE_SOLID, NULL}, {"BHOL", PIXPACK(0x202020), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, -0.01f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP+70.0f+273.15f, 255, "Black hole, sucks in other particles and heats up.", TYPE_SOLID, NULL}, {"WHOL", PIXPACK(0xEFEFEF), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.010f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_SPECIAL, R_TEMP-16.0f+273.15f, 255, "White hole, pushes other particles away.", TYPE_SOLID, NULL}, @@ -350,8 +351,8 @@ static const part_type ptypes[PT_NUM] = {"SMKE", PIXPACK(0x222222), 0.9f, 0.04f * CFDS, 0.97f, 0.20f, 0.0f, -0.1f, 0.00f, 0.001f * CFDS, 1, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+320.0f+273.15f, 88, "Smoke", TYPE_GAS, NULL}, {"DESL", PIXPACK(0x440000), 1.0f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.0f, 0.0f * CFDS, 2, 2, 0, 0, 5, 1, 15, SC_LIQUID, R_TEMP+0.0f +273.15f, 42, "Liquid. Explodes under high pressure and temperatures", TYPE_LIQUID, NULL}, {"COAL", PIXPACK(0x222222), 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.", TYPE_SOLID, NULL}, - {"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}, + {"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}, {"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}, @@ -366,8 +367,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, NULL}, {"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, NULL}, {"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, NULL}, - {"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 | PROP_CONDUCTS, NULL}, - {"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, NULL}, + {"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 electrolysis of WATR", TYPE_SOLID | PROP_CONDUCTS, NULL}, + {"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, NULL}, {"GOL ", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Game Of Life! B3/S23", TYPE_SOLID|PROP_LIFE, NULL}, {"HLIF", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "High Life! B36/S23", TYPE_SOLID|PROP_LIFE, NULL}, {"ASIM", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Assimilation! B345/S4567", TYPE_SOLID|PROP_LIFE, NULL}, @@ -380,22 +381,22 @@ static const part_type ptypes[PT_NUM] = {"34 ", PIXPACK(0x500050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "34! B34/S34)", TYPE_SOLID|PROP_LIFE, NULL}, {"LLIF", PIXPACK(0x505050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Long Life! B345/S5", TYPE_SOLID|PROP_LIFE, NULL}, {"STAN", PIXPACK(0x5000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "Stains! B3678/S235678", TYPE_SOLID|PROP_LIFE, NULL}, - {"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.",TYPE_SOLID, NULL}, - {"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, NULL}, - {"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, NULL}, + {"SPNG", PIXPACK(0xFFBE30), 0.00f, 0.00f * CFDS, 0.00f, 1.00f, 0.00f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 1, 30, 1, 100, SC_SOLIDS, R_TEMP+0.0f +273.15f, 251, "A sponge, absorbs water.",TYPE_SOLID, NULL}, + {"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, NULL}, + {"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, 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, NULL}, - {"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, 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, NULL}, + {"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, 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, NULL}, {"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}, {"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, NULL}, - {"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, NULL}, - {"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}, - {"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, NULL}, + {"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, NULL}, + {"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}, + {"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, NULL}, {"BIZR", 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, "Bizarre... contradicts the normal state changes.", TYPE_LIQUID, NULL}, - {"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}, + {"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, 0, 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}, @@ -406,24 +407,24 @@ 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, NULL}, {"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, NULL}, {"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 | PROP_NEUTPASS, NULL}, - {"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}, - {"SPW2", 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, "Stickman2 spawnpoint", 0, NULL}, - {"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_SPECIAL, R_TEMP+0.0f +273.15f, 0, "Stickman spawnpoint", 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", TYPE_SOLID, 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", TYPE_SOLID, 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", TYPE_SOLID, 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", TYPE_SOLID, NULL}, - {"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}, + {"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, NULL}, + {"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, 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, 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}, + {"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}, {"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, NULL}, {"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, 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, 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}, + {"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}, - {"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}, + {"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}, {"MAZE", PIXPACK(0xA8E4A0), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B3/S12345", TYPE_SOLID|PROP_LIFE, NULL}, {"COAG", PIXPACK(0x9ACD32), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B378/S235678", TYPE_SOLID|PROP_LIFE, NULL}, @@ -431,13 +432,13 @@ static const part_type ptypes[PT_NUM] = {"GNAR", PIXPACK(0xE5B73B), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B1/S1", TYPE_SOLID|PROP_LIFE, NULL}, {"REPL", PIXPACK(0x259588), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B1357/S1357", TYPE_SOLID|PROP_LIFE, NULL}, {"MYST", PIXPACK(0x0C3C00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE, 9000.0f, 40, "B3458/S05678", TYPE_SOLID|PROP_LIFE, NULL}, - {"BOYL", PIXPACK(0x0A3200), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.18f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Boyle, variable pressure gas. Expands when heated.", TYPE_GAS, NULL}, + {"BOYL", PIXPACK(0x0A3200), 1.0f, 0.01f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 0.18f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Boyle, variable pressure gas. Expands when heated.", TYPE_GAS, NULL}, {"LOTE", PIXPACK(0xFF0000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE2, 9000.0f, 40, "Behaves kinda like Living on the Edge S3458/B37/4", TYPE_SOLID|PROP_LIFE, NULL}, {"FRG2", PIXPACK(0x00FF00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE2, 9000.0f, 40, "Like Frogs rule S124/B3/3", TYPE_SOLID|PROP_LIFE, NULL}, {"STAR", PIXPACK(0x0000FF), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE2, 9000.0f, 40, "Like Star Wars rule S3456/B278/6", TYPE_SOLID|PROP_LIFE, NULL}, {"FROG", PIXPACK(0x00AA00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE2, 9000.0f, 40, "Frogs S12/B34/3", TYPE_SOLID|PROP_LIFE, NULL}, {"BRAN", PIXPACK(0xCCCC00), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 100, SC_LIFE2, 9000.0f, 40, "Brian 6 S6/B246/3", TYPE_SOLID|PROP_LIFE, NULL}, - //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 Description }; static part_state pstates[PT_NUM] = @@ -533,7 +534,7 @@ static part_state pstates[PT_NUM] = /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - /* SPNG */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 2730.0f}, + /* SPNG */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 2730.0f}, /* RIME */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 273.15f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* FOG */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* BCLN */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, @@ -590,7 +591,6 @@ static part_state pstates[PT_NUM] = /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, /* GOL */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f}, - }; static int grule[NGOL][10] = { diff --git a/src/graphics.c b/src/graphics.c index ce6c561d2..286182aff 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -447,7 +447,7 @@ void draw_tool(pixel *vid_buf, int b, int sl, int sr, unsigned pc, unsigned iswa int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc) { int i, j, c; - if(b>=UI_WALLSTART && b<=UI_WALLSTART+UI_WALLCOUNT) + if(b>=UI_WALLSTART) { b = b-100; //x = (2+32*((b-22)/1)); @@ -1451,13 +1451,13 @@ void draw_parts(pixel *vid) } else { - cr = PIXR(ptypes[t].pcolors); - cg = PIXG(ptypes[t].pcolors); - cb = PIXB(ptypes[t].pcolors); - blendpixel(vid, nx, ny, cr, cg, cb, 255); + 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) + } + else if(cmode==CM_GRAD)//forgot to put else, broke nothing view { float frequency = 0.05; int q = parts[i].temp-40; @@ -2073,7 +2073,7 @@ void draw_parts(pixel *vid) blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32); blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32); } - } + } else if(t==PT_FILT) { int temp_bin = (int)((parts[i].temp-273.0f)*0.025f); @@ -2901,8 +2901,8 @@ void render_signs(pixel *vid_buf) } if(strcmp(signs[i].text, "{t}")==0) { - if((pmap[signs[i].y][signs[i].x]>>PS)>0 && (pmap[signs[i].y][signs[i].x]>>PS)>PS].temp-273.15); //...tempirature + if((pmap[signs[i].y][signs[i].x]>>8)>0 && (pmap[signs[i].y][signs[i].x]>>8)>8].temp-273.15); //...tempirature else sprintf(buff, "Temp: 0.00"); //...tempirature drawtext(vid_buf, x+3, y+3, buff, 255, 255, 255, 255); @@ -3160,12 +3160,12 @@ pixel *prerender_save(void *save, int size, int *width, int *height) if(!(j%2) && !(i%2)) fb[(ry+j)*w+(rx+i)] = PIXPACK(0xC0C0C0); break; - case 4: - for(j=0; j>1)&1; i>1)&1; i>1)&1; i=UI_WALLSTART&&h<=UI_WALLSTART+UI_WALLCOUNT)) + else if(i==SC_WALL||(i==SC_SPECIAL&&h>=UI_WALLSTART)) { drawtext(vid_buf, XRES-textwidth((char *)mwalls[h-UI_WALLSTART].descs)-BARSIZE, sy-10, (char *)mwalls[h-UI_WALLSTART].descs, 255, 255, 255, 255); } diff --git a/src/main.c b/src/main.c index 1e7a6c514..ba20752d9 100644 --- a/src/main.c +++ b/src/main.c @@ -496,7 +496,7 @@ int parse_save(void *save, int size, int replace, int x0, int y0) { x = (int)(parts[i].x+0.5f); y = (int)(parts[i].y+0.5f); - pmap[y][x] = (i<>PS; + k = pmap[y][x]>>8; parts[k].type = j; if(j == PT_PHOT) parts[k].ctype = 0x3fffffff; @@ -1249,7 +1249,7 @@ int main(int argc, char *argv[]) if(!sys_pause||framerender) { - update_air(); + update_air(); } #ifdef OpenGL ClearScreen(); @@ -1701,7 +1701,7 @@ int main(int argc, char *argv[]) bsx = 1180; if(bsx<0) bsx = 0; - if(bsy>1180) + if(bsy>1180) bsy = 1180; if(bsy<0) bsy = 0; @@ -1747,28 +1747,28 @@ int main(int argc, char *argv[]) }else{ cr = pmap[y/sdl_scale][x/sdl_scale]; } - if(!((cr>>PS)>=NPART || !cr)) + if(!((cr>>8)>=NPART || !cr)) { #ifdef BETA if(DEBUG_MODE) { - int tctype = parts[cr>>PS].ctype; + int tctype = parts[cr>>8].ctype; if(tctype>=PT_NUM) tctype = 0; - sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&TYPE].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>PS].temp-273.15f, parts[cr>>PS].life); - //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&TYPE].name, ptypes[parts[cr>>PS].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>PS].temp-273.15f, parts[cr>>PS].life); + sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); + //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); } else - sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&TYPE].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>PS].temp-273.15f, parts[cr>>PS].life); + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); #else if(DEBUG_MODE) { - int tctype = parts[cr>>PS].ctype; + int tctype = parts[cr>>8].ctype; if(tctype>=PT_NUM) tctype = 0; - sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d,tmp: %d", ptypes[cr&TYPE].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>PS].temp-273.15f, parts[cr>>PS].life,parts[cr>>PS].tmp); - //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&TYPE].name, ptypes[parts[cr>>PS].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>PS].temp-273.15f, parts[cr>>PS].life); + sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d,tmp: %d", ptypes[cr&0xFF].name, ptypes[tctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life,parts[cr>>8].tmp); + //sprintf(heattext, "%s (%s), Pressure: %3.2f, Temp: %4.2f C, Life: %d", ptypes[cr&0xFF].name, ptypes[parts[cr>>8].ctype].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f, parts[cr>>8].life); } else { - sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&TYPE].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>PS].temp-273.15f); + sprintf(heattext, "%s, Pressure: %3.2f, Temp: %4.2f C", ptypes[cr&0xFF].name, pv[(y/sdl_scale)/CELL][(x/sdl_scale)/CELL], parts[cr>>8].temp-273.15f); } #endif } @@ -2076,9 +2076,6 @@ int main(int argc, char *argv[]) memset(bmap, 0, sizeof(bmap)); memset(emap, 0, sizeof(emap)); memset(parts, 0, sizeof(particle)*NPART); - memset(photons, 0,sizeof(photons)); - memset(wireless, 0, sizeof(wireless)); - memset(gol2, 0, sizeof(gol2)); for(i=0; i=19 && x<=35 && svf_last && svf_open && !bq){ //int tpval = sys_pause; parse_save(svf_last, svf_lsize, 1, 0, 0); - memset(wireless, 0, sizeof(wireless)); + for(j= 0;j<99;j++){ //reset wifi on reload + wireless[j][0] = 0; + wireless[j][1] = 0; + } //sys_pause = tpval; } if(x>=(XRES+BARSIZE-(510-476)) && x<=(XRES+BARSIZE-(510-491)) && !bq) @@ -2235,9 +2235,9 @@ int main(int argc, char *argv[]) { int cr; cr = pmap[y][x]; - if(!((cr>>PS)>=NPART || !cr)) + if(!((cr>>8)>=NPART || !cr)) { - c = sl = cr&TYPE; + c = sl = cr&0xFF; } else { diff --git a/src/powder.c b/src/powder.c index c38b475ac..2d9a6d014 100644 --- a/src/powder.c +++ b/src/powder.c @@ -29,7 +29,7 @@ unsigned photons[YRES][XRES]; static int pn_junction_sprk(int x, int y, int pt) { unsigned r = pmap[y][x]; - if((r & TYPE) != pt) + if((r & 0xFF) != pt) return 0; r >>= 8; if(parts[r].type != pt) @@ -47,11 +47,11 @@ static void photoelectric_effect(int nx, int ny) { unsigned r = pmap[ny][nx]; - if((r&TYPE) == PT_PSCN) { - if((pmap[ny][nx-1] & TYPE) == PT_NSCN || - (pmap[ny][nx+1] & TYPE) == PT_NSCN || - (pmap[ny-1][nx] & TYPE) == PT_NSCN || - (pmap[ny+1][nx] & TYPE) == PT_NSCN) + if((r&0xFF) == PT_PSCN) { + if((pmap[ny][nx-1] & 0xFF) == PT_NSCN || + (pmap[ny][nx+1] & 0xFF) == PT_NSCN || + (pmap[ny-1][nx] & 0xFF) == PT_NSCN || + (pmap[ny+1][nx] & 0xFF) == PT_NSCN) pn_junction_sprk(nx, ny, PT_PSCN); } } @@ -69,30 +69,30 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) return 0; r = pmap[ny][nx]; - if(r && (r>>PS)>PS].type; + if(r && (r>>8)>8].type; if(rr) *rr = r; - if((r&TYPE)==PT_VOID || (r&TYPE)==PT_BHOL) + if((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL) return 1; if(pt==PT_PHOT&&( - (r&TYPE)==PT_GLAS || (r&TYPE)==PT_PHOT || - (r&TYPE)==PT_CLNE || (r&TYPE)==PT_PCLN || - (r&TYPE)==PT_GLOW || (r&TYPE)==PT_WATR || - (r&TYPE)==PT_DSTW || (r&TYPE)==PT_SLTW || - (r&TYPE)==PT_ISOZ || (r&TYPE)==PT_ISZS || - (r&TYPE)==PT_FILT || (r&TYPE)==PT_INVIS || - (r&TYPE)==PT_QRTZ || (r&TYPE)==PT_PQRT || - ((r&TYPE)==PT_LCRY&&parts[r>>PS].life > 5))) + (r&0xFF)==PT_GLAS || (r&0xFF)==PT_PHOT || + (r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || + (r&0xFF)==PT_GLOW || (r&0xFF)==PT_WATR || + (r&0xFF)==PT_DSTW || (r&0xFF)==PT_SLTW || + (r&0xFF)==PT_ISOZ || (r&0xFF)==PT_ISZS || + (r&0xFF)==PT_FILT || (r&0xFF)==PT_INVIS || + (r&0xFF)==PT_QRTZ || (r&0xFF)==PT_PQRT || + ((r&0xFF)==PT_LCRY&&parts[r>>8].life > 5))) return 2; if(pt==PT_STKM) //Stick man's head shouldn't collide return 2; if(pt==PT_STKM2) //Stick man's head shouldn't collide return 2; - if((pt==PT_BIZR||pt==PT_BIZRG)&&(r&TYPE)==PT_FILT) + if((pt==PT_BIZR||pt==PT_BIZRG)&&(r&0xFF)==PT_FILT) return 2; if(bmap[ny/CELL][nx/CELL]==WL_ALLOWGAS && ptypes[pt].falldown!=0 && pt!=PT_FIRE && pt!=PT_SMKE) return 0; @@ -107,19 +107,19 @@ static int eval_move(int pt, int nx, int ny, unsigned *rr) if(ptypes[pt].falldown!=1 && bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID) return 0; - if(r && (r&TYPE) < PT_NUM){ - if(ptypes[pt].properties&TYPE_ENERGY && ptypes[(r&TYPE)].properties&TYPE_ENERGY) + if(r && (r&0xFF) < PT_NUM){ + if(ptypes[pt].properties&TYPE_ENERGY && ptypes[(r&0xFF)].properties&TYPE_ENERGY) return 2; - if(pt==PT_NEUT && ptypes[(r&TYPE)].properties&PROP_NEUTPASS) + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPASS) return 2; - if(pt==PT_NEUT && ptypes[(r&TYPE)].properties&PROP_NEUTPENETRATE) + if(pt==PT_NEUT && ptypes[(r&0xFF)].properties&PROP_NEUTPENETRATE) return 1; - if((r&TYPE)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) + if((r&0xFF)==PT_NEUT && ptypes[pt].properties&PROP_NEUTPENETRATE) return 0; } - if (r && ((r&TYPE) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&TYPE)].weight))) + if (r && ((r&0xFF) >= PT_NUM || (ptypes[pt].weight <= ptypes[(r&0xFF)].weight))) return 0; if(pt == PT_PHOT) @@ -140,56 +140,56 @@ int try_move(int i, int x, int y, int nx, int ny) e = eval_move(parts[i].type, nx, ny, &r); - if((pmap[ny][nx]&TYPE)==PT_BOMB && parts[i].type==PT_BOMB && parts[i].tmp == 1) + if((pmap[ny][nx]&0xFF)==PT_BOMB && parts[i].type==PT_BOMB && parts[i].tmp == 1) e = 2; - if((pmap[ny][nx]&TYPE)==PT_INVIS && (pv[ny/CELL][nx/CELL]>4.0f ||pv[ny/CELL][nx/CELL]<-4.0f)) + if((pmap[ny][nx]&0xFF)==PT_INVIS && (pv[ny/CELL][nx/CELL]>4.0f ||pv[ny/CELL][nx/CELL]<-4.0f)) return 1; /* half-silvered mirror */ if(!e && parts[i].type==PT_PHOT && - (((r&TYPE)==PT_BMTL && rand()>PS].temp = parts[i].temp; + if((r & 0xFF) == PT_COAL || (r & 0xFF) == PT_BCOL) + parts[r>>8].temp = parts[i].temp; - if((r & TYPE) < PT_NUM && ptypes[r&TYPE].hconduct) - parts[i].temp = parts[r>>PS].temp = restrict_flt((parts[r>>PS].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); + if((r & 0xFF) < PT_NUM && ptypes[r&0xFF].hconduct) + parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP); } return 0; } if(e == 2) { - if(parts[i].type == PT_PHOT && (r&TYPE)==PT_GLOW && !parts[r>>PS].life) + if(parts[i].type == PT_PHOT && (r&0xFF)==PT_GLOW && !parts[r>>8].life) if(rand() < RAND_MAX/30) { - parts[r>>PS].life = 120; + parts[r>>8].life = 120; create_gain_photon(i); } - if(parts[i].type == PT_PHOT && (r&TYPE)==PT_FILT) + if(parts[i].type == PT_PHOT && (r&0xFF)==PT_FILT) { - int temp_bin = (int)((parts[r>>PS].temp-273.0f)*0.025f); + int temp_bin = (int)((parts[r>>8].temp-273.0f)*0.025f); if(temp_bin < 0) temp_bin = 0; if(temp_bin > 25) temp_bin = 25; parts[i].ctype = 0x1F << temp_bin; } - if(parts[i].type == PT_NEUT && (r&TYPE)==PT_GLAS) { + if(parts[i].type == PT_NEUT && (r&0xFF)==PT_GLAS) { if(rand() < RAND_MAX/10) create_cherenkov_photon(i); } - if(parts[i].type == PT_PHOT && (r&TYPE)==PT_INVIS) { + if(parts[i].type == PT_PHOT && (r&0xFF)==PT_INVIS) { parts[i].type = PT_NEUT; parts[i].ctype = 0; } - if((parts[i].type==PT_BIZR||parts[i].type==PT_BIZRG) && (r&TYPE)==PT_FILT) + if((parts[i].type==PT_BIZR||parts[i].type==PT_BIZRG) && (r&0xFF)==PT_FILT) { - int temp_bin = (int)((parts[r>>PS].temp-273.0f)*0.025f); + int temp_bin = (int)((parts[r>>8].temp-273.0f)*0.025f); if(temp_bin < 0) temp_bin = 0; if(temp_bin > 25) temp_bin = 25; parts[i].ctype = 0x1F << temp_bin; @@ -197,7 +197,7 @@ int try_move(int i, int x, int y, int nx, int ny) return 1; } - if((r&TYPE)==PT_VOID) + if((r&0xFF)==PT_VOID) { if(parts[i].type == PT_STKM) { @@ -212,7 +212,7 @@ int try_move(int i, int x, int y, int nx, int ny) parts[i].type=PT_NONE; return 0; } - if((r&TYPE)==PT_BHOL) + if((r&0xFF)==PT_BHOL) { if(parts[i].type == PT_STKM) { @@ -227,14 +227,14 @@ int try_move(int i, int x, int y, int nx, int ny) parts[i].type=PT_NONE; if(!legacy_enable) { - parts[r>>PS].temp = restrict_flt(parts[r>>PS].temp+parts[i].temp/2, MIN_TEMP, MAX_TEMP);//3.0f; + parts[r>>8].temp = restrict_flt(parts[r>>8].temp+parts[i].temp/2, MIN_TEMP, MAX_TEMP);//3.0f; } return 0; } - if((pmap[ny][nx]&TYPE)==PT_CNCT) + if((pmap[ny][nx]&0xFF)==PT_CNCT) return 0; - if(parts[i].type==PT_CNCT && y>PS)>8)>PS; + e = r >> 8; if(r && e=XRES || y>=YRES) return 0; - if((pmap[y][x] & TYPE) == PT_GLAS) + if((pmap[y][x] & 0xFF) == PT_GLAS) return 1; return 0; } @@ -422,12 +422,8 @@ void kill_part(int i) { ISSPAWN2 = 0; } - if (x>=0 && y>=0 && x>PS)==i) - pmap[y][x] = 0; - else if ((photons[y][x]>>PS)==i) - photons[y][x] = 0; - } + if(x>=0 && y>=0 && x>PS].temp>8].temp>PS].temp = restrict_flt(parts[pmap[y][x]>>PS].temp + 0.1f, MIN_TEMP, MAX_TEMP); + if((pmap[y][x]&0xFF)==PT_PUMP) { + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 0.1f, MIN_TEMP, MAX_TEMP); } else if((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))) { - parts[pmap[y][x]>>PS].temp = restrict_flt(parts[pmap[y][x]>>PS].temp + 50.0f, MIN_TEMP, MAX_TEMP); + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 50.0f, MIN_TEMP, MAX_TEMP); } else { - parts[pmap[y][x]>>PS].temp = restrict_flt(parts[pmap[y][x]>>PS].temp + 4.0f, MIN_TEMP, MAX_TEMP); + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 4.0f, MIN_TEMP, MAX_TEMP); } } - if(t==SPC_COOL&&parts[pmap[y][x]>>PS].temp>MIN_TEMP) + if(t==SPC_COOL&&parts[pmap[y][x]>>8].temp>MIN_TEMP) { - if((pmap[y][x]&TYPE)==PT_PUMP) { - parts[pmap[y][x]>>PS].temp = restrict_flt(parts[pmap[y][x]>>PS].temp - 0.1f, MIN_TEMP, MAX_TEMP); + if((pmap[y][x]&0xFF)==PT_PUMP) { + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 0.1f, MIN_TEMP, MAX_TEMP); } else if((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))) { - parts[pmap[y][x]>>PS].temp = restrict_flt(parts[pmap[y][x]>>PS].temp - 50.0f, MIN_TEMP, MAX_TEMP); + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 50.0f, MIN_TEMP, MAX_TEMP); } else { - parts[pmap[y][x]>>PS].temp = restrict_flt(parts[pmap[y][x]>>PS].temp - 4.0f, MIN_TEMP, MAX_TEMP); + parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 4.0f, MIN_TEMP, MAX_TEMP); } } - return pmap[y][x]>>PS; + return pmap[y][x]>>8; } else { @@ -546,30 +542,30 @@ inline int create_part(int p, int x, int y, int t) if(t==PT_SPRK) { - if((pmap[y][x]&TYPE)!=PT_METL && - (pmap[y][x]&TYPE)!=PT_PSCN && - (pmap[y][x]&TYPE)!=PT_NSCN && - (pmap[y][x]&TYPE)!=PT_NTCT && - (pmap[y][x]&TYPE)!=PT_PTCT && - (pmap[y][x]&TYPE)!=PT_WATR && - (pmap[y][x]&TYPE)!=PT_SLTW && - (pmap[y][x]&TYPE)!=PT_BMTL && - (pmap[y][x]&TYPE)!=PT_RBDM && - (pmap[y][x]&TYPE)!=PT_LRBD && - (pmap[y][x]&TYPE)!=PT_ETRD && - (pmap[y][x]&TYPE)!=PT_BRMT && - (pmap[y][x]&TYPE)!=PT_NBLE && - (pmap[y][x]&TYPE)!=PT_IRON && - (pmap[y][x]&TYPE)!=PT_INST && - (pmap[y][x]&TYPE)!=PT_INWR) + if((pmap[y][x]&0xFF)!=PT_METL && + (pmap[y][x]&0xFF)!=PT_PSCN && + (pmap[y][x]&0xFF)!=PT_NSCN && + (pmap[y][x]&0xFF)!=PT_NTCT && + (pmap[y][x]&0xFF)!=PT_PTCT && + (pmap[y][x]&0xFF)!=PT_WATR && + (pmap[y][x]&0xFF)!=PT_SLTW && + (pmap[y][x]&0xFF)!=PT_BMTL && + (pmap[y][x]&0xFF)!=PT_RBDM && + (pmap[y][x]&0xFF)!=PT_LRBD && + (pmap[y][x]&0xFF)!=PT_ETRD && + (pmap[y][x]&0xFF)!=PT_BRMT && + (pmap[y][x]&0xFF)!=PT_NBLE && + (pmap[y][x]&0xFF)!=PT_IRON && + (pmap[y][x]&0xFF)!=PT_INST && + (pmap[y][x]&0xFF)!=PT_INWR) return -1; - if(parts[pmap[y][x]>>PS].life!=0) + if(parts[pmap[y][x]>>8].life!=0) return -1; - parts[pmap[y][x]>>PS].type = PT_SPRK; - parts[pmap[y][x]>>PS].life = 4; - parts[pmap[y][x]>>PS].ctype = pmap[y][x]&TYPE; - pmap[y][x] = (pmap[y][x]&~TYPE) | PT_SPRK; - return pmap[y][x]>>PS; + parts[pmap[y][x]>>8].type = PT_SPRK; + parts[pmap[y][x]>>8].life = 4; + parts[pmap[y][x]>>8].ctype = pmap[y][x]&0xFF; + pmap[y][x] = (pmap[y][x]&~0xFF) | PT_SPRK; + return pmap[y][x]>>8; } if(t==PT_SPAWN&&ISSPAWN1) return -1; @@ -579,7 +575,7 @@ inline int create_part(int p, int x, int y, int t) { if(pmap[y][x]) { - if((pmap[y][x]&TYPE)!=PT_SPAWN&&(pmap[y][x]&TYPE)!=PT_SPAWN2) + if((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2) { if(t!=PT_STKM&&t!=PT_STKM2) { @@ -598,14 +594,14 @@ inline int create_part(int p, int x, int y, int t) { if(pmap[y][x]) { - if(((pmap[y][x]&TYPE)==PT_CLNE||(pmap[y][x]&TYPE)==PT_BCLN||(pmap[y][x]&TYPE)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN&&t!=PT_STKM&&t!=PT_STKM2)) + if(((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||(pmap[y][x]&0xFF)==PT_PCLN)&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN&&t!=PT_STKM&&t!=PT_STKM2)) { - parts[pmap[y][x]>>PS].ctype = t; + parts[pmap[y][x]>>8].ctype = t; } return -1; - } - if(photons[y][x] && t==PT_PHOT) - return -1; + } + if(photons[y][x] && t==PT_PHOT) + return -1; if(pfree == -1) return -1; i = pfree; @@ -715,117 +711,129 @@ inline int create_part(int p, int x, int y, int t) if(t==PT_BIZR||t==PT_BIZRG) parts[i].ctype = 0x47FFFF; if(t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT) is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP - pmap[y][x] = t|(i<>PS].type = PT_STKM; - parts[pmap[y][x]>>PS].vx = 0; - parts[pmap[y][x]>>PS].vy = 0; - parts[pmap[y][x]>>PS].life = 100; - parts[pmap[y][x]>>PS].ctype = 0; - parts[pmap[y][x]>>PS].temp = ptypes[t].heat; - - } - else - { - parts[i].x = (float)x; - parts[i].y = (float)y; - parts[i].type = PT_STKM; - parts[i].vx = 0; - parts[i].vy = 0; - parts[i].life = 100; - parts[i].ctype = 0; - parts[i].temp = ptypes[t].heat; - } - - - + if(pmap[y][x]&0xFF==PT_SPAWN) + { + parts[pmap[y][x]>>8].type = PT_STKM; + parts[pmap[y][x]>>8].vx = 0; + parts[pmap[y][x]>>8].vy = 0; + parts[pmap[y][x]>>8].life = 100; + parts[pmap[y][x]>>8].ctype = 0; + parts[pmap[y][x]>>8].temp = ptypes[t].heat; + + } + else + { + parts[i].x = (float)x; + parts[i].y = (float)y; + parts[i].type = PT_STKM; + parts[i].vx = 0; + parts[i].vy = 0; + parts[i].life = 100; + parts[i].ctype = 0; + parts[i].temp = ptypes[t].heat; + } + + + player[3] = x-1; //Setting legs positions player[4] = y+6; player[5] = x-1; player[6] = y+6; - + player[7] = x-3; player[8] = y+12; player[9] = x-3; player[10] = y+12; - + player[11] = x+1; player[12] = y+6; player[13] = x+1; player[14] = y+6; - + player[15] = x+3; player[16] = y+12; player[17] = x+3; player[18] = y+12; - + isplayer = 1; } + else + { + return -1; + } //kill_part(playerspawn); create_part(-1,x,y,PT_SPAWN); ISSPAWN1 = 1; } - else if(t==PT_STKM2) + if(t==PT_STKM2) { if(isplayer2==0) { - if(pmap[y][x]&TYPE==PT_SPAWN2) - { - parts[pmap[y][x]>>PS].type = PT_STKM2; - parts[pmap[y][x]>>PS].vx = 0; - parts[pmap[y][x]>>PS].vy = 0; - parts[pmap[y][x]>>PS].life = 100; - parts[pmap[y][x]>>PS].ctype = 0; - parts[pmap[y][x]>>PS].temp = ptypes[t].heat; - - } - else - { - parts[i].x = (float)x; - parts[i].y = (float)y; - parts[i].type = PT_STKM2; - parts[i].vx = 0; - parts[i].vy = 0; - parts[i].life = 100; - parts[i].ctype = 0; - parts[i].temp = ptypes[t].heat; - } - - - + if(pmap[y][x]&0xFF==PT_SPAWN2) + { + parts[pmap[y][x]>>8].type = PT_STKM2; + parts[pmap[y][x]>>8].vx = 0; + parts[pmap[y][x]>>8].vy = 0; + parts[pmap[y][x]>>8].life = 100; + parts[pmap[y][x]>>8].ctype = 0; + parts[pmap[y][x]>>8].temp = ptypes[t].heat; + + } + else + { + parts[i].x = (float)x; + parts[i].y = (float)y; + parts[i].type = PT_STKM2; + parts[i].vx = 0; + parts[i].vy = 0; + parts[i].life = 100; + parts[i].ctype = 0; + parts[i].temp = ptypes[t].heat; + } + + + player2[3] = x-1; //Setting legs positions player2[4] = y+6; player2[5] = x-1; player2[6] = y+6; - + player2[7] = x-3; player2[8] = y+12; player2[9] = x-3; player2[10] = y+12; - + player2[11] = x+1; player2[12] = y+6; player2[13] = x+1; player2[14] = y+6; - + player2[15] = x+3; player2[16] = y+12; player2[17] = x+3; player2[18] = y+12; - + isplayer2 = 1; } + else + { + return -1; + } //kill_part(player2spawn); create_part(-1,x,y,PT_SPAWN2); ISSPAWN2 = 1; } + if(t==PT_BIZR||t==PT_BIZRG) + parts[i].ctype = 0x47FFFF; + if(t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT)// && t!=PT_NEUT) is this needed? it breaks floodfill, Yes photons should not be placed in the PMAP + pmap[y][x] = t|(i<<8); return i; } @@ -855,7 +863,7 @@ static void create_gain_photon(int pp) if(nx<0 || ny<0 || nx>=XRES || ny>=YRES) return; - if((pmap[ny][nx] & TYPE) != PT_GLOW) + if((pmap[ny][nx] & 0xFF) != PT_GLOW) return; pfree = parts[i].life; @@ -866,9 +874,8 @@ static void create_gain_photon(int pp) parts[i].y = yy; parts[i].vx = parts[pp].vx; parts[i].vy = parts[pp].vy; - parts[i].temp = parts[pmap[ny][nx] >>PS].temp; + parts[i].temp = parts[pmap[ny][nx] >> 8].temp; parts[i].tmp = 0; - photons[ny][nx] = PT_PHOT|(i<>PS].temp; + parts[i].temp = parts[pmap[ny][nx] >> 8].temp; parts[i].tmp = 0; - photons[ny][nx] = PT_PHOT|(i<>PS)>=NPART) + if(!i || (i>>8)>=NPART) return; - if((parts[i>>PS].type==SLALT)||SLALT==0) + if((parts[i>>8].type==SLALT)||SLALT==0) { - kill_part(i>>PS); + kill_part(i>>8); + pmap[y][x] = 0; } - else if(ptypes[parts[i>>PS].type].menusection==SEC) + else if(ptypes[parts[i>>8].type].menusection==SEC) { - kill_part(i>>PS); + kill_part(i>>8); + pmap[y][x] = 0; } else return; @@ -1059,17 +1067,17 @@ inline int parts_avg(int ci, int ni,int t) if(t==PT_INSL)//to keep electronics working { int pmr = pmap[(int)((parts[ci].y + parts[ni].y)/2)][(int)((parts[ci].x + parts[ni].x)/2)]; - if((pmr>>PS) < NPART && pmr) - return parts[pmr>>PS].type; + if((pmr>>8) < NPART && pmr) + return parts[pmr>>8].type; else return PT_NONE; } else { int pmr2 = pmap[(int)((parts[ci].y + parts[ni].y)/2+0.5f)][(int)((parts[ci].x + parts[ni].x)/2+0.5f)];//seems to be more accurate. - if((pmr2>>PS) < NPART && pmr2) + if((pmr2>>8) < NPART && pmr2) { - if(parts[pmr2>>PS].type==t) + if(parts[pmr2>>8].type==t) return t; } else @@ -1169,13 +1177,13 @@ void update_particles_i(pixel *vid, int start, int inc) for(nx=0;nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) { continue; } - else if((ny<9||nx<9||ny>YRES-7||nx>XRES-10)&&parts[r>>PS].type==PT_LOVE) - parts[r>>PS].type = PT_NONE; - else if(parts[r>>PS].type==PT_LOVE) + else if((ny<9||nx<9||ny>YRES-7||nx>XRES-10)&&parts[r>>8].type==PT_LOVE) + parts[r>>8].type = PT_NONE; + else if(parts[r>>8].type==PT_LOVE) { love[nx/9][ny/9] = 1; } @@ -1194,7 +1202,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(ny+nny>0&&ny+nny=0&&nx+nnx>PS)>=NPART) + if((rt>>8)>=NPART) { continue; } @@ -1202,8 +1210,8 @@ void update_particles_i(pixel *vid, int start, int inc) create_part(-1,nx+nnx,ny+nny,PT_LOVE); else if(!rt) continue; - else if(parts[rt>>PS].type==PT_LOVE&&loverule[nnx][nny]==0) - parts[rt>>PS].type=PT_NONE; + else if(parts[rt>>8].type==PT_LOVE&&loverule[nnx][nny]==0) + parts[rt>>8].type=PT_NONE; } } @@ -1220,13 +1228,13 @@ void update_particles_i(pixel *vid, int start, int inc) for(nx=0;nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) { continue; } - else if((ny<9||nx<9||ny>YRES-7||nx>XRES-10)&&parts[r>>PS].type==PT_LOLZ) - parts[r>>PS].type = PT_NONE; - else if(parts[r>>PS].type==PT_LOLZ) + else if((ny<9||nx<9||ny>YRES-7||nx>XRES-10)&&parts[r>>8].type==PT_LOLZ) + parts[r>>8].type = PT_NONE; + else if(parts[r>>8].type==PT_LOLZ) { lolz[nx/9][ny/9] = 1; } @@ -1245,7 +1253,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(ny+nny>0&&ny+nny=0&&nx+nnx>PS)>=NPART) + if((rt>>8)>=NPART) { continue; } @@ -1253,8 +1261,8 @@ void update_particles_i(pixel *vid, int start, int inc) create_part(-1,nx+nnx,ny+nny,PT_LOLZ); else if(!rt) continue; - else if(parts[rt>>PS].type==PT_LOLZ&&lolzrule[nny][nnx]==0) - parts[rt>>PS].type=PT_NONE; + else if(parts[rt>>8].type==PT_LOLZ&&lolzrule[nny][nnx]==0) + parts[rt>>8].type=PT_NONE; } } @@ -1272,16 +1280,16 @@ void update_particles_i(pixel *vid, int start, int inc) for(ny=CELL;ny>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) { gol[nx][ny] = 0; continue; } else for( golnum=1;golnum>PS].type==goltype[golnum-1]) + if(parts[r>>8].type==goltype[golnum-1]) { - if(parts[r>>PS].tmp == grule[golnum][9]-1) { + if(parts[r>>8].tmp == grule[golnum][9]-1) { gol[nx][ny] = golnum; for( nnx=-1;nnx<2;nnx++) for( nny=-1;nny<2;nny++)//it will count itself as its own neighbor, which is needed, but will have 1 extra for delete check @@ -1290,9 +1298,9 @@ void update_particles_i(pixel *vid, int start, int inc) gol2[((nx+nnx+XRES-3*CELL)%(XRES-2*CELL))+CELL][((ny+nny+YRES-3*CELL)%(YRES-2*CELL))+CELL][0] ++; } } else { - parts[r>>PS].tmp --; - if(parts[r>>PS].tmp<=0) - parts[r>>PS].type = PT_NONE; + parts[r>>8].tmp --; + if(parts[r>>8].tmp<=0) + parts[r>>8].type = PT_NONE; } } } @@ -1301,7 +1309,7 @@ void update_particles_i(pixel *vid, int start, int inc) { r = pmap[ny][nx]; int neighbors = gol2[nx][ny][0]; - if(neighbors==0 || (r>>PS)>=NPART || !(ptypes[r&TYPE].properties&PROP_LIFE || !(r&TYPE))) + if(neighbors==0 || !(ptypes[r&0xFF].properties&PROP_LIFE || !r&0xFF) || (r>>8)>=NPART) continue; for( golnum = 1;golnum>PS].tmp==grule[golnum][9]-1) - parts[r>>PS].tmp --; + if(parts[r>>8].tmp==grule[golnum][9]-1) + parts[r>>8].tmp --; } - if(parts[r>>PS].tmp<=0) - parts[r>>PS].type = PT_NONE; + if(parts[r>>8].tmp<=0) + parts[r>>8].type = PT_NONE; } gol2[nx][ny][0] = 0; for( z = 1;z5.0f) - { // Only way I know to make it - t = parts[i].type = PT_FIRE; // combust under pressure. - parts[i].life = rand()%50+120; - } + { + t = parts[i].type = PT_FIRE; + parts[i].life = rand()%50+120; + } if(t==PT_GAS && pv[y/CELL][x/CELL]>6.0f) t = parts[i].type = PT_OIL; if(t==PT_BMTL && pv[y/CELL][x/CELL]>2.5f) @@ -1644,21 +1652,21 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = PT_BRMT; if(t==PT_BRCK && pv[y/CELL][x/CELL]>8.8f) t = parts[i].type = PT_STNE; - if(t==PT_PIPE && pv[y/CELL][x/CELL]>10.0f) + if(t==PT_PIPE && pv[y/CELL][x/CELL]>10.0f) t = parts[i].type = PT_BRMT; - if(t==PT_PSTE && pv[y/CELL][x/CELL]>0.5f) + if(t==PT_PSTE && pv[y/CELL][x/CELL]>0.5f) t = parts[i].type = PT_PSTS; - if(t==PT_PSTS && pv[y/CELL][x/CELL]<0.5f) + if(t==PT_PSTS && pv[y/CELL][x/CELL]<0.5f) t = parts[i].type = PT_PSTE; - if(t==PT_SHLD1 && pv[y/CELL][x/CELL]>7.0f) + if(t==PT_SHLD1 && pv[y/CELL][x/CELL]>7.0f) t = parts[i].type = PT_NONE; - if(t==PT_SHLD2 && pv[y/CELL][x/CELL]>15.0f) + if(t==PT_SHLD2 && pv[y/CELL][x/CELL]>15.0f) t = parts[i].type = PT_NONE; - if(t==PT_SHLD3 && pv[y/CELL][x/CELL]>25.0f) + if(t==PT_SHLD3 && pv[y/CELL][x/CELL]>25.0f) t = parts[i].type = PT_NONE; - if(t==PT_SHLD4 && pv[y/CELL][x/CELL]>40.0f) + if(t==PT_SHLD4 && pv[y/CELL][x/CELL]>40.0f) t = parts[i].type = PT_NONE; - if(t==PT_WIFI && pv[y/CELL][x/CELL]>15.0f) + if(t==PT_WIFI && pv[y/CELL][x/CELL]>15.0f) t = parts[i].type = PT_BRMT; //if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f) // t = parts[i].type = PT_BGLA; @@ -1671,7 +1679,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].type = PT_BGLA; } } - if(t==PT_QRTZ) + if(t==PT_QRTZ) { parts[i].pavg[0] = parts[i].pavg[1]; parts[i].pavg[1] = pv[y/CELL][x/CELL]; @@ -1687,20 +1695,20 @@ 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)) + 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); + 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(t==PT_PSTE) - if(parts[i].temp>747.0f) - t = parts[i].type = PT_BRCK; + if(t==PT_PSTE) + if(parts[i].temp>747.0f) + t = parts[i].type = PT_BRCK; if(t==PT_SPRK&&parts[i].ctype==PT_ETRD&&parts[i].life==1) { nearp = nearest_part(i, PT_ETRD); @@ -1732,12 +1740,12 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>PS].type].hconduct>0&&!(parts[r>>PS].type==PT_HSWC&&parts[r>>PS].life!=10)&&!(parts[r>>PS].type==PT_BRAY&&parts[i].type==PT_FILT)&&!(parts[i].type==PT_BRAY&&parts[r>>PS].type==PT_FILT)&&!(parts[i].type==PT_PHOT&&parts[r>>PS].type==PT_FILT)&&!(parts[i].type==PT_BIZR&&parts[r>>PS].type==PT_FILT)&&!(parts[i].type==PT_BIZRG&&parts[r>>PS].type==PT_FILT)&&!(parts[r>>PS].type==PT_BIZR&&parts[i].type==PT_FILT)&&!(parts[r>>PS].type==PT_BIZRG&&parts[i].type==PT_FILT)) + if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)&&!(parts[r>>8].type==PT_BRAY&&parts[i].type==PT_FILT)&&!(parts[i].type==PT_BRAY&&parts[r>>8].type==PT_FILT)&&!(parts[i].type==PT_PHOT&&parts[r>>8].type==PT_FILT)&&!(parts[i].type==PT_BIZR&&parts[r>>8].type==PT_FILT)&&!(parts[i].type==PT_BIZRG&&parts[r>>8].type==PT_FILT)&&!(parts[r>>8].type==PT_BIZR&&parts[i].type==PT_FILT)&&!(parts[r>>8].type==PT_BIZRG&&parts[i].type==PT_FILT)) { h_count++; - c_heat += parts[r>>PS].temp; + c_heat += parts[r>>8].temp; } } } @@ -1750,11 +1758,11 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>PS].type].hconduct>0&&!(parts[r>>PS].type==PT_HSWC&&parts[r>>PS].life!=10)&&!(parts[r>>PS].type==PT_BRAY&&parts[i].type==PT_FILT)&&!(parts[i].type==PT_BRAY&&parts[r>>PS].type==PT_FILT)&&!(parts[i].type==PT_PHOT&&parts[r>>PS].type==PT_FILT)&&!(parts[i].type==PT_BIZR&&parts[r>>PS].type==PT_FILT)&&!(parts[i].type==PT_BIZRG&&parts[r>>PS].type==PT_FILT)&&!(parts[r>>PS].type==PT_BIZR&&parts[i].type==PT_FILT)&&!(parts[r>>PS].type==PT_BIZRG&&parts[i].type==PT_FILT)) + if(parts[r>>8].type!=PT_NONE&&parts[i].type!=PT_NONE&&ptypes[parts[r>>8].type].hconduct>0&&!(parts[r>>8].type==PT_HSWC&&parts[r>>8].life!=10)&&!(parts[r>>8].type==PT_BRAY&&parts[i].type==PT_FILT)&&!(parts[i].type==PT_BRAY&&parts[r>>8].type==PT_FILT)&&!(parts[i].type==PT_PHOT&&parts[r>>8].type==PT_FILT)&&!(parts[i].type==PT_BIZR&&parts[r>>8].type==PT_FILT)&&!(parts[i].type==PT_BIZRG&&parts[r>>8].type==PT_FILT)&&!(parts[r>>8].type==PT_BIZR&&parts[i].type==PT_FILT)&&!(parts[r>>8].type==PT_BIZRG&&parts[i].type==PT_FILT)) { - parts[r>>PS].temp = parts[i].temp; + parts[r>>8].temp = parts[i].temp; } } } @@ -1762,11 +1770,11 @@ void update_particles_i(pixel *vid, int start, int inc) if(y-2 >= 0 && y-2 < YRES && ptypes[t].properties&TYPE_LIQUID){ float swappage; r = pmap[y-2][x]; - if(!((r>>PS)>=NPART || !r || parts[i].type != (r&TYPE))){ - if(parts[i].temp>parts[r>>PS].temp){ + if(!((r>>8)>=NPART || !r || parts[i].type != (r&0xFF))){ + if(parts[i].temp>parts[r>>8].temp){ swappage = parts[i].temp; - parts[i].temp = parts[r>>PS].temp; - parts[r>>PS].temp = swappage; + parts[i].temp = parts[r>>8].temp; + parts[r>>8].temp = swappage; } } } @@ -1932,16 +1940,16 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((ptypes[r&TYPE].properties&PROP_CONDUCTS) && parts[r>>PS].life==0 && !((r&TYPE)==PT_WATR||(r&TYPE)==PT_SLTW) && parts[r>>PS].ctype!=PT_SPRK) + if((ptypes[r&0xFF].properties&PROP_CONDUCTS) && parts[r>>8].life==0 && !((r&0xFF)==PT_WATR||(r&0xFF)==PT_SLTW) && parts[r>>8].ctype!=PT_SPRK) { t = parts[i].type = PT_NONE; - parts[r>>PS].ctype = parts[r>>PS].type; - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].life = 4; + parts[r>>8].ctype = parts[r>>8].type; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; } - else if((r&TYPE)!=PT_CLNE&&(r&TYPE)!=PT_THDR&&(r&TYPE)!=PT_SPRK&&(r&TYPE)!=PT_DMND&&(r&TYPE)!=PT_FIRE&&(r&TYPE)!=PT_NEUT&&(r&TYPE)!=PT_PHOT&&(r&TYPE)) + else if((r&0xFF)!=PT_CLNE&&(r&0xFF)!=PT_THDR&&(r&0xFF)!=PT_SPRK&&(r&0xFF)!=PT_DMND&&(r&0xFF)!=PT_FIRE&&(r&0xFF)!=PT_NEUT&&(r&0xFF)!=PT_PHOT&&(r&0xFF)) { pv[y/CELL][x/CELL] += 100.0f; if(legacy_enable&&1>(rand()%200)) @@ -1971,21 +1979,21 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_SALT || (r&TYPE)==PT_SLTW) && 1>(rand()%1000)) + if(((r&0xFF)==PT_SALT || (r&0xFF)==PT_SLTW) && 1>(rand()%1000)) { t = parts[i].type = PT_SLTW; - parts[r>>PS].type = PT_SLTW; + parts[r>>8].type = PT_SLTW; } if(legacy_enable) { - if(((r&TYPE)==PT_WATR || (r&TYPE)==PT_DSTW) && 1>(rand()%1000)) + if(((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && 1>(rand()%1000)) { t = parts[i].type = PT_ICEI; - parts[r>>PS].type = PT_ICEI; + parts[r>>8].type = PT_ICEI; } - if(t==PT_SNOW && ((r&TYPE)==PT_WATR || (r&TYPE)==PT_DSTW) && 15>(rand()%1000)) + if(t==PT_SNOW && ((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && 15>(rand()%1000)) t = parts[i].type = PT_WATR; } } @@ -1998,13 +2006,13 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt =parts[r>>PS].type; + rt =parts[r>>8].type; if((rt==PT_METL || rt==PT_IRON) && 1>(rand()/(RAND_MAX/100))) { - parts[r>>PS].type=PT_BMTL; - parts[r>>PS].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100; + parts[r>>8].type=PT_BMTL; + parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100; } } } else if(parts[i].tmp==1 && 1>rand()%1000) { @@ -2019,13 +2027,13 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((((r&TYPE) == PT_SALT && 15>(rand()/(RAND_MAX/700))) || - ((r&TYPE) == PT_SLTW && 30>(rand()/(RAND_MAX/2000))) || - ((r&TYPE) == PT_WATR && 5 >(rand()/(RAND_MAX/6000))) || - ((r&TYPE) == PT_O2 && 2 >(rand()/(RAND_MAX/500))) || - ((r&TYPE) == PT_LO2))&& + if((((r&0xFF) == PT_SALT && 15>(rand()/(RAND_MAX/700))) || + ((r&0xFF) == PT_SLTW && 30>(rand()/(RAND_MAX/2000))) || + ((r&0xFF) == PT_WATR && 5 >(rand()/(RAND_MAX/6000))) || + ((r&0xFF) == PT_O2 && 2 >(rand()/(RAND_MAX/500))) || + ((r&0xFF) == PT_LO2))&& (!(parts[i].life)) ) { @@ -2040,14 +2048,14 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE) == PT_DSTW && 30>(rand()/(RAND_MAX/1000))) || - ((r&TYPE) == PT_SLTW && 30>(rand()/(RAND_MAX/1000))) || - ((r&TYPE) == PT_WATR && 30>(rand()/(RAND_MAX/1000)))) + if(((r&0xFF) == PT_DSTW && 30>(rand()/(RAND_MAX/1000))) || + ((r&0xFF) == PT_SLTW && 30>(rand()/(RAND_MAX/1000))) || + ((r&0xFF) == PT_WATR && 30>(rand()/(RAND_MAX/1000)))) { - parts[r>>PS].type=PT_O2; - //parts[r>>PS].tmp=(rand()/(RAND_MAX/10))+20; + parts[r>>8].type=PT_O2; + //parts[r>>8].tmp=(rand()/(RAND_MAX/10))+20; } } } @@ -2078,9 +2086,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_FIRE || (r&TYPE)==PT_PLSM) && 1>(rand()%500)) + if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500)) { if(parts[i].life>100) { parts[i].life = 99; @@ -2106,9 +2114,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_FIRE || (r&TYPE)==PT_PLSM) && 1>(rand()%500)) + if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM) && 1>(rand()%500)) { if(parts[i].life>100) { parts[i].life = 99; @@ -2122,17 +2130,17 @@ void update_particles_i(pixel *vid, int start, int inc) for(ny=-1; ny<2; ny++){ if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_SPRK){ - int destroy = (parts[r>>PS].ctype==PT_PSCN)?1:0; - int nostop = (parts[r>>PS].ctype==PT_INST)?1:0; + if((r&0xFF)==PT_SPRK){ + int destroy = (parts[r>>8].ctype==PT_PSCN)?1:0; + int nostop = (parts[r>>8].ctype==PT_INST)?1:0; for (docontinue = 1, nxx = 0, nyy = 0, nxi = nx*-1, nyi = ny*-1; docontinue; nyy+=nyi, nxx+=nxi) { if(!(x+nxi+nxx= 0 && y+nyi+nyy >= 0)){ break; } r = pmap[y+nyi+nyy][x+nxi+nxx]; - if(!((r>>PS)>=NPART)) { + if(!((r>>8)>=NPART)) { if(!r){ int nr = create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_BRAY); if(nr!=-1){ @@ -2143,36 +2151,36 @@ void update_particles_i(pixel *vid, int start, int inc) parts[nr].ctype = colored; } } else if(!destroy) { - if(parts[r>>PS].type==PT_BRAY&&parts[r>>PS].tmp==0){ + if(parts[r>>8].type==PT_BRAY&&parts[r>>8].tmp==0){ if(nyy!=0 || nxx!=0){ - parts[r>>PS].type = PT_BRAY; - parts[r>>PS].life = 1020; - parts[r>>PS].tmp = 1; - if(!parts[r>>PS].ctype) - parts[r>>PS].ctype = colored; + parts[r>>8].type = PT_BRAY; + parts[r>>8].life = 1020; + parts[r>>8].tmp = 1; + if(!parts[r>>8].ctype) + parts[r>>8].ctype = colored; } docontinue = 0; - } else if(parts[r>>PS].type==PT_BRAY&&parts[r>>PS].tmp==1){ - parts[r>>PS].life = 1020; + } else if(parts[r>>8].type==PT_BRAY&&parts[r>>8].tmp==1){ + parts[r>>8].life = 1020; //docontinue = 1; } - else if(parts[r>>PS].type==PT_FILT){ - colored = parts[r>>PS].ctype; - }else if(parts[r>>PS].type!=PT_INWR && parts[r>>PS].type!=PT_ARAY && parts[r>>PS].type!=PT_WIFI && !(parts[r>>PS].type==PT_SWCH && parts[r>>PS].life>=10)) { + else if(parts[r>>8].type==PT_FILT){ + colored = parts[r>>8].ctype; + }else if(parts[r>>8].type!=PT_INWR && parts[r>>8].type!=PT_ARAY && parts[r>>8].type!=PT_WIFI && !(parts[r>>8].type==PT_SWCH && parts[r>>8].life>=10)) { if(nyy!=0 || nxx!=0){ create_part(-1, x+nxi+nxx, y+nyi+nyy, PT_SPRK); } - if(!(nostop && (ptypes[parts[r>>PS].ctype].properties&PROP_CONDUCTS))){ + if(!(nostop && (ptypes[parts[r>>8].ctype].properties&PROP_CONDUCTS))){ docontinue = 0; } else { docontinue = 1; } } } else if(destroy) { - if(parts[r>>PS].type==PT_BRAY){ - parts[r>>PS].life = 1; + if(parts[r>>8].type==PT_BRAY){ + parts[r>>8].life = 1; docontinue = 1; - } else if(parts[r>>PS].type==PT_INWR || parts[r>>PS].type==PT_ARAY || parts[r>>PS].type==PT_WIFI || parts[r>>PS].type==PT_FILT || (parts[r>>PS].type==PT_SWCH && parts[r>>PS].life>=10)) { + } else if(parts[r>>8].type==PT_INWR || parts[r>>8].type==PT_ARAY || parts[r>>8].type==PT_WIFI || parts[r>>8].type==PT_FILT || (parts[r>>8].type==PT_SWCH && parts[r>>8].life>=10)) { docontinue = 1; } else { docontinue = 0; @@ -2219,9 +2227,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_SPRK || ((parts[i].temp>=(273.15+700.0f)) && 1>(rand()%20))) + if((r&0xFF)==PT_SPRK || ((parts[i].temp>=(273.15+700.0f)) && 1>(rand()%20))) { if(parts[i].life>40) { parts[i].life = 39; @@ -2252,9 +2260,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_SPRK || (parts[i].temp>=(273.15+400.0f))) && 1>(rand()%15)) + if(((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f))) && 1>(rand()%15)) { if(parts[i].life>40) { parts[i].life = 39; @@ -2270,9 +2278,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_SPRK && parts[r>>PS].ctype==PT_METL && parts_avg(i, r>>PS,PT_INSL)!=PT_INSL) + if((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_METL && parts_avg(i, r>>8,PT_INSL)!=PT_INSL) { parts[i].temp = 473.0f; } @@ -2286,38 +2294,38 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_WATR && 1>(rand()%250)) + if((r&0xFF)==PT_WATR && 1>(rand()%250)) { t = parts[i].type = PT_PLNT; - parts[r>>PS].type = PT_PLNT; - parts[r>>PS].life = 0; + parts[r>>8].type = PT_PLNT; + parts[r>>8].life = 0; } - else if((r&TYPE)==PT_LAVA && 1>(rand()%250)) + else if((r&0xFF)==PT_LAVA && 1>(rand()%250)) { parts[i].life = 4; t = parts[i].type = PT_FIRE; } - else if((r&TYPE)==PT_SMKE && (1>rand()%250)) + else if((r&0xFF)==PT_SMKE && (1>rand()%250)) { - parts[r>>PS].type = PT_NONE; + parts[r>>8].type = PT_NONE; parts[i].life = rand()%60 + 60; } - else if((r&TYPE)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2 && VINE_MODE) + else if((r&0xFF)==PT_WOOD && (1>rand()%20) && abs(nx+ny)<=2 && VINE_MODE) { int nnx = rand()%3 -1; int nny = rand()%3 -1; if(x+nx+nnx>=0 && y+ny+nny>0 && x+nx+nnx>PS)>=NPART||pmap[y+ny+nny][x+nx+nnx]) + if((pmap[y+ny+nny][x+nx+nnx]>>8)>=NPART||pmap[y+ny+nny][x+nx+nnx]) continue; if(create_part(-1,x+nx+nnx,y+ny+nny,PT_VINE)) - parts[pmap[y+ny+nny][x+nx+nnx]>>PS].temp = parts[i].temp; + parts[pmap[y+ny+nny][x+nx+nnx]>>8].temp = parts[i].temp; } } - //if(t==PT_SNOW && (r&TYPE)==PT_WATR && 15>(rand()%1000)) + //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; } if(parts[i].life==2) @@ -2328,7 +2336,7 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART) + if((r>>8)>=NPART) continue; if(!r) create_part(-1,x+nx,y+ny,PT_O2); @@ -2344,14 +2352,14 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART) + if((r>>8)>=NPART) continue; if(1>rand()%15) parts[i].type=PT_PLNT; else if(!r) { create_part(-1,x+nx,y+ny,PT_VINE); - parts[pmap[y+ny][x+nx]>>PS].temp = parts[i].temp; + parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; parts[i].type=PT_PLNT; } } @@ -2363,9 +2371,9 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_FIRE || (r&TYPE)==PT_PLSM || (r&TYPE)==PT_LAVA)) + if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_PLSM || (r&0xFF)==PT_LAVA)) { if(1>(rand()%500)) { t = parts[i].type = PT_LAVA; @@ -2380,7 +2388,7 @@ void update_particles_i(pixel *vid, int start, int inc) parts[i].tmp = 20; } } - //if(t==PT_SNOW && (r&TYPE)==PT_WATR && 15>(rand()%1000)) + //if(t==PT_SNOW && (r&0xFF)==PT_WATR && 15>(rand()%1000)) //t = parts[i].type = PT_WATR; } } @@ -2392,34 +2400,34 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_FIRE || (r&TYPE)==PT_LAVA) && 1>(rand()%10) && legacy_enable) + if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_LAVA) && 1>(rand()%10) && legacy_enable) { t = parts[i].type = PT_WTRV; } - else if((r&TYPE)==PT_SALT && 1>(rand()%250)) + else if((r&0xFF)==PT_SALT && 1>(rand()%250)) { t = parts[i].type = PT_SLTW; - parts[r>>PS].type = PT_SLTW; + parts[r>>8].type = PT_SLTW; } - if((((r&TYPE)==PT_WATR||(r&TYPE)==PT_SLTW)&&t==PT_DSTW) && 1>(rand()%500)) + if((((r&0xFF)==PT_WATR||(r&0xFF)==PT_SLTW)&&t==PT_DSTW) && 1>(rand()%500)) { t = parts[i].type = PT_WATR; } - if(((r&TYPE)==PT_SLTW&&t==PT_DSTW) && 1>(rand()%500)) + if(((r&0xFF)==PT_SLTW&&t==PT_DSTW) && 1>(rand()%500)) { t = parts[i].type = PT_SLTW; } - if(((r&TYPE)==PT_RBDM||(r&TYPE)==PT_LRBD) && (legacy_enable||pt>12.0f) && 1>(rand()%500)) + if(((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && (legacy_enable||pt>12.0f) && 1>(rand()%500)) { parts[i].life = 4; t = parts[i].type = PT_FIRE; } - if(((r&TYPE)==PT_CNCT&&t==PT_WATR) && 1>(rand()%500)) + if(((r&0xFF)==PT_CNCT&&t==PT_WATR) && 1>(rand()%500)) { t = parts[i].type = PT_PSTE; - parts[r>>PS].type = PT_NONE; + parts[r>>8].type = PT_NONE; } } } @@ -2431,20 +2439,20 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_FIRE || (r&TYPE)==PT_LAVA) && 1>(rand()%10) && legacy_enable) + if(((r&0xFF)==PT_FIRE || (r&0xFF)==PT_LAVA) && 1>(rand()%10) && legacy_enable) { t = parts[i].type = PT_SALT; - parts[r>>PS].type = PT_WTRV; + parts[r>>8].type = PT_WTRV; } - else if((r&TYPE)==PT_SALT && 1>(rand()%10000)) + else if((r&0xFF)==PT_SALT && 1>(rand()%10000)) { - parts[r>>PS].type = PT_NONE; + parts[r>>8].type = PT_NONE; } - if((r&TYPE)==PT_PLNT&&5>(rand()%1000)) - parts[r>>PS].type = PT_NONE; - if(((r&TYPE)==PT_RBDM||(r&TYPE)==PT_LRBD) && pt>12.0f && 1>(rand()%500)) + if((r&0xFF)==PT_PLNT&&5>(rand()%1000)) + parts[r>>8].type = PT_NONE; + if(((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && pt>12.0f && 1>(rand()%500)) { parts[i].life = 4; t = parts[i].type = PT_FIRE; @@ -2460,25 +2468,25 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(((r&TYPE)==PT_WATR||(r&TYPE)==PT_DSTW||(r&TYPE)==PT_SLTW) && 1>(rand()%1000) && legacy_enable) + if(((r&0xFF)==PT_WATR||(r&0xFF)==PT_DSTW||(r&0xFF)==PT_SLTW) && 1>(rand()%1000) && legacy_enable) { t = parts[i].type = PT_WATR; - parts[r>>PS].type = PT_WATR; + parts[r>>8].type = PT_WATR; } - if(((r&TYPE)==PT_RBDM||(r&TYPE)==PT_LRBD) && pt>12.0f && 1>(rand()%500)) + if(((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && pt>12.0f && 1>(rand()%500)) { parts[i].life = 4; t = parts[i].type = PT_FIRE; } - if(((r&TYPE)==PT_ICEI || (r&TYPE)==PT_SNOW) && 1>(rand()%1000) && legacy_enable) + if(((r&0xFF)==PT_ICEI || (r&0xFF)==PT_SNOW) && 1>(rand()%1000) && legacy_enable) { t = parts[i].type = PT_WATR; if(1>(rand()%1000)) - parts[r>>PS].type = PT_WATR; + parts[r>>8].type = PT_WATR; } } } @@ -2490,9 +2498,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_DYST && 1>(rand()%30) && !legacy_enable) + if((r&0xFF)==PT_DYST && 1>(rand()%30) && !legacy_enable) { t = parts[i].type = PT_DYST; } @@ -2505,24 +2513,24 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)!=PT_ACID) + if((r&0xFF)!=PT_ACID) { - if ((r&TYPE)==PT_PLEX || (r&TYPE)==PT_NITR || (r&TYPE)==PT_GUNP || (r&TYPE)==PT_RBDM || (r&TYPE)==PT_LRBD) + if ((r&0xFF)==PT_PLEX || (r&0xFF)==PT_NITR || (r&0xFF)==PT_GUNP || (r&0xFF)==PT_RBDM || (r&0xFF)==PT_LRBD) { t = parts[i].type = PT_FIRE; parts[i].life = 4; - parts[r>>PS].type = PT_FIRE; - parts[r>>PS].life = 4; + parts[r>>8].type = PT_FIRE; + parts[r>>8].life = 4; } - else if(((r&TYPE)!=PT_CLNE && (r&TYPE)!=PT_PCLN && ptypes[parts[r>>PS].type].hardness>(rand()%1000))&&parts[i].life>=50) + else if(((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && ptypes[parts[r>>8].type].hardness>(rand()%1000))&&parts[i].life>=50) { - if(parts_avg(i, r>>PS,PT_GLAS)!= PT_GLAS) - { - parts[i].life--; - parts[r>>PS].type = PT_NONE; - } + if(parts_avg(i, r>>8,PT_GLAS)!= PT_GLAS) + { + parts[i].life--; + parts[r>>8].type = PT_NONE; + } } else if (parts[i].life<=50) { @@ -2541,90 +2549,87 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_WATR || (r&TYPE)==PT_ICEI || (r&TYPE)==PT_SNOW) + if((r&0xFF)==PT_WATR || (r&0xFF)==PT_ICEI || (r&0xFF)==PT_SNOW) { parts[i].vx *= 0.995; parts[i].vy *= 0.995; } - if((r&TYPE)==PT_PLUT && rt>(rand()%1000)) + if((r&0xFF)==PT_PLUT && rt>(rand()%1000)) { if(33>rand()%100) { - create_part(r>>PS, x+nx, y+ny, rand()%3 ? PT_LAVA : PT_URAN); - parts[r>>PS].temp = MAX_TEMP; - if(parts[r>>PS].type==PT_LAVA){ - parts[r>>PS].tmp = 100; - parts[r>>PS].ctype = PT_PLUT; + create_part(r>>8, x+nx, y+ny, rand()%3 ? PT_LAVA : PT_URAN); + parts[r>>8].temp = MAX_TEMP; + if(parts[r>>8].type==PT_LAVA){ + parts[r>>8].tmp = 100; + parts[r>>8].ctype = PT_PLUT; } } else { - create_part(r>>PS, x+nx, y+ny, PT_NEUT); - parts[r>>PS].vx = 0.25f*parts[r>>PS].vx + parts[i].vx; - parts[r>>PS].vy = 0.25f*parts[r>>PS].vy + parts[i].vy; + create_part(r>>8, x+nx, y+ny, PT_NEUT); + parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; + parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; } pv[y/CELL][x/CELL] += 10.0f * CFDS; //Used to be 2, some people said nukes weren't powerful enough fe ++; } - if((r&TYPE)==PT_DEUT && (rt+1)>(rand()%1000)) + if((r&0xFF)==PT_DEUT && (rt+1)>(rand()%1000)) { #ifdef SDEUT - create_n_parts(parts[r>>PS].life, x+nx, y+ny, parts[i].vx, parts[i].vy, PT_NEUT); + create_n_parts(parts[r>>8].life, x+nx, y+ny, parts[i].vx, parts[i].vy, PT_NEUT); #else - create_part(r>>PS, x+nx, y+ny, PT_NEUT); - parts[r>>PS].vx = 0.25f*parts[r>>PS].vx + parts[i].vx; - parts[r>>PS].vy = 0.25f*parts[r>>PS].vy + parts[i].vy; - if(parts[r>>PS].life>0) + create_part(r>>8, x+nx, y+ny, PT_NEUT); + parts[r>>8].vx = 0.25f*parts[r>>8].vx + parts[i].vx; + parts[r>>8].vy = 0.25f*parts[r>>8].vy + parts[i].vy; + if(parts[r>>8].life>0) { - parts[r>>PS].life --; - parts[r>>PS].temp += (parts[r>>PS].life*17); + parts[r>>8].life --; + parts[r>>8].temp += (parts[r>>8].life*17); pv[y/CELL][x/CELL] += 6.0f * CFDS; } else - parts[r>>PS].type = PT_NONE; + parts[r>>8].type = PT_NONE; #endif } - if((r&TYPE)==PT_GUNP && 15>(rand()%1000)) - parts[r>>PS].type = PT_DUST; - if((r&TYPE)==PT_DYST && 15>(rand()%1000)) - parts[r>>PS].type = PT_YEST; - if((r&TYPE)==PT_YEST) { - if(15>(rand()%100000)&&isplayer==0) - parts[r>>PS].type = PT_STKM; - else - parts[r>>PS].type = PT_DYST; + if((r&0xFF)==PT_GUNP && 15>(rand()%1000)) + parts[r>>8].type = PT_DUST; + if((r&0xFF)==PT_DYST && 15>(rand()%1000)) + parts[r>>8].type = PT_YEST; + if((r&0xFF)==PT_YEST) { + parts[r>>8].type = PT_DYST; } - if((r&TYPE)==PT_WATR && 15>(rand()%100)) - parts[r>>PS].type = PT_DSTW; - if((r&TYPE)==PT_PLEX && 15>(rand()%1000)) - parts[r>>PS].type = PT_GOO; - if((r&TYPE)==PT_NITR && 15>(rand()%1000)) - parts[r>>PS].type = PT_DESL; - if((r&TYPE)==PT_PLNT && 5>(rand()%100)) - parts[r>>PS].type = PT_WOOD; - if((r&TYPE)==PT_DESL && 15>(rand()%1000)) - parts[r>>PS].type = PT_GAS; - if((r&TYPE)==PT_COAL && 5>(rand()%100)) - parts[r>>PS].type = PT_WOOD; - if((r&TYPE)==PT_DUST && 5>(rand()%100)) - parts[r>>PS].type = PT_FWRK; - if((r&TYPE)==PT_FWRK && 5>(rand()%100)) - parts[r>>PS].ctype = PT_DUST; - if((r&TYPE)==PT_ACID && 5>(rand()%100)) + if((r&0xFF)==PT_WATR && 15>(rand()%100)) + parts[r>>8].type = PT_DSTW; + if((r&0xFF)==PT_PLEX && 15>(rand()%1000)) + parts[r>>8].type = PT_GOO; + if((r&0xFF)==PT_NITR && 15>(rand()%1000)) + parts[r>>8].type = PT_DESL; + if((r&0xFF)==PT_PLNT && 5>(rand()%100)) + parts[r>>8].type = PT_WOOD; + if((r&0xFF)==PT_DESL && 15>(rand()%1000)) + parts[r>>8].type = PT_GAS; + if((r&0xFF)==PT_COAL && 5>(rand()%100)) + parts[r>>8].type = PT_WOOD; + if((r&0xFF)==PT_DUST && 5>(rand()%100)) + parts[r>>8].type = PT_FWRK; + if((r&0xFF)==PT_FWRK && 5>(rand()%100)) + parts[r>>8].ctype = PT_DUST; + if((r&0xFF)==PT_ACID && 5>(rand()%100)) { - parts[r>>PS].type = PT_ISOZ; - parts[r>>PS].life = 0; + parts[r>>8].type = PT_ISOZ; + parts[r>>8].life = 0; } - /*if(parts[r>>PS].type>1 && parts[r>>PS].type!=PT_NEUT && parts[r>>PS].type-1!=PT_NEUT && parts[r>>PS].type-1!=PT_STKM && - (ptypes[parts[r>>PS].type-1].menusection==SC_LIQUID|| - ptypes[parts[r>>PS].type-1].menusection==SC_EXPLOSIVE|| - ptypes[parts[r>>PS].type-1].menusection==SC_GAS|| - ptypes[parts[r>>PS].type-1].menusection==SC_POWDERS) && 15>(rand()%1000)) - parts[r>>PS].type--;*/ + /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && + (ptypes[parts[r>>8].type-1].menusection==SC_LIQUID|| + ptypes[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| + ptypes[parts[r>>8].type-1].menusection==SC_GAS|| + ptypes[parts[r>>8].type-1].menusection==SC_POWDERS) && 15>(rand()%1000)) + parts[r>>8].type--;*/ } } else if(t==PT_PHOT) @@ -2636,9 +2641,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_WATR || (r&TYPE)==PT_ICEI || (r&TYPE)==PT_SNOW) + if((r&0xFF)==PT_WATR || (r&0xFF)==PT_ICEI || (r&0xFF)==PT_SNOW) { parts[i].vx *= 0.995; parts[i].vy *= 0.995; @@ -2650,32 +2655,32 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((r&TYPE)==PT_ISOZ && 5>(rand()%2000)) + if((r&0xFF)==PT_ISOZ && 5>(rand()%2000)) { parts[i].vx *= 0.90; parts[i].vy *= 0.90; - parts[r>>PS].type = PT_PHOT; + parts[r>>8].type = PT_PHOT; rrr = (rand()%360)*3.14159f/180.0f; rr = (rand()%128+128)/127.0f; - parts[r>>PS].life = 680; - parts[r>>PS].ctype = 0x3FFFFFFF; - parts[r>>PS].vx = rr*cosf(rrr); - parts[r>>PS].vy = rr*sinf(rrr); + parts[r>>8].life = 680; + parts[r>>8].ctype = 0x3FFFFFFF; + parts[r>>8].vx = rr*cosf(rrr); + parts[r>>8].vy = rr*sinf(rrr); pv[y/CELL][x/CELL] -= 15.0f * CFDS; } - if((r&TYPE)==PT_ISZS && 5>(rand()%2000)) + if((r&0xFF)==PT_ISZS && 5>(rand()%2000)) { parts[i].vx *= 0.90; parts[i].vy *= 0.90; - parts[r>>PS].type = PT_PHOT; + parts[r>>8].type = PT_PHOT; rr = (rand()%228+128)/127.0f; rrr = (rand()%360)*3.14159f/180.0f; - parts[r>>PS].life = 680; - parts[r>>PS].ctype = 0x3FFFFFFF; - parts[r>>PS].vx = rr*cosf(rrr); - parts[r>>PS].vy = rr*sinf(rrr); + parts[r>>8].life = 680; + parts[r>>8].ctype = 0x3FFFFFFF; + parts[r>>8].vx = rr*cosf(rrr); + parts[r>>8].vy = rr*sinf(rrr); pv[y/CELL][x/CELL] -= 15.0f * CFDS; } } @@ -2687,13 +2692,13 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_WATR&&5>(rand()%2000)) + if(parts[r>>8].type==PT_WATR&&5>(rand()%2000)) { t = parts[i].type = PT_NONE; - parts[r>>PS].type = PT_DEUT; - parts[r>>PS].life = 10; + parts[r>>8].type = PT_DEUT; + parts[r>>8].life = 10; } } } @@ -2721,12 +2726,12 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r || parts[i].temp>374.0f) + if((r>>8)>=NPART || !r || parts[i].temp>374.0f) continue; - if(parts[r>>PS].type==PT_WATR&&33>=rand()/(RAND_MAX/100)+1) + if(parts[r>>8].type==PT_WATR&&33>=rand()/(RAND_MAX/100)+1) { parts[i].life++; - parts[r>>PS].type=PT_NONE; + parts[r>>8].type=PT_NONE; } } } @@ -2736,7 +2741,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART) + if((r>>8)>=NPART) continue; if((bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALLELEC||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_EWALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_DESTROYALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALL|| bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWAIR||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWSOLID||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWGAS)) @@ -2754,20 +2759,20 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==t&&(parts[i].life>parts[r>>PS].life)&&parts[i].life>0)//diffusion + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion { - int temp = parts[i].life - parts[r>>PS].life; + int temp = parts[i].life - parts[r>>8].life; if(temp ==1) { - parts[r>>PS].life ++; + parts[r>>8].life ++; parts[i].life --; trade = 9; } else if(temp>0) { - parts[r>>PS].life += temp/2; + parts[r>>8].life += temp/2; parts[i].life -= temp/2; trade = 9; } @@ -2779,9 +2784,9 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_FIRE&&parts[i].life>0) + if(parts[r>>8].type==PT_FIRE&&parts[i].life>0) { if(parts[i].life<=2) parts[i].life --; @@ -2794,7 +2799,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART) + if((r>>8)>=NPART) continue; if((bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALLELEC||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWLIQUID||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_DESTROYALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWSOLID)) continue; @@ -2816,13 +2821,13 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(pstates[parts[r>>PS].type].state==ST_SOLID&&5>=rand()%50&&parts[i].life==0&&!(parts[r>>PS].type==PT_CLNE||parts[r>>PS].type==PT_PCLN)) + if(pstates[parts[r>>8].type].state==ST_SOLID&&5>=rand()%50&&parts[i].life==0&&!(parts[r>>8].type==PT_CLNE||parts[r>>8].type==PT_PCLN)) { t = parts[i].type = PT_RIME; } - if(parts[r>>PS].type==PT_SPRK) + if(parts[r>>8].type==PT_SPRK) { parts[i].life += rand()%20; } @@ -2838,18 +2843,18 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; if(rt==PT_SPRK) { t = parts[i].type = PT_FOG; parts[i].life = rand()%50 + 60; } - else if(rt==PT_FOG&&parts[r>>PS].life>0) + else if(rt==PT_FOG&&parts[r>>8].life>0) { t = parts[i].type = PT_FOG; - parts[i].life = parts[r>>PS].life; + parts[i].life = parts[r>>8].life; } } } @@ -2865,14 +2870,14 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r || (parts[i].life >=maxlife)) + if((r>>8)>=NPART || !r || (parts[i].life >=maxlife)) continue; - if(parts[r>>PS].type==PT_DEUT&&33>=rand()/(RAND_MAX/100)+1) + if(parts[r>>8].type==PT_DEUT&&33>=rand()/(RAND_MAX/100)+1) { - if((parts[i].life + parts[r>>PS].life + 1) <= maxlife) + if((parts[i].life + parts[r>>8].life + 1) <= maxlife) { - parts[i].life += parts[r>>PS].life + 1; - parts[r>>PS].type=PT_NONE; + parts[i].life += parts[r>>8].life + 1; + parts[r>>8].type=PT_NONE; } } } @@ -2883,7 +2888,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || (parts[i].life<=maxlife)) + if((r>>8)>=NPART || (parts[i].life<=maxlife)) continue; if((bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALLELEC||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_EWALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_DESTROYALL||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_WALL|| bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWAIR||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWSOLID||bmap[(y+ny)/CELL][(x+nx)/CELL]==WL_ALLOWGAS)) @@ -2892,8 +2897,8 @@ 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]>>PS].temp = parts[i].temp; - parts[pmap[y+ny][x+nx]>>PS].life = 0; + parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp; + parts[pmap[y+ny][x+nx]>>8].life = 0; } } for( trade = 0; trade<4;trade ++) @@ -2903,19 +2908,19 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==t&&(parts[i].life>parts[r>>PS].life)&&parts[i].life>0)//diffusion + if(parts[r>>8].type==t&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion { - int temp = parts[i].life - parts[r>>PS].life; + int temp = parts[i].life - parts[r>>8].life; if(temp ==1) { - parts[r>>PS].life ++; + parts[r>>8].life ++; parts[i].life --; } else if(temp>0) { - parts[r>>PS].life += temp/2; + parts[r>>8].life += temp/2; parts[i].life -= temp/2; } } @@ -2931,14 +2936,14 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type!=PT_WARP&&parts[r>>PS].type!=PT_STKM&&parts[r>>PS].type!=PT_DMND&&parts[r>>PS].type!=PT_CLNE&&parts[r>>PS].type!=PT_BCLN&&parts[r>>PS].type!=PT_PCLN&&(10>=rand()%200)) + 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>>PS].x; - parts[i].y = parts[r>>PS].y; - parts[r>>PS].x = x; - parts[r>>PS].y = y; + 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; } @@ -2952,14 +2957,14 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if((parts[r>>PS].temp<100 && parts[r>>PS].type!=PT_C5)||parts[r>>PS].type==PT_HFLM) + 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>>PS].temp = parts[i].temp = 0; + parts[r>>8].temp = parts[i].temp = 0; parts[i].life = rand()%150+50; pv[y/CELL][x/CELL] += 1.5; } @@ -2975,9 +2980,9 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type!=PT_NONE && parts[r>>PS].type!=PT_BOMB){ + if(parts[r>>8].type!=PT_NONE && parts[r>>8].type!=PT_BOMB){ parts[i].type = PT_NONE; goto killed; } @@ -2988,9 +2993,9 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type!=PT_NONE && parts[r>>PS].type!=PT_BOMB && parts[r>>PS].type!=PT_DMND && parts[r>>PS].type!=PT_CLNE && parts[r>>PS].type!=PT_PCLN && parts[r>>PS].type!=PT_BCLN){ + 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; @@ -3010,7 +3015,7 @@ void update_particles_i(pixel *vid, int start, int inc) 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]&TYPE)!=PT_DMND && (pmap[y+nxj][x+nxi]&TYPE)!=PT_CLNE && (pmap[y+nxj][x+nxi]&TYPE)!=PT_PCLN && (pmap[y+nxj][x+nxi]&TYPE)!=PT_BCLN){ + 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); @@ -3034,11 +3039,11 @@ void update_particles_i(pixel *vid, int start, int inc) { create_part(-1, x , y-1 , PT_FWRK); r = pmap[y-1][x]; - if((r&TYPE)==PT_FWRK) + if((r&0xFF)==PT_FWRK) { - parts[r>>PS].vy = rand()%8-22; - parts[r>>PS].vx = rand()%20-rand()%20; - parts[r>>PS].life=rand()%15+25; + 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; } } @@ -3064,15 +3069,15 @@ void update_particles_i(pixel *vid, int start, int inc) 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>>PS].type==PT_DUST) + if(parts[a>>8].type==PT_DUST) { - parts[a>>PS].vy = -(rand()%10-1); - parts[a>>PS].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; - parts[a>>PS].life= rand()%37+18; - parts[a>>PS].tmp=q; - parts[a>>PS].flags=w; - parts[a>>PS].ctype=e; - parts[a>>PS].temp= rand()%20+6000; + 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; } } } @@ -3088,27 +3093,27 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; if(rt==PT_SPRK) { - if(parts[r>>PS].ctype==PT_PSCN) + if(parts[r>>8].ctype==PT_PSCN) { parts[i].life = 10; } - else if(parts[r>>PS].ctype==PT_NSCN) + else if(parts[r>>8].ctype==PT_NSCN) { parts[i].life = 9; } } if(rt==PT_LCRY) { - if(parts[i].life==10&&parts[r>>PS].life<10&&parts[r>>PS].life>0) + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) { parts[i].life = 9; } - else if(parts[i].life==0&&parts[r>>PS].life==10) + else if(parts[i].life==0&&parts[r>>8].life==10) { parts[i].life = 10; } @@ -3144,7 +3149,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART ) + if((r>>8)>=NPART ) continue; if(!r) create_part(-1,x+nx,y+ny,PT_BRCK); @@ -3160,7 +3165,7 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART) + if((r>>8)>=NPART) continue; if(!r&&!parts[i].life) parts[i].life=50; @@ -3184,12 +3189,12 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_PIPE&&parts[r>>PS].ctype==1) + if(parts[r>>8].type==PT_PIPE&&parts[r>>8].ctype==1) { - parts[r>>PS].ctype = (((ctype)%3)+2);//reverse - parts[r>>PS].life = 6; + parts[r>>8].ctype = (((ctype)%3)+2);//reverse + parts[r>>8].life = 6; } } } @@ -3200,32 +3205,32 @@ void update_particles_i(pixel *vid, int start, int inc) if(x+nx>=0 && y+ny>0 && x+nx>PS)>=NPART) + if((r>>8)>=NPART) continue; else if(!r&&parts[i].tmp!=0) { if(create_part(-1,x+nx,y+ny,parts[i].tmp)) { - parts[pmap[y+ny][x+nx]>>PS].temp = parts[i].temp;//pipe saves temp and life now - parts[pmap[y+ny][x+nx]>>PS].life = parts[i].flags; + parts[pmap[y+ny][x+nx]>>8].temp = parts[i].temp;//pipe saves temp and life now + parts[pmap[y+ny][x+nx]>>8].life = parts[i].flags; } parts[i].tmp = 0; continue; } else if(!r) continue; - else if(parts[i].tmp == 0 && (ptypes[parts[r>>PS].type].falldown!= 0 || pstates[parts[r>>PS].type].state == ST_GAS)) + else if(parts[i].tmp == 0 && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS)) { - parts[i].tmp = parts[r>>PS].type; - parts[i].temp = parts[r>>PS].temp; - parts[i].flags = parts[r>>PS].life; - parts[r>>PS].type = PT_NONE; + parts[i].tmp = parts[r>>8].type; + parts[i].temp = parts[r>>8].temp; + parts[i].flags = parts[r>>8].life; + parts[r>>8].type = PT_NONE; } - else if(parts[r>>PS].type==PT_PIPE && parts[r>>PS].ctype!=(((ctype)%3)+2) && parts[r>>PS].tmp==0&&parts[i].tmp>0) + else if(parts[r>>8].type==PT_PIPE && parts[r>>8].ctype!=(((ctype)%3)+2) && parts[r>>8].tmp==0&&parts[i].tmp>0) { - parts[r>>PS].tmp = parts[i].tmp; - parts[r>>PS].temp = parts[i].temp; - parts[r>>PS].flags = parts[i].flags; + parts[r>>8].tmp = parts[i].tmp; + parts[r>>8].temp = parts[i].temp; + parts[r>>8].flags = parts[i].flags; parts[i].tmp = 0; } } @@ -3241,12 +3246,12 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_WATR&&5>rand()%100) + if(parts[r>>8].type==PT_WATR&&5>rand()%100) { - parts[r>>PS].type=PT_FRZW; - parts[r>>PS].life = 100; + parts[r>>8].type=PT_FRZW; + parts[r>>8].life = 100; t = parts[i].type = PT_NONE; } @@ -3260,11 +3265,11 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_WATR&&5>rand()%70) + if(parts[r>>8].type==PT_WATR&&5>rand()%70) { - parts[r>>PS].type=PT_FRZW; + parts[r>>8].type=PT_FRZW; } } if(parts[i].life==0&&13>rand()%2500) @@ -3292,12 +3297,12 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - else if(parts[r>>PS].type==PT_SPRK&&(parts[r>>PS].ctype==PT_PSCN)&&(parts[r>>PS].life>=3)&&parts[i].life==0&&parts_avg(i,r>>PS,PT_INSL)!=PT_INSL) + else if(parts[r>>8].type==PT_SPRK&&(parts[r>>8].ctype==PT_PSCN)&&(parts[r>>8].life>=3)&&parts[i].life==0&&parts_avg(i,r>>8,PT_INSL)!=PT_INSL) { flood_parts(x,y,PT_SPRK,PT_INST,-1);//spark the wire - //parts[r>>PS].type=parts[r>>PS].ctype; + //parts[r>>8].type=parts[r>>8].ctype; } } } @@ -3315,19 +3320,19 @@ void update_particles_i(pixel *vid, int start, int inc) { count ++; r = pmap[y+ny][x+nx]; - if((r>>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_SPRK || (parts[r>>PS].type!=PT_PRTI && parts[r>>PS].type!=PT_PRTO && (ptypes[parts[r>>PS].type].falldown!= 0 || pstates[parts[r>>PS].type].state == ST_GAS))) + if(parts[r>>8].type==PT_SPRK || (parts[r>>8].type!=PT_PRTI && parts[r>>8].type!=PT_PRTO && (ptypes[parts[r>>8].type].falldown!= 0 || pstates[parts[r>>8].type].state == ST_GAS))) for( nnx=0;nnx<80;nnx++) if(!portal[parts[i].tmp][count-1][nnx]) { - portal[parts[i].tmp][count-1][nnx] = parts[r>>PS].type; - portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>PS].temp; - portalctype[parts[i].tmp][count-1][nnx] = parts[r>>PS].ctype; - if(parts[r>>PS].type==PT_SPRK) - parts[r>>PS].type = parts[r>>PS].ctype; + portal[parts[i].tmp][count-1][nnx] = parts[r>>8].type; + portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>8].temp; + portalctype[parts[i].tmp][count-1][nnx] = parts[r>>8].ctype; + if(parts[r>>8].type==PT_SPRK) + parts[r>>8].type = parts[r>>8].ctype; else - parts[r>>PS].type = PT_NONE; + parts[r>>8].type = PT_NONE; break; } } @@ -3346,7 +3351,7 @@ void update_particles_i(pixel *vid, int start, int inc) { count ++; r = pmap[y+ny][x+nx]; - if((r>>PS)>=NPART || r) + if((r>>8)>=NPART || r) continue; if(!r) { @@ -3374,8 +3379,8 @@ void update_particles_i(pixel *vid, int start, int inc) 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]>>PS].temp = portaltemp[parts[i].tmp][randomness-1][nnx]; - parts[pmap[y+ny][x+nx]>>PS].ctype = portalctype[parts[i].tmp][randomness-1][nnx]; + parts[pmap[y+ny][x+nx]>>8].temp = portaltemp[parts[i].tmp][randomness-1][nnx]; + parts[pmap[y+ny][x+nx]>>8].ctype = portalctype[parts[i].tmp][randomness-1][nnx]; portal[parts[i].tmp][randomness-1][nnx] = 0; portaltemp[parts[i].tmp][randomness-1][nnx] = 0; portalctype[parts[i].tmp][randomness-1][nnx] = 0; @@ -3397,29 +3402,29 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_NSCN&&parts[r>>PS].life==0 && wireless[parts[i].tmp][0]) + if(parts[r>>8].type==PT_NSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0]) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].ctype = PT_NSCN; - parts[r>>PS].life = 4; + parts[r>>8].type = PT_SPRK; + parts[r>>8].ctype = PT_NSCN; + parts[r>>8].life = 4; } - else if(parts[r>>PS].type==PT_PSCN&&parts[r>>PS].life==0 && wireless[parts[i].tmp][0]) + else if(parts[r>>8].type==PT_PSCN&&parts[r>>8].life==0 && wireless[parts[i].tmp][0]) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].ctype = PT_PSCN; - parts[r>>PS].life = 4; + parts[r>>8].type = PT_SPRK; + parts[r>>8].ctype = PT_PSCN; + parts[r>>8].life = 4; } - else if(parts[r>>PS].type==PT_INWR&&parts[r>>PS].life==0 && wireless[parts[i].tmp][0]) + else if(parts[r>>8].type==PT_INWR&&parts[r>>8].life==0 && wireless[parts[i].tmp][0]) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].ctype = PT_INWR; - parts[r>>PS].life = 4; + parts[r>>8].type = PT_SPRK; + parts[r>>8].ctype = PT_INWR; + parts[r>>8].life = 4; } - else if(parts[r>>PS].type==PT_SPRK && parts[r>>PS].ctype!=PT_NSCN && parts[r>>PS].life>=3 && !wireless[parts[i].tmp][0]) + 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>>PS].type = parts[r>>PS].ctype; + //parts[r>>8].type = parts[r>>8].ctype; wireless[parts[i].tmp][0] = 1; wireless[parts[i].tmp][1] = 1; ISWIRE = 1; @@ -3434,27 +3439,27 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; if(rt==PT_SPRK) { - if(parts[r>>PS].ctype==PT_PSCN) + if(parts[r>>8].ctype==PT_PSCN) { parts[i].life = 10; } - else if(parts[r>>PS].ctype==PT_NSCN) + else if(parts[r>>8].ctype==PT_NSCN) { parts[i].life = 9; } } if(rt==PT_PCLN) { - if(parts[i].life==10&&parts[r>>PS].life<10&&parts[r>>PS].life>0) + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) { parts[i].life = 9; } - else if(parts[i].life==0&&parts[r>>PS].life==10) + else if(parts[i].life==0&&parts[r>>8].life==10) { parts[i].life = 10; } @@ -3469,27 +3474,27 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; if(rt==PT_SPRK) { - if(parts[r>>PS].ctype==PT_PSCN) + if(parts[r>>8].ctype==PT_PSCN) { parts[i].life = 10; } - else if(parts[r>>PS].ctype==PT_NSCN) + else if(parts[r>>8].ctype==PT_NSCN) { parts[i].life = 9; } } if(rt==PT_HSWC) { - if(parts[i].life==10&&parts[r>>PS].life<10&&parts[r>>PS].life>0) + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) { parts[i].life = 9; } - else if(parts[i].life==0&&parts[r>>PS].life==10) + else if(parts[i].life==0&&parts[r>>8].life==10) { parts[i].life = 10; } @@ -3504,27 +3509,27 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; if(rt==PT_SPRK) { - if(parts[r>>PS].ctype==PT_PSCN) + if(parts[r>>8].ctype==PT_PSCN) { parts[i].life = 10; } - else if(parts[r>>PS].ctype==PT_NSCN) + else if(parts[r>>8].ctype==PT_NSCN) { parts[i].life = 9; } } if(rt==PT_PUMP) { - if(parts[i].life==10&&parts[r>>PS].life<10&&parts[r>>PS].life>0) + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) { parts[i].life = 9; } - else if(parts[i].life==0&&parts[r>>PS].life==10) + else if(parts[i].life==0&&parts[r>>8].life==10) { parts[i].life = 10; } @@ -3539,9 +3544,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - else if(parts[r>>PS].type==PT_SPRK&&parts[i].life==0) + else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) for( nnx=-1;nnx<2;nnx++) for( nny=-1;nny<2;nny++) { @@ -3553,10 +3558,10 @@ void update_particles_i(pixel *vid, int start, int inc) 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]>>PS].life=7; + //parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; } } - else if(parts[r>>PS].type==PT_SHLD3&&4>rand()%10) + else if(parts[r>>8].type==PT_SHLD3&&4>rand()%10) { t = parts[i].type=PT_SHLD2; parts[i].life = 7; @@ -3571,13 +3576,13 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART) + 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>>PS].type==PT_SPRK&&parts[i].life==0) + else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) for( nnx=-1;nnx<2;nnx++) for( nny=-1;nny<2;nny++) { @@ -3589,10 +3594,10 @@ void update_particles_i(pixel *vid, int start, int inc) 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]>>PS].life=7; + parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; } } - else if(parts[r>>PS].type==PT_SHLD4&&4>rand()%10) + else if(parts[r>>8].type==PT_SHLD4&&4>rand()%10) { t = parts[i].type=PT_SHLD3; parts[i].life = 7; @@ -3607,26 +3612,26 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART) + 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]>>PS].life=7; + parts[pmap[y+ny][x+nx]>>8].life=7; t = parts[i].type = PT_SHLD2; } else continue; } - if(parts[r>>PS].type==PT_SHLD1 && parts[i].life>3) + if(parts[r>>8].type==PT_SHLD1 && parts[i].life>3) { - parts[r>>PS].type = PT_SHLD2; - parts[r>>PS].life=7; + parts[r>>8].type = PT_SHLD2; + parts[r>>8].life=7; } - else if(parts[r>>PS].type==PT_SPRK&&parts[i].life==0) + else if(parts[r>>8].type==PT_SPRK&&parts[i].life==0) for( nnx=-1;nnx<2;nnx++) for( nny=-1;nny<2;nny++) { @@ -3638,7 +3643,7 @@ void update_particles_i(pixel *vid, int start, int inc) 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]>>PS].life=7; + parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; } } } @@ -3651,33 +3656,33 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART) + 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]>>PS].life=7; + parts[pmap[y+ny][x+nx]>>8].life=7; t = parts[i].type = PT_SHLD2; } else continue; } - if(parts[r>>PS].type==PT_SHLD2 && parts[i].life>3) + if(parts[r>>8].type==PT_SHLD2 && parts[i].life>3) { - parts[r>>PS].type = PT_SHLD3; - parts[r>>PS].life = 7; + parts[r>>8].type = PT_SHLD3; + parts[r>>8].life = 7; } - else if(parts[r>>PS].type==PT_SPRK&&parts[i].life==0) + 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]>>PS].life=7; + parts[pmap[y+ny+nny][x+nx+nnx]>>8].life=7; } } } @@ -3690,10 +3695,10 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; - if((r&TYPE)!=PT_AMTR && (r&TYPE)!=PT_DMND && (r&TYPE)!=PT_CLNE && (r&TYPE)!=PT_PCLN && (r&TYPE)!=PT_NONE && (r&TYPE)!=PT_PHOT && (r&TYPE)!=PT_VOID && (r&TYPE)!=PT_BHOL && (r&TYPE)!=PT_PRTI && (r&TYPE)!=PT_PRTO) + 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) @@ -3702,9 +3707,9 @@ void update_particles_i(pixel *vid, int start, int inc) kill_part(i); goto killed; } - parts[r>>PS].life = 0; - parts[r>>PS].type = PT_NONE; - kill_part(r>>PS); + 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; @@ -3720,31 +3725,31 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type!=PT_DMND&&33>=rand()/(RAND_MAX/100)+1) + if(parts[r>>8].type!=PT_DMND&&33>=rand()/(RAND_MAX/100)+1) { - if(parts[r>>PS].type==PT_SING && parts[r>>PS].life >10) + if(parts[r>>8].type==PT_SING && parts[r>>8].life >10) { - if(parts[i].life+parts[r>>PS].life > 255) + if(parts[i].life+parts[r>>8].life > 255) continue; - parts[i].life += parts[r>>PS].life; + parts[i].life += parts[r>>8].life; } else { if(parts[i].life+3 > 255) { - if(parts[r>>PS].type!=PT_SING && 1>rand()%100) + if(parts[r>>8].type!=PT_SING && 1>rand()%100) { - parts[r>>PS].type = PT_SING; - parts[r>>PS].life = rand()%50+60; + 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>>PS].temp+parts[i].temp, MIN_TEMP, MAX_TEMP); - parts[r>>PS].type=PT_NONE; + parts[i].temp = restrict_flt(parts[r>>8].temp+parts[i].temp, MIN_TEMP, MAX_TEMP); + parts[r>>8].type=PT_NONE; } } } @@ -3756,15 +3761,15 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_WATR && 1>rand()%30) + if(parts[r>>8].type==PT_WATR && 1>rand()%30) { - parts[r>>PS].type = PT_FOG; + parts[r>>8].type = PT_FOG; } - if(parts[r>>PS].type==PT_O2 && 1>rand()%9) + if(parts[r>>8].type==PT_O2 && 1>rand()%9) { - parts[r>>PS].type = PT_NONE; + parts[r>>8].type = PT_NONE; t = parts[i].type = PT_WATR; pv[y/CELL][x/CELL] += 4.0; } @@ -3778,9 +3783,9 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; if(rt==PT_FIRE||rt==PT_PLSM||rt==PT_THDR) { parts[i].tmp = 1; @@ -3794,7 +3799,7 @@ void update_particles_i(pixel *vid, int start, int inc) } else { float newVel = parts[i].life/25; parts[i].flags = parts[i].flags&0xFFFFFFFE; - if((pmap[(int)(ly-newVel)][(int)lx]&TYPE)==PT_NONE && ly-newVel>0) { + if((pmap[(int)(ly-newVel)][(int)lx]&0xFF)==PT_NONE && ly-newVel>0) { parts[i].vy = -newVel; ly-=newVel; iy-=newVel; @@ -3810,14 +3815,14 @@ void update_particles_i(pixel *vid, int start, int inc) int tmul = rand()%7; create_part(-1, x+nx, y+ny, PT_FIRW); r = pmap[y+ny][x+nx]; - if((r>>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - if(parts[r>>PS].type==PT_FIRW) { - parts[r>>PS].vx = (rand()%3-1)*tmul; - parts[r>>PS].vy = (rand()%3-1)*tmul; - parts[r>>PS].tmp = col; - parts[r>>PS].life = rand()%100+100; - parts[r>>PS].temp = 6000.0f; + 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; } } } @@ -3841,16 +3846,16 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; - if(parts_avg(i,r>>PS,PT_INSL) != PT_INSL) + 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>>PS].life==0 && abs(nx)+abs(ny) < 4) + 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>>PS].life = 4; - parts[r>>PS].ctype = rt; - parts[r>>PS].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; + parts[r>>8].type = PT_SPRK; } } } @@ -3863,32 +3868,32 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; - if(parts[r>>PS].type == PT_SWCH&&parts_avg(i,r>>PS,PT_INSL)!=PT_INSL) + if(parts[r>>8].type == PT_SWCH&&parts_avg(i,r>>8,PT_INSL)!=PT_INSL) { - if(parts[i].life==10&&parts[r>>PS].life<10&&parts[r>>PS].life>0) + if(parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) { parts[i].life = 9; } - else if(parts[i].life==0&&parts[r>>PS].life==10) + else if(parts[i].life==0&&parts[r>>8].life==10) { parts[i].life = 10; } } - else if(parts[r>>PS].type == PT_SPRK && parts[r>>PS].ctype==PT_SWCH && parts[i].life<10 && parts[i].life>0 &&parts_avg(i,r>>PS,PT_INSL)!=PT_INSL) + else if(parts[r>>8].type == PT_SPRK && parts[r>>8].ctype==PT_SWCH && parts[i].life<10 && parts[i].life>0 &&parts_avg(i,r>>8,PT_INSL)!=PT_INSL) { - parts[r>>PS].type = parts[r>>PS].ctype; - parts[r>>PS].life = 9; + parts[r>>8].type = parts[r>>8].ctype; + parts[r>>8].life = 9; } } - if(parts[i].life==10 && (!(pmap[y-1][x-1]&TYPE) && ((pmap[y-1][x]&TYPE)==PT_BRAY&&parts[pmap[y-1][x]>>PS].tmp==2) && !(pmap[y-1][x+1]&TYPE) && ((pmap[y][x+1]&TYPE)==PT_BRAY&&parts[pmap[y][x+1]>>PS].tmp==2))) + if(parts[i].life==10 && (!(pmap[y-1][x-1]&0xFF) && ((pmap[y-1][x]&0xFF)==PT_BRAY&&parts[pmap[y-1][x]>>8].tmp==2) && !(pmap[y-1][x+1]&0xFF) && ((pmap[y][x+1]&0xFF)==PT_BRAY&&parts[pmap[y][x+1]>>8].tmp==2))) { parts[i].life = 9; } - else if(parts[i].life<=5 && (!(pmap[y-1][x-1]&TYPE) && (((pmap[y-1][x]&TYPE)==PT_BRAY&&parts[pmap[y-1][x]>>PS].tmp==2) || ((pmap[y+1][x]&TYPE)==PT_BRAY&&parts[pmap[y+1][x]>>PS].tmp==2)) && !(pmap[y-1][x+1]&TYPE) && (((pmap[y][x+1]&TYPE)==PT_BRAY&&parts[pmap[y][x+1]>>PS].tmp==2) || ((pmap[y][x-1]&TYPE)==PT_BRAY&&parts[pmap[y][x-1]>>PS].tmp==2)))) + else if(parts[i].life<=5 && (!(pmap[y-1][x-1]&0xFF) && (((pmap[y-1][x]&0xFF)==PT_BRAY&&parts[pmap[y-1][x]>>8].tmp==2) || ((pmap[y+1][x]&0xFF)==PT_BRAY&&parts[pmap[y+1][x]>>8].tmp==2)) && !(pmap[y-1][x+1]&0xFF) && (((pmap[y][x+1]&0xFF)==PT_BRAY&&parts[pmap[y][x+1]>>8].tmp==2) || ((pmap[y][x-1]&0xFF)==PT_BRAY&&parts[pmap[y][x-1]>>8].tmp==2)))) { parts[i].life = 14; } @@ -3906,19 +3911,19 @@ void update_particles_i(pixel *vid, int start, int inc) x+nx>PS)>=NPART || !r) + if((r>>8)>=NPART || !r) continue; if(bmap[(y+ny)/CELL][(x+nx)/CELL] && bmap[(y+ny)/CELL][(x+nx)/CELL]!=WL_STREAM) continue; - rt = parts[r>>PS].type; + rt = parts[r>>8].type; if((a || ptypes[rt].explosive) && ((rt!=PT_RBDM && rt!=PT_LRBD && rt!=PT_INSL && rt!=PT_SWCH) || t!=PT_SPRK) && !(t==PT_PHOT && rt==PT_INSL) && - (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR && rt!=PT_QRTZ)) && !(rt==PT_SPNG && parts[r>>PS].life>0) && + (t!=PT_LAVA || parts[i].life>0 || (rt!=PT_STNE && rt!=PT_PSCN && rt!=PT_NSCN && rt!=PT_NTCT && rt!=PT_PTCT && rt!=PT_METL && rt!=PT_IRON && rt!=PT_ETRD && rt!=PT_BMTL && rt!=PT_BRMT && rt!=PT_SWCH && rt!=PT_INWR && rt!=PT_QRTZ)) && !(rt==PT_SPNG && parts[r>>8].life>0) && ptypes[rt].flammable && (ptypes[rt].flammable + (int)(pv[(y+ny)/CELL][(x+nx)/CELL]*10.0f))>(rand()%1000)) { - parts[r>>PS].type = PT_FIRE; - parts[r>>PS].temp = ptypes[PT_FIRE].heat + (ptypes[rt].flammable/2); - parts[r>>PS].life = rand()%80+180; + parts[r>>8].type = PT_FIRE; + parts[r>>8].temp = ptypes[PT_FIRE].heat + (ptypes[rt].flammable/2); + parts[r>>8].life = rand()%80+180; if(ptypes[rt].explosive) pv[y/CELL][x/CELL] += 0.25f * CFDS; continue; @@ -3932,10 +3937,10 @@ void update_particles_i(pixel *vid, int start, int inc) { if(t!=PT_LAVA || parts[i].life>0) { - parts[r>>PS].ctype = (parts[r>>PS].type==PT_BRMT)?PT_BMTL:parts[r>>PS].type; - parts[r>>PS].ctype = (parts[r>>PS].ctype==PT_SAND)?PT_GLAS:parts[r>>PS].ctype; - parts[r>>PS].type = PT_LAVA; - parts[r>>PS].life = rand()%120+240; + parts[r>>8].ctype = (parts[r>>8].type==PT_BRMT)?PT_BMTL:parts[r>>8].type; + parts[r>>8].ctype = (parts[r>>8].ctype==PT_SAND)?PT_GLAS:parts[r>>8].ctype; + parts[r>>8].type = PT_LAVA; + parts[r>>8].life = rand()%120+240; } else { @@ -3947,7 +3952,7 @@ void update_particles_i(pixel *vid, int start, int inc) } if(t!=PT_SPRK && (rt==PT_ICEI || rt==PT_SNOW)) { - parts[r>>PS].type = PT_WATR; + parts[r>>8].type = PT_WATR; if(t==PT_FIRE) { parts[i].x = lx; @@ -3964,7 +3969,7 @@ void update_particles_i(pixel *vid, int start, int inc) } if(t!=PT_SPRK && (rt==PT_WATR || rt==PT_DSTW || rt==PT_SLTW)) { - kill_part(r>>PS); + kill_part(r>>8); if(t==PT_FIRE) { parts[i].x = lx; @@ -3984,99 +3989,99 @@ void update_particles_i(pixel *vid, int start, int inc) //Check if there is a SWCH that is currently covered with SPRK //If so check if the current SPRK is covering a NSCN //If so turn the SPRK that covers the SWCH back into SWCH and turn it off - if(rt==PT_SPRK && parts[r>>PS].ctype == PT_SWCH && t==PT_SPRK) + if(rt==PT_SPRK && parts[r>>8].ctype == PT_SWCH && t==PT_SPRK) { - pavg = parts_avg(r>>PS, i,PT_INSL); + pavg = parts_avg(r>>8, i,PT_INSL); if(parts[i].ctype == PT_NSCN&&pavg != PT_INSL) { - parts[r>>PS].type = PT_SWCH; - parts[r>>PS].ctype = PT_NONE; - parts[r>>PS].life = 9; + parts[r>>8].type = PT_SWCH; + parts[r>>8].ctype = PT_NONE; + parts[r>>8].life = 9; } } - pavg = parts_avg(i, r>>PS,PT_INSL); + pavg = parts_avg(i, r>>8,PT_INSL); if(rt==PT_SWCH && t==PT_SPRK) { - pavg = parts_avg(r>>PS, i,PT_INSL); - if(parts[i].ctype == PT_PSCN&&pavg != PT_INSL && parts[r>>PS].life<10) - parts[r>>PS].life = 10; + pavg = parts_avg(r>>8, i,PT_INSL); + if(parts[i].ctype == PT_PSCN&&pavg != PT_INSL && parts[r>>8].life<10) + parts[r>>8].life = 10; if(parts[i].ctype == PT_NSCN&&pavg != PT_INSL) - parts[r>>PS].life = 9; - if(!(parts[i].ctype == PT_PSCN||parts[i].ctype == PT_NSCN)&&parts[r>>PS].life == 10&&pavg != PT_INSL) + parts[r>>8].life = 9; + if(!(parts[i].ctype == PT_PSCN||parts[i].ctype == PT_NSCN)&&parts[r>>8].life == 10&&pavg != PT_INSL) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].ctype = PT_SWCH; - parts[r>>PS].life = 4; + parts[r>>8].type = PT_SPRK; + parts[r>>8].ctype = PT_SWCH; + parts[r>>8].life = 4; } } - pavg = parts_avg(i, r>>PS,PT_INSL); + pavg = parts_avg(i, r>>8,PT_INSL); if(pavg != PT_INSL) { - if(t==PT_SPRK && (ptypes[rt].properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>PS].life==0 && - (parts[i].life<3 || ((r>>PS)>8].life==0 && + (parts[i].life<3 || ((r>>8)=373.0f)&&parts[i].ctype==PT_NTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN&&parts[i].temp<=373.0f)&&parts[i].ctype==PT_PTCT)&&!(rt!=PT_PSCN&&!(rt==PT_NSCN)&&parts[i].ctype==PT_INWR) && pavg != PT_INSL &&!(parts[i].ctype==PT_SWCH&&(rt==PT_PSCN||rt==PT_NSCN))&&!(parts[i].ctype==PT_INST&&rt!=PT_NSCN) ) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].life = 4; - parts[r>>PS].ctype = rt; - if(parts[r>>PS].temp+10.0f<673.0f&&!legacy_enable&&!(rt==PT_LRBD||rt==PT_RBDM||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR)) - parts[r>>PS].temp = parts[r>>PS].temp+10.0f; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; + if(parts[r>>8].temp+10.0f<673.0f&&!legacy_enable&&!(rt==PT_LRBD||rt==PT_RBDM||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR)) + parts[r>>8].temp = parts[r>>8].temp+10.0f; } } - if(t==PT_SPRK && rt==PT_NTCT && parts[r>>PS].life==0 && - (parts[i].life<3 || ((r>>PS)>8].life==0 && + (parts[i].life<3 || ((r>>8)>PS].temp>373.0f))&&pavg != PT_INSL) + if((parts[i].ctype==PT_NSCN||parts[i].ctype==PT_NTCT||(parts[i].ctype==PT_PSCN&&parts[r>>8].temp>373.0f))&&pavg != PT_INSL) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].life = 4; - parts[r>>PS].ctype = rt; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; } } - if(t==PT_SPRK && rt==PT_PTCT && parts[r>>PS].life==0 && - (parts[i].life<3 || ((r>>PS)>8].life==0 && + (parts[i].life<3 || ((r>>8)>PS].temp<373.0f))&&pavg != PT_INSL) + if((parts[i].ctype==PT_NSCN||parts[i].ctype==PT_PTCT||(parts[i].ctype==PT_PSCN&&parts[r>>8].temp<373.0f))&&pavg != PT_INSL) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].life = 4; - parts[r>>PS].ctype = rt; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; } } - if(t==PT_SPRK && rt==PT_INWR && parts[r>>PS].life==0 && - (parts[i].life<3 || ((r>>PS)>8].life==0 && + (parts[i].life<3 || ((r>>8)>PS].type = PT_SPRK; - parts[r>>PS].life = 4; - parts[r>>PS].ctype = rt; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; } } - if(t==PT_SPRK && rt==PT_QRTZ && parts[r>>PS].life==0 && - (parts[i].life<3 || ((r>>PS)>8].life==0 && + (parts[i].life<3 || ((r>>8)>PS].temp<173.15||pv[(y+ny)/CELL][(x+nx)/CELL]>8)) + if((parts[i].ctype==PT_NSCN||parts[i].ctype==PT_METL||parts[i].ctype==PT_PSCN||parts[i].ctype==PT_QRTZ)&&pavg != PT_INSL && (parts[r>>8].temp<173.15||pv[(y+ny)/CELL][(x+nx)/CELL]>8)) { - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].life = 4; - parts[r>>PS].ctype = rt; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; } } - if(t==PT_SPRK && rt==PT_WATR && parts[r>>PS].life==0 && - (parts[i].life<2 || ((r>>PS)>8].life==0 && + (parts[i].life<2 || ((r>>8)>PS].type = PT_SPRK; - parts[r>>PS].life = 6; - parts[r>>PS].ctype = rt; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 6; + parts[r>>8].ctype = rt; } - if(t==PT_SPRK && rt==PT_SLTW && parts[r>>PS].life==0 && - (parts[i].life<2 || ((r>>PS)>8].life==0 && + (parts[i].life<2 || ((r>>8)>PS].type = PT_SPRK; - parts[r>>PS].life = 5; - parts[r>>PS].ctype = rt; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 5; + parts[r>>8].ctype = rt; } if(t==PT_SPRK&&parts[i].ctype==PT_ETRD&&parts[i].life==5) { @@ -4085,9 +4090,9 @@ void update_particles_i(pixel *vid, int start, int inc) t = parts[i].type = PT_ETRD; parts[i].ctype = PT_NONE; parts[i].life = 20; - parts[r>>PS].type = PT_SPRK; - parts[r>>PS].life = 4; - parts[r>>PS].ctype = rt; + parts[r>>8].type = PT_SPRK; + parts[r>>8].life = 4; + parts[r>>8].ctype = rt; } } @@ -4119,6 +4124,11 @@ killed: if((parts[i].temp<309.6f) && (parts[i].temp>=243)) parts[i].temp += 1; + if (isplayer) { //Already a stickman in the simulation + death = 1; + parts[i].type = PT_NONE; + } + //Death if(parts[i].life<1 || death == 1 || (pv[y/CELL][x/CELL]>=4.5f && player[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... { @@ -4178,10 +4188,10 @@ killed: player[26] = 0; //Go left - if (((int)(player[0])&0x01) == 0x01 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_GAS) + if (((int)(player[0])&0x01) == 0x01 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS) { - if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_LIQUID - && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE) != PT_LNTG) + if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID + && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG) { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { @@ -4216,10 +4226,10 @@ killed: } //Go right - if (((int)(player[0])&0x02) == 0x02 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_GAS) + if (((int)(player[0])&0x02) == 0x02 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS) { - if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_LIQUID - && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE) != PT_LNTG) + if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID + && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG) { if (pmap[(int)(player[8]-1)][(int)(player[7])]) { @@ -4255,7 +4265,7 @@ killed: } //Jump - if (((int)(player[0])&0x04) == 0x04 && (pstates[pmap[(int)(player[8]-0.5)][(int)(player[7])]&TYPE].state != ST_GAS || pstates[pmap[(int)(player[16]-0.5)][(int)(player[15])]&TYPE].state != ST_GAS)) + if (((int)(player[0])&0x04) == 0x04 && (pstates[pmap[(int)(player[8]-0.5)][(int)(player[7])]&0xFF].state != ST_GAS || pstates[pmap[(int)(player[16]-0.5)][(int)(player[15])]&0xFF].state != ST_GAS)) { if (pmap[(int)(player[8]-0.5)][(int)(player[7])] || pmap[(int)(player[16]-0.5)][(int)(player[15])]) { @@ -4275,25 +4285,25 @@ killed: for(nx = -2; nx <= 2; nx++) for(ny = 0; ny>=-2; ny--) { - if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>PS)>=NPART) + if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>8)>=NPART) continue; - if(ptypes[pmap[ny+y][nx+x]&TYPE].falldown!=0 || (pmap[ny+y][nx+x]&TYPE) == PT_NEUT || (pmap[ny+y][nx+x]&TYPE) == PT_PHOT) + if(ptypes[pmap[ny+y][nx+x]&0xFF].falldown!=0 || (pmap[ny+y][nx+x]&0xFF) == PT_NEUT || (pmap[ny+y][nx+x]&0xFF) == PT_PHOT) { - player[2] = pmap[ny+y][nx+x]&TYPE; //Current element + player[2] = pmap[ny+y][nx+x]&0xFF; //Current element } - if((pmap[ny+y][nx+x]&TYPE) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP + if((pmap[ny+y][nx+x]&0xFF) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP { if(parts[i].life<=95) parts[i].life += 5; else parts[i].life = 100; - kill_part(pmap[ny+y][nx+x]>>PS); + kill_part(pmap[ny+y][nx+x]>>8); } - if((pmap[ny+y][nx+x]&TYPE) == PT_NEUT) + if((pmap[ny+y][nx+x]&0xFF) == PT_NEUT) { parts[i].life -= (102-parts[i].life)/2; - kill_part(pmap[ny+y][nx+x]>>PS); + kill_part(pmap[ny+y][nx+x]>>8); } if(bmap[(ny+y)/CELL][(nx+x)/CELL]==WL_FAN) player[2] = SPC_AIR; @@ -4308,9 +4318,9 @@ killed: { ny -= 2*(rand()%2)+1; r = pmap[ny][nx]; - if(!((r>>PS)>=NPART)) + if(!((r>>8)>=NPART)) { - if(pstates[r&TYPE].state == ST_SOLID) + if(pstates[r&0xFF].state == ST_SOLID) { create_part(-1, nx, ny, PT_SPRK); } @@ -4322,20 +4332,20 @@ killed: create_part(-1, nx, ny, player[2]); r = pmap[ny][nx]; - if( ((r>>PS) < NPART) && (r>>PS)>=0 && player[2] != PT_PHOT && player[2] != SPC_AIR) - parts[r>>PS].vx = parts[r>>PS].vx + 5*((((int)player[1])&0x02) == 0x02) - 5*(((int)(player[1])&0x01) == 0x01); - if(((r>>PS) < NPART) && (r>>PS)>=0 && player[2] == PT_PHOT) + if( ((r>>8) < NPART) && (r>>8)>=0 && player[2] != PT_PHOT && player[2] != SPC_AIR) + parts[r>>8].vx = parts[r>>8].vx + 5*((((int)player[1])&0x02) == 0x02) - 5*(((int)(player[1])&0x01) == 0x01); + if(((r>>8) < NPART) && (r>>8)>=0 && player[2] == PT_PHOT) { int random = abs(rand()%3-1)*3; if (random==0) { - parts[r>>PS].life = 0; - parts[r>>PS].type = PT_NONE; + parts[r>>8].life = 0; + parts[r>>8].type = PT_NONE; } else { - parts[r>>PS].vy = 0; - parts[r>>PS].vx = (((((int)player[1])&0x02) == 0x02) - (((int)(player[1])&0x01) == 0x01))*random; + parts[r>>8].vy = 0; + parts[r>>8].vx = (((((int)player[1])&0x02) == 0x02) - (((int)(player[1])&0x01) == 0x01))*random; } } @@ -4372,11 +4382,11 @@ killed: for(nx = -3; nx <= 3; nx++) { r = pmap[(int)(player[16]-2)][(int)(player[15]+nx)]; - if(r && pstates[r&TYPE].state != ST_GAS && pstates[r&TYPE].state != ST_LIQUID) + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player[15] -= nx; r = pmap[(int)(player[8]-2)][(int)(player[7]+nx)]; - if(r && pstates[r&TYPE].state != ST_GAS && pstates[r&TYPE].state != ST_LIQUID) + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player[7] -= nx; } @@ -4386,9 +4396,9 @@ killed: r = pmap[(int)(player[8]+ny)][(int)(player[7]+0.5)]; //This is to make coding more pleasant :-) //For left leg - if (r && (r&TYPE)!=PT_STKM) + if (r && (r&0xFF)!=PT_STKM) { - if(pstates[r&TYPE].state == ST_LIQUID || (r&TYPE) == PT_LNTG) //Liquid checks //Liquid checks + if(pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) //Liquid checks //Liquid checks { if(parts[i].y<(player[8]-10)) parts[i].vy = 1*dt; @@ -4399,7 +4409,7 @@ killed: } else { - if(pstates[r&TYPE].state != ST_GAS) + if(pstates[r&0xFF].state != ST_GAS) { player[8] += ny-1; parts[i].vy -= 0.5*parts[i].vy*dt; @@ -4411,9 +4421,9 @@ killed: r = pmap[(int)(player[16]+ny)][(int)(player[15]+0.5)]; //For right leg - if (r && (r&TYPE)!=PT_STKM) + if (r && (r&0xFF)!=PT_STKM) { - if(pstates[r&TYPE].state == ST_LIQUID || (r&TYPE) == PT_LNTG) + if(pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) { if(parts[i].y<(player[16]-10)) parts[i].vy = 1*dt; @@ -4424,7 +4434,7 @@ killed: } else { - if(pstates[r&TYPE].state != ST_GAS) + if(pstates[r&0xFF].state != ST_GAS) { player[16] += ny-1; parts[i].vy -= 0.5*parts[i].vy*dt; @@ -4457,45 +4467,45 @@ killed: //If legs touch something r = pmap[(int)(player[8]+0.5)][(int)(player[7]+0.5)]; - if((r&TYPE)==PT_SPRK && r && (r>>PS)>8)0 && (r>>PS)0 && (r>>8)>PS].temp>=323 || parts[r>>PS].temp<=243) + if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; player[26] -= 1; } } - if ((r&TYPE)==PT_ACID) //If on acid + if ((r&0xFF)==PT_ACID) //If on acid parts[i].life -= 5; - if ((r&TYPE)==PT_PLUT) //If on plut + if ((r&0xFF)==PT_PLUT) //If on plut parts[i].life -= 1; r = pmap[(int)(player[16]+0.5)][(int)(player[15]+0.5)]; - if((r&TYPE)==PT_SPRK && r && (r>>PS)>8)0 && (r>>PS)0 && (r>>8)>PS].temp>=323 || parts[r>>PS].temp<=243) + if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; player[22] -= 1; } } - if ((r&TYPE)==PT_ACID) //If on acid + if ((r&0xFF)==PT_ACID) //If on acid parts[i].life -= 5; - if ((r&TYPE)==PT_PLUT) //If on plut + if ((r&0xFF)==PT_PLUT) //If on plut parts[i].life -= 1; isplayer = 1; @@ -4509,6 +4519,11 @@ killed: if((parts[i].temp<309.6f) && (parts[i].temp>=243)) parts[i].temp += 1; + if (isplayer2) { //Already a stickman2 in the simulation + death2 = 1; + parts[i].type = PT_NONE; + } + //Death if(parts[i].life<1 || death2 == 1 || (pv[y/CELL][x/CELL]>=4.5f && player2[2] != SPC_AIR) ) //If his HP is less that 0 or there is very big wind... { @@ -4520,7 +4535,7 @@ killed: create_part(-1, x+2, y+r, player2[2]); } kill_part(i); //Kill him - goto killed; + continue; } parts[i].vy += -0.7*dt; //Head up! @@ -4568,10 +4583,10 @@ killed: player2[26] = 0; //Go left - if (((int)(player2[0])&0x01) == 0x01 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_GAS) + if (((int)(player2[0])&0x01) == 0x01 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS) { - if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_LIQUID - && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE) != PT_LNTG) + if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID + && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG) { if (pmap[(int)(player2[8]-1)][(int)(player2[7])]) { @@ -4606,10 +4621,10 @@ killed: } //Go right - if (((int)(player2[0])&0x02) == 0x02 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_GAS) + if (((int)(player2[0])&0x02) == 0x02 && pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_GAS) { - if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE].state != ST_LIQUID - && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&TYPE) != PT_LNTG) + if (pstates[pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF].state != ST_LIQUID + && (pmap[(int)(parts[i].y+10)][(int)(parts[i].x)]&0xFF) != PT_LNTG) { if (pmap[(int)(player2[8]-1)][(int)(player2[7])]) { @@ -4645,7 +4660,7 @@ killed: } //Jump - if (((int)(player2[0])&0x04) == 0x04 && (pstates[pmap[(int)(player2[8]-0.5)][(int)(player2[7])]&TYPE].state != ST_GAS || pstates[pmap[(int)(player2[16]-0.5)][(int)(player2[15])]&TYPE].state != ST_GAS)) + if (((int)(player2[0])&0x04) == 0x04 && (pstates[pmap[(int)(player2[8]-0.5)][(int)(player2[7])]&0xFF].state != ST_GAS || pstates[pmap[(int)(player2[16]-0.5)][(int)(player2[15])]&0xFF].state != ST_GAS)) { if (pmap[(int)(player2[8]-0.5)][(int)(player2[7])] || pmap[(int)(player2[16]-0.5)][(int)(player2[15])]) { @@ -4665,25 +4680,25 @@ killed: for(nx = -2; nx <= 2; nx++) for(ny = 0; ny>=-2; ny--) { - if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>PS)>=NPART) + if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>8)>=NPART) continue; - if(ptypes[pmap[ny+y][nx+x]&TYPE].falldown!=0 || (pmap[ny+y][nx+x]&TYPE) == PT_NEUT || (pmap[ny+y][nx+x]&TYPE) == PT_PHOT) + if(ptypes[pmap[ny+y][nx+x]&0xFF].falldown!=0 || (pmap[ny+y][nx+x]&0xFF) == PT_NEUT || (pmap[ny+y][nx+x]&0xFF) == PT_PHOT) { - player2[2] = pmap[ny+y][nx+x]&TYPE; //Current element + player2[2] = pmap[ny+y][nx+x]&0xFF; //Current element } - if((pmap[ny+y][nx+x]&TYPE) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP + if((pmap[ny+y][nx+x]&0xFF) == PT_PLNT && parts[i].life<100) //Plant gives him 5 HP { if(parts[i].life<=95) parts[i].life += 5; else parts[i].life = 100; - kill_part(pmap[ny+y][nx+x]>>PS); + kill_part(pmap[ny+y][nx+x]>>8); } - if((pmap[ny+y][nx+x]&TYPE) == PT_NEUT) + if((pmap[ny+y][nx+x]&0xFF) == PT_NEUT) { parts[i].life -= (102-parts[i].life)/2; - kill_part(pmap[ny+y][nx+x]>>PS); + kill_part(pmap[ny+y][nx+x]>>8); } if(bmap[(ny+y)/CELL][(nx+x)/CELL]==WL_FAN) player2[2] = SPC_AIR; @@ -4698,9 +4713,9 @@ killed: { ny -= 2*(rand()%2)+1; r = pmap[ny][nx]; - if(!((r>>PS)>=NPART)) + if(!((r>>8)>=NPART)) { - if(pstates[r&TYPE].state == ST_SOLID) + if(pstates[r&0xFF].state == ST_SOLID) { create_part(-1, nx, ny, PT_SPRK); } @@ -4712,20 +4727,20 @@ killed: create_part(-1, nx, ny, player2[2]); r = pmap[ny][nx]; - if( ((r>>PS) < NPART) && (r>>PS)>=0 && player2[2] != PT_PHOT && player2[2] != SPC_AIR) - parts[r>>PS].vx = parts[r>>PS].vx + 5*((((int)player2[1])&0x02) == 0x02) - 5*(((int)(player2[1])&0x01) == 0x01); - if(((r>>PS) < NPART) && (r>>PS)>=0 && player2[2] == PT_PHOT) + if( ((r>>8) < NPART) && (r>>8)>=0 && player2[2] != PT_PHOT && player2[2] != SPC_AIR) + parts[r>>8].vx = parts[r>>8].vx + 5*((((int)player2[1])&0x02) == 0x02) - 5*(((int)(player2[1])&0x01) == 0x01); + if(((r>>8) < NPART) && (r>>8)>=0 && player2[2] == PT_PHOT) { int random = abs(rand()%3-1)*3; if (random==0) { - parts[r>>PS].life = 0; - parts[r>>PS].type = PT_NONE; + parts[r>>8].life = 0; + parts[r>>8].type = PT_NONE; } else { - parts[r>>PS].vy = 0; - parts[r>>PS].vx = (((((int)player2[1])&0x02) == 0x02) - (((int)(player2[1])&0x01) == 0x01))*random; + parts[r>>8].vy = 0; + parts[r>>8].vx = (((((int)player2[1])&0x02) == 0x02) - (((int)(player2[1])&0x01) == 0x01))*random; } } @@ -4762,11 +4777,11 @@ killed: for(nx = -3; nx <= 3; nx++) { r = pmap[(int)(player2[16]-2)][(int)(player2[15]+nx)]; - if(r && pstates[r&TYPE].state != ST_GAS && pstates[r&TYPE].state != ST_LIQUID) + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player2[15] -= nx; r = pmap[(int)(player2[8]-2)][(int)(player2[7]+nx)]; - if(r && pstates[r&TYPE].state != ST_GAS && pstates[r&TYPE].state != ST_LIQUID) + if(r && pstates[r&0xFF].state != ST_GAS && pstates[r&0xFF].state != ST_LIQUID) player2[7] -= nx; } @@ -4776,9 +4791,9 @@ killed: r = pmap[(int)(player2[8]+ny)][(int)(player2[7]+0.5)]; //This is to make coding more pleasant :-) //For left leg - if (r && (r&TYPE)!=PT_STKM2) + if (r && (r&0xFF)!=PT_STKM2) { - if(pstates[r&TYPE].state == ST_LIQUID || (r&TYPE) == PT_LNTG) //Liquid checks //Liquid checks + if(pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) //Liquid checks //Liquid checks { if(parts[i].y<(player2[8]-10)) parts[i].vy = 1*dt; @@ -4789,7 +4804,7 @@ killed: } else { - if(pstates[r&TYPE].state != ST_GAS) + if(pstates[r&0xFF].state != ST_GAS) { player2[8] += ny-1; parts[i].vy -= 0.5*parts[i].vy*dt; @@ -4801,9 +4816,9 @@ killed: r = pmap[(int)(player2[16]+ny)][(int)(player2[15]+0.5)]; //For right leg - if (r && (r&TYPE)!=PT_STKM2) + if (r && (r&0xFF)!=PT_STKM2) { - if(pstates[r&TYPE].state == ST_LIQUID || (r&TYPE) == PT_LNTG) + if(pstates[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG) { if(parts[i].y<(player2[16]-10)) parts[i].vy = 1*dt; @@ -4814,7 +4829,7 @@ killed: } else { - if(pstates[r&TYPE].state != ST_GAS) + if(pstates[r&0xFF].state != ST_GAS) { player2[16] += ny-1; parts[i].vy -= 0.5*parts[i].vy*dt; @@ -4847,45 +4862,45 @@ killed: //If legs touch something r = pmap[(int)(player2[8]+0.5)][(int)(player2[7]+0.5)]; - if((r&TYPE)==PT_SPRK && r && (r>>PS)>8)0 && (r>>PS)0 && (r>>8)>PS].temp>=323 || parts[r>>PS].temp<=243) + if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; player2[26] -= 1; } } - if ((r&TYPE)==PT_ACID) //If on acid + if ((r&0xFF)==PT_ACID) //If on acid parts[i].life -= 5; - if ((r&TYPE)==PT_PLUT) //If on plut + if ((r&0xFF)==PT_PLUT) //If on plut parts[i].life -= 1; r = pmap[(int)(player2[16]+0.5)][(int)(player2[15]+0.5)]; - if((r&TYPE)==PT_SPRK && r && (r>>PS)>8)0 && (r>>PS)0 && (r>>8)>PS].temp>=323 || parts[r>>PS].temp<=243) + if(parts[r>>8].temp>=323 || parts[r>>8].temp<=243) { parts[i].life -= 2; player2[22] -= 1; } } - if ((r&TYPE)==PT_ACID) //If on acid + if ((r&0xFF)==PT_ACID) //If on acid parts[i].life -= 5; - if ((r&TYPE)==PT_PLUT) //If on plut + if ((r&0xFF)==PT_PLUT) //If on plut parts[i].life -= 1; isplayer2 = 1; @@ -4917,13 +4932,13 @@ killed: if(x+nx>=0 && y+ny>0 && x+nx=0 && y+ny>0 && x+nx=0 && y+ny>0 && x+nx>PS; + lt = pmap[ny][nx] >> 8; if(!parts[lt].ctype) parts[lt].ctype = PT_PHOT; } - lt = pmap[y][x] & TYPE; + lt = pmap[y][x] & 0xFF; r = eval_move(PT_PHOT, nx, ny, NULL); @@ -5147,7 +5162,7 @@ killed: s = 1; break; } - if((pmap[y][j]&TYPE)!=t || (bmap[y/CELL][j/CELL] && bmap[y/CELL][j/CELL]!=WL_STREAM)) + if((pmap[y][j]&255)!=t || (bmap[y/CELL][j/CELL] && bmap[y/CELL][j/CELL]!=WL_STREAM)) break; } if(parts[i].vy>0) @@ -5162,7 +5177,7 @@ killed: parts[i].y += j-y; break; } - if((pmap[j][x]&TYPE)!=t || (bmap[j/CELL][x/CELL] && bmap[j/CELL][x/CELL]!=WL_STREAM)) + if((pmap[j][x]&255)!=t || (bmap[j/CELL][x/CELL] && bmap[j/CELL][x/CELL]!=WL_STREAM)) { s = 0; break; @@ -5194,22 +5209,22 @@ killed: r = pmap[ny][nx]; /* this should be replaced with a particle type attribute ("photwl" or something) */ - if((r & TYPE) == PT_PSCN) parts[i].ctype = 0x00000000; - if((r & TYPE) == PT_NSCN) parts[i].ctype = 0x00000000; - if((r & TYPE) == PT_SPRK) parts[i].ctype = 0x00000000; - if((r & TYPE) == PT_COAL) parts[i].ctype = 0x00000000; - if((r & TYPE) == PT_BCOL) parts[i].ctype = 0x00000000; - if((r & TYPE) == PT_PLEX) parts[i].ctype &= 0x1F00003E; - if((r & TYPE) == PT_NITR) parts[i].ctype &= 0x0007C000; - if((r & TYPE) == PT_NBLE) parts[i].ctype &= 0x3FFF8000; - if((r & TYPE) == PT_LAVA) parts[i].ctype &= 0x3FF00000; - if((r & TYPE) == PT_ACID) parts[i].ctype &= 0x1FE001FE; - if((r & TYPE) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0; - if((r & TYPE) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF; - if((r & TYPE) == PT_GOO) parts[i].ctype &= 0x3FFAAA00; - if((r & TYPE) == PT_PLNT) parts[i].ctype &= 0x0007C000; - if((r & TYPE) == PT_PLUT) parts[i].ctype &= 0x001FCE00; - if((r & TYPE) == PT_URAN) parts[i].ctype &= 0x003FC000; + if((r & 0xFF) == PT_PSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_NSCN) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_SPRK) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_COAL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_BCOL) parts[i].ctype = 0x00000000; + if((r & 0xFF) == PT_PLEX) parts[i].ctype &= 0x1F00003E; + if((r & 0xFF) == PT_NITR) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_NBLE) parts[i].ctype &= 0x3FFF8000; + if((r & 0xFF) == PT_LAVA) parts[i].ctype &= 0x3FF00000; + if((r & 0xFF) == PT_ACID) parts[i].ctype &= 0x1FE001FE; + if((r & 0xFF) == PT_DUST) parts[i].ctype &= 0x3FFFFFC0; + if((r & 0xFF) == PT_SNOW) parts[i].ctype &= 0x03FFFFFF; + if((r & 0xFF) == PT_GOO) parts[i].ctype &= 0x3FFAAA00; + if((r & 0xFF) == PT_PLNT) parts[i].ctype &= 0x0007C000; + if((r & 0xFF) == PT_PLUT) parts[i].ctype &= 0x001FCE00; + if((r & 0xFF) == PT_URAN) parts[i].ctype &= 0x003FC000; if(get_normal_interp(t, lx, ly, parts[i].vx, parts[i].vy, &nrx, &nry)) { dp = nrx*parts[i].vx + nry*parts[i].vy; @@ -5299,11 +5314,11 @@ void update_particles(pixel *vid) x = (int)(parts[i].x+0.5f); y = (int)(parts[i].y+0.5f); if(x>=0 && y>=0 && x>PS)<=NPART&&rtpmap[cy][cx]) + if((rtpmap[cy][cx]>>8)<=NPART&&rtpmap[cy][cx]) { - parts[rtpmap[(int)(cy+0.5f)][(int)(cx+0.5f)]>>PS].x = area_x +cx; - parts[rtpmap[(int)(cy+0.5f)][(int)(cx+0.5f)]>>PS].y = area_y +cy; + parts[rtpmap[(int)(cy+0.5f)][(int)(cx+0.5f)]>>8].x = area_x +cx; + parts[rtpmap[(int)(cy+0.5f)][(int)(cx+0.5f)]>>8].y = area_y +cy; } bmap[(area_y+cy)/CELL][(area_x+cx)/CELL] = rtbmap[cy/CELL][cx/CELL]; fvy[(area_y+cy)/CELL][(area_x+cx)/CELL] = tfvy[cy/CELL][cx/CELL]; @@ -5936,7 +5951,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) int x1, x2, dy = (c=UI_WALLSTART&&c<=UI_WALLSTART+UI_WALLCOUNT) { @@ -5946,7 +5961,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) { if(c==0) { - cm = pmap[y][x]&TYPE; + cm = pmap[y][x]&0xFF; if(!cm) return 0; if(REPLACE_MODE && cm!=SLALT) @@ -5969,14 +5984,14 @@ int flood_parts(int x, int y, int c, int cm, int bm) bm = 0; } - if(((pmap[y][x]&TYPE)!=cm || bmap[y/CELL][x/CELL]!=bm )||( (sdl_mod & (KMOD_CAPS)) && cm!=SLALT)) + if(((pmap[y][x]&0xFF)!=cm || bmap[y/CELL][x/CELL]!=bm )||( (sdl_mod & (KMOD_CAPS)) && cm!=SLALT)) return 1; // go left as far as possible x1 = x2 = x; while(x1>=CELL) { - if((pmap[y][x1-1]&TYPE)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm) + if((pmap[y][x1-1]&0xFF)!=cm || bmap[y/CELL][(x1-1)/CELL]!=bm) { break; } @@ -5984,7 +5999,7 @@ int flood_parts(int x, int y, int c, int cm, int bm) } while(x2=CELL+dy && x1==x2 && - ((pmap[y-1][x1-1]&TYPE)==PT_INST||(pmap[y-1][x1-1]&TYPE)==PT_SPRK) && ((pmap[y-1][x1]&TYPE)==PT_INST||(pmap[y-1][x1]&TYPE)==PT_SPRK) && ((pmap[y-1][x1+1]&TYPE)==PT_INST || (pmap[y-1][x1+1]&TYPE)==PT_SPRK) && - (pmap[y-2][x1-1]&TYPE)!=PT_INST && ((pmap[y-2][x1]&TYPE)==PT_INST ||(pmap[y-2][x1]&TYPE)==PT_SPRK) && (pmap[y-2][x1+1]&TYPE)!=PT_INST) + ((pmap[y-1][x1-1]&0xFF)==PT_INST||(pmap[y-1][x1-1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1]&0xFF)==PT_INST||(pmap[y-1][x1]&0xFF)==PT_SPRK) && ((pmap[y-1][x1+1]&0xFF)==PT_INST || (pmap[y-1][x1+1]&0xFF)==PT_SPRK) && + (pmap[y-2][x1-1]&0xFF)!=PT_INST && ((pmap[y-2][x1]&0xFF)==PT_INST ||(pmap[y-2][x1]&0xFF)==PT_SPRK) && (pmap[y-2][x1+1]&0xFF)!=PT_INST) flood_parts(x1, y-2, co, cm, bm); else if(y>=CELL+dy) for(x=x1; x<=x2; x++) - if((pmap[y-1][x]&TYPE)!=PT_SPRK) + if((pmap[y-1][x]&0xFF)!=PT_SPRK) { if(x==x1 || x==x2 || y>=YRES-CELL-1 || - (pmap[y-1][x-1]&TYPE)==PT_INST || (pmap[y-1][x+1]&TYPE)==PT_INST || - (pmap[y+1][x-1]&TYPE)==PT_INST || ((pmap[y+1][x]&TYPE)!=PT_INST&&(pmap[y+1][x]&TYPE)!=PT_SPRK) || (pmap[y+1][x+1]&TYPE)==PT_INST) + (pmap[y-1][x-1]&0xFF)==PT_INST || (pmap[y-1][x+1]&0xFF)==PT_INST || + (pmap[y+1][x-1]&0xFF)==PT_INST || ((pmap[y+1][x]&0xFF)!=PT_INST&&(pmap[y+1][x]&0xFF)!=PT_SPRK) || (pmap[y+1][x+1]&0xFF)==PT_INST) flood_parts(x, y-dy, co, cm, bm); } if(y=CELL+dy) for(x=x1; x<=x2; x++) - if((pmap[y-dy][x]&TYPE)==cm && bmap[(y-dy)/CELL][x/CELL]==bm) + if((pmap[y-dy][x]&0xFF)==cm && bmap[(y-dy)/CELL][x/CELL]==bm) if(!flood_parts(x, y-dy, co, cm, bm)) return 0; if(y