Permalink
Browse files

Visual effect for FILT when an ARAY or CRAY beam passes through it

(increased opacity for up to 4 frames)
  • Loading branch information...
jacksonmj committed May 22, 2014
1 parent 2946030 commit 1158647285f853c6ce5b01061dba804fcbb3a597
Showing with 11 additions and 2 deletions.
  1. +5 −0 src/simulation/elements/ARAY.cpp
  2. +1 −0 src/simulation/elements/CRAY.cpp
  3. +5 −2 src/simulation/elements/FILT.cpp
@@ -104,6 +104,7 @@ int Element_ARAY::update(UPDATE_FUNC_ARGS)
if (!colored)
break;
}
parts[r>>8].life = 4;
//this if prevents BRAY from stopping on certain materials
} else if ((r&0xFF)!=PT_STOR && (r&0xFF)!=PT_INWR && ((r&0xFF)!=PT_SPRK || parts[r>>8].ctype!=PT_INWR) && (r&0xFF)!=PT_ARAY && (r&0xFF)!=PT_WIFI && !((r&0xFF)==PT_SWCH && parts[r>>8].life>=10)) {
if (nyy!=0 || nxx!=0) {
@@ -151,6 +152,10 @@ int Element_ARAY::update(UPDATE_FUNC_ARGS)
parts[r>>8].tmp = 0;
parts[r>>8].life = 0;
}
else if ((r&0xFF)==PT_FILT)
{
parts[r>>8].life = 2;
}
docontinue = 1;
} else {
docontinue = 0;
@@ -107,6 +107,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS)
{
colored = wavelengthToDecoColour(Element_FILT::getWavelengths(&parts[r>>8]));
}
parts[r>>8].life = 4;
} else if ((r&0xFF) == PT_CRAY || nostop) {
docontinue = 1;
} else if(destroy && r && ((r&0xFF) != PT_DMND)) {
@@ -31,7 +31,7 @@ Element_FILT::Element_FILT()
Description = "Filter for photons, changes the color.";
State = ST_SOLID;
Properties = TYPE_SOLID | PROP_NOAMBHEAT;
Properties = TYPE_SOLID | PROP_NOAMBHEAT | PROP_LIFE_DEC;
LowPressure = IPL;
LowPressureTransition = NT;
@@ -60,7 +60,10 @@ int Element_FILT::graphics(GRAPHICS_FUNC_ARGS)
for (x=0; x<12; x++)
*colg += (wl >> (x+9)) & 1;
x = 624/(*colr+*colg+*colb+1);
*cola = 127;
if (cpart->life>0 && cpart->life<=4)
*cola = 127+cpart->life*30;
else
*cola = 127;
*colr *= x;
*colg *= x;
*colb *= x;

0 comments on commit 1158647

Please sign in to comment.