Add reactions of resist with other elements.
This commit is contained in:
parent
93cbb065dd
commit
b000abcdd8
@ -66,6 +66,12 @@ static int update(UPDATE_FUNC_ARGS)
|
||||
parts[ID(r)].life = 10;
|
||||
return 1;
|
||||
}
|
||||
else if (TYP(r) == PT_GEL)
|
||||
{
|
||||
sim->kill_part(i);
|
||||
sim->part_change_type(ID(r),x+rx,y+ry,PT_RSST);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -236,6 +236,10 @@ static int update(UPDATE_FUNC_ARGS)
|
||||
case PT_SMKE: // SMKE -> CO2
|
||||
sim->part_change_type(ID(r), x + rx, y + ry, PT_CO2);
|
||||
break;
|
||||
|
||||
case PT_RSST: // RSST -> BIZR
|
||||
sim->part_change_type(ID(r), x + rx, y + ry, PT_BIZR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "simulation/ElementCommon.h"
|
||||
|
||||
int update(UPDATE_FUNC_ARGS);
|
||||
|
||||
void Element::Element_RSST()
|
||||
{
|
||||
Identifier = "DEFAULT_PT_RSST";
|
||||
@ -24,7 +26,7 @@ void Element::Element_RSST()
|
||||
Meltable = 0;
|
||||
Hardness = 50;
|
||||
|
||||
Weight = 40;
|
||||
Weight = 34;
|
||||
|
||||
DefaultProperties.temp = R_TEMP + 20.0f + 273.15f;
|
||||
HeatConduct = 44;
|
||||
@ -40,4 +42,29 @@ void Element::Element_RSST()
|
||||
LowTemperatureTransition = NT;
|
||||
HighTemperature = ITH;
|
||||
HighTemperatureTransition = NT;
|
||||
|
||||
Update = &update;
|
||||
}
|
||||
|
||||
int update(UPDATE_FUNC_ARGS)
|
||||
{
|
||||
for(int rx = -1; rx < 2; rx++)
|
||||
{
|
||||
for(int ry = -1; ry < 2; ry++)
|
||||
{
|
||||
auto r = pmap[y+ry][x+rx];
|
||||
|
||||
if (!r)
|
||||
continue;
|
||||
|
||||
if(TYP(r) == PT_GUNP)
|
||||
{
|
||||
sim->part_change_type(i, x, y, PT_FIRW);
|
||||
sim->kill_part(ID(r));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user