/
ROCK.cpp
73 lines (59 loc) · 1.39 KB
/
ROCK.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "simulation/ElementCommon.h"
static int graphics(GRAPHICS_FUNC_ARGS);
static void create(ELEMENT_CREATE_FUNC_ARGS);
void Element::Element_ROCK()
{
Identifier = "DEFAULT_PT_ROCK";
Name = "ROCK";
Colour = 0x727272_rgb;
MenuVisible = 1;
MenuSection = SC_SOLIDS;
Enabled = 1;
Advection = 0.0f;
AirDrag = 0.00f * CFDS;
AirLoss = 0.94f;
Loss = 0.00f;
Collision = 0.0f;
Gravity = 0.0f;
Diffusion = 0.00f;
HotAir = 0.000f * CFDS;
Falldown = 0;
Flammable = 0;
Explosive = 0;
Meltable = 5;
Hardness = 1;
Weight = 100;
HeatConduct = 200;
Description = "Rock. Solid material, CNCT can stack on top of it.";
Properties = TYPE_SOLID | PROP_HOT_GLOW;
LowPressure = IPL;
LowPressureTransition = NT;
HighPressure = 120;
HighPressureTransition = PT_STNE;
LowTemperature = ITL;
LowTemperatureTransition = NT;
HighTemperature = 1943.15f;
HighTemperatureTransition = PT_LAVA;
Graphics = &graphics;
Create = &create;
}
static int graphics(GRAPHICS_FUNC_ARGS)
{
int z = (cpart->tmp2 - 7) * 6; // Randomized color noise based on tmp2
*colr += z;
*colg += z;
*colb += z;
if (cpart->temp >= 810.15) // Glows when hot, right before melting becomes bright
{
*pixel_mode |= FIRE_ADD;
*firea = int(((cpart->temp)-810.15)/45);
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
}
return 0;
}
static void create(ELEMENT_CREATE_FUNC_ARGS)
{
sim->parts[i].tmp2 = sim->rng.between(0, 10);
}