summaryrefslogtreecommitdiff
path: root/src/game/Tool.cpp
diff options
context:
space:
mode:
authorbuild.powdertoy.co.uk <admin@powdertoy.co.uk>2012-07-19 17:08:34 (GMT)
committer build.powdertoy.co.uk <admin@powdertoy.co.uk>2012-07-19 17:08:34 (GMT)
commitd328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01 (patch)
treedb311c7849270ddd2510cbd65a192b059f8a3c77 /src/game/Tool.cpp
parentd71af3706a7a14e8ae65523e1a062417818b8fe2 (diff)
parent4d961117bde4398ae4d72f2db96eef381371e2df (diff)
downloadpowder-d328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01.zip
powder-d328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01.tar.gz
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/game/Tool.cpp')
-rw-r--r--src/game/Tool.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/game/Tool.cpp b/src/game/Tool.cpp
index 2467d3f..efe4831 100644
--- a/src/game/Tool.cpp
+++ b/src/game/Tool.cpp
@@ -12,15 +12,17 @@
using namespace std;
-Tool::Tool(int id, string name, int r, int g, int b):
+Tool::Tool(int id, string name, string description, int r, int g, int b):
toolID(id),
toolName(name),
+ toolDescription(description),
colRed(r),
colGreen(g),
colBlue(b)
{
}
string Tool::GetName() { return toolName; }
+string Tool::GetDescription() { return toolDescription; }
Tool::~Tool() {}
void Tool::Click(Simulation * sim, Brush * brush, ui::Point position) { }
void Tool::Draw(Simulation * sim, Brush * brush, ui::Point position) {
@@ -34,8 +36,8 @@ void Tool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Po
}
void Tool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {};
-ElementTool::ElementTool(int id, string name, int r, int g, int b):
- Tool(id, name, r, g, b)
+ElementTool::ElementTool(int id, string name, string description, int r, int g, int b):
+ Tool(id, name, description, r, g, b)
{
}
ElementTool::~ElementTool() {}
@@ -53,8 +55,8 @@ void ElementTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position)
}
-WallTool::WallTool(int id, string name, int r, int g, int b):
-Tool(id, name, r, g, b)
+WallTool::WallTool(int id, string name, string description, int r, int g, int b):
+Tool(id, name, description, r, g, b)
{
}
WallTool::~WallTool() {}
@@ -72,8 +74,8 @@ void WallTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
}
-GolTool::GolTool(int id, string name, int r, int g, int b):
- Tool(id, name, r, g, b)
+GolTool::GolTool(int id, string name, string description, int r, int g, int b):
+ Tool(id, name, description, r, g, b)
{
}
GolTool::~GolTool() {}
@@ -90,5 +92,14 @@ void GolTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
sim->FloodParts(position.X, position.Y, PT_LIFE|(toolID<<8), -1, -1, 0);
}
-
-
+void Element_LIGH_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position)
+{
+ int p = sim->create_part(-2, position.X, position.Y, toolID);
+ if (p != -1)
+ {
+ sim->parts[p].life = brush->GetRadius().X+brush->GetRadius().Y;
+ if (sim->parts[p].life > 55)
+ sim->parts[p].life = 55;
+ sim->parts[p].temp = sim->parts[p].life*150; // temperature of the lighting shows the power of the lighting
+ }
+} \ No newline at end of file