From f77f1ab485b8e710421afb2551e9372784157d4d Mon Sep 17 00:00:00 2001 From: Catelite Date: Wed, 6 Jun 2012 11:11:05 -0400 Subject: [PATCH] Added diffusion code for tmp2 in EXOT starting at >100 so that electron patterns won't cause abrupt fission reactions. Also, rearranged air generation line that depends on tmp already so that it doesn't abruptly switch on past 5000 and then violenly explode, but slowly increments instead. --- src/elements/exot.c | 43 +++++++++++++++++++++++++++++++++++++------ src/elements/warp.c | 4 ++-- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/elements/exot.c b/src/elements/exot.c index 81f7c7db6..e631b4636 100644 --- a/src/elements/exot.c +++ b/src/elements/exot.c @@ -16,7 +16,8 @@ #include int update_EXOT(UPDATE_FUNC_ARGS) { - int r, rt, rx, ry, nb, rrx, rry; + int r, rt, rx, ry, nb, rrx, rry, trade, tym, t; + t = parts[i].type; for (rx=-2; rx<=2; rx++) for (ry=-2; ry<=2; ry++) if (x+rx>=0 && y+ry>=0 && x+rx>8].tmp2>2000) if (1>rand()%100) { - parts[i].tmp2 += 50; + parts[i].tmp2 += 100; } } } @@ -38,19 +39,49 @@ int update_EXOT(UPDATE_FUNC_ARGS) { parts[i].tmp = 250; if (parts[i].tmp2<1) parts[i].tmp2 = 1; - else if (parts[i].tmp2>2500) + else if (parts[i].tmp2>6000) { - parts[i].tmp2 = 2500; + parts[i].tmp2 = 6000; part_change_type(i, x, y, PT_WARP); parts[i].temp = 10000; } else - pv[y/CELL][x/CELL] += (parts[i].tmp2/2000) * CFDS; + pv[y/CELL][x/CELL] += (parts[i].tmp2*CFDS)/40000; if (pv[y/CELL][x/CELL]>200 && parts[i].temp>9000 && parts[i].tmp2>200) { part_change_type(i, x, y, PT_WARP); - parts[i].tmp2 = 2500; + parts[i].tmp2 = 6000; } + if (parts[i].tmp2>100) + { + for ( trade = 0; trade<9; trade ++) + { + rx = rand()%5-2; + ry = rand()%5-2; + if (x+rx>=0 && y+ry>0 && x+rxparts[r>>8].tmp2) && parts[r>>8].tmp2>=0 )//diffusion + { + tym = parts[i].tmp2 - parts[r>>8].tmp2; + if (tym ==1) + { + parts[r>>8].tmp2 ++; + parts[i].tmp2 --; + break; + } + if (tym>0) + { + parts[r>>8].tmp2 += tym/2; + parts[i].tmp2 -= tym/2; + break; + } + } + } + } + } return 0; } int graphics_EXOT(GRAPHICS_FUNC_ARGS) diff --git a/src/elements/warp.c b/src/elements/warp.c index 0108bb972..05ec92948 100644 --- a/src/elements/warp.c +++ b/src/elements/warp.c @@ -21,8 +21,8 @@ int update_WARP(UPDATE_FUNC_ARGS) { if (parts[i].tmp2>2000) { parts[i].temp = 10000; - pv[y/CELL][x/CELL] += (parts[i].tmp2/2000) * CFDS; - if (2>rand()%1000) + pv[y/CELL][x/CELL] += (parts[i].tmp2/5000) * CFDS; + if (2>rand()%100) create_part(-3, x, y, PT_ELEC); } for ( trade = 0; trade<5; trade ++)