2013-05-16 19:04:39 -05:00
|
|
|
#include "ToolClasses.h"
|
2012-06-12 09:37:46 -05:00
|
|
|
#include "simulation/Air.h"
|
2013-06-06 22:23:48 -05:00
|
|
|
//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 3
|
2012-06-12 09:37:46 -05:00
|
|
|
Tool_Vac::Tool_Vac()
|
|
|
|
{
|
|
|
|
Identifier = "DEFAULT_TOOL_VAC";
|
|
|
|
Name = "VAC";
|
2012-08-03 12:04:18 -05:00
|
|
|
Colour = PIXPACK(0x303030);
|
2013-06-06 22:23:48 -05:00
|
|
|
Description = "Vacuum, reduces air pressure.";
|
2012-06-12 09:37:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
int Tool_Vac::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
|
|
|
|
{
|
2013-06-06 22:23:48 -05:00
|
|
|
sim->air->pv[y/CELL][x/CELL] -= strength*0.05f;
|
|
|
|
|
|
|
|
if (sim->air->pv[y/CELL][x/CELL] > 256.0f)
|
2012-08-14 10:29:07 -05:00
|
|
|
sim->air->pv[y/CELL][x/CELL] = 256.0f;
|
2013-06-06 22:23:48 -05:00
|
|
|
else if (sim->air->pv[y/CELL][x/CELL] < -256.0f)
|
2012-08-14 10:29:07 -05:00
|
|
|
sim->air->pv[y/CELL][x/CELL] = -256.0f;
|
2012-06-12 09:37:46 -05:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Tool_Vac::~Tool_Vac() {}
|