Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Less overpowered (in terms of bunkers) QRTZ
Newly grown QRTZ now inherits the temperature of the particle that created it
and PQRT doesn't start growing in midair immediately after it's been shattered
  • Loading branch information
jacksonmj committed May 22, 2014
1 parent 2153282 commit 2946030
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/simulation/elements/QRTZ.cpp
Expand Up @@ -57,8 +57,11 @@ int Element_QRTZ::update(UPDATE_FUNC_ARGS)
if (parts[i].pavg[1]-parts[i].pavg[0] > 0.05*(parts[i].temp/3) || parts[i].pavg[1]-parts[i].pavg[0] < -0.05*(parts[i].temp/3))
{
sim->part_change_type(i,x,y,PT_PQRT);
parts[i].life = 5; //timer before it can grow or diffuse again
}
}
if (parts[i].life>5)
parts[i].life = 5;
// absorb SLTW
if (parts[i].tmp != -1)
for (rx=-1; rx<2; rx++)
Expand All @@ -75,7 +78,7 @@ int Element_QRTZ::update(UPDATE_FUNC_ARGS)
}
}
// grow and diffuse
if (parts[i].tmp > 0)
if (parts[i].tmp > 0 && (parts[i].vx*parts[i].vx + parts[i].vy*parts[i].vy)<0.2f && parts[i].life<=0)
{
bool stopgrow = false;
int rnd, sry, srx;
Expand All @@ -96,8 +99,14 @@ int Element_QRTZ::update(UPDATE_FUNC_ARGS)
np = sim->create_part(-1,x+srx,y+sry,PT_QRTZ);
if (np>-1)
{
parts[np].temp = parts[i].temp;
parts[np].tmp2 = parts[i].tmp2;
parts[i].tmp--;
if (t == PT_PQRT)
{
// If PQRT is stationary and has started growing particles of QRTZ, the PQRT is basically part of a new QRTZ crystal. So turn it back into QRTZ so that it behaves more like part of the crystal.
sim->part_change_type(i,x,y,PT_QRTZ);
}
if (rand()%2)
{
parts[np].tmp=-1;//dead qrtz
Expand Down

0 comments on commit 2946030

Please sign in to comment.