Redo resist reactions.

This commit is contained in:
Saveliy Skresanov 2023-11-26 20:59:51 +07:00
parent 84b790ceaf
commit bc5fad1500
5 changed files with 28 additions and 24 deletions

View File

@ -61,20 +61,10 @@ static int update(UPDATE_FUNC_ARGS)
int under = pmap[y][x];
int utype = TYP(under);
int uID = ID(under);
if(utype == PT_RSST)
if((utype == PT_RSSS) && sim->rng.chance(1, 5))
{
sim->part_change_type(uID, x, y, PT_SWCH);
sim->kill_part(i);
return 1;
}
else if(utype == PT_RSSS)
{
sim->part_change_type(uID, x, y, PT_NSCN);
sim->kill_part(i);
return 1;
}

View File

@ -101,16 +101,11 @@ static int update(UPDATE_FUNC_ARGS)
else change = 0.0f;
parts[uID].temp = restrict_flt(parts[uID].temp + change, MIN_TEMP, MAX_TEMP);
break;
case PT_RSST:
{
sim->part_change_type(uID, x, y, PT_METL);
sim->kill_part(i);
}
break;
case PT_RSSS:
{
sim->part_change_type(uID, x, y, PT_PSCN);
sim->kill_part(uID);
sim->kill_part(i);
return 1;
}
break;
case PT_NONE:

View File

@ -29,8 +29,8 @@ void Element::Element_RSSS()
Weight = 100;
HeatConduct = 251;
Description = "Solidified resist. Blocks pressure and insulates SPRK. Liquefies on contact with NEUT.";
HeatConduct = 130;
Description = "Solidified resist. Blocks pressure and insulates electricity. Liquefies on contact with neutrons.";
Properties = TYPE_SOLID|PROP_NEUTPASS;

View File

@ -26,13 +26,13 @@ void Element::Element_RSST()
Meltable = 0;
Hardness = 50;
Weight = 34;
Weight = 33;
DefaultProperties.temp = R_TEMP + 20.0f + 273.15f;
HeatConduct = 44;
Description = "Resist. Solidifies on contact with PHOT, and reacts with other energy particles.";
HeatConduct = 55;
Description = "Resist. Solidifies on contact with photons, is destroyed by electrons and spark.";
Properties = TYPE_LIQUID|PROP_NEUTPASS;
Properties = TYPE_LIQUID|PROP_CONDUCTS|PROP_LIFE_DEC|PROP_NEUTPASS;
LowPressure = IPL;
LowPressureTransition = NT;
@ -63,6 +63,11 @@ int update(UPDATE_FUNC_ARGS)
sim->kill_part(ID(r));
return 1;
}
if((TYP(r) == PT_CLNE) || (TYP(r) == PT_PCLN))
{
parts[i].ctype = parts[ID(r)].ctype;
}
}
}

View File

@ -69,6 +69,12 @@ static int update(UPDATE_FUNC_ARGS)
parts[i].life = 54;
else if (ct == PT_SWCH)
parts[i].life = 14;
else if (ct == PT_RSST)
{
sim->kill_part(i);
return 1;
}
if (sim->part_change_type(i,x,y,ct))
return 1;
return 0;
@ -357,6 +363,14 @@ static int update(UPDATE_FUNC_ARGS)
sim->FloodINST(x+rx,y+ry);//spark the wire
}
}
else if (receiver==PT_RSST) {
if (parts[ID(r)].life==0 && parts[i].life<4)
{
sim->part_change_type(ID(r),x+rx,y+ry,PT_SPRK);
parts[ID(r)].life = 5;
parts[ID(r)].ctype = receiver;
}
}
else if (parts[ID(r)].life==0 && parts[i].life<4) {
parts[ID(r)].life = 4;
parts[ID(r)].ctype = receiver;