diff options
| author | cracker64 <cracker642@gmail.com> | 2013-02-28 05:40:36 (GMT) |
|---|---|---|
| committer | cracker64 <cracker642@gmail.com> | 2013-02-28 05:40:36 (GMT) |
| commit | c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2 (patch) | |
| tree | 90744a56bc618c12aab5ef617445b283ce2d6d57 /src/simulation/elements/SHLD2.cpp | |
| parent | 08d1a68ce091b6ba53788224fd1bda92c1895ca6 (diff) | |
| download | powder-c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2.zip powder-c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2.tar.gz | |
Finished first pass-through for all elements.
Will get a few more places later.
Diffstat (limited to 'src/simulation/elements/SHLD2.cpp')
| -rw-r--r-- | src/simulation/elements/SHLD2.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/simulation/elements/SHLD2.cpp b/src/simulation/elements/SHLD2.cpp index c00e4c9..c5f3504 100644 --- a/src/simulation/elements/SHLD2.cpp +++ b/src/simulation/elements/SHLD2.cpp @@ -55,13 +55,15 @@ int Element_SHLD2::update(UPDATE_FUNC_ARGS) if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) { r = pmap[y+ry][x+rx]; - if (!r && parts[i].life>0) - sim->create_part(-1,x+rx,y+ry,PT_SHLD1); if (!r) + { + if ( parts[i].life>0) + sim->create_part(-1,x+rx,y+ry,PT_SHLD1); continue; + } else if ((r&0xFF)==PT_SPRK&&parts[i].life==0) { - if (25>rand()%200&&parts[i].life==0) + if (!(rand()%8)) { sim->part_change_type(i,x,y,PT_SHLD3); parts[i].life = 7; @@ -77,7 +79,7 @@ int Element_SHLD2::update(UPDATE_FUNC_ARGS) } } } - else if ((r&0xFF)==PT_SHLD4&&4>rand()%10) + else if ((r&0xFF)==PT_SHLD4&&2>rand()%5) { sim->part_change_type(i,x,y,PT_SHLD3); parts[i].life = 7; @@ -88,4 +90,4 @@ int Element_SHLD2::update(UPDATE_FUNC_ARGS) -Element_SHLD2::~Element_SHLD2() {}
\ No newline at end of file +Element_SHLD2::~Element_SHLD2() {} |
