Skip to content

Commit

Permalink
Release 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeimers113 committed Apr 28, 2022
1 parent 44f3c71 commit 152f6fb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
16 changes: 15 additions & 1 deletion README.md
Expand Up @@ -2,13 +2,27 @@
### Version 5.0.0

#### Cyens Toy aims to enhance The Powder Toy by going deeper into science simulation. This mod implements phenomena from several branches of natural science which are feasible to simulate and fun to explore in a 2D particle simulator.
#### This iteration of firefreak11's mod implements the best features of previous mods including [The Science Toy](https://github.com/cbeimers113/The-Science-Toy) and [Metacircuits Mod](https://github.com/cbeimers113/metacircuits).
---
**Features**
- Time Dilation
- Particles tick slower in the presence of gravitational fields
- Toggle with T
- Local Gravity
- Particles each exert a gravitational field proportional to their mass
- Cycle through gravity modes with W
- Compressible Gases
- Gases will compress up to 5 layers under strong pressure and decompress when the pressure is low
- Toggle with O
- Hydrocarbons System
- Hydrocarbons are formed from CRBN and H2 as methane
- The number of carbons and hydrogens are determined by life and tmp respectively
- Smaller hydrocarbons can bond together if hot enough
- Hydrocarbons' phase transitions and combustion are determined by temperature, pressure and number of carbons
- The hydrocarbons exist in either gas (GAS), liquid (OIL or MWAX) or solid (WAX) phase. OIL is the liquid phase of shorter molecules with 1-10 carbons, and MWAX is that of longer molecules with 11 - 60 carbons
- Hydrocarbons decompose into smaller hydrocarbons over time, with larger molecules decomposing quicker
- Hydrocarbon name displayed in HUD detailed mode (toggle with D)

For other features, see the [changelog](https://github.com/cbeimers113/cyens-toy/blob/master/changelog.txt).

---
**Version Numbering**
Expand Down
8 changes: 3 additions & 5 deletions changelog.txt
@@ -1,5 +1,3 @@
All changes from version 5.0.0 are listed here

Version 5.0.0:
* Cyens Toy is now forked from vanilla TPT, making it easier to keep up to date
* Fresh new icons for menu sections added by Cyens Toy
Expand All @@ -10,6 +8,6 @@ Version 5.0.0:
* FullName field for elements that shows up in detailed HUD
* Renamed some vanilla elements
* Moved some elements to more appropriate menu sections
* The hydrocarbons system has been rewritten to be simpler
* Hydrocarbons's phase transitions and combustion are determined by temp, pressure and number of carbons
* The hydrocarbons exist in either gas (GAS), liquid (OIL or MWAX) or solid (WAX) phase.
* Added a reworked, simpler hydrocarbons system
* Added CRBN, forms from burning WOOD and COAL, can be compressed back into BCOL and form methane with H2
* WOOD also creates some EMBR when burning
2 changes: 1 addition & 1 deletion src/simulation/elements/COAL.cpp
Expand Up @@ -55,7 +55,7 @@ void Element::Element_COAL()
int Element_COAL_update(UPDATE_FUNC_ARGS)
{
if (parts[i].life<=0) {
sim->create_part(i, x, y, RNG::Ref().chance(1, 100) ? PT_CRBN : PT_FIRE);
sim->create_part(i, x, y, RNG::Ref().chance(1, 50) ? PT_CRBN : PT_FIRE);
return 1;
} else if (parts[i].life < 100) {
parts[i].life--;
Expand Down
12 changes: 2 additions & 10 deletions src/simulation/elements/CRBN.cpp
Expand Up @@ -51,11 +51,9 @@ static int update(UPDATE_FUNC_ARGS)
{
int r, rx, ry;

// Look for 4 hydrogens to create methane
// Look for 4 hydrogens (2 H2) to create methane
int H1 = -1;
int H2 = -1;
int H3 = -1;
int H4 = -1;

for (rx = -2; rx < 3; rx++)
for (ry = -2; ry < 3; ry++)
Expand All @@ -73,21 +71,15 @@ static int update(UPDATE_FUNC_ARGS)
H1 = ID(r);
else if (H2 == -1)
H2 = ID(r);
else if (H3 == -1)
H3 = ID(r);
else if (H4 == -1)
H4 = ID(r);

// Create methane if we have all 4 hydrogens
if (H1 != -1 && H2 != -1 && H3 != -1 && H4 != -1)
if (H1 != -1 && H2 != -1)
{
parts[i].life = 1;
parts[i].tmp = 4;
sim->part_change_type(i, x, y, PT_GAS);
sim->kill_part(H1);
sim->kill_part(H2);
sim->kill_part(H3);
sim->kill_part(H4);
return 0;
}
}
Expand Down
13 changes: 12 additions & 1 deletion src/simulation/elements/FIRE.cpp
Expand Up @@ -270,7 +270,18 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS)
(t != PT_PHOT || rt != PT_INSL) &&
(rt != PT_SPNG || parts[ID(r)].life == 0))
{
int combust_type = parts[ID(r)].type == PT_WOOD && RNG::Ref().chance(1, 100) ? PT_CRBN : PT_FIRE;
int combust_type = PT_FIRE;

if (parts[ID(r)].type == PT_WOOD)
{
int rand_combust = RNG::Ref().between(0, 50);

if (rand_combust == 0)
combust_type = PT_CRBN;
else if (rand_combust == 1)
combust_type = PT_EMBR;
}

sim->part_change_type(ID(r), x + rx, y + ry, combust_type);
parts[ID(r)].temp = restrict_flt(sim->elements[PT_FIRE].DefaultProperties.temp + (sim->elements[rt].Flammable / 2), MIN_TEMP, MAX_TEMP);
parts[ID(r)].life = RNG::Ref().between(180, 259);
Expand Down

0 comments on commit 152f6fb

Please sign in to comment.