Permalink
Browse files

fix a few cases where the rng calls were converted improperly

  • Loading branch information...
jacob1 committed Nov 21, 2018
1 parent a3eae58 commit b41f228c109806fcc7d7b81eaae22d1a13765f45
@@ -59,7 +59,7 @@ int Element_DEST::update(UPDATE_FUNC_ARGS)
if (parts[i].life<=0 || parts[i].life>37)
{
parts[i].life = RNG::Ref().between(30, 59);
parts[i].life = RNG::Ref().between(30, 49);
sim->pv[y/CELL][x/CELL]+=60.0f;
}
if (rt == PT_PLUT || rt == PT_DEUT)
@@ -91,7 +91,7 @@ int Element_LIGH::update(UPDATE_FUNC_ARGS)
rt = TYP(r);
if ((surround_space || sim->elements[rt].Explosive) &&
(rt!=PT_SPNG || parts[ID(r)].life==0) &&
sim->elements[rt].Flammable && (sim->elements[rt].Flammable + RNG::Ref().chance(sim->pv[(y+ry)/CELL][(x+rx)/CELL] * 10.0f, 1000)))
sim->elements[rt].Flammable && RNG::Ref().chance(sim->elements[rt].Flammable + sim->pv[(y+ry)/CELL][(x+rx)/CELL] * 10.0f, 1000))
{
sim->part_change_type(ID(r),x+rx,y+ry,PT_FIRE);
parts[ID(r)].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP);
@@ -70,7 +70,7 @@ int Element_NEUT::update(UPDATE_FUNC_ARGS)
{
if (RNG::Ref().chance(1, 3))
{
sim->create_part(ID(r), x+rx, y+ry, RNG::Ref().chance(1, 3) ? PT_LAVA : PT_URAN);
sim->create_part(ID(r), x+rx, y+ry, RNG::Ref().chance(2, 3) ? PT_LAVA : PT_URAN);
parts[ID(r)].temp = MAX_TEMP;
if (parts[ID(r)].type==PT_LAVA) {
parts[ID(r)].tmp = 100;
@@ -73,7 +73,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS)
if (parts[i].life<limit && RNG::Ref().chance(50, absorbChanceDenom))
{
parts[i].life++;
if (RNG::Ref().chance(1, 4))
if (RNG::Ref().chance(3, 4))
sim->kill_part(ID(r));
else
sim->part_change_type(ID(r), x+rx, y+ry, PT_SALT);
@@ -468,7 +468,7 @@ int Element_STKM::run_stickman(playerst *playerp, UPDATE_FUNC_ARGS) {
if (angle<0)
angle+=360;
parts[np].tmp = angle;
parts[np].life = RNG::Ref().between(0, 2+power/15) + power/7;
parts[np].life = RNG::Ref().between(0, 1+power/15) + power/7;
parts[np].temp = parts[np].life*power/2.5;
parts[np].tmp2 = 1;
}
@@ -592,7 +592,7 @@ void Element_STKM::STKM_interact(Simulation *sim, playerst *playerp, int i, int
{
if (TYP(r)==PT_SPRK && playerp->elem!=PT_LIGH) //If on charge
{
sim->parts[i].life -= RNG::Ref().between(32, 52);
sim->parts[i].life -= RNG::Ref().between(32, 51);
}
if (sim->elements[TYP(r)].HeatConduct && (TYP(r)!=PT_HSWC||sim->parts[ID(r)].life==10) && ((playerp->elem!=PT_LIGH && sim->parts[ID(r)].temp>=323) || sim->parts[ID(r)].temp<=243) && (!playerp->rocketBoots || TYP(r)!=PT_PLSM))

0 comments on commit b41f228

Please sign in to comment.