HEAC is now meltable via LIGH, fix HEAC hardness, fixes #441

This commit is contained in:
jacob1 2017-06-11 21:10:19 -04:00
parent fb2431d99e
commit 1718fe9287
4 changed files with 29 additions and 9 deletions

View File

@ -3922,7 +3922,7 @@ void Simulation::UpdateParticles(int start, int end)
if (ctemph >= pres+elements[PT_CRMC].HighTemperature)
s = 0;
}
else if (elements[parts[i].ctype].HighTemperatureTransition == PT_LAVA)
else if (elements[parts[i].ctype].HighTemperatureTransition == PT_LAVA || parts[i].ctype == PT_HEAC)
{
if (pt >= elements[parts[i].ctype].HighTemperature)
s = 0;

View File

@ -128,14 +128,25 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS)
}
}
// LAVA(CLST) + LAVA(PQRT) + high enough temp = LAVA(CRMC) + LAVA(CRMC)
if (t == PT_LAVA && parts[i].ctype == PT_QRTZ && rt == PT_LAVA && parts[r>>8].ctype == PT_CLST)
if (t == PT_LAVA)
{
float pres = std::max(sim->pv[y/CELL][x/CELL]*10.0f, 0.0f);
if (parts[i].temp >= pres+sim->elements[PT_CRMC].HighTemperature+50.0f)
// LAVA(CLST) + LAVA(PQRT) + high enough temp = LAVA(CRMC) + LAVA(CRMC)
if (parts[i].ctype == PT_QRTZ && rt == PT_LAVA && parts[r>>8].ctype == PT_CLST)
{
parts[i].ctype = PT_CRMC;
parts[r>>8].ctype = PT_CRMC;
float pres = std::max(sim->pv[y/CELL][x/CELL]*10.0f, 0.0f);
if (parts[i].temp >= pres+sim->elements[PT_CRMC].HighTemperature+50.0f)
{
parts[i].ctype = PT_CRMC;
parts[r>>8].ctype = PT_CRMC;
}
}
else if (rt == PT_HEAC && parts[i].ctype == PT_HEAC)
{
if (parts[r>>8].temp > sim->elements[PT_HEAC].HighTemperature && rand()%200)
{
sim->part_change_type(r>>8, x+rx, y+ry, PT_LAVA);
parts[r>>8].ctype = PT_HEAC;
}
}
}

View File

@ -23,7 +23,7 @@ Element_HEAC::Element_HEAC()
Flammable = 0;
Explosive = 0;
Meltable = 1;
Hardness = 50;
Hardness = 0;
Weight = 100;
@ -39,7 +39,8 @@ Element_HEAC::Element_HEAC()
HighPressureTransition = NT;
LowTemperature = ITL;
LowTemperatureTransition = NT;
HighTemperature = ITH;
// can't melt by normal heat conduction, this is used by other elements for special melting behavior
HighTemperature = 1887.15f;
HighTemperatureTransition = NT;
Update = &Element_HEAC::update;

View File

@ -133,6 +133,14 @@ int Element_LIGH::update(UPDATE_FUNC_ARGS)
if (sim->player2.elem!=PT_LIGH)
parts[r>>8].life-=powderful/100;
break;
case PT_HEAC:
parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/10, MIN_TEMP, MAX_TEMP);
if (parts[r>>8].temp > sim->elements[PT_HEAC].HighTemperature)
{
sim->part_change_type(r>>8, x+rx, y+ry, PT_LAVA);
parts[r>>8].ctype = PT_HEAC;
}
break;
default:
break;
}