diff options
| author | Simon 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) |
| commit | e4d1c7141fdc362629c239ff31f97df37a3b92f9 (patch) | |
| tree | 25bb989983daa2281086a26b1c333342f7ec1c94 /src/simulation/Simulation.cpp | |
| parent | 472cb8916eea4313c1d6ac9feb5c415db295536f (diff) | |
| download | powder-e4d1c7141fdc362629c239ff31f97df37a3b92f9.zip powder-e4d1c7141fdc362629c239ff31f97df37a3b92f9.tar.gz | |
TPT: TRON element, needs to glow and fancy explosion on crash eccf5658d2
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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) |
