summaryrefslogtreecommitdiff
path: root/src/elements/cbnw.c
diff options
context:
space:
mode:
authorCate <cate@cate-6sh2.(none)>2011-09-22 17:01:54 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-09-22 17:11:57 (GMT)
commit39525e6ef0e90964f674a27993c38590c0bd98ea (patch)
tree1f73bc4564e7d47b2a803936d4849df448731aa0 /src/elements/cbnw.c
parent3ac14d94e74e9bc4b75ce49ca7c848c717005c55 (diff)
downloadpowder-39525e6ef0e90964f674a27993c38590c0bd98ea.zip
powder-39525e6ef0e90964f674a27993c38590c0bd98ea.tar.gz
Fixes to carbonated water explosions. Help from cracker with create_part making overlapping particles to fix CO2 emitting water (as a bit of a sneaky trick to make less overlapping water.) Carb water slowly increases pressure if sealed, causing explosions when released.
Diffstat (limited to 'src/elements/cbnw.c')
-rw-r--r--src/elements/cbnw.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/elements/cbnw.c b/src/elements/cbnw.c
index 60b1bf3..478fba7 100644
--- a/src/elements/cbnw.c
+++ b/src/elements/cbnw.c
@@ -3,9 +3,9 @@
int update_CBNW(UPDATE_FUNC_ARGS) {
int r, rx, ry, oldt;
oldt = parts[i].tmp;
- if (pv[y/CELL][x/CELL]<=1)
+ if (pv[y/CELL][x/CELL]<=5)
{
- if(20>(rand()%20000))
+ if(20>(rand()%80000))
{
part_change_type(i,x,y,PT_CO2);
parts[i].ctype = 5;
@@ -25,10 +25,9 @@ int update_CBNW(UPDATE_FUNC_ARGS) {
//Explode
if(rand()%4)
{
- part_change_type(i,x,y,PT_WATR);
- } else {
- pv[y/CELL][x/CELL] += 0.5f;
- part_change_type(i,x,y,PT_CO2);
+ part_change_type(i,x,y,PT_CO2);
+ parts[i].ctype = 5;
+ pv[y/CELL][x/CELL] += 0.2f;
}
}
for (rx=-2; rx<3; rx++)
@@ -47,10 +46,9 @@ int update_CBNW(UPDATE_FUNC_ARGS) {
{
if(rand()%2)
{
- part_change_type(i,x,y,PT_WATR);
- } else {
- pv[y/CELL][x/CELL] += 0.5f;
- part_change_type(i,x,y,PT_CO2);
+ part_change_type(i,x,y,PT_CO2);
+ parts[i].ctype = 5;
+ pv[y/CELL][x/CELL] += 0.2f;
}
}
if ((r&0xFF)==PT_CBNW)