summaryrefslogtreecommitdiff
path: root/src/simulation/elements/LAVA.cpp
blob: 35eefecaff43284bfcc1df4415e306cc062c9a4d (plain)
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
#include "simulation/Elements.h"
//#TPT-Directive ElementClass Element_LAVA PT_LAVA 6
Element_LAVA::Element_LAVA()
{
    Identifier = "DEFAULT_PT_LAVA";
    Name = "LAVA";
    Colour = PIXPACK(0xE05010);
    MenuVisible = 1;
    MenuSection = SC_LIQUID;
    Enabled = 1;
    
    Advection = 0.3f;
    AirDrag = 0.02f * CFDS;
    AirLoss = 0.95f;
    Loss = 0.80f;
    Collision = 0.0f;
    Gravity = 0.15f;
    Diffusion = 0.00f;
    HotAir = 0.0003f	* CFDS;
    Falldown = 2;
    
    Flammable = 0;
    Explosive = 0;
    Meltable = 0;
    Hardness = 2;
    
    Weight = 45;
    
    Temperature = R_TEMP+1500.0f+273.15f;
    HeatConduct = 60;
    Description = "Heavy liquid. Ignites flammable materials. Solidifies when cold.";
    
    State = ST_LIQUID;
    Properties = TYPE_LIQUID|PROP_LIFE_DEC;
    
    LowPressure = IPL;
    LowPressureTransition = NT;
    HighPressure = IPH;
    HighPressureTransition = NT;
    LowTemperature = 2573.15f;
    LowTemperatureTransition = ST;
    HighTemperature = ITH;
    HighTemperatureTransition = NT;
    
    Update = &Element_FIRE::update;
    Graphics = &Element_LAVA::graphics;
}


//#TPT-Directive ElementHeader Element_LAVA static int graphics(GRAPHICS_FUNC_ARGS)
int Element_LAVA::graphics(GRAPHICS_FUNC_ARGS)

{
	*colr = cpart->life * 2 + 0xE0;
	*colg = cpart->life * 1 + 0x50;
	*colb = cpart->life / 2 + 0x10;
	if (*colr>255) *colr = 255;
	if (*colg>192) *colg = 192;
	if (*colb>128) *colb = 128;
	*firea = 40;
	*firer = *colr;
	*fireg = *colg;
	*fireb = *colb;
	*pixel_mode |= FIRE_ADD;
	*pixel_mode |= PMODE_BLUR;
	//Returning 0 means dynamic, do not cache
	return 0;
}


Element_LAVA::~Element_LAVA() {}