1 #include "simulation/ElementCommon.h"
2 
3 static int update(UPDATE_FUNC_ARGS);
4 
Element_YEST()5 void Element::Element_YEST()
6 {
7 	Identifier = "DEFAULT_PT_YEST";
8 	Name = "YEST";
9 	Colour = PIXPACK(0xEEE0C0);
10 	MenuVisible = 1;
11 	MenuSection = SC_POWDERS;
12 	Enabled = 1;
13 
14 	Advection = 0.7f;
15 	AirDrag = 0.02f * CFDS;
16 	AirLoss = 0.96f;
17 	Loss = 0.80f;
18 	Collision = 0.0f;
19 	Gravity = 0.1f;
20 	Diffusion = 0.00f;
21 	HotAir = 0.000f	* CFDS;
22 	Falldown = 1;
23 
24 	Flammable = 15;
25 	Explosive = 0;
26 	Meltable = 0;
27 	Hardness = 30;
28 
29 	Weight = 80;
30 
31 	HeatConduct = 70;
32 	Description = "Yeast, grows when warm (~37C).";
33 
34 	Properties = TYPE_PART;
35 
36 	LowPressure = IPL;
37 	LowPressureTransition = NT;
38 	HighPressure = IPH;
39 	HighPressureTransition = NT;
40 	LowTemperature = ITL;
41 	LowTemperatureTransition = NT;
42 	HighTemperature = 373.0f;
43 	HighTemperatureTransition = PT_DYST;
44 
45 	Update = &update;
46 }
47 
update(UPDATE_FUNC_ARGS)48 static int update(UPDATE_FUNC_ARGS)
49 {
50 	int r, rx, ry;
51 	for (rx=-1; rx<2; rx++)
52 		for (ry=-1; ry<2; ry++)
53 			if (BOUNDS_CHECK && (rx || ry))
54 			{
55 				r = pmap[y+ry][x+rx];
56 				if (!r)
57 					continue;
58 				if (TYP(r)==PT_DYST && RNG::Ref().chance(1, 6) && !sim->legacy_enable)
59 				{
60 					sim->part_change_type(i,x,y,PT_DYST);
61 				}
62 			}
63 	if (parts[i].temp > 303 && parts[i].temp < 317) {
64 		sim->create_part(-1, x + RNG::Ref().between(-1, 1), y + RNG::Ref().between(-1, 1), PT_YEST);
65 	}
66 	return 0;
67 }
68