summaryrefslogtreecommitdiff
path: root/src/simulation/tools/Cool.cpp
blob: bc4963432e6fd78491a5d5594c8000d4b969822a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "ToolClasses.h"
//#TPT-Directive ToolClass Tool_Cool TOOL_COOL 1
Tool_Cool::Tool_Cool()
{
	Identifier = "DEFAULT_TOOL_COOL";
	Name = "COOL";
	Colour = PIXPACK(0x00DDFF);
	Description = "Cools particles";
}

int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
{
	if(!cpart)
		return 0;
	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)
		cpart->temp = 0;
	return 1;
}

Tool_Cool::~Tool_Cool() {}