Permalink
Browse files

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

  • Loading branch information...
jacob1 committed Jun 12, 2017
1 parent fb2431d commit 1718fe92872110af3128a80e8127897541359879
@@ -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;
@@ -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;
}
}
}
@@ -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;
@@ -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;
}

0 comments on commit 1718fe9

Please sign in to comment.