summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMakefile4
-rw-r--r--powder.c1056
-rwxr-xr-xversion.h2
3 files changed, 601 insertions, 461 deletions
diff --git a/Makefile b/Makefile
index e5b5f9e..c02fb2e 100755
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ LFLAGS_MTW32 := -lpthreadGC2
LFLAGS_MT := $(LFLAGS) -lpthread
MFLAGS_MT := -march=k8 -DX86 -DX86_SSE3 -DMT -msse3
MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3
-MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2
+MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE
FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lpthread -lbz2
COMPILER := gcc
@@ -88,4 +88,4 @@ release: $(LINUX_TARG) $(WIN32_TARG) powder-src.tar.bz2
cp powder-sse release/powder
gzip release/powder
cd release; tar czf powder-bin.tar.gz powder.gz powder64.gz powder-linux.tar.gz powder-win32.zip powder.zip; cd ..
- rm -f $(LINUX_TARG) $(WIN32_TARG) SDL.dll powder.exe \ No newline at end of file
+ rm -f $(LINUX_TARG) $(WIN32_TARG) SDL.dll powder.exe
diff --git a/powder.c b/powder.c
index f4161da..6db7f0f 100644
--- a/powder.c
+++ b/powder.c
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <SDL.h>
+#include <SDL/SDL.h>
#include <bzlib.h>
#include <time.h>
@@ -151,8 +151,8 @@ float mheat = 0.0f;
int do_open = 0;
int sys_pause = 0;
int legacy_enable = 0; //Used to disable new features such as heat, will be set by commandline or save.
-
-int amd = 0;
+int death = 1, gravityd = 2, framerender = 0;
+int amd = 1;
unsigned char fire_r[YRES/CELL][XRES/CELL];
unsigned char fire_g[YRES/CELL][XRES/CELL];
@@ -192,7 +192,7 @@ float fvx[YRES/CELL][XRES/CELL], fvy[YRES/CELL][XRES/CELL];
#define VADV 0.3f
#define VLOSS 0.999f
#define PLOSS 0.9999f
-int numCores = 1;
+int numCores = 4;
float kernel[9];
void make_kernel(void)
{
@@ -598,8 +598,13 @@ struct menu_section msections[] =
#define PT_STKM 55
#define PT_SWCH 56
#define PT_SMKE 57
-#define PT_INWR 58
-#define PT_NUM 59
+#define PT_PLAS 58
+#define PT_DESL 59
+#define PT_COAL 60
+#define PT_LOX 61
+#define PT_O2 62
+#define PT_INWR 63
+#define PT_NUM 64
#define R_TEMP 22
#define MAX_TEMP 3500
@@ -617,7 +622,7 @@ const struct part_type ptypes[] =
{"", 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, SC_SPECIAL, R_TEMP+0.0f, 251, "Erases particles."},
{"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, SC_POWDERS, R_TEMP+0.0f, 70, "Very light dust. Flammable."},
{"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, SC_LIQUID, R_TEMP+-2.0f, 29, "Liquid. Conducts electricity. Freezes. Extinguishes fires."},
- {"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, SC_LIQUID, R_TEMP+0.0f, 42, "Liquid. Flammable."},
+ {"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, SC_LIQUID, R_TEMP+0.0f, 42, "Liquid. Flammable. Solidifies under pressure"},
{"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, SC_EXPLOSIVE, R_TEMP+400.0f, 88, "Ignites flammable materials. Heats air."},
{"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, SC_POWDERS, R_TEMP+0.0f, 150, "Heavy particles. Meltable."},
{"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, SC_LIQUID, R_TEMP+1500.0f, 60, "Heavy liquid. Ignites flammable materials. Solidifies when cold."},
@@ -631,7 +636,7 @@ const struct part_type ptypes[] =
{"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, SC_ELEC, R_TEMP+0.0f, 251, "Solid. Conducts electricity. Meltable."},
{"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, SC_ELEC, R_TEMP+0.0f, 251, "Electricity. Conducted by metal and water."},
{"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, SC_POWDERS, R_TEMP+-30.0f, 46, "Light particles."},
- {"WOOD", PIXPACK(0xC0A040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 15, 1, SC_SOLIDS, R_TEMP+0.0f, 164, "Solid. Flammable."},
+ {"WOOD", PIXPACK(0xC0A040), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 15, 1, SC_SOLIDS, R_TEMP+0.0f, 164, "Solid. Flammable. Can be pressurised into COAL"},
{"NEUT", PIXPACK(0x20E0FF), 0.0f, 0.00f * CFDS, 1.00f, 1.00f, -0.99f, 0.0f, 0.01f, 0.002f * CFDS, 0, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+4.0f, 60, "Neutrons. Interact with matter in odd ways."},
{"PLUT", PIXPACK(0x407020), 0.4f, 0.01f * CFDS, 0.99f, 0.95f, 0.0f, 0.4f, 0.00f, 0.000f * CFDS, 1, 0, 0, 0, 0, 1, SC_NUCLEAR, R_TEMP+4.0f, 251, "Heavy particles. Fissile. Generates neutrons under pressure."},
{"PLNT", PIXPACK(0x0CAC00), 0.0f, 0.00f * CFDS, 0.95f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 20, 0, 0, 10, 1, SC_SOLIDS, R_TEMP+0.0f, 65, "Plant, drinks water and grows."},
@@ -672,7 +677,13 @@ const struct part_type ptypes[] =
{"STKM", PIXPACK(0X000000), 0.5f, 0.00f * CFDS, 0.2f, 1.0f, 0.0f, -0.7f, 0.0f, 0.00f * CFDS, 0, 0, 0, 0, 0, 1, SC_SPECIAL, R_TEMP+14.6f, 0, "Stickman. Don't kill him!"},
{"SWCH", PIXPACK(0x103B11), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_ELEC, R_TEMP+0.0f, 251, "Solid. Only conducts when switched on. (PSCN switches on, NSCN switches off)"},
{"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, SC_GAS, R_TEMP+400.0f, 88, "Smoke"},
+ {"PLAS", PIXPACK(0x444444), 0.1f, 0.00f * CFDS, 0.97f, 0.50f, 0.0f, 0.0f, 0.00f, 0.0f * CFDS, 0, 0, 0, 1, 12, 1, SC_SOLIDS, R_TEMP+0.0f, 75, "Solid. Deforms under really high pressure."},
+ {"DESL", PIXPACK(0x440000), 1.0f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.0f, 0.0f * CFDS, 2, 2, 0.01f, 0, 5, 1, SC_LIQUID, R_TEMP+0.0f, 42, "Liquid. Vaporises under low pressure, explodes under high pressure and temperatures"},
+ {"COAL", PIXPACK(0x222222), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.0f, 0.0f * CFDS, 0, 10, 0, 0, 20, 1, SC_SOLIDS, R_TEMP+0.0f, 200, "Solid. Burns slowly."},
+ {"LOX", 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, SC_LIQUID, -210.0f, 70, "Liquid Oxygen. Very cold. Reacts with fire"},
+ {"O2", PIXPACK(0x80A0FF), 2.0f, 0.00f * CFDS, 0.99f, 0.30f, -0.1f, 0.0f, 5.0f, 0.000f * CFDS, 0, 1000, 0, 0, 0, 1, SC_GAS, R_TEMP+0.0f, 70, "Gas. Oxygen helps make things burn."},
{"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, SC_ELEC, R_TEMP+0.0f, 251, "Insulated Wire. Doesn't conduct to metal or semiconductors."},
+ //Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
};
#define ST_NONE 0
@@ -685,21 +696,21 @@ const struct part_state pstates[] =
/* NONE */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* DUST */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* WATR */ {ST_LIQUID, PT_ICEI, 0.0f, PT_NONE, 0.0f, PT_WTRV, 100.0f, PT_NONE, 0.0f},
- /* OIL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_GASS, 50.0f, PT_NONE, 0.0f},
+ /* OIL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* FIRE */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_PLSM, 2500.0f},
/* STNE */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 710.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* LAVA */ {ST_LIQUID, PT_STNE, 700.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* GUN */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 400.0f},
/* NITR */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 400.0f},
/* CLNE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
- /* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_OILL, -40.0f, PT_NONE, 50.0f, PT_FIRE, 300.0f},
+ /* GAS */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 50.0f, PT_FIRE, 300.0f},
/* C-4 */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 400.0f},
/* GOO */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* ICE */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* METL */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1000.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SPRK */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SNOW */ {ST_SOLID, PT_NONE, 0.0f, PT_WATR, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
- /* WOOD */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 500.0f},
+ /* WOOD */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_COAL, 300.0f, PT_FIRE, 600.0f},
/* NEUT */ {ST_GAS, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PLUT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* PLNT */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 300.0f},
@@ -740,6 +751,11 @@ const struct part_state pstates[] =
/* STKM */ {ST_NONE, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SWCH */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* SMKE */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
+ /* PLAS */ {ST_SOLID, PT_NONE, 0.0f, PT_OILL, 250.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
+ /* DESL */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 62.0f},
+ /* COAL */ {ST_SOLID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_FIRE, 600.0f},
+ /* LOX */ {ST_LIQUID, PT_NONE, 0.0f, PT_NONE, 0.0f, PT_O2, -180.0f, PT_NONE, 0.0f},
+ /* O2 */ {ST_GAS, PT_NONE, 0.0f, PT_LOX, -190.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
/* INWR */ {ST_SOLID, PT_NONE, 0.0f, PT_LAVA, 1414.0f, PT_NONE, 0.0f, PT_NONE, 0.0f},
};
static const unsigned char can_move[PT_NUM][PT_NUM] =
@@ -748,69 +764,78 @@ static const unsigned char can_move[PT_NUM][PT_NUM] =
/* A 0 1 | B ligher than A */
/* B 1 0 | A heavier than B */
- /* N D W O F M L G N C G P D I W S S W N P P A V W C D S S D B B P U W M P N L F B W R L H S G C B T P E N N B L S S S I*/
- /* o u a i i e a u i l a l f c i p n o e l l c o t n s a l m m r h r a W S S N o H H b R S a l s G h l t i B t C T W M N*/
- /* n s t l r t v n t n s e r e r r o o u u n i i r c t l t n t m o a x a c c 2 a o o d b C n a c l d s r c L r r K C K W*/
- /* e t r l e l a p r e s x m i e k w d t t t d d v t w t w d l t t n x n n m l l m d N d s n a r m d e E y y M H E R*/
- /* NONE */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
- /* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0},
- /* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+/* N D W O F S L G N C G P D I M S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S P D C L O I*/
+/* o u a i i t a u i l a l f c e p n o e l l c o t n s a l m m r h r a W S S N N H H b R S a l s G h l t i B t C T W M l e o O 2 N*/
+/* n s t l r n v n t n s e r e t r o o u u n i i r c t l t n t m o a x a c c 2 S o o d b C n a c l d s r c L r r K C K a s a X W*/
+/* e t r l e e a p r e s x m i l k w d t t t d d v t w t w d l t t n x n n U l l m d N d s n a r m d e E y y M H E s l l R*/
+/* NONE */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* None */
+/* DUST */ {0,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0}, /* Dust */
+/* WATR */ {0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0}, /* Watr */
+/* OILL */ {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Oill */
+/* FIRE */ {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,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,0,0,0,0,0,0}, /* Coal */
+/* LOX */ {0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0}, /* LOX */
+/* O2 */ {0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0}, /* O2 */
+/* INWR */ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* INWR */
+/* N D W O F M L G N C G P D I W S S W N P P A V W C D S S D B B P U W M P N L I B W R L H S G C B T P E N N B L S S S P D C L O*/
+/* o u a i i e a u i l a l f c i p n o e l l c o t n s a l m m r h r a W S S N n H H b R S a l s G h l t i B t C T W M l e o O 2*/
+/* n s t l r t v n t n s e r e r r o o u u n i i r c t l t n t m o a x a c c 2 s o o d b C n a c l d s r c L r r K C K a s a X */
+/* e t r l e l a p r e s x m i e k w d t t t d d v t w t w d l t t n x n n u l l m d N d s n a r m d e E y y M H E s l l */
};
#define FLAG_STAGNANT 1
@@ -1099,7 +1124,7 @@ inline int create_part(int p, int x, int y, int t)
//} else {
// parts[i].life = 0;
// parts[i].type = PT_NONE;
- //}
+ //}/
}
if(t!=PT_STKM)
@@ -1387,7 +1412,16 @@ void update_particles_i(pixel *vid, int start, int inc)
t = parts[i].type;
if(sys_pause)
- goto justdraw;
+ {
+ if(framerender)
+ {
+ sys_pause = 0;
+ }
+ else
+ {
+ goto justdraw;
+ }
+ }
if(parts[i].life && t!=PT_ACID && t!=PT_WOOD && t!=PT_NBLE && t!=PT_SWCH && t!=PT_STKM)
{
@@ -1491,9 +1525,53 @@ void update_particles_i(pixel *vid, int start, int inc)
}
else
{
- parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL];
- parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity;
- }
+ if(t==PT_PLAS && pv[y/CELL][x/CELL]>25.0f)
+ {
+ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL];
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL];
+ } else {
+ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL];
+ if(gravityd == 1)
+ {
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity;
+ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL] - ptypes[t].gravity;
+ }
+ if(gravityd == 2)
+ {
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity;
+ }
+ if(gravityd == 3)
+ {
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity;
+ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL] + ptypes[t].gravity;
+ }
+ if(gravityd == 4)
+ {
+ parts[i].vx += ptypes[t].advection*vy[y/CELL][x/CELL] - ptypes[t].gravity;
+ }
+ if(gravityd == 5)
+ {
+ parts[i].vx += ptypes[t].advection*vy[y/CELL][x/CELL];
+ }
+ if(gravityd == 6)
+ {
+ parts[i].vx += ptypes[t].advection*vy[y/CELL][x/CELL] + ptypes[t].gravity;
+ }
+ if(gravityd == 7)
+ {
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] - ptypes[t].gravity;
+ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL] - ptypes[t].gravity;
+ }
+ if(gravityd == 8)
+ {
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] - ptypes[t].gravity;
+ }
+ if(gravityd == 9)
+ {
+ parts[i].vy += ptypes[t].advection*vy[y/CELL][x/CELL] - ptypes[t].gravity;
+ parts[i].vx += ptypes[t].advection*vx[y/CELL][x/CELL] + ptypes[t].gravity;
+ }
+ }
if(ptypes[t].diffusion)
{
@@ -1561,11 +1639,27 @@ void update_particles_i(pixel *vid, int start, int inc)
{
if(t==PT_WTRV && pv[y/CELL][x/CELL]>4.0f)
t = parts[i].type = PT_DSTW;
- if(t==PT_GASS && pv[y/CELL][x/CELL]>4.0f)
- t = parts[i].type = PT_OILL;
- if(t==PT_OILL && pv[y/CELL][x/CELL]<-4.0f)
+ if(t==PT_OILL && pv[y/CELL][x/CELL]>8.0f)
+ t = parts[i].type = PT_PLAS;
+ if(t==PT_DESL && pv[y/CELL][x/CELL]<-6.0f)
t = parts[i].type = PT_GASS;
- }
+ if(t==PT_GASS && pv[y/CELL][x/CELL]>6.0f)
+ t = parts[i].type = PT_DESL;
+ if(t==PT_DESL && pv[y/CELL][x/CELL]>12.0f)
+ t = parts[i].type = PT_FIRE;
+ if(t==PT_WOOD && pv[y/CELL][x/CELL]>6.0f)
+ t = parts[i].type = PT_COAL;
+ }
+ if(t==PT_OILL && pv[y/CELL][x/CELL]>20.0f)
+ t = parts[i].type = PT_PLAS;
+ if(t==PT_DESL && pv[y/CELL][x/CELL]<-20.0f)
+ t = parts[i].type = PT_GASS;
+ if(t==PT_DESL && pv[y/CELL][x/CELL]>50.0f) // Only way I know to make it
+ t = parts[i].type = PT_FIRE; // combust under pressure.
+ if(t==PT_GASS && pv[y/CELL][x/CELL]>20.0f)
+ t = parts[i].type = PT_DESL;
+ if(t==PT_WOOD && pv[y/CELL][x/CELL]>30.0f)
+ t = parts[i].type = PT_COAL;
if(t==PT_BMTL && pv[y/CELL][x/CELL]>2.5f)
t = parts[i].type = PT_BRMT;
//if(t==PT_GLAS && pv[y/CELL][x/CELL]>4.0f)
@@ -2027,11 +2121,17 @@ void update_particles_i(pixel *vid, int start, int inc)
if((r&0xFF)==PT_PLEX && 15>(rand()%1000))
parts[r>>8].type = PT_DFRM;
if((r&0xFF)==PT_NITR && 15>(rand()%1000))
- parts[r>>8].type = PT_OILL;
+ parts[r>>8].type = PT_DESL;
if((r&0xFF)==PT_OILL && 5>(rand()%1000))
- parts[r>>8].type = PT_GASS;
+ parts[r>>8].type = PT_PLAS;
if((r&0xFF)==PT_PLNT && 5>(rand()%100))
parts[r>>8].type = PT_WOOD;
+ if((r&0xFF)==PT_PLAS && 5>(rand()%1000))
+ parts[r>>8].type = PT_OILL;
+ if((r&0xFF)==PT_DESL && 15>(rand()%1000))
+ parts[r>>8].type = PT_GASS;
+ if((r&0xFF)==PT_COAL && 5>(rand()%100))
+ parts[r>>8].type = PT_WOOD;
}
}
else if(t==PT_PHOT)
@@ -2327,378 +2427,369 @@ killed:
if(parts[i].type == PT_NONE)
continue;
}
+ if(t==PT_STKM)
+ {
+ //Tempirature handling
+ if(parts[i].temp<-30)
+ parts[i].life -= 0.2;
+ if((parts[i].temp<36.6f) && (parts[i].temp>=-30))
+ parts[i].temp += 1;
- if(t==PT_STKM)
- {
- //Tempirature handling
- if(parts[i].temp<-30)
- parts[i].life -= 0.2;
- if((parts[i].temp<36.6f) && (parts[i].temp>=-30))
- parts[i].temp += 1;
-
- //Death
- if(parts[i].life<=0 || pv[y/CELL][x/CELL]>=4.5f) //If his HP is less that 0 or there is very big wind...
- {
- for(r=-2; r<=1; r++)
- {
- create_part(-1, x+r, y-2, player[2]);
- create_part(-1, x+r+1, y+2, player[2]);
- create_part(-1, x-2, y+r+1, player[2]);
- create_part(-1, x+2, y+r, player[2]);
- }
- kill_part(i); //Kill him
- goto killed;
- }
-
- //Verlet integration
- pp = 2*player[3]-player[5];
- player[5] = player[3];
- player[3] = pp;
- pp = 2*player[4]-player[6];
- player[6] = player[4];
- player[4] = pp;
-
- pp = 2*player[7]-player[9];
- player[9] = player[7];
- player[7] = pp;
- pp = 2*player[8]-player[10]+1;
- player[10] = player[8];
- player[8] = pp;
-
- pp = 2*player[11]-player[13];
- player[13] = player[11];
- player[11] = pp;
- pp = 2*player[12]-player[14];
- player[14] = player[12];
- player[12] = pp;
-
- pp = 2*player[15]-player[17];
- player[17] = player[15];
- player[15] = pp;
- pp = 2*player[16]-player[18]+1;
- player[18] = player[16];
- player[16] = pp;
-
- //Go left
- if (((int)(player[0])&0x01) == 0x01)
- {
- 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])])
- {
- player[9] += 3;
- player[10] += 2;
- player[5] += 2;
- }
-
- if (pmap[(int)(player[16]-1)][(int)(player[15])])
- {
- player[17] += 3;
- player[18] += 2;
- player[13] +=2;
- }
- }
- else
- {
- if (pmap[(int)(player[8]-1)][(int)(player[7])]) //It should move another way in liquids
- {
- player[9] += 1;
- player[10] += 1;
- player[5] += 1;
- }
-
- if (pmap[(int)(player[16]-1)][(int)(player[15])])
- {
- player[17] += 1;
- player[18] += 1;
- player[13] +=1;
- }
- }
- }
-
- //Go right
- if (((int)(player[0])&0x02) == 0x02)
- {
- 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])])
- {
- player[9] -= 3;
- player[10] += 2;
- player[5] -= 2;
- }
-
- if (pmap[(int)(player[16]-1)][(int)(player[15])])
- {
- player[17] -= 3;
- player[18] += 2;
- player[13] -= 2;
- }
- }
- else
- {
- if (pmap[(int)(player[8]-1)][(int)(player[7])])
- {
- player[9] -= 1;
- player[10] += 1;
- player[5] -= 1;
- }
-
- if (pmap[(int)(player[16]-1)][(int)(player[15])])
- {
- player[17] -= 1;
- player[18] += 1;
- player[13] -= 1;
- }
-
- }
- }
-
- //Charge detector wall if foot inside
- if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==6)
- set_emap((int)player[7]/CELL, (int)player[8]/CELL);
- if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==6)
- set_emap((int)(player[15]+0.5)/CELL, (int)(player[16]+0.5)/CELL);
-
- //Searching for particles near head
- for(nx = -2; nx <= 2; nx++)
- for(ny = 0; ny>=-2; ny--)
- {
- if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>8)>=NPART)
- continue;
- if(((pstates[pmap[ny+y][nx+x]&0xFF].state != ST_SOLID || ptypes[pmap[ny+y][nx+x]&0xFF].falldown > 0) &&
- (pmap[ny+y][nx+x]&0xFF)!=PT_STKM
- && (pmap[ny+y][nx+x]&0xFF)!=PT_WHOL && (pmap[ny+y][nx+x]&0xFF)!=PT_BHOL)
- || (pmap[ny+y][nx+x]&0xFF) == PT_LNTG)
- {
- player[2] = pmap[ny+y][nx+x]&0xFF; //Current element
- }
- 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]>>8);
- }
-
- if((pmap[ny+y][nx+x]&0xFF) == PT_NEUT)
- {
- parts[i].life -= (102-parts[i].life)/2;
- kill_part(pmap[ny+y][nx+x]>>8);
- }
- }
-
- //Head position
- nx = x + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01);
- ny = y - 3*(player[1] == 0);
-
- //Spawn
- if(((int)(player[0])&0x08) == 0x08)
- {
- ny -= 2*(rand()%2)+1;
- r = pmap[ny][nx];
- if(!((r>>8)>=NPART))
- {
- if(pstates[r&0xFF].state == ST_SOLID)
- {
- create_part(-1, nx, ny, PT_SPRK);
- }
- else
- {
- create_part(-1, nx, ny, player[2]);
- r = pmap[ny][nx];
- if( ((r>>8) < NPART) && (r>>8)>=0 && player[2]!=PT_PHOT)
- 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>>8].life = 0;
- parts[r>>8].type = PT_NONE;
- }
- else
- {
- parts[r>>8].vy = -(player[1] == 0)*random;
- parts[r>>8].vx = (player[1]!=0)*(((((int)player[1])&0x02) == 0x02) - (((int)(player[1])&0x01) == 0x01))*random;
- }
- }
-
- }
- }
- }
-
- //Jump
- if (((int)(player[0])&0x04) == 0x04)
- {
- if (pmap[(int)(player[8]-0.5)][(int)(player[7])] || pmap[(int)(player[16]-0.5)][(int)(player[15])])
- {
- parts[i].vy = -5;
- player[10] += 1;
- player[18] += 1;
- }
-
- }
-
- //Simulation of joints
- d = 25/(pow((player[3]-player[7]), 2) + pow((player[4]-player[8]), 2)+25) - 0.5; //Fast distance
- player[7] -= (player[3]-player[7])*d;
- player[8] -= (player[4]-player[8])*d;
- player[3] += (player[3]-player[7])*d;
- player[4] += (player[4]-player[8])*d;
-
- d = 25/(pow((player[11]-player[15]), 2) + pow((player[12]-player[16]), 2)+25) - 0.5;
- player[15] -= (player[11]-player[15])*d;
- player[16] -= (player[12]-player[16])*d;
- player[11] += (player[11]-player[15])*d;
- player[12] += (player[12]-player[16])*d;
-
- d = 36/(pow((player[3]-parts[i].x), 2) + pow((player[4]-parts[i].y), 2)+36) - 0.5;
- parts[i].vx -= (player[3]-parts[i].x)*d;
- parts[i].vy -= (player[4]-parts[i].y)*d;
- player[3] += (player[3]-parts[i].x)*d;
- player[4] += (player[4]-parts[i].y)*d;
-
- d = 36/(pow((player[11]-parts[i].x), 2) + pow((player[12]-parts[i].y), 2)+36) - 0.5;
- parts[i].vx -= (player[11]-parts[i].x)*d;
- parts[i].vy -= (player[12]-parts[i].y)*d;
- player[11] += (player[11]-parts[i].x)*d;
- player[12] += (player[12]-parts[i].y)*d;
-
- //Side collisions checking
- for(nx = -3; nx <= 3; nx++)
- {
- if(pmap[(int)(player[16]-2)][(int)(player[15]+nx)])
- player[15] -= nx;
-
- if(pmap[(int)(player[8]-2)][(int)(player[7]+nx)])
- player[7] -= nx;
- }
-
- //Collision checks
- for(ny = -2-(int)parts[i].vy; ny<=0; ny++)
- {
- if ((int)(ny+player[8])>=YRES)
- continue;
-
- r = pmap[(int)(player[8]+ny)][(int)(player[7]+0.5)]; //This is to make coding more pleasant :-)
-
- //For left leg
- if (r && (r&0xFF)!=PT_STKM)
- {
- if(pstates[r&0xFF].state == ST_LIQUID || pstates[r&0xFF].state == ST_GAS || (r&0xFF)==PT_LNTG) //Liquid checks
- {
- if(parts[i].y<(player[8]-10))
- parts[i].vy = 1;
- else
- parts[i].vy = 0;
- if(abs(parts[i].vx)>1)
- parts[i].vx *= 0.5;
- }
- else
- {
- player[8] += ny-1;
- parts[i].vy -= 0.5*parts[i].vy;
- }
- player[9] = player[7];
- }
-
- if ((int)(ny+player[16])>=YRES)
- continue;
-
- r = pmap[(int)(player[16]+ny)][(int)(player[15]+0.5)];
-
- //For right leg
- if (r && (r&0xFF)!=PT_STKM)
- {
- if(pstates[r&0xFF].state == ST_LIQUID || pstates[r&0xFF].state == ST_GAS || (r&0xFF)==PT_LNTG)
- {
- if(parts[i].y<(player[16]-10))
- parts[i].vy = 1;
- else
- parts[i].vy = 0;
- if(abs(parts[i].vx)>1)
- parts[i].vx *= 0.5;
- }
- else
- {
- player[16] += ny-1;
- parts[i].vy -= 0.5*parts[i].vy;
- }
- player[17] = player[15];
- }
-
- //If it falls too fast
- if (parts[i].vy>=30)
- {
- parts[i].y -= 10+ny;
- parts[i].vy = -10;
- }
-
- }
-
- //Keeping legs distance
- if (pow((player[7] - player[15]), 2)<16 && pow((player[8]-player[16]), 2)<1)
- {
- player[7] += 0.2;
- player[15] -= 0.2;
- }
-
- if (pow((player[3] - player[11]), 2)<16 && pow((player[4]-player[12]), 2)<1)
- {
- player[3] += 0.2;
- player[11] -= 0.2;
- }
-
- //If legs touch something
- r = pmap[(int)(player[8]+0.5)][(int)(player[7]+0.5)];
- if((r&0xFF)==PT_SPRK && r && (r>>8)<NPART) //If on charge
- {
- parts[i].life -= (int)(rand()/1000)+38;
- }
-
- if (r>0 && (r>>8)<NPART) //If hot or cold
- {
- if(parts[r>>8].temp>=50 || parts[r>>8].temp<=-30)
- {
- parts[i].life -= 2;
- player[16] -= 1;
- }
- }
-
- if ((r&0xFF)==PT_ACID) //If on acid
- parts[i].life -= 5;
-
- 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&0xFF)==PT_SPRK && r && (r>>8)<NPART) //If on charge
- {
- parts[i].life -= (int)(rand()/1000)+38;
- }
-
- if(r>0 && (r>>8)<NPART) //If hot or cold
- {
- if(parts[r>>8].temp>=50 || parts[r>>8].temp<=-30)
- {
- parts[i].life -= 2;
- player[8] -= 1;
- }
- }
-
- if ((r&0xFF)==PT_ACID) //If on acid
- parts[i].life -= 5;
-
- if ((r&0xFF)==PT_PLUT) //If on plut
- parts[i].life -= 1;
-
- isplayer = 1;
- }
+ //Death
+ if(parts[i].life<0 && (death == 1)) //If his HP is less that 0 or there is very big wind...
+ {
+ for(r=-2; r<=1; r++)
+ {
+ create_part(-1, x+r, y-2, player[2]);
+ create_part(-1, x+r+1, y+2, player[2]);
+ create_part(-1, x-2, y+r+1, player[2]);
+ create_part(-1, x+2, y+r, player[2]);
+ }
+ kill_part(i); //Kill him
+ goto killed;
+ }
+
+ //Verlet integration
+ pp = 2*player[3]-player[5];
+ player[5] = player[3];
+ player[3] = pp;
+ pp = 2*player[4]-player[6];
+ player[6] = player[4];
+ player[4] = pp;
+
+ pp = 2*player[7]-player[9];
+ player[9] = player[7];
+ player[7] = pp;
+ pp = 2*player[8]-player[10]+1;
+ player[10] = player[8];
+ player[8] = pp;
+
+ pp = 2*player[11]-player[13];
+ player[13] = player[11];
+ player[11] = pp;
+ pp = 2*player[12]-player[14];
+ player[14] = player[12];
+ player[12] = pp;
+
+ pp = 2*player[15]-player[17];
+ player[17] = player[15];
+ player[15] = pp;
+ pp = 2*player[16]-player[18]+1;
+ player[18] = player[16];
+ player[16] = pp;
+
+ //Go left
+ if (((int)(player[0])&0x01) == 0x01)
+ {
+ 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])])
+ {
+ player[9] += 3;
+ player[10] += 2;
+ player[5] += 2;
+ }
+
+ if (pmap[(int)(player[16]-1)][(int)(player[15])])
+ {
+ player[17] += 3;
+ player[18] += 2;
+ player[13] +=2;
+ }
+ }
+ else
+ {
+ if (pmap[(int)(player[8]-1)][(int)(player[7])]) //It should move another way in liquids
+ {
+ player[9] += 1;
+ player[10] += 1;
+ player[5] += 1;
+ }
+
+ if (pmap[(int)(player[16]-1)][(int)(player[15])])
+ {
+ player[17] += 1;
+ player[18] += 1;
+ player[13] +=1;
+ }
+ }
+ }
+
+ //Go right
+ if (((int)(player[0])&0x02) == 0x02)
+ {
+ 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])])
+ {
+ player[9] -= 3;
+ player[10] += 2;
+ player[5] -= 2;
+ }
+
+ if (pmap[(int)(player[16]-1)][(int)(player[15])])
+ {
+ player[17] -= 3;
+ player[18] += 2;
+ player[13] -= 2;
+ }
+ }
+ else
+ {
+ if (pmap[(int)(player[8]-1)][(int)(player[7])])
+ {
+ player[9] -= 1;
+ player[10] += 1;
+ player[5] -= 1;
+ }
+
+ if (pmap[(int)(player[16]-1)][(int)(player[15])])
+ {
+ player[17] -= 1;
+ player[18] += 1;
+ player[13] -= 1;
+ }
+
+ }
+ }
+
+ //Charge detector wall if foot inside
+ if(bmap[(int)(player[8]+0.5)/CELL][(int)(player[7]+0.5)/CELL]==6)
+ set_emap((int)player[7]/CELL, (int)player[8]/CELL);
+ if(bmap[(int)(player[16]+0.5)/CELL][(int)(player[15]+0.5)/CELL]==6)
+ set_emap((int)(player[15]+0.5)/CELL, (int)(player[16]+0.5)/CELL);
+
+ //Searching for particles near head
+ for(nx = -2; nx <= 2; nx++)
+ for(ny = 0; ny>=-2; ny--)
+ {
+ if(!pmap[ny+y][nx+x] || (pmap[ny+y][nx+x]>>8)>=NPART)
+ continue;
+ if((pstates[pmap[ny+y][nx+x]&0xFF].state != ST_SOLID && (pmap[ny+y][nx+x]&0xFF)!=PT_STKM
+ && (pmap[ny+y][nx+x]&0xFF)!=PT_WHOL && (pmap[ny+y][nx+x]&0xFF)!=PT_BHOL)
+ || (pmap[ny+y][nx+x]&0xFF) == PT_LNTG)
+ {
+ player[2] = pmap[ny+y][nx+x]&0xFF; //Current element
+ }
+ 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]>>8);
+ }
+
+ if((pmap[ny+y][nx+x]&0xFF) == PT_NEUT)
+ {
+ parts[i].life -= (102-parts[i].life)/2;
+ kill_part(pmap[ny+y][nx+x]>>8);
+ }
+ }
+
+ //Head position
+ nx = x + 3*((((int)player[1])&0x02) == 0x02) - 3*((((int)player[1])&0x01) == 0x01);
+ ny = y - 3*(player[1] == 0);
+ //Spawn
+ if(((int)(player[0])&0x08) == 0x08)
+ {
+ ny -= 2*(rand()%2)+1;
+ r = pmap[ny][nx];
+ if(!((r>>8)>=NPART))
+ {
+ if(pstates[r&0xFF].state == ST_SOLID)
+ {
+ create_part(-1, nx, ny, PT_SPRK);
+ }
+ else
+ {
+ create_part(-1, nx, ny, player[2]);
+ r = pmap[ny][nx];
+ if( ((r>>8) < NPART) && (r>>8)>=0 && player[2]!=PT_PHOT)
+ 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>>8].life = 0;
+ parts[r>>8].type = PT_NONE;
+ }
+ else
+ {
+ parts[r>>8].vy = 0;
+ parts[r>>8].vx = (((((int)player[1])&0x02) == 0x02) - (((int)(player[1])&0x01) == 0x01))*random;
+ }
+ }
+
+ }
+ }
+ }
+
+ //Jump
+ if (((int)(player[0])&0x04) == 0x04)
+ {
+ if (pmap[(int)(player[8]-0.5)][(int)(player[7])] || pmap[(int)(player[16]-0.5)][(int)(player[15])])
+ {
+ parts[i].vy = -5;
+ player[10] += 1;
+ player[18] += 1;
+ }
+
+ }
+
+ //Simulation of joints
+ d = 25/(pow((player[3]-player[7]), 2) + pow((player[4]-player[8]), 2)+25) - 0.5; //Fast distance
+ player[7] -= (player[3]-player[7])*d;
+ player[8] -= (player[4]-player[8])*d;
+ player[3] += (player[3]-player[7])*d;
+ player[4] += (player[4]-player[8])*d;
+
+ d = 25/(pow((player[11]-player[15]), 2) + pow((player[12]-player[16]), 2)+25) - 0.5;
+ player[15] -= (player[11]-player[15])*d;
+ player[16] -= (player[12]-player[16])*d;
+ player[11] += (player[11]-player[15])*d;
+ player[12] += (player[12]-player[16])*d;
+
+ d = 36/(pow((player[3]-parts[i].x), 2) + pow((player[4]-parts[i].y), 2)+36) - 0.5;
+ parts[i].vx -= (player[3]-parts[i].x)*d;
+ parts[i].vy -= (player[4]-parts[i].y)*d;
+ player[3] += (player[3]-parts[i].x)*d;
+ player[4] += (player[4]-parts[i].y)*d;
+
+ d = 36/(pow((player[11]-parts[i].x), 2) + pow((player[12]-parts[i].y), 2)+36) - 0.5;
+ parts[i].vx -= (player[11]-parts[i].x)*d;
+ parts[i].vy -= (player[12]-parts[i].y)*d;
+ player[11] += (player[11]-parts[i].x)*d;
+ player[12] += (player[12]-parts[i].y)*d;
+
+ //Side collisions checking
+ for(nx = -3; nx <= 3; nx++)
+ {
+ if(pmap[(int)(player[16]-2)][(int)(player[15]+nx)])
+ player[15] -= nx;
+
+ if(pmap[(int)(player[8]-2)][(int)(player[7]+nx)])
+ player[7] -= nx;
+ }
+
+ //Collision checks
+ for(ny = -2-(int)parts[i].vy; ny<=0; ny++)
+ {
+ r = pmap[(int)(player[8]+ny)][(int)(player[7]+0.5)]; //This is to make coding more pleasant :-)
+
+ //For left leg
+ if (r && (r&0xFF)!=PT_STKM)
+ {
+ if(pstates[r&0xFF].state == ST_LIQUID || pstates[r&0xFF].state == ST_GAS || (r&0xFF)==PT_LNTG) //Liquid checks
+ {
+ if(parts[i].y<(player[8]-10))
+ parts[i].vy = 1;
+ else
+ parts[i].vy = 0;
+ if(abs(parts[i].vx)>1)
+ parts[i].vx *= 0.5;
+ }
+ else
+ {
+ player[8] += ny-1;
+ parts[i].vy -= 0.5*parts[i].vy;
+ }
+ player[9] = player[7];
+ }
+
+ r = pmap[(int)(player[16]+ny)][(int)(player[15]+0.5)];
+
+ //For right leg
+ if (r && (r&0xFF)!=PT_STKM)
+ {
+ if(pstates[r&0xFF].state == ST_LIQUID || pstates[r&0xFF].state == ST_GAS || (r&0xFF)==PT_LNTG)
+ {
+ if(parts[i].y<(player[16]-10))
+ parts[i].vy = 1;
+ else
+ parts[i].vy = 0;
+ if(abs(parts[i].vx)>1)
+ parts[i].vx *= 0.5;
+ }
+ else
+ {
+ player[16] += ny-1;
+ parts[i].vy -= 0.5*parts[i].vy;
+ }
+ player[17] = player[15];
+ }
+
+ //If it falls too fast
+ if (parts[i].vy>=30)
+ {
+ parts[i].y -= 10+ny;
+ parts[i].vy = -10;
+ }
+
+ }
+
+ //Keeping legs distance
+ if (pow((player[7] - player[15]), 2)<16 && pow((player[8]-player[16]), 2)<1)
+ {
+ player[7] += 0.2;
+ player[15] -= 0.2;
+ }
+
+ if (pow((player[3] - player[11]), 2)<16 && pow((player[4]-player[12]), 2)<1)
+ {
+ player[3] += 0.2;
+ player[11] -= 0.2;
+ }
+
+ //If legs touch something
+ r = pmap[(int)(player[8]+0.5)][(int)(player[7]+0.5)];
+ if((r&0xFF)==PT_SPRK && r && (r>>8)<NPART) //If on charge
+ {
+ parts[i].life -= (int)(rand()/1000)+38;
+ }
+
+ if (r>0 && (r>>8)<NPART) //If hot or cold
+ {
+ if(parts[r>>8].temp>=50 || parts[r>>8].temp<=-30)
+ {
+ parts[i].life -= 2;
+ player[16] -= 1;
+ }
+ }
+
+ if ((r&0xFF)==PT_ACID) //If on acid
+ parts[i].life -= 5;
+
+ 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&0xFF)==PT_SPRK && r && (r>>8)<NPART) //If on charge
+ {
+ parts[i].life -= (int)(rand()/1000)+38;
+ }
+
+ if(r>0 && (r>>8)<NPART) //If hot or cold
+ {
+ if(parts[r>>8].temp>=50 || parts[r>>8].temp<=-30)
+ {
+ parts[i].life -= 2;
+ player[8] -= 1;
+ }
+ }
+
+ if ((r&0xFF)==PT_ACID) //If on acid
+ parts[i].life -= 5;
+
+ if ((r&0xFF)==PT_PLUT) //If on plut
+ parts[i].life -= 1;
+
+ isplayer = 1;
+ }
if(t==PT_CLNE)
{
if(!parts[i].ctype)
@@ -3550,7 +3641,13 @@ justdraw:
}
}
+ if(framerender == 1)
+ {
+ sys_pause = 1;
+ framerender= 0;
+ }
+ }
}
void drawblob(pixel *vid, int x, int y, unsigned char cr, unsigned char cg, unsigned char cb)
@@ -4303,7 +4400,42 @@ int sdl_poll(void)
{
player[0] = (int)(player[0])|0x08; //Go left command
}
-
+ if(event.key.keysym.sym == SDLK_KP1) //gravity direction commands
+ {
+ gravityd = 1;
+ }
+ if(event.key.keysym.sym == SDLK_KP2)
+ {
+ gravityd = 2;
+ }
+ if(event.key.keysym.sym == SDLK_KP3)
+ {
+ gravityd = 3;
+ }
+ if(event.key.keysym.sym == SDLK_KP4)
+ {
+ gravityd = 4;
+ }
+ if(event.key.keysym.sym == SDLK_KP5)
+ {
+ gravityd = 5;
+ }
+ if(event.key.keysym.sym == SDLK_KP6)
+ {
+ gravityd = 6;
+ }
+ if(event.key.keysym.sym == SDLK_KP7)
+ {
+ gravityd = 7;
+ }
+ if(event.key.keysym.sym == SDLK_KP8)
+ {
+ gravityd = 8;
+ }
+ if(event.key.keysym.sym == SDLK_KP9)
+ {
+ gravityd = 9;
+ }
if(event.key.keysym.sym == SDLK_UP && ((int)(player[0])&0x04)!=0x04)
{
player[0] = (int)(player[0])|0x04; //Jump command
@@ -10016,6 +10148,14 @@ int main(int argc, char *argv[])
break;
}
}
+ if(sdl_key=='d')
+ {
+ death = !(death);
+ }
+ if(sdl_key=='f')
+ {
+ framerender = 1;
+ }
if((sdl_key=='l' || sdl_key=='k') && stamps[0].name[0])
{
if(load_mode)
@@ -10163,8 +10303,8 @@ int main(int argc, char *argv[])
else
{
bs += sdl_wheel;
- if(bs>16)
- bs = 16;
+ if(bs>1224)
+ bs = 1224;
if(bs<0)
bs = 0;
sdl_wheel = 0;
diff --git a/version.h b/version.h
index 83066d0..6e08742 100755
--- a/version.h
+++ b/version.h
@@ -22,7 +22,7 @@
#define SAVE_VERSION 41
#define MINOR_VERSION 3
-#define IDENT_VERSION "G" //Change this if you're not Simon! It should be a single letter.
+#define IDENT_VERSION "A" //Change this if you're not Simon! It should be a single letter.
#define MENUV3
#define BETA