1 #include "simulation/ElementCommon.h"
2 
3 static int update(UPDATE_FUNC_ARGS);
4 
Element_ISZS()5 void Element::Element_ISZS()
6 {
7 	Identifier = "DEFAULT_PT_ISZS";
8 	Name = "ISZS";
9 	Colour = PIXPACK(0x662089);
10 	MenuVisible = 1;
11 	MenuSection = SC_NUCLEAR;
12 	Enabled = 1;
13 
14 	Advection = 0.0f;
15 	AirDrag = 0.00f * CFDS;
16 	AirLoss = 0.90f;
17 	Loss = 0.00f;
18 	Collision = 0.0f;
19 	Gravity = 0.0f;
20 	Diffusion = 0.00f;
21 	HotAir = -0.0007f* CFDS;
22 	Falldown = 0;
23 
24 	Flammable = 0;
25 	Explosive = 0;
26 	Meltable = 1;
27 	Hardness = 1;
28 
29 	Weight = 100;
30 
31 	DefaultProperties.temp = 140.00f;
32 	HeatConduct = 251;
33 	Description = "Solid form of ISOZ, slowly decays into PHOT.";
34 
35 	Properties = TYPE_SOLID;
36 
37 	LowPressure = IPL;
38 	LowPressureTransition = NT;
39 	HighPressure = IPH;
40 	HighPressureTransition = NT;
41 	LowTemperature = ITL;
42 	LowTemperatureTransition = NT;
43 	HighTemperature = 300.0f;
44 	HighTemperatureTransition = PT_ISOZ;
45 
46 	Update = &update;
47 }
48 
update(UPDATE_FUNC_ARGS)49 static int update(UPDATE_FUNC_ARGS)
50 {
51 	float rr, rrr;
52 	if (RNG::Ref().chance(1, 200) && RNG::Ref().chance(-4.0f * sim->pv[y/CELL][x/CELL], 1000))
53 	{
54 		sim->create_part(i, x, y, PT_PHOT);
55 		rr = RNG::Ref().between(128, 355) / 127.0f;
56 		rrr = RNG::Ref().between(0, 359) * 3.14159f / 180.0f;
57 		parts[i].vx = rr*cosf(rrr);
58 		parts[i].vy = rr*sinf(rrr);
59 	}
60 	return 0;
61 }
62