1 #include "simulation/ToolCommon.h"
2
3 static int perform(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength);
4
Tool_HEAT()5 void SimTool::Tool_HEAT()
6 {
7 Identifier = "DEFAULT_TOOL_HEAT";
8 Name = "HEAT";
9 Colour = PIXPACK(0xFFDD00);
10 Description = "Heats the targeted element.";
11 Perform = &perform;
12 }
13
perform(Simulation * sim,Particle * cpart,int x,int y,int brushX,int brushY,float strength)14 static int perform(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength)
15 {
16 if(!cpart)
17 return 0;
18 if (cpart->type == PT_PUMP || cpart->type == PT_GPMP)
19 cpart->temp += strength*.1f;
20 else
21 cpart->temp += strength*2.0f;
22
23 if (cpart->temp > MAX_TEMP)
24 cpart->temp = MAX_TEMP;
25 else if (cpart->temp < 0)
26 cpart->temp = 0;
27 return 1;
28 }
29