summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-05-17 16:44:25 (GMT)
committer jacob1 <jfu614@gmail.com>2013-05-17 16:44:25 (GMT)
commit981f6984c2c0f87d54a9c90f4518c69c9ef02ae0 (patch)
tree757bd699a23c1fad61e60700265a25feb1a3042c /src/simulation
parentcbd402d8cb6aa699ffde83a1b5b3c2f4fc51baaf (diff)
parent77bf649fb4482c86ac1fd9b3233f062b53226007 (diff)
downloadpowder-981f6984c2c0f87d54a9c90f4518c69c9ef02ae0.zip
powder-981f6984c2c0f87d54a9c90f4518c69c9ef02ae0.tar.gz
Merge branch 'HEAD' of git@github.com:FacialTurd/The-Powder-Toy.git
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/ElementGraphics.h2
-rw-r--r--src/simulation/Elements.h35
-rw-r--r--src/simulation/Sample.h2
-rw-r--r--src/simulation/Simulation.cpp519
-rw-r--r--src/simulation/Simulation.h6
-rw-r--r--src/simulation/SimulationData.h12
-rw-r--r--src/simulation/Snapshot.h2
-rw-r--r--src/simulation/StorageClasses.h2
-rw-r--r--src/simulation/Tools.h7
-rw-r--r--src/simulation/elements/116.cpp2
-rw-r--r--src/simulation/elements/146.cpp2
-rw-r--r--src/simulation/elements/ANAR.cpp2
-rw-r--r--src/simulation/elements/BCOL.cpp2
-rw-r--r--src/simulation/elements/BGLA.cpp2
-rw-r--r--src/simulation/elements/BHOL.cpp2
-rw-r--r--src/simulation/elements/BIZR.cpp1
-rw-r--r--src/simulation/elements/BMTL.cpp2
-rw-r--r--src/simulation/elements/BRAY.cpp2
-rw-r--r--src/simulation/elements/BRCK.cpp2
-rw-r--r--src/simulation/elements/BREC.cpp2
-rw-r--r--src/simulation/elements/BRMT.cpp4
-rw-r--r--src/simulation/elements/BVBR.cpp2
-rw-r--r--src/simulation/elements/CAUS.cpp2
-rw-r--r--src/simulation/elements/CFLM.cpp2
-rw-r--r--src/simulation/elements/CNCT.cpp2
-rw-r--r--src/simulation/elements/CRAY.cpp2
-rw-r--r--src/simulation/elements/DESL.cpp2
-rw-r--r--src/simulation/elements/DMG.cpp4
-rw-r--r--src/simulation/elements/DMND.cpp2
-rw-r--r--src/simulation/elements/DRIC.cpp2
-rw-r--r--src/simulation/elements/DUST.cpp2
-rw-r--r--src/simulation/elements/DYST.cpp2
-rw-r--r--src/simulation/elements/ETRD.cpp2
-rw-r--r--src/simulation/elements/EXOT.cpp19
-rw-r--r--src/simulation/elements/FRAY.cpp2
-rw-r--r--src/simulation/elements/FRME.cpp2
-rw-r--r--src/simulation/elements/GEL.cpp1
-rw-r--r--src/simulation/elements/GLAS.cpp2
-rw-r--r--src/simulation/elements/GOO.cpp2
-rw-r--r--src/simulation/elements/GUNP.cpp4
-rw-r--r--src/simulation/elements/H2.cpp2
-rw-r--r--src/simulation/elements/INSL.cpp2
-rw-r--r--src/simulation/elements/INST.cpp2
-rw-r--r--src/simulation/elements/INVIS.cpp2
-rw-r--r--src/simulation/elements/INWR.cpp2
-rw-r--r--src/simulation/elements/ISOZ.cpp2
-rw-r--r--src/simulation/elements/LIFE.cpp2
-rw-r--r--src/simulation/elements/LNTG.cpp2
-rw-r--r--src/simulation/elements/LO2.cpp2
-rw-r--r--src/simulation/elements/LOLZ.cpp2
-rw-r--r--src/simulation/elements/LOVE.cpp2
-rw-r--r--src/simulation/elements/LRBD.cpp2
-rw-r--r--src/simulation/elements/METL.cpp2
-rw-r--r--src/simulation/elements/MORT.cpp2
-rw-r--r--src/simulation/elements/MWAX.cpp2
-rw-r--r--src/simulation/elements/NICE.cpp4
-rw-r--r--src/simulation/elements/NITR.cpp2
-rw-r--r--src/simulation/elements/NONE.cpp2
-rw-r--r--src/simulation/elements/NSCN.cpp2
-rw-r--r--src/simulation/elements/NTCT.cpp2
-rw-r--r--src/simulation/elements/NWHL.cpp2
-rw-r--r--src/simulation/elements/PLEX.cpp2
-rw-r--r--src/simulation/elements/PLSM.cpp2
-rw-r--r--src/simulation/elements/PQRT.cpp2
-rw-r--r--src/simulation/elements/PRTI.cpp2
-rw-r--r--src/simulation/elements/PRTO.cpp2
-rw-r--r--src/simulation/elements/PSCN.cpp2
-rw-r--r--src/simulation/elements/PSNS.cpp2
-rw-r--r--src/simulation/elements/PSTE.cpp2
-rw-r--r--src/simulation/elements/PSTS.cpp2
-rw-r--r--src/simulation/elements/PTCT.cpp2
-rw-r--r--src/simulation/elements/RBDM.cpp2
-rw-r--r--src/simulation/elements/REPL.cpp2
-rw-r--r--src/simulation/elements/SALT.cpp2
-rw-r--r--src/simulation/elements/SAND.cpp2
-rw-r--r--src/simulation/elements/SMKE.cpp2
-rw-r--r--src/simulation/elements/SOAP.cpp2
-rw-r--r--src/simulation/elements/SPAWN.cpp2
-rw-r--r--src/simulation/elements/SPAWN2.cpp2
-rw-r--r--src/simulation/elements/SPRK.cpp4
-rw-r--r--src/simulation/elements/STKM.cpp12
-rw-r--r--src/simulation/elements/STKM2.cpp2
-rw-r--r--src/simulation/elements/STNE.cpp2
-rw-r--r--src/simulation/elements/STOR.cpp2
-rw-r--r--src/simulation/elements/SWCH.cpp2
-rw-r--r--src/simulation/elements/TESC.cpp4
-rw-r--r--src/simulation/elements/THDR.cpp2
-rw-r--r--src/simulation/elements/TRON.cpp2
-rw-r--r--src/simulation/elements/TTAN.cpp2
-rw-r--r--src/simulation/elements/TUNG.cpp (renamed from src/simulation/elements/TUGN.cpp)27
-rw-r--r--src/simulation/elements/URAN.cpp2
-rw-r--r--src/simulation/elements/VOID.cpp2
-rw-r--r--src/simulation/elements/WAX.cpp2
-rw-r--r--src/simulation/elements/WHOL.cpp2
-rw-r--r--src/simulation/elements/WIFI.cpp2
-rw-r--r--src/simulation/elements/WOOD.cpp2
-rw-r--r--src/simulation/elements/WTRV.cpp2
-rw-r--r--src/simulation/tools/AirTool.cpp4
-rw-r--r--src/simulation/tools/Cool.cpp9
-rw-r--r--src/simulation/tools/GravTool.cpp18
-rw-r--r--src/simulation/tools/Heat.cpp9
-rw-r--r--src/simulation/tools/NGrv.cpp4
-rw-r--r--src/simulation/tools/PGrv.cpp18
-rw-r--r--src/simulation/tools/SimTool.cpp4
-rw-r--r--src/simulation/tools/SimTool.h2
-rw-r--r--src/simulation/tools/Vac.cpp4
106 files changed, 384 insertions, 513 deletions
diff --git a/src/simulation/ElementGraphics.h b/src/simulation/ElementGraphics.h
index 0f3723c..d1c8167 100644
--- a/src/simulation/ElementGraphics.h
+++ b/src/simulation/ElementGraphics.h
@@ -33,7 +33,7 @@
#define RENDER_GLOW OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_GLOW | PMODE_ADD | PMODE_BLEND
#define RENDER_BLUR OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_BLUR | PMODE_ADD | PMODE_BLEND
#define RENDER_BLOB OPTIONS | PSPEC_STICKMAN | /*PMODE_FLAT |*/ PMODE_BLOB | PMODE_ADD | PMODE_BLEND
-#define RENDER_BASC OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND
+#define RENDER_BASC OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND | EFFECT_LINES
#define RENDER_NONE OPTIONS | PSPEC_STICKMAN | PMODE_FLAT
#define COLOUR_HEAT 0x00000001
diff --git a/src/simulation/Elements.h b/src/simulation/Elements.h
index cb13216..67e2c4b 100644
--- a/src/simulation/Elements.h
+++ b/src/simulation/Elements.h
@@ -48,41 +48,6 @@
#define BOUNDS_CHECK true
-#define SPC_AIR 236
-#define SPC_HEAT 237
-#define SPC_COOL 238
-#define SPC_VACUUM 239
-#define SPC_WIND 241
-#define SPC_PGRV 243
-#define SPC_NGRV 244
-#define SPC_PROP 246
-
-
-#define NGT_GOL 0
-#define NGT_HLIF 1
-#define NGT_ASIM 2
-#define NGT_2x2 3
-#define NGT_DANI 4
-#define NGT_AMOE 5
-#define NGT_MOVE 6
-#define NGT_PGOL 7
-#define NGT_DMOE 8
-#define NGT_34 9
-#define NGT_LLIF 10
-#define NGT_STAN 11
-#define NGT_SEED 12
-#define NGT_MAZE 13
-#define NGT_COAG 14
-#define NGT_WALL 15
-#define NGT_GNAR 16
-#define NGT_REPL 17
-#define NGT_MYST 18
-#define NGT_LOTE 19
-#define NGT_FRG2 20
-#define NGT_STAR 21
-#define NGT_FROG 22
-#define NGT_BRAN 23
-
#define OLD_PT_WIND 147
//#define PT_NUM 161
diff --git a/src/simulation/Sample.h b/src/simulation/Sample.h
index 3605a5d..d37d0c8 100644
--- a/src/simulation/Sample.h
+++ b/src/simulation/Sample.h
@@ -26,4 +26,4 @@ public:
SimulationSample() : PositionX(0), PositionY(0), ParticleID(0), particle(), AirPressure(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), AirTemperature(0), NumParts(0) {}
};
-#endif \ No newline at end of file
+#endif
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index c1f56f7..4c1a543 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -17,15 +17,17 @@
//#include "graphics/Renderer.h"
//#include "graphics/Graphics.h"
#include "Misc.h"
-#include "Tools.h"
+#include "ToolClasses.h"
#include "gui/game/Brush.h"
#include "client/GameSave.h"
#include "Sample.h"
#include "Snapshot.h"
//#include "StorageClasses.h"
+#ifdef LUACONSOLE
#include "cat/LuaScriptInterface.h"
#include "cat/LuaScriptHelper.h"
+#endif
int Simulation::Load(GameSave * save)
{
@@ -373,8 +375,6 @@ void Simulation::clear_area(int area_x, int area_y, int area_w, int area_h)
void Simulation::CreateBox(int x1, int y1, int x2, int y2, int c, int flags)
{
int i, j;
- if (c==SPC_PROP)
- return;
if (x1>x2)
{
i = x2;
@@ -675,8 +675,6 @@ int Simulation::FloodParts(int x, int y, int fullc, int cm, int bm, int flags)
int coord_stack_size = 0;
int created_something = 0;
- if (c==SPC_PROP)
- return 0;
if (cm==-1)
{
if (c==0)
@@ -884,19 +882,6 @@ int Simulation::flood_water(int x, int y, int i, int originaly, int check)
return 1;
}
-//wrapper around create_part to create TESC with correct tmp value
-int Simulation::create_part_add_props(int p, int x, int y, int tv, int rx, int ry)
-{
- p=create_part(p, x, y, tv);
- if (tv==PT_TESC)
- {
- parts[p].tmp=rx*4+ry*4+7;
- if (parts[p].tmp>300)
- parts[p].tmp=300;
- }
- return p;
-}
-
void Simulation::SetEdgeMode(int newEdgeMode)
{
edgeMode = newEdgeMode;
@@ -1048,15 +1033,9 @@ void Simulation::ApplyDecorationPoint(int positionX, int positionY, int colR, in
if(cBrush)
{
- int radiusX, radiusY, sizeX, sizeY;
-
- radiusX = cBrush->GetRadius().X;
- radiusY = cBrush->GetRadius().Y;
-
- sizeX = cBrush->GetSize().X;
- sizeY = cBrush->GetSize().Y;
-
+ int radiusX = cBrush->GetRadius().X, radiusY = cBrush->GetRadius().Y, sizeX = cBrush->GetSize().X, sizeY = cBrush->GetSize().Y;
unsigned char *bitmap = cBrush->GetBitmap();
+
for(int y = 0; y < sizeY; y++)
{
for(int x = 0; x < sizeX; x++)
@@ -1093,7 +1072,8 @@ void Simulation::ApplyDecorationBox(int x1, int y1, int x2, int y2, int colR, in
void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int colR, int colG, int colB, int colA, int mode, Brush * cBrush)
{
- int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy, rx, ry;
+ bool reverseXY = abs(y2-y1) > abs(x2-x1);
+ int x, y, dx, dy, sy, rx, ry;
float e, de;
if(cBrush)
@@ -1102,7 +1082,7 @@ void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int colR, i
ry = cBrush->GetRadius().Y;
}
- if (cp)
+ if (reverseXY)
{
y = x1;
x1 = y1;
@@ -1131,7 +1111,7 @@ void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int colR, i
sy = (y1<y2) ? 1 : -1;
for (x=x1; x<=x2; x++)
{
- if (cp)
+ if (reverseXY)
ApplyDecorationPoint(y, x, colR, colG, colB, colA, mode, cBrush);
else
ApplyDecorationPoint(x, y, colR, colG, colB, colA, mode, cBrush);
@@ -1141,7 +1121,7 @@ void Simulation::ApplyDecorationLine(int x1, int y1, int x2, int y2, int colR, i
y += sy;
if (!(rx+ry))
{
- if (cp)
+ if (reverseXY)
ApplyDecorationPoint(y, x, colR, colG, colB, colA, mode, cBrush);
else
ApplyDecorationPoint(x, y, colR, colG, colB, colA, mode, cBrush);
@@ -1170,13 +1150,7 @@ int Simulation::ToolBrush(int positionX, int positionY, int tool, Brush * cBrush
{
if(cBrush)
{
- int radiusX, radiusY, sizeX, sizeY;
-
- radiusX = cBrush->GetRadius().X;
- radiusY = cBrush->GetRadius().Y;
-
- sizeX = cBrush->GetSize().X;
- sizeY = cBrush->GetSize().Y;
+ int radiusX = cBrush->GetRadius().X, radiusY = cBrush->GetRadius().Y, sizeX = cBrush->GetSize().X, sizeY = cBrush->GetSize().Y;
unsigned char *bitmap = cBrush->GetBitmap();
for(int y = 0; y < sizeY; y++)
for(int x = 0; x < sizeX; x++)
@@ -1188,11 +1162,10 @@ int Simulation::ToolBrush(int positionX, int positionY, int tool, Brush * cBrush
void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength)
{
- int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy, rx, ry;
+ bool reverseXY = abs(y2-y1) > abs(x2-x1);
+ int x, y, dx, dy, sy, rx = cBrush->GetRadius().X, ry = cBrush->GetRadius().Y;
float e, de;
- rx = cBrush->GetRadius().X;
- ry = cBrush->GetRadius().Y;
- if (cp)
+ if (reverseXY)
{
y = x1;
x1 = y1;
@@ -1221,7 +1194,7 @@ void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBru
sy = (y1<y2) ? 1 : -1;
for (x=x1; x<=x2; x++)
{
- if (cp)
+ if (reverseXY)
ToolBrush(y, x, tool, cBrush, strength);
else
ToolBrush(x, y, tool, cBrush, strength);
@@ -1229,9 +1202,9 @@ void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBru
if (e >= 0.5f)
{
y += sy;
- if ((!(rx+ry)) && ((y1<y2) ? (y<=y2) : (y>=y2)))
+ if (!(rx+ry) && ((y1<y2) ? (y<=y2) : (y>=y2)))
{
- if (cp)
+ if (reverseXY)
ToolBrush(y, x, tool, cBrush, strength);
else
ToolBrush(x, y, tool, cBrush, strength);
@@ -1240,7 +1213,7 @@ void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBru
}
}
}
-void Simulation::ToolBox(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength)
+void Simulation::ToolBox(int x1, int y1, int x2, int y2, int tool, float strength)
{
int i, j;
if (x1>x2)
@@ -1264,39 +1237,25 @@ int Simulation::CreateParts(int positionX, int positionY, int c, Brush * cBrush)
{
if(cBrush)
{
- int radiusX, radiusY, sizeX, sizeY;
-
- radiusX = cBrush->GetRadius().X;
- radiusY = cBrush->GetRadius().Y;
-
- sizeX = cBrush->GetSize().X;
- sizeY = cBrush->GetSize().Y;
-
+ int radiusX = cBrush->GetRadius().X, radiusY = cBrush->GetRadius().Y, sizeX = cBrush->GetSize().X, sizeY = cBrush->GetSize().Y, fn;
unsigned char *bitmap = cBrush->GetBitmap();
- if(c == PT_NONE)
- {
- for(int y = 0; y < sizeY; y++)
- {
- for(int x = 0; x < sizeX; x++)
- {
- if(bitmap[(y*sizeX)+x] && (positionX+(x-radiusX) >= 0 && positionY+(y-radiusY) >= 0 && positionX+(x-radiusX) < XRES && positionY+(y-radiusY) < YRES))
- {
- delete_part(positionX+(x-radiusX), positionY+(y-radiusY), 0);
- }
- }
- }
- }
- else
+ if (c == 0)// && !(flags&BRUSH_REPLACEMODE)) // delete
+ fn = 0;
+ //else if ((flags&BRUSH_SPECIFIC_DELETE) && !(flags&BRUSH_REPLACEMODE)) // specific delete
+ // fn = 1;
+ //else if (flags&BRUSH_REPLACEMODE) // replace
+ // fn = 2;
+ else // normal draw
+ fn = 3;
+
+ for(int y = 0; y < sizeY; y++)
{
- for(int y = 0; y < sizeY; y++)
+ for(int x = 0; x < sizeX; x++)
{
- for(int x = 0; x < sizeX; x++)
+ if(bitmap[(y*sizeX)+x] && (positionX+(x-radiusX) >= 0 && positionY+(y-radiusY) >= 0 && positionX+(x-radiusX) < XRES && positionY+(y-radiusY) < YRES))
{
- if(bitmap[(y*sizeX)+x] && (positionX+(x-radiusX) >= 0 && positionY+(y-radiusY) >= 0 && positionX+(x-radiusX) < XRES && positionY+(y-radiusY) < YRES))
- {
- create_part(-2, positionX+(x-radiusX), positionY+(y-radiusY), c);
- }
+ CreatePartFlags(positionX+(x-radiusX), positionY+(y-radiusY), c, fn, 0);
}
}
}
@@ -1306,77 +1265,47 @@ int Simulation::CreateParts(int positionX, int positionY, int c, Brush * cBrush)
int Simulation::CreateParts(int x, int y, int rx, int ry, int c, int flags)
{
- int i, j, r, f = 0, u, v, oy, ox, b = 0, dw = 0, stemp = 0, p;
- int wall = c - 100;
- if (c==SPC_WIND || c==PT_FIGH)
- return 0;
-
- if (c==PT_LIGH)
+ int i, j, f = 0, fn;
+
+ if (c == 0)// && !(flags&BRUSH_REPLACEMODE)) // delete
+ fn = 0;
+ //else if ((flags&BRUSH_SPECIFIC_DELETE) && !(flags&BRUSH_REPLACEMODE)) // specific delete
+ // fn = 1;
+ //else if (flags&BRUSH_REPLACEMODE) // replace
+ // fn = 2;
+ else // normal draw
+ fn = 3;
+
+ for (j=-ry; j<=ry; j++)
+ for (i=-rx; i<=rx; i++)
+ if (CreatePartFlags(x+i, y+j, c, fn, flags))
+ f = 1;
+ return !f;
+}
+
+int Simulation::CreatePartFlags(int x, int y, int c, int fn, int flags)
+{
+ if (fn == 0) //delete
+ delete_part(x, y, 0);
+ else if (fn == 1) //specific delete
+ delete_part(x, y, flags);
+ else if (fn == 2) //replace mode
{
- if (lighting_recreate>0 && rx+ry>0)
+ if (x<0 || y<0 || x>=XRES || y>=YRES)
return 0;
- p=create_part(-2, x, y, c);
- if (p!=-1)
- {
- parts[p].life=rx+ry;
- if (parts[p].life>55)
- parts[p].life=55;
- parts[p].temp=parts[p].life*150; // temperature of the lighting shows the power of the lighting
- lighting_recreate+=parts[p].life/2+1;
- return 1;
- }
- else return 0;
- }
-
- //eraser
- if (c == 0)
- {
- if (rx==0&&ry==0)
+ //if ((pmap[y][x]&0xFF)!=SLALT&&SLALT!=0)
+ // return 0;
+ if ((pmap[y][x]))
{
delete_part(x, y, 0);
+ if (c!=0)
+ create_part(-2, x, y, c);
}
- else
- {
- for (j=-ry; j<=ry; j++)
- for (i=-rx; i<=rx; i++)
- delete_part(x+i, y+j, 0);
- }
- return 1;
}
-
- if (c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM || c == SPC_PGRV || c == SPC_NGRV)
- {
- if (rx==0&&ry==0)
- {
- create_part(-2, x, y, c);
- }
- else
- {
- for (j=-ry; j<=ry; j++)
- for (i=-rx; i<=rx; i++)
- {
- if ( x+i<0 || y+j<0 || x+i>=XRES || y+j>=YRES)
- continue;
- create_part(-2, x+i, y+j, c);
- }
- }
- return 1;
- }
-
- //else, no special modes, draw element like normal.
- if (rx==0&&ry==0)//workaround for 1pixel brush/floodfill crashing. todo: find a better fix later.
- {
- if (create_part_add_props(-2, x, y, c, rx, ry)==-1)
- f = 1;
- }
- else
- {
- for (j=-ry; j<=ry; j++)
- for (i=-rx; i<=rx; i++)
- if (create_part_add_props(-2, x+i, y+j, c, rx, ry)==-1)
- f = 1;
- }
- return !f;
+ else if (fn == 3) //normal draw
+ if (create_part(-2, x, y, c) == -1)
+ return 1;
+ return 0;
}
int Simulation::CreateWalls(int x, int y, int rx, int ry, int c, int flags, Brush * cBrush)
@@ -1441,13 +1370,10 @@ int Simulation::CreateWalls(int x, int y, int rx, int ry, int c, int flags, Brus
void Simulation::CreateLine(int x1, int y1, int x2, int y2, int c, Brush * cBrush)
{
- int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy, rx, ry;
- rx = cBrush->GetRadius().X;
- ry = cBrush->GetRadius().Y;
+ int x, y, dx, dy, sy, rx = cBrush->GetRadius().X, ry = cBrush->GetRadius().Y;
+ bool reverseXY = abs(y2-y1) > abs(x2-x1);
float e, de;
- if (c==SPC_PROP)
- return;
- if (cp)
+ if (reverseXY)
{
y = x1;
x1 = y1;
@@ -1476,7 +1402,7 @@ void Simulation::CreateLine(int x1, int y1, int x2, int y2, int c, Brush * cBrus
sy = (y1<y2) ? 1 : -1;
for (x=x1; x<=x2; x++)
{
- if (cp)
+ if (reverseXY)
CreateParts(y, x, c, cBrush);
else
CreateParts(x, y, c, cBrush);
@@ -1484,10 +1410,9 @@ void Simulation::CreateLine(int x1, int y1, int x2, int y2, int c, Brush * cBrus
if (e >= 0.5f)
{
y += sy;
- if ((c==WL_EHOLE+100 || c==WL_ALLOWGAS+100 || c==WL_ALLOWENERGY+100 || c==WL_ALLOWALLELEC+100 || c==WL_ALLOWSOLID+100 || c==WL_ALLOWAIR+100 || c==WL_WALL+100 || c==WL_DESTROYALL+100 || c==WL_ALLOWLIQUID+100 || c==WL_FAN+100 || c==WL_STREAM+100 || c==WL_DETECT+100 || c==WL_EWALL+100 || c==WL_WALLELEC+100 || !(rx+ry))
- && ((y1<y2) ? (y<=y2) : (y>=y2)))
+ if (!(rx+ry) && ((y1<y2) ? (y<=y2) : (y>=y2)))
{
- if (cp)
+ if (reverseXY)
CreateParts(y, x, c, cBrush);
else
CreateParts(x, y, c, cBrush);
@@ -1497,13 +1422,13 @@ void Simulation::CreateLine(int x1, int y1, int x2, int y2, int c, Brush * cBrus
}
}
-void Simulation::CreateLine(int x1, int y1, int x2, int y2, int rx, int ry, int c, int flags)
+//Now simply creates a 0 pixel radius line without all the complicated flags / other checks
+void Simulation::CreateLine(int x1, int y1, int x2, int y2, int c)
{
- int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy;
+ bool reverseXY = abs(y2-y1) > abs(x2-x1);
+ int x, y, dx, dy, sy;
float e, de;
- if (c==SPC_PROP)
- return;
- if (cp)
+ if (reverseXY)
{
y = x1;
x1 = y1;
@@ -1532,21 +1457,20 @@ void Simulation::CreateLine(int x1, int y1, int x2, int y2, int rx, int ry, int
sy = (y1<y2) ? 1 : -1;
for (x=x1; x<=x2; x++)
{
- if (cp)
- CreateParts(y, x, rx, ry, c, flags);
+ if (reverseXY)
+ create_part(-2, y, x, c);
else
- CreateParts(x, y, rx, ry, c, flags);
+ create_part(-2, x, y, c);
e += de;
if (e >= 0.5f)
{
y += sy;
- if ((c==WL_EHOLE+100 || c==WL_ALLOWGAS+100 || c==WL_ALLOWENERGY+100 || c==WL_ALLOWALLELEC+100 || c==WL_ALLOWSOLID+100 || c==WL_ALLOWAIR+100 || c==WL_WALL+100 || c==WL_DESTROYALL+100 || c==WL_ALLOWLIQUID+100 || c==WL_FAN+100 || c==WL_STREAM+100 || c==WL_DETECT+100 || c==WL_EWALL+100 || c==WL_WALLELEC+100 || !(rx+ry))
- && ((y1<y2) ? (y<=y2) : (y>=y2)))
+ if ((y1<y2) ? (y<=y2) : (y>=y2))
{
- if (cp)
- CreateParts(y, x, rx, ry, c, flags);
+ if (reverseXY)
+ create_part(-2, y, x, c);
else
- CreateParts(x, y, rx, ry, c, flags);
+ create_part(-2, x, y, c);
}
e -= 1.0f;
}
@@ -1951,7 +1875,7 @@ void Simulation::create_arc(int sx, int sy, int dx, int dy, int midpoints, int v
xmid[i+1] += (rand()%variance)-voffset;
ymid[i+1] += (rand()%variance)-voffset;
}
- CreateLine(xmid[i], ymid[i], xmid[i+1], ymid[i+1], 0, 0, type, flags);
+ CreateLine(xmid[i], ymid[i], xmid[i+1], ymid[i+1], type);
}
free(xmid);
free(ymid);
@@ -2707,46 +2631,12 @@ int Simulation::create_part(int p, int x, int y, int tv)
int t = tv & 0xFF;
int v = (tv >> 8) & 0xFFFFFF;
- if (x<0 || y<0 || x>=XRES || y>=YRES || ((t<=0 || t>=PT_NUM)&&t!=SPC_HEAT&&t!=SPC_COOL&&t!=SPC_AIR&&t!=SPC_VACUUM&&t!=SPC_PGRV&&t!=SPC_NGRV))
+ if (x<0 || y<0 || x>=XRES || y>=YRES)
return -1;
- if (t>=0 && t<PT_NUM && !elements[t].Enabled && t!=SPC_AIR)
+ if (t>=0 && t<PT_NUM && !elements[t].Enabled)
return -1;
- if(t==SPC_PROP) {
- return -1; //Prop tool works on a mouse click basic, make sure it doesn't do anything here
- }
- /*if (t==SPC_HEAT||t==SPC_COOL)
- {
- if ((pmap[y][x]&0xFF)!=PT_NONE&&(pmap[y][x]&0xFF)<PT_NUM)
- {
- if (t==SPC_HEAT&&parts[pmap[y][x]>>8].temp<MAX_TEMP)
- {
- if ((pmap[y][x]&0xFF)==PT_PUMP || (pmap[y][x]&0xFF)==PT_GPMP) {
- 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]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 50.0f, MIN_TEMP, MAX_TEMP);
- } else {
- 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]>>8].temp>MIN_TEMP)
- {
- if ((pmap[y][x]&0xFF)==PT_PUMP || (pmap[y][x]&0xFF)==PT_GPMP) {
- 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]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 50.0f, MIN_TEMP, MAX_TEMP);
- } else {
- parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 4.0f, MIN_TEMP, MAX_TEMP);
- }
- }
- return pmap[y][x]>>8;
- }
- else
- {
- return -1;
- }
- }*/
- if (t==SPC_AIR)
+ if (tv == SPC_AIR)
{
pv[y/CELL][x/CELL] += 0.03f;
if (y+CELL<YRES)
@@ -2759,30 +2649,6 @@ int Simulation::create_part(int p, int x, int y, int tv)
}
return -1;
}
- if (t==SPC_VACUUM)
- {
- pv[y/CELL][x/CELL] -= 0.03f;
- if (y+CELL<YRES)
- pv[y/CELL+1][x/CELL] -= 0.03f;
- if (x+CELL<XRES)
- {
- pv[y/CELL][x/CELL+1] -= 0.03f;
- if (y+CELL<YRES)
- pv[y/CELL+1][x/CELL+1] -= 0.03f;
- }
- return -1;
- }
- if (t==SPC_PGRV)
- {
- gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = 5;
- return -1;
- }
- if (t==SPC_NGRV)
- {
- gravmap[(y/CELL)*(XRES/CELL)+(x/CELL)] = -5;
- return -1;
- }
-
if (t==PT_SPRK)
{
@@ -2791,10 +2657,9 @@ int Simulation::create_part(int p, int x, int y, int tv)
if(type == PT_WIRE)
{
parts[index].ctype = PT_DUST;
+ return index;
}
- if (!(type == PT_INST || (elements[type].Properties&PROP_CONDUCTS)))
- return -1;
- if (parts[index].life!=0)
+ if (!(type == PT_INST || (elements[type].Properties&PROP_CONDUCTS)) || parts[index].life!=0)
return -1;
if (p == -2 && type == PT_INST)
{
@@ -2913,10 +2778,21 @@ int Simulation::create_part(int p, int x, int y, int tv)
if (i>parts_lastActiveIndex) parts_lastActiveIndex = i;
+ parts[i].x = (float)x;
+ parts[i].y = (float)y;
+ parts[i].type = t;
+ parts[i].vx = 0;
+ parts[i].vy = 0;
+ parts[i].life = 0;
+ parts[i].ctype = 0;
+ parts[i].temp = elements[t].Temperature;
+ parts[i].tmp = 0;
+ parts[i].tmp2 = 0;
parts[i].dcolour = 0;
parts[i].flags = 0;
- if (t == PT_GLAS || t == PT_QRTZ || t == PT_TUGN)
+ if (t == PT_GLAS || t == PT_QRTZ || t == PT_TUNG)
{
+ parts[i].pavg[0] = 0.0f;
parts[i].pavg[1] = pv[y/CELL][x/CELL];
}
else
@@ -2924,19 +2800,7 @@ int Simulation::create_part(int p, int x, int y, int tv)
parts[i].pavg[0] = 0.0f;
parts[i].pavg[1] = 0.0f;
}
- if (t!=PT_STKM&&t!=PT_STKM2&&t!=PT_FIGH)//set everything to default values first, except for stickman.
- {
- parts[i].x = (float)x;
- parts[i].y = (float)y;
- parts[i].type = t;
- parts[i].vx = 0;
- parts[i].vy = 0;
- parts[i].life = 0;
- parts[i].ctype = 0;
- parts[i].temp = elements[t].Temperature;
- parts[i].tmp = 0;
- parts[i].tmp2 = 0;
- }
+
switch (t)
{
case PT_SOAP:
@@ -3043,14 +2907,7 @@ int Simulation::create_part(int p, int x, int y, int tv)
case PT_STKM:
if (player.spwn==0)
{
- 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 = elements[t].Temperature;
Element_STKM::STKM_init_legs(this, &player, i);
player.spwn = 1;
player.elem = PT_DUST;
@@ -3065,14 +2922,7 @@ int Simulation::create_part(int p, int x, int y, int tv)
case PT_STKM2:
if (player2.spwn==0)
{
- 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 = elements[t].Temperature;
Element_STKM::STKM_init_legs(this, &player2, i);
player2.spwn = 1;
player2.elem = PT_DUST;
@@ -3791,7 +3641,7 @@ void Simulation::update_particles_i(int start, int inc)
if (elements[t].Diffusion)//the random diffusion that gasses have
{
#ifdef REALISTIC
- //The magic number controlls diffusion speed
+ //The magic number controls diffusion speed
parts[i].vx += 0.05*sqrtf(parts[i].temp)*elements[t].Diffusion*(rand()/(0.5f*RAND_MAX)-1.0f);
parts[i].vy += 0.05*sqrtf(parts[i].temp)*elements[t].Diffusion*(rand()/(0.5f*RAND_MAX)-1.0f);
#else
@@ -3834,13 +3684,11 @@ void Simulation::update_particles_i(int start, int inc)
h_count = 0;
#ifdef REALISTIC
if (t&&(t!=PT_HSWC||parts[i].life==10)&&(elements[t].HeatConduct*gel_scale))
- {
- float c_Cm = 0.0f;
#else
if (t&&(t!=PT_HSWC||parts[i].life==10)&&(elements[t].HeatConduct*gel_scale)>(rand()%250))
+#endif
{
float c_Cm = 0.0f;
-#endif
if (aheat_enable && !(elements[t].Properties&PROP_NOAMBHEAT))
{
#ifdef REALISTIC
@@ -3924,11 +3772,12 @@ void Simulation::update_particles_i(int start, int inc)
if ((t==PT_ICEI || t==PT_SNOW) && (parts[i].ctype==0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI || parts[i].ctype==PT_SNOW))
parts[i].ctype = PT_WATR;
- if (ctemph>elements[t].HighTemperature&&elements[t].HighTemperatureTransition>-1) {
+ if (ctemph>elements[t].HighTemperature && elements[t].HighTemperatureTransition>-1)
+ {
// particle type change due to high temperature
#ifdef REALISTIC
float dbt = ctempl - pt;
- if (elements[t].HighTemperatureTransition!=PT_NUM)
+ if (elements[t].HighTemperatureTransition != PT_NUM)
{
if (platent[t] <= (c_heat - (elements[t].HighTemperature - dbt)*c_Cm))
{
@@ -3941,14 +3790,18 @@ void Simulation::update_particles_i(int start, int inc)
s = 0;
}
}
- #else
- if (elements[t].HighTemperatureTransition!=PT_NUM)
+#else
+ if (elements[t].HighTemperatureTransition != PT_NUM)
t = elements[t].HighTemperatureTransition;
#endif
- else if (t==PT_ICEI || t==PT_SNOW) {
- if (parts[i].ctype<PT_NUM&&parts[i].ctype!=t) {
- if (elements[parts[i].ctype].LowTemperatureTransition==t&&pt<=elements[parts[i].ctype].LowTemperature) s = 0;
- else {
+ else if (t == PT_ICEI || t == PT_SNOW)
+ {
+ if (parts[i].ctype < PT_NUM && parts[i].ctype != t)
+ {
+ if (elements[parts[i].ctype].LowTemperatureTransition==t && pt<=elements[parts[i].ctype].LowTemperature)
+ s = 0;
+ else
+ {
#ifdef REALISTIC
//One ice table value for all it's kinds
if (platent[t] <= (c_heat - (elements[parts[i].ctype].LowTemperature - dbt)*c_Cm))
@@ -3963,16 +3816,18 @@ void Simulation::update_particles_i(int start, int inc)
parts[i].temp = restrict_flt(elements[parts[i].ctype].LowTemperature - dbt, MIN_TEMP, MAX_TEMP);
s = 0;
}
- #else
+#else
t = parts[i].ctype;
parts[i].ctype = PT_NONE;
parts[i].life = 0;
#endif
}
}
- else s = 0;
+ else
+ s = 0;
}
- else if (t==PT_SLTW) {
+ else if (t == PT_SLTW)
+ {
#ifdef REALISTIC
if (platent[t] <= (c_heat - (elements[t].HighTemperature - dbt)*c_Cm))
{
@@ -3987,16 +3842,31 @@ void Simulation::update_particles_i(int start, int inc)
s = 0;
}
#else
- if (rand()%4==0) t = PT_SALT;
- else t = PT_WTRV;
+ if (rand()%4 == 0)
+ t = PT_SALT;
+ else
+ t = PT_WTRV;
#endif
}
- else s = 0;
- } else if (ctempl<elements[t].LowTemperature&&elements[t].LowTemperatureTransition>-1) {
+ else if (t == PT_BRMT)
+ {
+ if (parts[i].ctype == PT_TUNG && ctemph <= 3695.0)
+ s = 0;
+ else
+ {
+ t = PT_LAVA;
+ parts[i].type = PT_TUNG;
+ }
+ }
+ else
+ s = 0;
+ }
+ else if (ctempl<elements[t].LowTemperature && elements[t].LowTemperatureTransition > -1)
+ {
// particle type change due to low temperature
#ifdef REALISTIC
float dbt = ctempl - pt;
- if (elements[t].LowTemperatureTransition!=PT_NUM)
+ if (elements[t].LowTemperatureTransition != PT_NUM)
{
if (platent[elements[t].LowTemperatureTransition] >= (c_heat - (elements[t].LowTemperature - dbt)*c_Cm))
{
@@ -4010,44 +3880,62 @@ void Simulation::update_particles_i(int start, int inc)
}
}
#else
- if (elements[t].LowTemperatureTransition!=PT_NUM)
- t = elements[t].LowTemperatureTransition;
+ if (elements[t].LowTemperatureTransition != PT_NUM)
+ t = elements[t].LowTemperatureTransition;
#endif
- else if (t==PT_WTRV) {
- if (pt<273.0f) t = PT_RIME;
- else t = PT_DSTW;
+ else if (t == PT_WTRV)
+ {
+ if (pt < 273.0f)
+ t = PT_RIME;
+ else
+ t = PT_DSTW;
}
- else if (t==PT_LAVA) {
- if (parts[i].ctype>0 && parts[i].ctype<PT_NUM && parts[i].ctype!=PT_LAVA) {
- if (parts[i].ctype==PT_THRM&&pt>=elements[PT_BMTL].HighTemperature) s = 0;
- else if ((parts[i].ctype==PT_VIBR || parts[i].ctype==PT_BVBR) && pt>=273.15f) s = 0;
- else if (parts[i].ctype==PT_TUGN) {
- if (pt>3695.0) s = 0;
+ else if (t == PT_LAVA)
+ {
+ if (parts[i].ctype>0 && parts[i].ctype<PT_NUM && parts[i].ctype!=PT_LAVA)
+ {
+ if (parts[i].ctype==PT_THRM&&pt>=elements[PT_BMTL].HighTemperature)
+ s = 0;
+ else if ((parts[i].ctype==PT_VIBR || parts[i].ctype==PT_BVBR) && pt>=273.15f)
+ s = 0;
+ else if (parts[i].ctype==PT_TUNG)
+ {
+ if (pt>3695.0)
+ s = 0;
}
- else if (elements[parts[i].ctype].HighTemperatureTransition==PT_LAVA) {
- if (pt>=elements[parts[i].ctype].HighTemperature) s = 0;
+ else if (elements[parts[i].ctype].HighTemperatureTransition == PT_LAVA)
+ {
+ if (pt >= elements[parts[i].ctype].HighTemperature)
+ s = 0;
}
- else if (pt>=973.0f) s = 0; // freezing point for lava with any other (not listed in ptransitions as turning into lava) ctype
- if (s) {
+ else if (pt>=973.0f)
+ s = 0; // freezing point for lava with any other (not listed in ptransitions as turning into lava) ctype
+ if (s)
+ {
t = parts[i].ctype;
parts[i].ctype = PT_NONE;
- if (t==PT_THRM) {
+ if (t == PT_THRM)
+ {
parts[i].tmp = 0;
t = PT_BMTL;
}
- if (t==PT_PLUT)
+ if (t == PT_PLUT)
{
parts[i].tmp = 0;
t = PT_LAVA;
}
}
}
- else if (pt<973.0f) t = PT_STNE;
- else s = 0;
+ else if (pt<973.0f)
+ t = PT_STNE;
+ else
+ s = 0;
}
- else s = 0;
+ else
+ s = 0;
}
- else s = 0;
+ else
+ s = 0;
#ifdef REALISTIC
pt = restrict_flt(pt, MIN_TEMP, MAX_TEMP);
for (j=0; j<8; j++)
@@ -4055,30 +3943,37 @@ void Simulation::update_particles_i(int start, int inc)
parts[surround_hconduct[j]].temp = pt;
}
#endif
- if (s) { // particle type change occurred
- if (t==PT_ICEI||t==PT_LAVA||t==PT_SNOW)
+ if (s) // particle type change occurred
+ {
+ if (t==PT_ICEI || t==PT_LAVA || t==PT_SNOW)
parts[i].ctype = parts[i].type;
- if (!(t==PT_ICEI&&parts[i].ctype==PT_FRZW)) parts[i].life = 0;
- if (elements[t].State==ST_GAS&&elements[parts[i].type].State!=ST_GAS)
+ if (!(t==PT_ICEI && parts[i].ctype==PT_FRZW))
+ parts[i].life = 0;
+ if (elements[t].State==ST_GAS && elements[parts[i].type].State!=ST_GAS)
pv[y/CELL][x/CELL] += 0.50f;
+
part_change_type(i,x,y,t);
- if (t==PT_FIRE||t==PT_PLSM||t==PT_CFLM)
+
+ if (t==PT_FIRE || t==PT_PLSM || t==PT_CFLM)
parts[i].life = rand()%50+120;
- if (t==PT_LAVA) {
- if (parts[i].ctype==PT_BRMT) parts[i].ctype = PT_BMTL;
- else if (parts[i].ctype==PT_SAND) parts[i].ctype = PT_GLAS;
- else if (parts[i].ctype==PT_BGLA) parts[i].ctype = PT_GLAS;
- else if (parts[i].ctype==PT_PQRT) parts[i].ctype = PT_QRTZ;
+ if (t == PT_LAVA)
+ {
+ if (parts[i].ctype == PT_BRMT) parts[i].ctype = PT_BMTL;
+ else if (parts[i].ctype == PT_SAND) parts[i].ctype = PT_GLAS;
+ else if (parts[i].ctype == PT_BGLA) parts[i].ctype = PT_GLAS;
+ else if (parts[i].ctype == PT_PQRT) parts[i].ctype = PT_QRTZ;
parts[i].life = rand()%120+240;
}
- if (t==PT_NONE) {
+ if (t == PT_NONE)
+ {
kill_part(i);
goto killed;
}
}
pt = parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP);
- if (t==PT_LAVA) {
+ if (t == PT_LAVA)
+ {
parts[i].life = restrict_flt((parts[i].temp-700)/7, 0.0f, 400.0f);
if (parts[i].ctype==PT_THRM&&parts[i].tmp>0)
{
@@ -4091,11 +3986,7 @@ void Simulation::update_particles_i(int start, int inc)
parts[i].temp = MAX_TEMP;
}
}
-#ifdef REALISTIC //needed to fix update_particles_i parsing
}
-#else
- }
-#endif
else parts[i].temp = restrict_flt(parts[i].temp, MIN_TEMP, MAX_TEMP);
}
@@ -4196,7 +4087,11 @@ void Simulation::update_particles_i(int start, int inc)
}
//call the particle update function, if there is one
+#if !defined(RENDERER) && defined(LUACONSOLE)
if (elements[t].Update && lua_el_mode[t] != 2)
+#else
+ if (elements[t].Update)
+#endif
{
if ((*(elements[t].Update))(this, i, x, y, surround_space, nt, parts, pmap))
continue;
@@ -4207,6 +4102,7 @@ void Simulation::update_particles_i(int start, int inc)
y = (int)(parts[i].y+0.5f);
}
}
+#if !defined(RENDERER) && defined(LUACONSOLE)
if(lua_el_mode[t])
{
if(luacon_elementReplacement(this, i, x, y, surround_space, nt, parts, pmap))
@@ -4215,6 +4111,7 @@ void Simulation::update_particles_i(int start, int inc)
x = (int)(parts[i].x+0.5f);
y = (int)(parts[i].y+0.5f);
}
+#endif
if(legacy_enable)//if heat sim is off
Element::legacyUpdate(this, i,x,y,surround_space,nt, parts, pmap);
diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h
index 5ce0d1e..1b27bc7 100644
--- a/src/simulation/Simulation.h
+++ b/src/simulation/Simulation.h
@@ -139,7 +139,6 @@ public:
int flood_water(int x, int y, int i, int originaly, int check);
TPT_NO_INLINE void detach(int i);
TPT_NO_INLINE void part_change_type(int i, int x, int y, int t);
- TPT_NO_INLINE int create_part_add_props(int p, int x, int y, int tv, int rx, int ry);
//int InCurrentBrush(int i, int j, int rx, int ry);
//int get_brush_flags();
TPT_NO_INLINE int create_part(int p, int x, int y, int t);
@@ -161,7 +160,7 @@ public:
int Tool(int x, int y, int tool, float strength = 1.0f);
int ToolBrush(int x, int y, int tool, Brush * cBrush, float strength = 1.0f);
void ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength = 1.0f);
- void ToolBox(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength = 1.0f);
+ void ToolBox(int x1, int y1, int x2, int y2, int tool, float strength = 1.0f);
void CreateBox(int x1, int y1, int x2, int y2, int c, int flags);
int FloodINST(int x, int y, int fullc, int cm);
@@ -170,8 +169,9 @@ public:
int CreateParts(int positionX, int positionY, int c, Brush * cBrush);
//Old particle creation, will create a crappy square, do not use
int CreateParts(int x, int y, int rx, int ry, int c, int flags);
+ int CreatePartFlags(int x, int y, int c, int fn, int flags);
void CreateLine(int x1, int y1, int x2, int y2, int c, Brush * cBrush);
- void CreateLine(int x1, int y1, int x2, int y2, int rx, int ry, int c, int flags);
+ void CreateLine(int x1, int y1, int x2, int y2, int c);
void CreateWallBox(int x1, int y1, int x2, int y2, int c, int flags);
int FloodWalls(int x, int y, int c, int cm, int bm, int flags);
diff --git a/src/simulation/SimulationData.h b/src/simulation/SimulationData.h
index 770d732..219db51 100644
--- a/src/simulation/SimulationData.h
+++ b/src/simulation/SimulationData.h
@@ -19,8 +19,6 @@
#define SC_CRACKER2 16
#define SC_TOTAL 15
-#define UI_WALLSTART 222
-#define UI_ACTUALSTART 122
#define UI_WALLCOUNT 16
#define O_WL_WALLELEC 122
@@ -61,14 +59,8 @@
#define WL_ALLOWENERGY 15
#define WL_FLOODHELPER 255
-#define SPC_AIR 236
-#define SPC_HEAT 237
-#define SPC_COOL 238
-#define SPC_VACUUM 239
-#define SPC_WIND 241
-#define SPC_PGRV 243
-#define SPC_NGRV 244
-#define SPC_PROP 246
+#define OLD_SPC_AIR 236
+#define SPC_AIR 256
#define DECO_DRAW 0
#define DECO_ADD 1
diff --git a/src/simulation/Snapshot.h b/src/simulation/Snapshot.h
index d87f4d9..2ef4d30 100644
--- a/src/simulation/Snapshot.h
+++ b/src/simulation/Snapshot.h
@@ -57,4 +57,4 @@ public:
{
}
-}; \ No newline at end of file
+};
diff --git a/src/simulation/StorageClasses.h b/src/simulation/StorageClasses.h
index 45b9b00..7f60b39 100644
--- a/src/simulation/StorageClasses.h
+++ b/src/simulation/StorageClasses.h
@@ -51,4 +51,4 @@ typedef struct part_type part_type;*/
};
typedef struct part_transition part_transition;*/
-#endif \ No newline at end of file
+#endif
diff --git a/src/simulation/Tools.h b/src/simulation/Tools.h
deleted file mode 100644
index 525701e..0000000
--- a/src/simulation/Tools.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef TOOLS_H_
-#define TOOLS_H_
-
-#include "ToolClasses.h"
-
-
-#endif
diff --git a/src/simulation/elements/116.cpp b/src/simulation/elements/116.cpp
index e99f0cf..7e52557 100644
--- a/src/simulation/elements/116.cpp
+++ b/src/simulation/elements/116.cpp
@@ -46,4 +46,4 @@ Element_116::Element_116()
}
-Element_116::~Element_116() {} \ No newline at end of file
+Element_116::~Element_116() {}
diff --git a/src/simulation/elements/146.cpp b/src/simulation/elements/146.cpp
index 173d435..df2b7bc 100644
--- a/src/simulation/elements/146.cpp
+++ b/src/simulation/elements/146.cpp
@@ -46,4 +46,4 @@ Element_146::Element_146()
}
-Element_146::~Element_146() {} \ No newline at end of file
+Element_146::~Element_146() {}
diff --git a/src/simulation/elements/ANAR.cpp b/src/simulation/elements/ANAR.cpp
index 16d619d..5a5ea33 100644
--- a/src/simulation/elements/ANAR.cpp
+++ b/src/simulation/elements/ANAR.cpp
@@ -28,7 +28,7 @@ Element_ANAR::Element_ANAR()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 70;
- Description = "Very light dust. Behaves opposite gravity";
+ Description = "Anti-air. Very light dust, which behaves opposite gravity.";
State = ST_SOLID;
Properties = TYPE_PART;
diff --git a/src/simulation/elements/BCOL.cpp b/src/simulation/elements/BCOL.cpp
index d6e1612..9c90ff3 100644
--- a/src/simulation/elements/BCOL.cpp
+++ b/src/simulation/elements/BCOL.cpp
@@ -28,7 +28,7 @@ Element_BCOL::Element_BCOL()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 150;
- Description = "Broken Coal. Heavy particles. See COAL";
+ Description = "Broken Coal. Heavy particles, burns slowly.";
State = ST_SOLID;
Properties = TYPE_PART;
diff --git a/src/simulation/elements/BGLA.cpp b/src/simulation/elements/BGLA.cpp
index 3c7e9ba..e514c90 100644
--- a/src/simulation/elements/BGLA.cpp
+++ b/src/simulation/elements/BGLA.cpp
@@ -46,4 +46,4 @@ Element_BGLA::Element_BGLA()
}
-Element_BGLA::~Element_BGLA() {} \ No newline at end of file
+Element_BGLA::~Element_BGLA() {}
diff --git a/src/simulation/elements/BHOL.cpp b/src/simulation/elements/BHOL.cpp
index 8139e7d..7fc73ec 100644
--- a/src/simulation/elements/BHOL.cpp
+++ b/src/simulation/elements/BHOL.cpp
@@ -46,4 +46,4 @@ Element_BHOL::Element_BHOL()
}
-Element_BHOL::~Element_BHOL() {} \ No newline at end of file
+Element_BHOL::~Element_BHOL() {}
diff --git a/src/simulation/elements/BIZR.cpp b/src/simulation/elements/BIZR.cpp
index 8b61543..0352c26 100644
--- a/src/simulation/elements/BIZR.cpp
+++ b/src/simulation/elements/BIZR.cpp
@@ -117,6 +117,7 @@ int Element_BIZR::graphics(GRAPHICS_FUNC_ARGS)
*firer = *colr/5 * fabs(cpart->vx)+fabs(cpart->vy);
*pixel_mode |= FIRE_ADD;
}
+ *pixel_mode |= PMODE_BLUR;
return 0;
}
diff --git a/src/simulation/elements/BMTL.cpp b/src/simulation/elements/BMTL.cpp
index 65a76b7..1d91e82 100644
--- a/src/simulation/elements/BMTL.cpp
+++ b/src/simulation/elements/BMTL.cpp
@@ -28,7 +28,7 @@ Element_BMTL::Element_BMTL()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251;
- Description = "Breakable metal.";
+ Description = "Breakable metal. Common conductive building material, can melt and break under pressure.";
State = ST_SOLID;
Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
diff --git a/src/simulation/elements/BRAY.cpp b/src/simulation/elements/BRAY.cpp
index 5030020..285c065 100644
--- a/src/simulation/elements/BRAY.cpp
+++ b/src/simulation/elements/BRAY.cpp
@@ -106,4 +106,4 @@ int Element_BRAY::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_BRAY::~Element_BRAY() {} \ No newline at end of file
+Element_BRAY::~Element_BRAY() {}
diff --git a/src/simulation/elements/BRCK.cpp b/src/simulation/elements/BRCK.cpp
index da96b87..a375207 100644
--- a/src/simulation/elements/BRCK.cpp
+++ b/src/simulation/elements/BRCK.cpp
@@ -62,4 +62,4 @@ int Element_BRCK::graphics(GRAPHICS_FUNC_ARGS)
return 0;
}
-Element_BRCK::~Element_BRCK() {} \ No newline at end of file
+Element_BRCK::~Element_BRCK() {}
diff --git a/src/simulation/elements/BREC.cpp b/src/simulation/elements/BREC.cpp
index 1c09c64..b7a5857 100644
--- a/src/simulation/elements/BREC.cpp
+++ b/src/simulation/elements/BREC.cpp
@@ -28,7 +28,7 @@ Element_BREC::Element_BREC()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 211;
- Description = "Broken electronics";
+ Description = "Broken electronics. Formed from EMP blasts, and when constantly sparked while under pressure, turns to EXOT.";
State = ST_SOLID;
Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
diff --git a/src/simulation/elements/BRMT.cpp b/src/simulation/elements/BRMT.cpp
index cf4f99d..4bc5910 100644
--- a/src/simulation/elements/BRMT.cpp
+++ b/src/simulation/elements/BRMT.cpp
@@ -28,7 +28,7 @@ Element_BRMT::Element_BRMT()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 211;
- Description = "Broken metal.";
+ Description = "Broken metal. Created when iron rusts or when when metals break from pressure.";
State = ST_SOLID;
Properties = TYPE_PART|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
@@ -40,7 +40,7 @@ Element_BRMT::Element_BRMT()
LowTemperature = ITL;
LowTemperatureTransition = NT;
HighTemperature = 1273.0f;
- HighTemperatureTransition = PT_LAVA;
+ HighTemperatureTransition = ST;
Update = &Element_BRMT::update;
diff --git a/src/simulation/elements/BVBR.cpp b/src/simulation/elements/BVBR.cpp
index 1a2cc41..4e86782 100644
--- a/src/simulation/elements/BVBR.cpp
+++ b/src/simulation/elements/BVBR.cpp
@@ -47,4 +47,4 @@ Element_BVBR::Element_BVBR()
}
-Element_BVBR::~Element_BVBR() {} \ No newline at end of file
+Element_BVBR::~Element_BVBR() {}
diff --git a/src/simulation/elements/CAUS.cpp b/src/simulation/elements/CAUS.cpp
index 0118fad..520784e 100644
--- a/src/simulation/elements/CAUS.cpp
+++ b/src/simulation/elements/CAUS.cpp
@@ -83,4 +83,4 @@ int Element_CAUS::update(UPDATE_FUNC_ARGS)
}
-Element_CAUS::~Element_CAUS() {} \ No newline at end of file
+Element_CAUS::~Element_CAUS() {}
diff --git a/src/simulation/elements/CFLM.cpp b/src/simulation/elements/CFLM.cpp
index d19f9f0..53cb0a7 100644
--- a/src/simulation/elements/CFLM.cpp
+++ b/src/simulation/elements/CFLM.cpp
@@ -72,4 +72,4 @@ int Element_CFLM::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_CFLM::~Element_CFLM() {} \ No newline at end of file
+Element_CFLM::~Element_CFLM() {}
diff --git a/src/simulation/elements/CNCT.cpp b/src/simulation/elements/CNCT.cpp
index 4fa0808..5734791 100644
--- a/src/simulation/elements/CNCT.cpp
+++ b/src/simulation/elements/CNCT.cpp
@@ -46,4 +46,4 @@ Element_CNCT::Element_CNCT()
}
-Element_CNCT::~Element_CNCT() {} \ No newline at end of file
+Element_CNCT::~Element_CNCT() {}
diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp
index 20e3f92..2933dcf 100644
--- a/src/simulation/elements/CRAY.cpp
+++ b/src/simulation/elements/CRAY.cpp
@@ -28,7 +28,7 @@ Element_CRAY::Element_CRAY()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0;
- Description = "Particle Ray Emitter. Creates a beam of particles set by its ctype, range is set by tmp.";
+ Description = "Particle Ray Emitter. Creates a beam of particles set by its ctype, with a range set by tmp.";
State = ST_SOLID;
Properties = TYPE_SOLID|PROP_LIFE_DEC;
diff --git a/src/simulation/elements/DESL.cpp b/src/simulation/elements/DESL.cpp
index dc34dc8..53267f5 100644
--- a/src/simulation/elements/DESL.cpp
+++ b/src/simulation/elements/DESL.cpp
@@ -46,4 +46,4 @@ Element_DESL::Element_DESL()
}
-Element_DESL::~Element_DESL() {} \ No newline at end of file
+Element_DESL::~Element_DESL() {}
diff --git a/src/simulation/elements/DMG.cpp b/src/simulation/elements/DMG.cpp
index 4f1daaf..e805370 100644
--- a/src/simulation/elements/DMG.cpp
+++ b/src/simulation/elements/DMG.cpp
@@ -28,7 +28,7 @@ Element_DMG::Element_DMG()
Temperature = R_TEMP-2.0f +273.15f;
HeatConduct = 29;
- Description = "Generates damaging pressure and breaks elements it hits.";
+ Description = "Generates damaging pressure and breaks any elements it hits.";
State = ST_NONE;
Properties = TYPE_PART|PROP_LIFE_DEC|PROP_LIFE_KILL_DEC|PROP_SPARKSETTLE;
@@ -92,7 +92,7 @@ int Element_DMG::update(UPDATE_FUNC_ARGS)
sim->part_change_type(rr>>8, x+nxi, y+nxj, PT_BCOL);
else if(t == PT_QRTZ)
sim->part_change_type(rr>>8, x+nxi, y+nxj, PT_PQRT);
- else if(t == PT_TUGN)
+ else if(t == PT_TUNG)
sim->part_change_type(rr>>8, x+nxi, y+nxj, PT_BRMT);
}
}
diff --git a/src/simulation/elements/DMND.cpp b/src/simulation/elements/DMND.cpp
index 71321f6..9b86a84 100644
--- a/src/simulation/elements/DMND.cpp
+++ b/src/simulation/elements/DMND.cpp
@@ -46,4 +46,4 @@ Element_DMND::Element_DMND()
}
-Element_DMND::~Element_DMND() {} \ No newline at end of file
+Element_DMND::~Element_DMND() {}
diff --git a/src/simulation/elements/DRIC.cpp b/src/simulation/elements/DRIC.cpp
index f1e37ec..8809fbb 100644
--- a/src/simulation/elements/DRIC.cpp
+++ b/src/simulation/elements/DRIC.cpp
@@ -46,4 +46,4 @@ Element_DRIC::Element_DRIC()
}
-Element_DRIC::~Element_DRIC() {} \ No newline at end of file
+Element_DRIC::~Element_DRIC() {}
diff --git a/src/simulation/elements/DUST.cpp b/src/simulation/elements/DUST.cpp
index 7b4cf8c..5c80789 100644
--- a/src/simulation/elements/DUST.cpp
+++ b/src/simulation/elements/DUST.cpp
@@ -46,4 +46,4 @@ Element_DUST::Element_DUST()
Graphics = NULL;
}
-Element_DUST::~Element_DUST() {} \ No newline at end of file
+Element_DUST::~Element_DUST() {}
diff --git a/src/simulation/elements/DYST.cpp b/src/simulation/elements/DYST.cpp
index 14cfc27..6a04158 100644
--- a/src/simulation/elements/DYST.cpp
+++ b/src/simulation/elements/DYST.cpp
@@ -46,4 +46,4 @@ Element_DYST::Element_DYST()
}
-Element_DYST::~Element_DYST() {} \ No newline at end of file
+Element_DYST::~Element_DYST() {}
diff --git a/src/simulation/elements/ETRD.cpp b/src/simulation/elements/ETRD.cpp
index 3447f07..72825ab 100644
--- a/src/simulation/elements/ETRD.cpp
+++ b/src/simulation/elements/ETRD.cpp
@@ -46,4 +46,4 @@ Element_ETRD::Element_ETRD()
}
-Element_ETRD::~Element_ETRD() {} \ No newline at end of file
+Element_ETRD::~Element_ETRD() {}
diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp
index 2746695..df075e0 100644
--- a/src/simulation/elements/EXOT.cpp
+++ b/src/simulation/elements/EXOT.cpp
@@ -70,11 +70,22 @@ int Element_EXOT::update(UPDATE_FUNC_ARGS) {
}
else if (rt == PT_LAVA)
{
- if ((parts[r>>8].ctype == PT_TTAN || parts[r>>8].ctype == PT_GOLD) && !(rand()%10))
+ if (parts[r>>8].ctype == PT_TTAN || parts[r>>8].ctype == PT_GOLD)
{
- parts[r>>8].ctype = PT_VIBR;
- sim->kill_part(i);
- return 1;
+ if (!(rand()%10))
+ {
+ parts[r>>8].ctype = PT_VIBR;
+ sim->kill_part(i);
+ return 1;
+ }
+ }
+ else if (parts[r>>8].ctype == PT_VIBR)
+ {
+ if (1>rand()%1000)
+ {
+ sim->kill_part(i);
+ return 1;
+ }
}
}
if ((parts[i].tmp>245) && (parts[i].life>1000))
diff --git a/src/simulation/elements/FRAY.cpp b/src/simulation/elements/FRAY.cpp
index c529b87..8eed23c 100644
--- a/src/simulation/elements/FRAY.cpp
+++ b/src/simulation/elements/FRAY.cpp
@@ -28,7 +28,7 @@ Element_FRAY::Element_FRAY()
Temperature = 20.0f+0.0f +273.15f;
HeatConduct = 0;
- Description = "Force Emitter. Pushes or pulls objects based on its temp value, use like ARAY.";
+ Description = "Force Emitter. Pushes or pulls objects based on its temp value. Use like ARAY.";
State = ST_SOLID;
Properties = TYPE_SOLID|PROP_LIFE_DEC;
diff --git a/src/simulation/elements/FRME.cpp b/src/simulation/elements/FRME.cpp
index c1d3a79..1382265 100644
--- a/src/simulation/elements/FRME.cpp
+++ b/src/simulation/elements/FRME.cpp
@@ -57,4 +57,4 @@ int Element_FRME::graphics(GRAPHICS_FUNC_ARGS)
return 0;
}
-Element_FRME::~Element_FRME() {} \ No newline at end of file
+Element_FRME::~Element_FRME() {}
diff --git a/src/simulation/elements/GEL.cpp b/src/simulation/elements/GEL.cpp
index 8ea7f0f..462fe83 100644
--- a/src/simulation/elements/GEL.cpp
+++ b/src/simulation/elements/GEL.cpp
@@ -158,6 +158,7 @@ int Element_GEL::graphics(GRAPHICS_FUNC_ARGS)
*colr = q*(32-255)/120+255;
*colg = q*(48-186)/120+186;
*colb = q*208/120;
+ *pixel_mode |= PMODE_BLUR;
return 0;
}
diff --git a/src/simulation/elements/GLAS.cpp b/src/simulation/elements/GLAS.cpp
index 347e809..109cad0 100644
--- a/src/simulation/elements/GLAS.cpp
+++ b/src/simulation/elements/GLAS.cpp
@@ -59,4 +59,4 @@ int Element_GLAS::update(UPDATE_FUNC_ARGS)
}
-Element_GLAS::~Element_GLAS() {} \ No newline at end of file
+Element_GLAS::~Element_GLAS() {}
diff --git a/src/simulation/elements/GOO.cpp b/src/simulation/elements/GOO.cpp
index f23360d..6592eed 100644
--- a/src/simulation/elements/GOO.cpp
+++ b/src/simulation/elements/GOO.cpp
@@ -61,4 +61,4 @@ int Element_GOO::update(UPDATE_FUNC_ARGS)
}
-Element_GOO::~Element_GOO() {} \ No newline at end of file
+Element_GOO::~Element_GOO() {}
diff --git a/src/simulation/elements/GUNP.cpp b/src/simulation/elements/GUNP.cpp
index 7dc78db..625feeb 100644
--- a/src/simulation/elements/GUNP.cpp
+++ b/src/simulation/elements/GUNP.cpp
@@ -28,7 +28,7 @@ Element_GUNP::Element_GUNP()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 97;
- Description = "Gunpowder. Light dust, explosive.";
+ Description = "Gunpowder. Light dust, explodes on contact with fire or spark.";
State = ST_SOLID;
Properties = TYPE_PART;
@@ -46,4 +46,4 @@ Element_GUNP::Element_GUNP()
}
-Element_GUNP::~Element_GUNP() {} \ No newline at end of file
+Element_GUNP::~Element_GUNP() {}
diff --git a/src/simulation/elements/H2.cpp b/src/simulation/elements/H2.cpp
index f652d59..b9d8cd9 100644
--- a/src/simulation/elements/H2.cpp
+++ b/src/simulation/elements/H2.cpp
@@ -28,7 +28,7 @@ Element_H2::Element_H2()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251;
- Description = "Hydrogen. Combusts with OXYG to make WATR. Undergoes fusion at high temperature and pressure";
+ Description = "Hydrogen. Combusts with OXYG to make WATR. Undergoes fusion at high temperature and pressure.";
State = ST_GAS;
Properties = TYPE_GAS;
diff --git a/src/simulation/elements/INSL.cpp b/src/simulation/elements/INSL.cpp
index 4be5020..7fe5dff 100644
--- a/src/simulation/elements/INSL.cpp
+++ b/src/simulation/elements/INSL.cpp
@@ -46,4 +46,4 @@ Element_INSL::Element_INSL()
}
-Element_INSL::~Element_INSL() {} \ No newline at end of file
+Element_INSL::~Element_INSL() {}
diff --git a/src/simulation/elements/INST.cpp b/src/simulation/elements/INST.cpp
index dcf1c11..8340011 100644
--- a/src/simulation/elements/INST.cpp
+++ b/src/simulation/elements/INST.cpp
@@ -46,4 +46,4 @@ Element_INST::Element_INST()
}
-Element_INST::~Element_INST() {} \ No newline at end of file
+Element_INST::~Element_INST() {}
diff --git a/src/simulation/elements/INVIS.cpp b/src/simulation/elements/INVIS.cpp
index 5e7f87d..e73c9bf 100644
--- a/src/simulation/elements/INVIS.cpp
+++ b/src/simulation/elements/INVIS.cpp
@@ -6,7 +6,7 @@ Element_INVIS::Element_INVIS()
Name = "INVS";
Colour = PIXPACK(0x00CCCC);
MenuVisible = 1;
- MenuSection = SC_SOLIDS;
+ MenuSection = SC_SENSOR;
Enabled = 1;
Advection = 0.0f;
diff --git a/src/simulation/elements/INWR.cpp b/src/simulation/elements/INWR.cpp
index 3e438be..0356304 100644
--- a/src/simulation/elements/INWR.cpp
+++ b/src/simulation/elements/INWR.cpp
@@ -46,4 +46,4 @@ Element_INWR::Element_INWR()
}
-Element_INWR::~Element_INWR() {} \ No newline at end of file
+Element_INWR::~Element_INWR() {}
diff --git a/src/simulation/elements/ISOZ.cpp b/src/simulation/elements/ISOZ.cpp
index d3d6e6e..9f01495 100644
--- a/src/simulation/elements/ISOZ.cpp
+++ b/src/simulation/elements/ISOZ.cpp
@@ -28,7 +28,7 @@ Element_ISOZ::Element_ISOZ()
Temperature = R_TEMP-2.0f +273.15f;
HeatConduct = 29;
- Description = "Radioactive liquid. Decays into photons when touching PHOT or under negative pressure.";
+ Description = "Isotope-Z. Radioactive liquid, decays into photons when touching PHOT or under negative pressure.";
State = ST_LIQUID;
Properties = TYPE_LIQUID|PROP_NEUTPENETRATE;
diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp
index 9c5bdf8..d442310 100644
--- a/src/simulation/elements/LIFE.cpp
+++ b/src/simulation/elements/LIFE.cpp
@@ -128,4 +128,4 @@ int Element_LIFE::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_LIFE::~Element_LIFE() {} \ No newline at end of file
+Element_LIFE::~Element_LIFE() {}
diff --git a/src/simulation/elements/LNTG.cpp b/src/simulation/elements/LNTG.cpp
index da3199f..8b6e29a 100644
--- a/src/simulation/elements/LNTG.cpp
+++ b/src/simulation/elements/LNTG.cpp
@@ -46,4 +46,4 @@ Element_LNTG::Element_LNTG()
}
-Element_LNTG::~Element_LNTG() {} \ No newline at end of file
+Element_LNTG::~Element_LNTG() {}
diff --git a/src/simulation/elements/LO2.cpp b/src/simulation/elements/LO2.cpp
index 41a5053..abf08a4 100644
--- a/src/simulation/elements/LO2.cpp
+++ b/src/simulation/elements/LO2.cpp
@@ -46,4 +46,4 @@ Element_LO2::Element_LO2()
}
-Element_LO2::~Element_LO2() {} \ No newline at end of file
+Element_LO2::~Element_LO2() {}
diff --git a/src/simulation/elements/LOLZ.cpp b/src/simulation/elements/LOLZ.cpp
index 301e99a..9017211 100644
--- a/src/simulation/elements/LOLZ.cpp
+++ b/src/simulation/elements/LOLZ.cpp
@@ -61,4 +61,4 @@ int Element_LOLZ::RuleTable[9][9] =
//#TPT-Directive ElementHeader Element_LOLZ static int lolz[XRES/9][YRES/9];
int Element_LOLZ::lolz[XRES/9][YRES/9];
-Element_LOLZ::~Element_LOLZ() {} \ No newline at end of file
+Element_LOLZ::~Element_LOLZ() {}
diff --git a/src/simulation/elements/LOVE.cpp b/src/simulation/elements/LOVE.cpp
index f3b476a..f346635 100644
--- a/src/simulation/elements/LOVE.cpp
+++ b/src/simulation/elements/LOVE.cpp
@@ -61,4 +61,4 @@ int Element_LOVE::RuleTable[9][9] =
//#TPT-Directive ElementHeader Element_LOVE static int love[XRES/9][YRES/9];
int Element_LOVE::love[XRES/9][YRES/9];
-Element_LOVE::~Element_LOVE() {} \ No newline at end of file
+Element_LOVE::~Element_LOVE() {}
diff --git a/src/simulation/elements/LRBD.cpp b/src/simulation/elements/LRBD.cpp
index faf57cd..1b40fd3 100644
--- a/src/simulation/elements/LRBD.cpp
+++ b/src/simulation/elements/LRBD.cpp
@@ -46,4 +46,4 @@ Element_LRBD::Element_LRBD()
}
-Element_LRBD::~Element_LRBD() {} \ No newline at end of file
+Element_LRBD::~Element_LRBD() {}
diff --git a/src/simulation/elements/METL.cpp b/src/simulation/elements/METL.cpp
index a194793..d504e57 100644
--- a/src/simulation/elements/METL.cpp
+++ b/src/simulation/elements/METL.cpp
@@ -46,4 +46,4 @@ Element_METL::Element_METL()
}
-Element_METL::~Element_METL() {} \ No newline at end of file
+Element_METL::~Element_METL() {}
diff --git a/src/simulation/elements/MORT.cpp b/src/simulation/elements/MORT.cpp
index 768fddc..e5ef6ea 100644
--- a/src/simulation/elements/MORT.cpp
+++ b/src/simulation/elements/MORT.cpp
@@ -54,4 +54,4 @@ int Element_MORT::update(UPDATE_FUNC_ARGS)
}
-Element_MORT::~Element_MORT() {} \ No newline at end of file
+Element_MORT::~Element_MORT() {}
diff --git a/src/simulation/elements/MWAX.cpp b/src/simulation/elements/MWAX.cpp
index cb0cfbd..0a75013 100644
--- a/src/simulation/elements/MWAX.cpp
+++ b/src/simulation/elements/MWAX.cpp
@@ -46,4 +46,4 @@ Element_MWAX::Element_MWAX()
}
-Element_MWAX::~Element_MWAX() {} \ No newline at end of file
+Element_MWAX::~Element_MWAX() {}
diff --git a/src/simulation/elements/NICE.cpp b/src/simulation/elements/NICE.cpp
index 0c121c6..bd87de9 100644
--- a/src/simulation/elements/NICE.cpp
+++ b/src/simulation/elements/NICE.cpp
@@ -28,7 +28,7 @@ Element_NICE::Element_NICE()
Temperature = 35.0f;
HeatConduct = 46;
- Description = "Nitrogen Ice.";
+ Description = "Nitrogen Ice. Very cold, will melt into LN2 when heated only slightly.";
State = ST_SOLID;
Properties = TYPE_SOLID;
@@ -46,4 +46,4 @@ Element_NICE::Element_NICE()
}
-Element_NICE::~Element_NICE() {} \ No newline at end of file
+Element_NICE::~Element_NICE() {}
diff --git a/src/simulation/elements/NITR.cpp b/src/simulation/elements/NITR.cpp
index d4bce87..c61d2d1 100644
--- a/src/simulation/elements/NITR.cpp
+++ b/src/simulation/elements/NITR.cpp
@@ -46,4 +46,4 @@ Element_NITR::Element_NITR()
}
-Element_NITR::~Element_NITR() {} \ No newline at end of file
+Element_NITR::~Element_NITR() {}
diff --git a/src/simulation/elements/NONE.cpp b/src/simulation/elements/NONE.cpp
index 5dd02af..b2bcd12 100644
--- a/src/simulation/elements/NONE.cpp
+++ b/src/simulation/elements/NONE.cpp
@@ -63,4 +63,4 @@ VideoBuffer * Element_NONE::iconGen(int wallID, int width, int height)
}
-Element_NONE::~Element_NONE() {} \ No newline at end of file
+Element_NONE::~Element_NONE() {}
diff --git a/src/simulation/elements/NSCN.cpp b/src/simulation/elements/NSCN.cpp
index 1e71f10..36d0a06 100644
--- a/src/simulation/elements/NSCN.cpp
+++ b/src/simulation/elements/NSCN.cpp
@@ -46,4 +46,4 @@ Element_NSCN::Element_NSCN()
}
-Element_NSCN::~Element_NSCN() {} \ No newline at end of file
+Element_NSCN::~Element_NSCN() {}
diff --git a/src/simulation/elements/NTCT.cpp b/src/simulation/elements/NTCT.cpp
index 24a190b..7aa2969 100644
--- a/src/simulation/elements/NTCT.cpp
+++ b/src/simulation/elements/NTCT.cpp
@@ -55,4 +55,4 @@ int Element_NTCT::update(UPDATE_FUNC_ARGS)
}
-Element_NTCT::~Element_NTCT() {} \ No newline at end of file
+Element_NTCT::~Element_NTCT() {}
diff --git a/src/simulation/elements/NWHL.cpp b/src/simulation/elements/NWHL.cpp
index b1c10e5..ed39c56 100644
--- a/src/simulation/elements/NWHL.cpp
+++ b/src/simulation/elements/NWHL.cpp
@@ -54,4 +54,4 @@ int Element_NWHL::update(UPDATE_FUNC_ARGS)
}
-Element_NWHL::~Element_NWHL() {} \ No newline at end of file
+Element_NWHL::~Element_NWHL() {}
diff --git a/src/simulation/elements/PLEX.cpp b/src/simulation/elements/PLEX.cpp
index a4bd63e..2b8c867 100644
--- a/src/simulation/elements/PLEX.cpp
+++ b/src/simulation/elements/PLEX.cpp
@@ -46,4 +46,4 @@ Element_PLEX::Element_PLEX()
}
-Element_PLEX::~Element_PLEX() {} \ No newline at end of file
+Element_PLEX::~Element_PLEX() {}
diff --git a/src/simulation/elements/PLSM.cpp b/src/simulation/elements/PLSM.cpp
index 6d39a6b..a9e5728 100644
--- a/src/simulation/elements/PLSM.cpp
+++ b/src/simulation/elements/PLSM.cpp
@@ -67,4 +67,4 @@ int Element_PLSM::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_PLSM::~Element_PLSM() {} \ No newline at end of file
+Element_PLSM::~Element_PLSM() {}
diff --git a/src/simulation/elements/PQRT.cpp b/src/simulation/elements/PQRT.cpp
index e70377c..665f5a4 100644
--- a/src/simulation/elements/PQRT.cpp
+++ b/src/simulation/elements/PQRT.cpp
@@ -28,7 +28,7 @@ Element_PQRT::Element_PQRT()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 3;
- Description = "Broken quartz.";
+ Description = "Powdered quartz, broken form of QRTZ.";
State = ST_SOLID;
Properties = TYPE_PART| PROP_HOT_GLOW;
diff --git a/src/simulation/elements/PRTI.cpp b/src/simulation/elements/PRTI.cpp
index ce91087..2d629a6 100644
--- a/src/simulation/elements/PRTI.cpp
+++ b/src/simulation/elements/PRTI.cpp
@@ -28,7 +28,7 @@ Element_PRTI::Element_PRTI()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0;
- Description = "Portal IN. Things go in here, now with temperature dependent channels (same as WIFI)";
+ Description = "Portal IN. Particles go in here. Also has temperature dependent channels (same as WIFI)";
State = ST_SOLID;
Properties = TYPE_SOLID;
diff --git a/src/simulation/elements/PRTO.cpp b/src/simulation/elements/PRTO.cpp
index af3e7f8..218ce78 100644
--- a/src/simulation/elements/PRTO.cpp
+++ b/src/simulation/elements/PRTO.cpp
@@ -28,7 +28,7 @@ Element_PRTO::Element_PRTO()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0;
- Description = "Portal OUT. Things come out here, now with temperature dependent channels (same as WIFI)";
+ Description = "Portal OUT. Particles come out here. Also has temperature dependent channels (same as WIFI)";
State = ST_SOLID;
Properties = TYPE_SOLID;
diff --git a/src/simulation/elements/PSCN.cpp b/src/simulation/elements/PSCN.cpp
index 5456eaf..8e0a3d4 100644
--- a/src/simulation/elements/PSCN.cpp
+++ b/src/simulation/elements/PSCN.cpp
@@ -46,4 +46,4 @@ Element_PSCN::Element_PSCN()
}
-Element_PSCN::~Element_PSCN() {} \ No newline at end of file
+Element_PSCN::~Element_PSCN() {}
diff --git a/src/simulation/elements/PSNS.cpp b/src/simulation/elements/PSNS.cpp
index 033150d..1ab8de3 100644
--- a/src/simulation/elements/PSNS.cpp
+++ b/src/simulation/elements/PSNS.cpp
@@ -28,7 +28,7 @@ Element_PSNS::Element_PSNS()
Temperature = 277.15f;
HeatConduct = 0;
- Description = "Pressure sensor, creates spark when the pressure is greater than its temperature.";
+ Description = "Pressure sensor, creates a spark when the pressure is greater than its temperature.";
State = ST_SOLID;
Properties = TYPE_SOLID;
diff --git a/src/simulation/elements/PSTE.cpp b/src/simulation/elements/PSTE.cpp
index add4370..0857bff 100644
--- a/src/simulation/elements/PSTE.cpp
+++ b/src/simulation/elements/PSTE.cpp
@@ -46,4 +46,4 @@ Element_PSTE::Element_PSTE()
}
-Element_PSTE::~Element_PSTE() {} \ No newline at end of file
+Element_PSTE::~Element_PSTE() {}
diff --git a/src/simulation/elements/PSTS.cpp b/src/simulation/elements/PSTS.cpp
index 06a8c1e..e309ed1 100644
--- a/src/simulation/elements/PSTS.cpp
+++ b/src/simulation/elements/PSTS.cpp
@@ -46,4 +46,4 @@ Element_PSTS::Element_PSTS()
}
-Element_PSTS::~Element_PSTS() {} \ No newline at end of file
+Element_PSTS::~Element_PSTS() {}
diff --git a/src/simulation/elements/PTCT.cpp b/src/simulation/elements/PTCT.cpp
index be3c231..e78c453 100644
--- a/src/simulation/elements/PTCT.cpp
+++ b/src/simulation/elements/PTCT.cpp
@@ -55,4 +55,4 @@ int Element_PTCT::update(UPDATE_FUNC_ARGS)
}
-Element_PTCT::~Element_PTCT() {} \ No newline at end of file
+Element_PTCT::~Element_PTCT() {}
diff --git a/src/simulation/elements/RBDM.cpp b/src/simulation/elements/RBDM.cpp
index 9e08bc3..b1aed85 100644
--- a/src/simulation/elements/RBDM.cpp
+++ b/src/simulation/elements/RBDM.cpp
@@ -46,4 +46,4 @@ Element_RBDM::Element_RBDM()
}
-Element_RBDM::~Element_RBDM() {} \ No newline at end of file
+Element_RBDM::~Element_RBDM() {}
diff --git a/src/simulation/elements/REPL.cpp b/src/simulation/elements/REPL.cpp
index d0e2aaf..e0823ec 100644
--- a/src/simulation/elements/REPL.cpp
+++ b/src/simulation/elements/REPL.cpp
@@ -28,7 +28,7 @@ Element_REPL::Element_REPL()
Temperature = 20.0f+0.0f +273.15f;
HeatConduct = 0;
- Description = "Repels or attracts particles based on its temp value.";
+ Description = "Repels or attracts particles based on its temperature.";
State = ST_NONE;
Properties = TYPE_SOLID;
diff --git a/src/simulation/elements/SALT.cpp b/src/simulation/elements/SALT.cpp
index 4e21f1b..6772c2b 100644
--- a/src/simulation/elements/SALT.cpp
+++ b/src/simulation/elements/SALT.cpp
@@ -46,4 +46,4 @@ Element_SALT::Element_SALT()
}
-Element_SALT::~Element_SALT() {} \ No newline at end of file
+Element_SALT::~Element_SALT() {}
diff --git a/src/simulation/elements/SAND.cpp b/src/simulation/elements/SAND.cpp
index dade4f1..3a99e0e 100644
--- a/src/simulation/elements/SAND.cpp
+++ b/src/simulation/elements/SAND.cpp
@@ -46,4 +46,4 @@ Element_SAND::Element_SAND()
}
-Element_SAND::~Element_SAND() {} \ No newline at end of file
+Element_SAND::~Element_SAND() {}
diff --git a/src/simulation/elements/SMKE.cpp b/src/simulation/elements/SMKE.cpp
index b4572d0..4a993a3 100644
--- a/src/simulation/elements/SMKE.cpp
+++ b/src/simulation/elements/SMKE.cpp
@@ -65,4 +65,4 @@ int Element_SMKE::graphics(GRAPHICS_FUNC_ARGS)
return 1;
}
-Element_SMKE::~Element_SMKE() {} \ No newline at end of file
+Element_SMKE::~Element_SMKE() {}
diff --git a/src/simulation/elements/SOAP.cpp b/src/simulation/elements/SOAP.cpp
index 472dbd7..79434e9 100644
--- a/src/simulation/elements/SOAP.cpp
+++ b/src/simulation/elements/SOAP.cpp
@@ -246,7 +246,7 @@ int Element_SOAP::update(UPDATE_FUNC_ARGS)
int Element_SOAP::graphics(GRAPHICS_FUNC_ARGS)
{
- *pixel_mode |= EFFECT_LINES;
+ *pixel_mode |= EFFECT_LINES|PMODE_BLUR;
return 1;
}
diff --git a/src/simulation/elements/SPAWN.cpp b/src/simulation/elements/SPAWN.cpp
index 517c712..db12b2f 100644
--- a/src/simulation/elements/SPAWN.cpp
+++ b/src/simulation/elements/SPAWN.cpp
@@ -57,4 +57,4 @@ int Element_SPAWN::update(UPDATE_FUNC_ARGS)
-Element_SPAWN::~Element_SPAWN() {} \ No newline at end of file
+Element_SPAWN::~Element_SPAWN() {}
diff --git a/src/simulation/elements/SPAWN2.cpp b/src/simulation/elements/SPAWN2.cpp
index 4ce0ceb..96a50da 100644
--- a/src/simulation/elements/SPAWN2.cpp
+++ b/src/simulation/elements/SPAWN2.cpp
@@ -57,4 +57,4 @@ int Element_SPAWN2::update(UPDATE_FUNC_ARGS)
-Element_SPAWN2::~Element_SPAWN2() {} \ No newline at end of file
+Element_SPAWN2::~Element_SPAWN2() {}
diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp
index 15fd0e4..e289798 100644
--- a/src/simulation/elements/SPRK.cpp
+++ b/src/simulation/elements/SPRK.cpp
@@ -85,7 +85,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
nearp = sim->nearest_part(i, PT_ETRD, -1);
if (nearp!=-1 && sim->parts_avg(i, nearp, PT_INSL)!=PT_INSL)
{
- sim->CreateLine(x, y, (int)(parts[nearp].x+0.5f), (int)(parts[nearp].y+0.5f), 0, 0, PT_PLSM, 0);
+ sim->CreateLine(x, y, (int)(parts[nearp].x+0.5f), (int)(parts[nearp].y+0.5f), PT_PLSM);
sim->part_change_type(i,x,y,ct);
ct = parts[i].ctype = PT_NONE;
parts[i].life = 20;
@@ -158,7 +158,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
}
}
break;
- case PT_TUGN:
+ case PT_TUNG:
if(parts[i].temp < 3595.0){
parts[i].temp += (rand()%20)-4;
}
diff --git a/src/simulation/elements/STKM.cpp b/src/simulation/elements/STKM.cpp
index 55fac92..7767266 100644
--- a/src/simulation/elements/STKM.cpp
+++ b/src/simulation/elements/STKM.cpp
@@ -90,7 +90,7 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
parts[i].temp += 1;
//Death
- if (parts[i].life<1 || (sim->pv[y/CELL][x/CELL]>=4.5f && playerp->elem != SPC_AIR) ) //If his HP is less that 0 or there is very big wind...
+ if (parts[i].life<1 || (sim->pv[y/CELL][x/CELL]>=4.5f && playerp->elem != SPC_AIR) ) //If his HP is less than 0 or there is very big wind...
{
for (r=-2; r<=1; r++)
{
@@ -130,13 +130,13 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
float rbx = gvx;
float rby = gvy;
bool rbLowGrav = false;
- float tmp = fmaxf(fabsf(rbx), fabsf(rby));
+ float tmp = fabsf(rbx) > fabsf(rby)?fabsf(rbx):fabsf(rby);
if (tmp < 0.001f)
{
rbLowGrav = true;
rbx = -parts[i].vx;
rby = -parts[i].vy;
- tmp = fmaxf(fabsf(rbx), fabsf(rby));
+ tmp = fabsf(rbx) > fabsf(rby)?fabsf(rbx):fabsf(rby);
}
if (tmp < 0.001f)
{
@@ -421,7 +421,11 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
{
int np = -1;
if (playerp->elem == SPC_AIR)
- sim->CreateParts(rx + 3*((((int)playerp->pcomm)&0x02) == 0x02) - 3*((((int)playerp->pcomm)&0x01) == 0x01), ry, 4, 4, SPC_AIR, 0);
+ {
+ for(int j = -4; j < 5; j++)
+ for (int k = -4; k < 5; k++)
+ sim->create_part(-2, rx + 3*((((int)playerp->pcomm)&0x02) == 0x02) - 3*((((int)playerp->pcomm)&0x01) == 0x01)+j, ry+k, SPC_AIR);
+ }
else if (playerp->elem==PT_LIGH && playerp->frames<30)//limit lightning creation rate
np = -1;
else
diff --git a/src/simulation/elements/STKM2.cpp b/src/simulation/elements/STKM2.cpp
index 943cac9..ee94adb 100644
--- a/src/simulation/elements/STKM2.cpp
+++ b/src/simulation/elements/STKM2.cpp
@@ -53,4 +53,4 @@ int Element_STKM2::update(UPDATE_FUNC_ARGS)
return 0;
}
-Element_STKM2::~Element_STKM2() {} \ No newline at end of file
+Element_STKM2::~Element_STKM2() {}
diff --git a/src/simulation/elements/STNE.cpp b/src/simulation/elements/STNE.cpp
index c2197c5..c0354db 100644
--- a/src/simulation/elements/STNE.cpp
+++ b/src/simulation/elements/STNE.cpp
@@ -46,4 +46,4 @@ Element_STNE::Element_STNE()
}
-Element_STNE::~Element_STNE() {} \ No newline at end of file
+Element_STNE::~Element_STNE() {}
diff --git a/src/simulation/elements/STOR.cpp b/src/simulation/elements/STOR.cpp
index 92dd80f..a09096f 100644
--- a/src/simulation/elements/STOR.cpp
+++ b/src/simulation/elements/STOR.cpp
@@ -28,7 +28,7 @@ Element_STOR::Element_STOR()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 0;
- Description = "Stores a single particle, releases when charged with PSCN, also passes to PIPE.";
+ Description = "Captures and stores a single particle. releases when charged with PSCN, also passes to PIPE.";
State = ST_NONE;
Properties = TYPE_SOLID;
diff --git a/src/simulation/elements/SWCH.cpp b/src/simulation/elements/SWCH.cpp
index 824929d..893ce9e 100644
--- a/src/simulation/elements/SWCH.cpp
+++ b/src/simulation/elements/SWCH.cpp
@@ -110,4 +110,4 @@ int Element_SWCH::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_SWCH::~Element_SWCH() {} \ No newline at end of file
+Element_SWCH::~Element_SWCH() {}
diff --git a/src/simulation/elements/TESC.cpp b/src/simulation/elements/TESC.cpp
index 0ad7e00..00ae151 100644
--- a/src/simulation/elements/TESC.cpp
+++ b/src/simulation/elements/TESC.cpp
@@ -28,7 +28,7 @@ Element_TESC::Element_TESC()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251;
- Description = "Tesla coil!";
+ Description = "Tesla coil! Creates lightning when sparked.";
State = ST_SOLID;
Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_HOT_GLOW;
@@ -46,4 +46,4 @@ Element_TESC::Element_TESC()
}
-Element_TESC::~Element_TESC() {} \ No newline at end of file
+Element_TESC::~Element_TESC() {}
diff --git a/src/simulation/elements/THDR.cpp b/src/simulation/elements/THDR.cpp
index 3c9f0c9..507db2d 100644
--- a/src/simulation/elements/THDR.cpp
+++ b/src/simulation/elements/THDR.cpp
@@ -28,7 +28,7 @@ Element_THDR::Element_THDR()
Temperature = 9000.0f +273.15f;
HeatConduct = 1;
- Description = "Lightning! Very hot, inflicts damage upon most materials, transfers current to metals.";
+ Description = "Lightning! Very hot, inflicts damage upon most materials, and transfers current to metals.";
State = ST_NONE;
Properties = TYPE_PART;
diff --git a/src/simulation/elements/TRON.cpp b/src/simulation/elements/TRON.cpp
index 8ad0b4d..62378c6 100644
--- a/src/simulation/elements/TRON.cpp
+++ b/src/simulation/elements/TRON.cpp
@@ -28,7 +28,7 @@ Element_TRON::Element_TRON()
Temperature = 0.0f;
HeatConduct = 40;
- Description = "Smart particles, Travels in straight lines and avoids obstacles. Grows with time.";
+ Description = "Smart particles, Travels in straight lines and avoids obstacles. Grows with time.";
State = ST_NONE;
Properties = TYPE_SOLID|PROP_LIFE_DEC|PROP_LIFE_KILL;
diff --git a/src/simulation/elements/TTAN.cpp b/src/simulation/elements/TTAN.cpp
index 919c2b1..3f997f7 100644
--- a/src/simulation/elements/TTAN.cpp
+++ b/src/simulation/elements/TTAN.cpp
@@ -29,7 +29,7 @@ Element_TTAN::Element_TTAN()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251;
- Description = "Titanium, Higher melting temperature than other metals, blocks all air pressure";
+ Description = "Titanium. Higher melting temperature than most other metals, blocks all air pressure.";
State = ST_SOLID;
Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC;
diff --git a/src/simulation/elements/TUGN.cpp b/src/simulation/elements/TUNG.cpp
index 4fb8032..1666346 100644
--- a/src/simulation/elements/TUGN.cpp
+++ b/src/simulation/elements/TUNG.cpp
@@ -1,10 +1,10 @@
#include "simulation/Elements.h"
#include "simulation/Air.h"
-//#TPT-Directive ElementClass Element_TUGN PT_TUGN 171
-Element_TUGN::Element_TUGN()
+//#TPT-Directive ElementClass Element_TUNG PT_TUNG 171
+Element_TUNG::Element_TUNG()
{
- Identifier = "DEFAULT_PT_TUGN";
- Name = "TUGN";
+ Identifier = "DEFAULT_PT_TUNG";
+ Name = "TUNG";
Colour = PIXPACK(0x505050);
MenuVisible = 1;
MenuSection = SC_ELEC;
@@ -29,7 +29,7 @@ Element_TUGN::Element_TUGN()
Temperature = R_TEMP+0.0f +273.15f;
HeatConduct = 251;
- Description = "Brittle metal with a very high melting point.";
+ Description = "Tungsten. Brittle metal with a very high melting point.";
State = ST_SOLID;
Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_LIFE_DEC;
@@ -45,15 +45,15 @@ Element_TUGN::Element_TUGN()
/*HighTemperature = 3895.0f;
HighTemperatureTransition = PT_LAVA;*/
- Update = &Element_TUGN::update;
- Graphics = &Element_TUGN::graphics;
+ Update = &Element_TUNG::update;
+ Graphics = &Element_TUNG::graphics;
}
#define MELTING_POINT 3695.0
-//#TPT-Directive ElementHeader Element_TUGN static int update(UPDATE_FUNC_ARGS)
-int Element_TUGN::update(UPDATE_FUNC_ARGS)
+//#TPT-Directive ElementHeader Element_TUNG static int update(UPDATE_FUNC_ARGS)
+int Element_TUNG::update(UPDATE_FUNC_ARGS)
{
bool splode = false;
if(parts[i].temp > 2400.0)
@@ -85,7 +85,7 @@ int Element_TUGN::update(UPDATE_FUNC_ARGS)
else
{
sim->part_change_type(i, x, y, PT_LAVA);
- parts[i].ctype = PT_TUGN;
+ parts[i].ctype = PT_TUNG;
return 1;
}
if(splode)
@@ -101,13 +101,14 @@ int Element_TUGN::update(UPDATE_FUNC_ARGS)
if (parts[i].pavg[1]-parts[i].pavg[0] > 0.50f || parts[i].pavg[1]-parts[i].pavg[0] < -0.50f)
{
sim->part_change_type(i,x,y,PT_BRMT);
+ parts[i].ctype = PT_TUNG;
}
return 0;
}
-//#TPT-Directive ElementHeader Element_TUGN static int graphics(GRAPHICS_FUNC_ARGS)
-int Element_TUGN::graphics(GRAPHICS_FUNC_ARGS)
+//#TPT-Directive ElementHeader Element_TUNG static int graphics(GRAPHICS_FUNC_ARGS)
+int Element_TUNG::graphics(GRAPHICS_FUNC_ARGS)
{
double startTemp = (MELTING_POINT - 1500.0);
double tempOver = (((cpart->temp - startTemp)/1500.0)*M_PI) - (M_PI/2.0);
@@ -129,4 +130,4 @@ int Element_TUGN::graphics(GRAPHICS_FUNC_ARGS)
return 0;
}
-Element_TUGN::~Element_TUGN() {}
+Element_TUNG::~Element_TUNG() {}
diff --git a/src/simulation/elements/URAN.cpp b/src/simulation/elements/URAN.cpp
index 3ced8fe..61d5add 100644
--- a/src/simulation/elements/URAN.cpp
+++ b/src/simulation/elements/URAN.cpp
@@ -58,4 +58,4 @@ int Element_URAN::update(UPDATE_FUNC_ARGS)
}
-Element_URAN::~Element_URAN() {} \ No newline at end of file
+Element_URAN::~Element_URAN() {}
diff --git a/src/simulation/elements/VOID.cpp b/src/simulation/elements/VOID.cpp
index a21413a..ee95179 100644
--- a/src/simulation/elements/VOID.cpp
+++ b/src/simulation/elements/VOID.cpp
@@ -46,4 +46,4 @@ Element_VOID::Element_VOID()
}
-Element_VOID::~Element_VOID() {} \ No newline at end of file
+Element_VOID::~Element_VOID() {}
diff --git a/src/simulation/elements/WAX.cpp b/src/simulation/elements/WAX.cpp
index 2203b61..1873222 100644
--- a/src/simulation/elements/WAX.cpp
+++ b/src/simulation/elements/WAX.cpp
@@ -46,4 +46,4 @@ Element_WAX::Element_WAX()
}
-Element_WAX::~Element_WAX() {} \ No newline at end of file
+Element_WAX::~Element_WAX() {}
diff --git a/src/simulation/elements/WHOL.cpp b/src/simulation/elements/WHOL.cpp
index aba4e19..41a34bb 100644
--- a/src/simulation/elements/WHOL.cpp
+++ b/src/simulation/elements/WHOL.cpp
@@ -46,4 +46,4 @@ Element_WHOL::Element_WHOL()
}
-Element_WHOL::~Element_WHOL() {} \ No newline at end of file
+Element_WHOL::~Element_WHOL() {}
diff --git a/src/simulation/elements/WIFI.cpp b/src/simulation/elements/WIFI.cpp
index a20e6de..81d4e60 100644
--- a/src/simulation/elements/WIFI.cpp
+++ b/src/simulation/elements/WIFI.cpp
@@ -98,4 +98,4 @@ int Element_WIFI::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_WIFI::~Element_WIFI() {} \ No newline at end of file
+Element_WIFI::~Element_WIFI() {}
diff --git a/src/simulation/elements/WOOD.cpp b/src/simulation/elements/WOOD.cpp
index 589aa2f..4676790 100644
--- a/src/simulation/elements/WOOD.cpp
+++ b/src/simulation/elements/WOOD.cpp
@@ -72,4 +72,4 @@ int Element_WOOD::graphics(GRAPHICS_FUNC_ARGS)
return 0;
}
-Element_WOOD::~Element_WOOD() {} \ No newline at end of file
+Element_WOOD::~Element_WOOD() {}
diff --git a/src/simulation/elements/WTRV.cpp b/src/simulation/elements/WTRV.cpp
index 11ff088..b49ef67 100644
--- a/src/simulation/elements/WTRV.cpp
+++ b/src/simulation/elements/WTRV.cpp
@@ -28,7 +28,7 @@ Element_WTRV::Element_WTRV()
Temperature = R_TEMP+100.0f+273.15f;
HeatConduct = 48;
- Description = "Steam, heats up air, produced from hot water.";
+ Description = "Steam. Produced from hot water.";
State = ST_GAS;
Properties = TYPE_GAS;
diff --git a/src/simulation/tools/AirTool.cpp b/src/simulation/tools/AirTool.cpp
index 9fd7f79..4e7ebde 100644
--- a/src/simulation/tools/AirTool.cpp
+++ b/src/simulation/tools/AirTool.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
#include "simulation/Air.h"
//#TPT-Directive ToolClass Tool_Air TOOL_AIR 3
Tool_Air::Tool_Air()
@@ -19,4 +19,4 @@ int Tool_Air::Perform(Simulation * sim, Particle * cpart, int x, int y, float st
return 1;
}
-Tool_Air::~Tool_Air() {} \ No newline at end of file
+Tool_Air::~Tool_Air() {}
diff --git a/src/simulation/tools/Cool.cpp b/src/simulation/tools/Cool.cpp
index b1b57b1..bc49634 100644
--- a/src/simulation/tools/Cool.cpp
+++ b/src/simulation/tools/Cool.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
//#TPT-Directive ToolClass Tool_Cool TOOL_COOL 1
Tool_Cool::Tool_Cool()
{
@@ -12,7 +12,10 @@ int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
{
if(!cpart)
return 0;
- cpart->temp -= strength;
+ if (cpart->type == PT_PUMP || cpart->type == PT_GPMP)
+ cpart->temp -= .1f*strength;
+ else
+ cpart->temp -= strength;
if(cpart->temp > MAX_TEMP)
cpart->temp = MAX_TEMP;
if(cpart->temp < 0)
@@ -20,4 +23,4 @@ int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
return 1;
}
-Tool_Cool::~Tool_Cool() {} \ No newline at end of file
+Tool_Cool::~Tool_Cool() {}
diff --git a/src/simulation/tools/GravTool.cpp b/src/simulation/tools/GravTool.cpp
deleted file mode 100644
index 630ba12..0000000
--- a/src/simulation/tools/GravTool.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "simulation/Tools.h"
-#include "simulation/Simulation.h"
-//#TPT-Directive ToolClass Tool_Grav TOOL_GRAV 4
-Tool_Grav::Tool_Grav()
-{
- Identifier = "DEFAULT_TOOL_GRAV";
- Name = "GRAV";
- Colour = PIXPACK(0xCCCCFF);
- Description = "Creates a short-lasting gravity well";
-}
-
-int Tool_Grav::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
-{
- sim->gravmap[((y/CELL)*(XRES/CELL))+(x/CELL)] += 0.03f*strength;
- return 1;
-}
-
-Tool_Grav::~Tool_Grav() {} \ No newline at end of file
diff --git a/src/simulation/tools/Heat.cpp b/src/simulation/tools/Heat.cpp
index f28274c..903efe3 100644
--- a/src/simulation/tools/Heat.cpp
+++ b/src/simulation/tools/Heat.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
//#TPT-Directive ToolClass Tool_Heat TOOL_HEAT 0
Tool_Heat::Tool_Heat()
{
@@ -12,7 +12,10 @@ int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
{
if(!cpart)
return 0;
- cpart->temp += strength;
+ if (cpart->type == PT_PUMP || cpart->type == PT_GPMP)
+ cpart->temp += .1f*strength;
+ else
+ cpart->temp += strength;
if(cpart->temp > MAX_TEMP)
cpart->temp = MAX_TEMP;
if(cpart->temp < 0)
@@ -20,4 +23,4 @@ int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
return 1;
}
-Tool_Heat::~Tool_Heat() {} \ No newline at end of file
+Tool_Heat::~Tool_Heat() {}
diff --git a/src/simulation/tools/NGrv.cpp b/src/simulation/tools/NGrv.cpp
index 525d697..65530c5 100644
--- a/src/simulation/tools/NGrv.cpp
+++ b/src/simulation/tools/NGrv.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
#include "simulation/Simulation.h"
//#TPT-Directive ToolClass Tool_NGrv TOOL_NGRV 5
Tool_NGrv::Tool_NGrv()
@@ -15,4 +15,4 @@ int Tool_NGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
return 1;
}
-Tool_NGrv::~Tool_NGrv() {} \ No newline at end of file
+Tool_NGrv::~Tool_NGrv() {}
diff --git a/src/simulation/tools/PGrv.cpp b/src/simulation/tools/PGrv.cpp
new file mode 100644
index 0000000..cfa381c
--- /dev/null
+++ b/src/simulation/tools/PGrv.cpp
@@ -0,0 +1,18 @@
+#include "ToolClasses.h"
+#include "simulation/Simulation.h"
+//#TPT-Directive ToolClass Tool_PGrv TOOL_PGRV 4
+Tool_PGrv::Tool_PGrv()
+{
+ Identifier = "DEFAULT_TOOL_PGRV";
+ Name = "PGRV";
+ Colour = PIXPACK(0xCCCCFF);
+ Description = "Creates a short-lasting gravity well";
+}
+
+int Tool_PGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
+{
+ sim->gravmap[((y/CELL)*(XRES/CELL))+(x/CELL)] += 0.03f*strength;
+ return 1;
+}
+
+Tool_PGrv::~Tool_PGrv() {}
diff --git a/src/simulation/tools/SimTool.cpp b/src/simulation/tools/SimTool.cpp
index d7015fa..0fdec2b 100644
--- a/src/simulation/tools/SimTool.cpp
+++ b/src/simulation/tools/SimTool.cpp
@@ -1,5 +1,5 @@
#include "simulation/Element.h"
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
SimTool::SimTool():
Identifier("DEFAULT_TOOL_INVALID"),
@@ -7,4 +7,4 @@ Name(""),
Colour(PIXPACK(0xFFFFFF)),
Description("NULL Tool, does NOTHING")
{
-} \ No newline at end of file
+}
diff --git a/src/simulation/tools/SimTool.h b/src/simulation/tools/SimTool.h
index c32ba5b..c5a5cb1 100644
--- a/src/simulation/tools/SimTool.h
+++ b/src/simulation/tools/SimTool.h
@@ -20,4 +20,4 @@ public:
virtual int Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) { return 0; }
};
-#endif \ No newline at end of file
+#endif
diff --git a/src/simulation/tools/Vac.cpp b/src/simulation/tools/Vac.cpp
index aa319e2..fbf7e85 100644
--- a/src/simulation/tools/Vac.cpp
+++ b/src/simulation/tools/Vac.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
#include "simulation/Air.h"
//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 2
Tool_Vac::Tool_Vac()
@@ -6,7 +6,7 @@ Tool_Vac::Tool_Vac()
Identifier = "DEFAULT_TOOL_VAC";
Name = "VAC";
Colour = PIXPACK(0x303030);
- Description = "Removes air pressure";
+ Description = "Reduces air pressure";
}
int Tool_Vac::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)