This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
The-Powder-Toy/src/simulation/tools/Cool.cpp
2013-06-06 23:28:07 -04:00

28 lines
610 B
C++

#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 the targeted element.";
}
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 -= strength*.1f;
else
cpart->temp -= strength*2.0f;
if (cpart->temp > MAX_TEMP)
cpart->temp = MAX_TEMP;
else if (cpart->temp < 0)
cpart->temp = 0;
return 1;
}
Tool_Cool::~Tool_Cool() {}