summaryrefslogtreecommitdiff
path: root/src/simulation/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/tools')
-rw-r--r--src/simulation/tools/AirTool.cpp9
-rw-r--r--src/simulation/tools/Cool.cpp7
-rw-r--r--src/simulation/tools/Heat.cpp7
-rw-r--r--src/simulation/tools/NGrv.cpp2
-rw-r--r--src/simulation/tools/PGrv.cpp2
-rw-r--r--src/simulation/tools/Vac.cpp11
6 files changed, 21 insertions, 17 deletions
diff --git a/src/simulation/tools/AirTool.cpp b/src/simulation/tools/AirTool.cpp
index 5d7f405..506252e 100644
--- a/src/simulation/tools/AirTool.cpp
+++ b/src/simulation/tools/AirTool.cpp
@@ -1,20 +1,21 @@
#include "ToolClasses.h"
#include "simulation/Air.h"
-//#TPT-Directive ToolClass Tool_Air TOOL_AIR 3
+//#TPT-Directive ToolClass Tool_Air TOOL_AIR 2
Tool_Air::Tool_Air()
{
Identifier = "DEFAULT_TOOL_AIR";
Name = "AIR";
Colour = PIXPACK(0xFFFFFF);
- Description = "Creates air pressure";
+ Description = "Air, creates airflow and pressure.";
}
int Tool_Air::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
{
sim->air->pv[y/CELL][x/CELL] += strength*0.05f;
- if(sim->air->pv[y/CELL][x/CELL] > 256.0f)
+
+ if (sim->air->pv[y/CELL][x/CELL] > 256.0f)
sim->air->pv[y/CELL][x/CELL] = 256.0f;
- if(sim->air->pv[y/CELL][x/CELL] < -256.0f)
+ else if (sim->air->pv[y/CELL][x/CELL] < -256.0f)
sim->air->pv[y/CELL][x/CELL] = -256.0f;
return 1;
}
diff --git a/src/simulation/tools/Cool.cpp b/src/simulation/tools/Cool.cpp
index 16a7f91..db49e61 100644
--- a/src/simulation/tools/Cool.cpp
+++ b/src/simulation/tools/Cool.cpp
@@ -5,7 +5,7 @@ Tool_Cool::Tool_Cool()
Identifier = "DEFAULT_TOOL_COOL";
Name = "COOL";
Colour = PIXPACK(0x00DDFF);
- Description = "Cools particles";
+ Description = "Cools the targeted element.";
}
int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
@@ -16,9 +16,10 @@ int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
cpart->temp -= strength*.1f;
else
cpart->temp -= strength*2.0f;
- if(cpart->temp > MAX_TEMP)
+
+ if (cpart->temp > MAX_TEMP)
cpart->temp = MAX_TEMP;
- if(cpart->temp < 0)
+ else if (cpart->temp < 0)
cpart->temp = 0;
return 1;
}
diff --git a/src/simulation/tools/Heat.cpp b/src/simulation/tools/Heat.cpp
index 0d77d55..dac3347 100644
--- a/src/simulation/tools/Heat.cpp
+++ b/src/simulation/tools/Heat.cpp
@@ -5,7 +5,7 @@ Tool_Heat::Tool_Heat()
Identifier = "DEFAULT_TOOL_HEAT";
Name = "HEAT";
Colour = PIXPACK(0xFFDD00);
- Description = "Heats particles";
+ Description = "Heats the targeted element.";
}
int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
@@ -16,9 +16,10 @@ int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
cpart->temp += strength*.1f;
else
cpart->temp += strength*2.0f;
- if(cpart->temp > MAX_TEMP)
+
+ if (cpart->temp > MAX_TEMP)
cpart->temp = MAX_TEMP;
- if(cpart->temp < 0)
+ else if (cpart->temp < 0)
cpart->temp = 0;
return 1;
}
diff --git a/src/simulation/tools/NGrv.cpp b/src/simulation/tools/NGrv.cpp
index 89af1ea..c1fa2c1 100644
--- a/src/simulation/tools/NGrv.cpp
+++ b/src/simulation/tools/NGrv.cpp
@@ -6,7 +6,7 @@ Tool_NGrv::Tool_NGrv()
Identifier = "DEFAULT_TOOL_NGRV";
Name = "NGRV";
Colour = PIXPACK(0xAACCFF);
- Description = "Creates a short-lasting negative gravity well";
+ Description = "Creates a short-lasting negative gravity well.";
}
int Tool_NGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
diff --git a/src/simulation/tools/PGrv.cpp b/src/simulation/tools/PGrv.cpp
index e2c9fb0..a763570 100644
--- a/src/simulation/tools/PGrv.cpp
+++ b/src/simulation/tools/PGrv.cpp
@@ -6,7 +6,7 @@ Tool_PGrv::Tool_PGrv()
Identifier = "DEFAULT_TOOL_PGRV";
Name = "PGRV";
Colour = PIXPACK(0xCCCCFF);
- Description = "Creates a short-lasting gravity well";
+ Description = "Creates a short-lasting gravity well.";
}
int Tool_PGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
diff --git a/src/simulation/tools/Vac.cpp b/src/simulation/tools/Vac.cpp
index 86beb54..eded57c 100644
--- a/src/simulation/tools/Vac.cpp
+++ b/src/simulation/tools/Vac.cpp
@@ -1,20 +1,21 @@
#include "ToolClasses.h"
#include "simulation/Air.h"
-//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 2
+//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 3
Tool_Vac::Tool_Vac()
{
Identifier = "DEFAULT_TOOL_VAC";
Name = "VAC";
Colour = PIXPACK(0x303030);
- Description = "Reduces air pressure";
+ Description = "Vacuum, reduces air pressure.";
}
int Tool_Vac::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
{
- sim->air->pv[y/CELL][x/CELL] -= strength*0.05f;;
- if(sim->air->pv[y/CELL][x/CELL] > 256.0f)
+ sim->air->pv[y/CELL][x/CELL] -= strength*0.05f;
+
+ if (sim->air->pv[y/CELL][x/CELL] > 256.0f)
sim->air->pv[y/CELL][x/CELL] = 256.0f;
- if(sim->air->pv[y/CELL][x/CELL] < -256.0f)
+ else if (sim->air->pv[y/CELL][x/CELL] < -256.0f)
sim->air->pv[y/CELL][x/CELL] = -256.0f;
return 1;
}