summaryrefslogtreecommitdiff
path: root/src/simulation/elements/GOLD.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-05-03 23:47:09 (GMT)
committer jacob1 <jfu614@gmail.com>2013-05-03 23:47:09 (GMT)
commit3018c597c4cc2e58751d52020f5c927a3329a56f (patch)
treebe781d1b6d07481a3cc59e5a06777189de4619fb /src/simulation/elements/GOLD.cpp
parentd4391cc19eb694f12aecfedbe03fc01730f776a0 (diff)
downloadpowder-3018c597c4cc2e58751d52020f5c927a3329a56f.zip
powder-3018c597c4cc2e58751d52020f5c927a3329a56f.tar.gz
make GOLD sparkle slightly, and it kills NEUT
Diffstat (limited to 'src/simulation/elements/GOLD.cpp')
-rw-r--r--src/simulation/elements/GOLD.cpp19
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() {}