diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2013-05-04 13:42:23 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2013-05-04 13:42:23 (GMT) |
| commit | cab667001dd1944cae646349430b969912c0b157 (patch) | |
| tree | 53a425ae892e4f7f643822abdf1bb26449a443a0 /src/simulation/elements/GOLD.cpp | |
| parent | dd0f5f5efb4f108c2ce329a2ceabc7d8fa2b63f8 (diff) | |
| parent | 630216c2531545c232edb45d3054c903c2c205c4 (diff) | |
| download | powder-cab667001dd1944cae646349430b969912c0b157.zip powder-cab667001dd1944cae646349430b969912c0b157.tar.gz | |
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/simulation/elements/GOLD.cpp')
| -rw-r--r-- | src/simulation/elements/GOLD.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/simulation/elements/GOLD.cpp b/src/simulation/elements/GOLD.cpp index 00c93c5..09ff5cb 100644 --- a/src/simulation/elements/GOLD.cpp +++ b/src/simulation/elements/GOLD.cpp @@ -32,7 +32,7 @@ Element_GOLD::Element_GOLD() Description = "Corrosion resistant metal, will reverse corrosion of iron"; State = ST_SOLID; - Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC; + Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC|PROP_NEUTPASS; LowPressure = IPL; LowPressureTransition = NT; @@ -44,7 +44,7 @@ Element_GOLD::Element_GOLD() HighTemperatureTransition = PT_LAVA; Update = &Element_GOLD::update; - + Graphics = &Element_GOLD::graphics; } //#TPT-Directive ElementHeader Element_GOLD static int update(UPDATE_FUNC_ARGS) @@ -85,8 +85,23 @@ int Element_GOLD::update(UPDATE_FUNC_ARGS) } } } + if ((sim->photons[y][x]&0xFF) == PT_NEUT) + { + if (!(rand()%7)) + { + sim->kill_part(sim->photons[y][x]>>8); + } + } return 0; } +//#TPT-Directive ElementHeader Element_GOLD static int graphics(GRAPHICS_FUNC_ARGS) +int Element_GOLD::graphics(GRAPHICS_FUNC_ARGS) +{ + *colr += rand()%10-5; + *colg += rand()%10-5; + *colb += rand()%10-5; + return 0; +} Element_GOLD::~Element_GOLD() {} |
