1 #include "simulation/ElementCommon.h"
2 
3 static int update(UPDATE_FUNC_ARGS);
4 static int graphics(GRAPHICS_FUNC_ARGS);
5 static void create(ELEMENT_CREATE_FUNC_ARGS);
6 
Element_CRMC()7 void Element::Element_CRMC()
8 {
9 	Identifier = "DEFAULT_PT_CRMC";
10 	Name = "CRMC";
11 	Colour = PIXPACK(0xD6D1D4);
12 	MenuVisible = 1;
13 	MenuSection = SC_SOLIDS;
14 	Enabled = 1;
15 
16 	Advection = 0.0f;
17 	AirDrag = 0.00f * CFDS;
18 	AirLoss = 0.00f;
19 	Loss = 0.00f;
20 	Collision = 0.0f;
21 	Gravity = 0.0f;
22 	Diffusion = 0.00f;
23 	HotAir = 0.000f	* CFDS;
24 	Falldown = 0;
25 
26 	Flammable = 0;
27 	Explosive = 0;
28 	Meltable = 0;
29 	Hardness = 5;
30 
31 	Weight = 100;
32 
33 	HeatConduct = 35;
34 	Description = "Ceramic. Gets stronger under pressure.";
35 
36 	Properties = TYPE_SOLID | PROP_NEUTPASS;
37 
38 	LowPressure = IPL;
39 	LowPressureTransition = NT;
40 	HighPressure = IPH;
41 	HighPressureTransition = NT;
42 	LowTemperature = ITL;
43 	LowTemperatureTransition = NT;
44 	HighTemperature = 2887.15f;
45 	HighTemperatureTransition = ST;
46 
47 	Update = &update;
48 	Graphics = &graphics;
49 	Create = &create;
50 }
51 
update(UPDATE_FUNC_ARGS)52 static int update(UPDATE_FUNC_ARGS)
53 {
54 	if (sim->pv[y/CELL][x/CELL] < -30.0f)
55 		sim->create_part(i, x, y, PT_CLST);
56 	return 0;
57 }
58 
graphics(GRAPHICS_FUNC_ARGS)59 static int graphics(GRAPHICS_FUNC_ARGS)
60 {
61 	int z = (cpart->tmp2 - 2) * 8;
62 	*colr += z;
63 	*colg += z;
64 	*colb += z;
65 	return 0;
66 }
67 
create(ELEMENT_CREATE_FUNC_ARGS)68 static void create(ELEMENT_CREATE_FUNC_ARGS)
69 {
70 	sim->parts[i].tmp2 = RNG::Ref().between(0, 4);
71 }
72