summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-18 20:27:28 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-18 20:27:28 (GMT)
commite4d1c7141fdc362629c239ff31f97df37a3b92f9 (patch)
tree25bb989983daa2281086a26b1c333342f7ec1c94 /src/simulation
parent472cb8916eea4313c1d6ac9feb5c415db295536f (diff)
downloadpowder-e4d1c7141fdc362629c239ff31f97df37a3b92f9.zip
powder-e4d1c7141fdc362629c239ff31f97df37a3b92f9.tar.gz
TPT: TRON element, needs to glow and fancy explosion on crash eccf5658d2
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/ElementFunctions.h2
-rw-r--r--src/simulation/Elements.h1
-rw-r--r--src/simulation/Simulation.cpp12
-rw-r--r--src/simulation/SimulationData.cpp4
4 files changed, 16 insertions, 3 deletions
diff --git a/src/simulation/ElementFunctions.h b/src/simulation/ElementFunctions.h
index 7f86424..b1d6409 100644
--- a/src/simulation/ElementFunctions.h
+++ b/src/simulation/ElementFunctions.h
@@ -109,6 +109,7 @@ int update_FRAY(UPDATE_FUNC_ARGS);
int update_REPL(UPDATE_FUNC_ARGS);
int update_NBLE(UPDATE_FUNC_ARGS);
int update_GEL(UPDATE_FUNC_ARGS);
+int update_TRON(UPDATE_FUNC_ARGS);
int update_legacy_PYRO(UPDATE_FUNC_ARGS);
int update_legacy_all(UPDATE_FUNC_ARGS);
int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS);
@@ -168,6 +169,7 @@ int graphics_WIRE(GRAPHICS_FUNC_ARGS);
int graphics_ACEL(GRAPHICS_FUNC_ARGS);
int graphics_DCEL(GRAPHICS_FUNC_ARGS);
int graphics_GEL(GRAPHICS_FUNC_ARGS);
+int graphics_TRON(GRAPHICS_FUNC_ARGS);
int graphics_DEFAULT(GRAPHICS_FUNC_ARGS);
#endif /* ELEMENTFUNCTIONS_H_ */
diff --git a/src/simulation/Elements.h b/src/simulation/Elements.h
index 6a62c11..fc90929 100644
--- a/src/simulation/Elements.h
+++ b/src/simulation/Elements.h
@@ -263,6 +263,7 @@
#define PT_IGNT 140
#define PT_BOYL 141
#define PT_GEL 142
+#define PT_TRON 143
#define OLD_PT_WIND 147
#define PT_H2 148
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 5101dfb..e8c9d75 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -2027,7 +2027,17 @@ int Simulation::create_part(int p, int x, int y, int tv)//the function for creat
parts[i].tmp = grule[v+1][9] - 1;
parts[i].ctype = v;
}
-
+ if (t==PT_TRON)
+ {
+ int rr,rg,rb;
+ int randhue = rand()%360;
+ int randomdir = rand()%4;
+ HSV_to_RGB(randhue,255,255,&rr,&rg,&rb);
+ parts[i].dcolour = 255<<24 | rr<<16 | rg<<8 | rb;
+ parts[i].tmp = 1|(randomdir<<2);//set as a head and a direction
+ parts[i].tmp2 = 4;//tail
+ parts[i].life = 5;
+ }
if (t==PT_DEUT)
parts[i].life = 10;
if (t==PT_MERC)
diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp
index 46f3ee6..03e0344 100644
--- a/src/simulation/SimulationData.cpp
+++ b/src/simulation/SimulationData.cpp
@@ -332,7 +332,7 @@ part_type * LoadElements(int & elementCount)
{"IGNC", PIXPACK(0xC0B050), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, 1, 100, SC_EXPLOSIVE, R_TEMP+0.0f +273.15f, 88, "Ignition cord.", ST_SOLID, TYPE_SOLID | PROP_NEUTPENETRATE | PROP_SPARKSETTLE | PROP_LIFE_KILL, &update_IGNT, 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, 1, SC_GAS, R_TEMP+2.0f +273.15f, 42, "Boyle, variable pressure gas. Expands when heated.", ST_GAS, TYPE_GAS, &update_BOYL, NULL},
{"GEL", PIXPACK(0xFF9900), 0.6f, 0.01f * CFDS, 0.98f, 0.95f, 0.0f, 0.1f, 0.00f, 0.000f * CFDS, 2, 0, 0, 0, 20, 1, 1, 35, SC_LIQUID, R_TEMP-2.0f +273.15f, 29, "Gel. A liquid with variable viscosity and heat conductivity", ST_LIQUID, TYPE_LIQUID|PROP_LIFE_DEC|PROP_NEUTPENETRATE, &update_GEL, &graphics_GEL},
- /*FREE*/{"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, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Like Frogs rule S124/B3/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
+ {"TRON", PIXPACK(0x000000), 0.0f, 0.00f * CFDS, 0.90f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 0, 1, 1, 100, SC_SPECIAL, 0.0f, 40, "An automaton tron snake thing", ST_NONE, TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL, &update_TRON, NULL},
/*FREE*/{"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, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Like Star Wars rule S3456/B278/6", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
/*FREE*/{"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, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Frogs S12/B34/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
/*FREE*/{"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, 0, 0, 100, SC_LIFE, 9000.0f, 40, "Brian 6 S6/B246/3", ST_NONE, TYPE_SOLID|PROP_LIFE, NULL, NULL},
@@ -686,7 +686,7 @@ part_transition * LoadTransitions(int & transitionCount)
/* IGNP */ {IPL, NT, IPH, NT, ITL, NT, 673.0f, PT_FIRE},
/* BOYL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/* GEL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
- /*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
+ /* TRON */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},
/*FREE*//* GOL */ {IPL, NT, IPH, NT, ITL, NT, ITH, NT},