diff options
| author | jacob1 <jfu614@gmail.com> | 2012-11-17 04:35:34 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2012-11-17 04:35:34 (GMT) |
| commit | 7a21ae192fe19868539956f3fe28e62b2c7c4429 (patch) | |
| tree | ad303f091f9a08b209b91eb34a9fcad996a3de69 /src/simulation/elements | |
| parent | 9e72a619ab7a4b0aee928811923e675c19d1a569 (diff) | |
| download | powder-7a21ae192fe19868539956f3fe28e62b2c7c4429.zip powder-7a21ae192fe19868539956f3fe28e62b2c7c4429.tar.gz | |
VINE cool/burn effects like in PLNT, less sharp burn lines, fix infinite smoke from TNT
Diffstat (limited to 'src/simulation/elements')
| -rw-r--r-- | src/simulation/elements/BANG.cpp | 1 | ||||
| -rw-r--r-- | src/simulation/elements/PLNT.cpp | 2 | ||||
| -rw-r--r-- | src/simulation/elements/VINE.cpp | 20 | ||||
| -rw-r--r-- | src/simulation/elements/WOOD.cpp | 2 |
4 files changed, 23 insertions, 2 deletions
diff --git a/src/simulation/elements/BANG.cpp b/src/simulation/elements/BANG.cpp index b0ff983..8922e0e 100644 --- a/src/simulation/elements/BANG.cpp +++ b/src/simulation/elements/BANG.cpp @@ -102,6 +102,7 @@ int Element_BANG::update(UPDATE_FUNC_ARGS) else { sim->create_part(i, x, y, PT_SMKE); + parts[i].life = rand()%50+500; parts[i].temp = restrict_flt((MAX_TEMP/4)+otemp, MIN_TEMP, MAX_TEMP); } } diff --git a/src/simulation/elements/PLNT.cpp b/src/simulation/elements/PLNT.cpp index e7439d1..6e8202c 100644 --- a/src/simulation/elements/PLNT.cpp +++ b/src/simulation/elements/PLNT.cpp @@ -99,7 +99,7 @@ int Element_PLNT::update(UPDATE_FUNC_ARGS) } parts[i].life = 0; } - if (parts[i].temp > 400 && parts[i].temp > parts[i].tmp2) + if (parts[i].temp > 350 && parts[i].temp > parts[i].tmp2) parts[i].tmp2 = (int)parts[i].temp; return 0; } diff --git a/src/simulation/elements/VINE.cpp b/src/simulation/elements/VINE.cpp index 04c90bf..e31c8cd 100644 --- a/src/simulation/elements/VINE.cpp +++ b/src/simulation/elements/VINE.cpp @@ -64,6 +64,26 @@ int Element_VINE::update(UPDATE_FUNC_ARGS) sim->part_change_type(i,x,y,PT_PLNT); } } + if (parts[i].temp > 350 && parts[i].temp > parts[i].tmp2) + parts[i].tmp2 = (int)parts[i].temp; + return 0; +} + +//#TPT-Directive ElementHeader Element_VINE static int graphics(GRAPHICS_FUNC_ARGS) +int Element_VINE::graphics(GRAPHICS_FUNC_ARGS) +{ + float maxtemp = std::max((float)cpart->tmp2, cpart->temp); + if (maxtemp > 300) + { + *colr += (int)restrict_flt((maxtemp-300)/5,0,58); + *colg -= (int)restrict_flt((maxtemp-300)/2,0,102); + *colb += (int)restrict_flt((maxtemp-300)/5,0,70); + } + if (maxtemp < 273) + { + *colg += (int)restrict_flt((273-maxtemp)/4,0,255); + *colb += (int)restrict_flt((273-maxtemp)/1.5,0,255); + } return 0; } diff --git a/src/simulation/elements/WOOD.cpp b/src/simulation/elements/WOOD.cpp index 134d827..54e2e50 100644 --- a/src/simulation/elements/WOOD.cpp +++ b/src/simulation/elements/WOOD.cpp @@ -55,7 +55,7 @@ int Element_WOOD::graphics(GRAPHICS_FUNC_ARGS) *colr -= (int)restrict_flt((maxtemp-400)/3,0,172); *colg -= (int)restrict_flt((maxtemp-400)/4,0,140); *colb -= (int)restrict_flt((maxtemp-400)/20,0,44); - if (maxtemp > 550) + if (maxtemp > 450) cpart->tmp = (int)maxtemp; } if (maxtemp < 273) |
