diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-25 14:05:55 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-25 14:05:55 (GMT) |
| commit | fad383f3923cc04fb8b2ecd7a72cf5406832cf5d (patch) | |
| tree | 95e7d43ea1baa3cb556ed13849da3df69bd3c1dc /src/simulation | |
| parent | a03e92830a429e89d2c516e9b63eb44ab49e8417 (diff) | |
| download | powder-fad383f3923cc04fb8b2ecd7a72cf5406832cf5d.zip powder-fad383f3923cc04fb8b2ecd7a72cf5406832cf5d.tar.gz | |
TPT: Update to EXOT that makes it permeable to neutrons as well as electro... a104696620
Diffstat (limited to 'src/simulation')
| -rw-r--r-- | src/simulation/Simulation.cpp | 1 | ||||
| -rw-r--r-- | src/simulation/elements/ELEC.cpp | 3 | ||||
| -rw-r--r-- | src/simulation/elements/EXOT.cpp | 81 | ||||
| -rw-r--r-- | src/simulation/elements/NEUT.cpp | 2 |
4 files changed, 58 insertions, 29 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index dcb1e42..b5e30f0 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1828,6 +1828,7 @@ void Simulation::init_can_move() } can_move[PT_ELEC][PT_LCRY] = 2; can_move[PT_ELEC][PT_EXOT] = 2; + can_move[PT_NEUT][PT_EXOT] = 2; can_move[PT_PHOT][PT_LCRY] = 3;//varies according to LCRY life can_move[PT_PHOT][PT_BIZR] = 2; diff --git a/src/simulation/elements/ELEC.cpp b/src/simulation/elements/ELEC.cpp index c644f2f..4dd17be 100644 --- a/src/simulation/elements/ELEC.cpp +++ b/src/simulation/elements/ELEC.cpp @@ -128,7 +128,10 @@ int Element_ELEC::update(UPDATE_FUNC_ARGS) return 1; } if ((r&0xFF)==PT_EXOT) + { parts[r>>8].tmp2 += 5; + parts[r>>8].life = 1000; + } if ((sim->elements[r&0xFF].Properties & PROP_CONDUCTS) && ((r&0xFF)!=PT_NBLE||parts[i].temp<2273.15)) { sim->create_part(-1, x+rx, y+ry, PT_SPRK); diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp index 64691fc..3db5bc9 100644 --- a/src/simulation/elements/EXOT.cpp +++ b/src/simulation/elements/EXOT.cpp @@ -64,13 +64,14 @@ int Element_EXOT::update(UPDATE_FUNC_ARGS) { parts[i].tmp2 += 100; } } - if (parts[i].tmp>245) - if (1>rand()%500) - if ((r&0xFF)!=PT_EXOT && (r&0xFF)!=PT_BREC && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_NBHL && (r&0xFF)!=PT_WARP) - { - sim->create_part(i, x, y, parts[r>>8].type); - return 0; - } + if ((r&0xFF)==PT_EXOT && parts[r>>8].life==1500 && 1>rand()%1000) + parts[i].life = 1500; + if ((parts[i].tmp>245) && (parts[i].life>1000)) + if ((r&0xFF)!=PT_EXOT && (r&0xFF)!=PT_BREC && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PRTI && (r&0xFF)!=PT_PRTO && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_PHOT && (r&0xFF)!=PT_VOID && (r&0xFF)!=PT_NBHL && (r&0xFF)!=PT_WARP && (r&0xFF)!=PT_NEUT) + { + sim->create_part(i, x, y, parts[r>>8].type); + return 0; + } } parts[i].tmp--; parts[i].tmp2--; @@ -80,17 +81,19 @@ int Element_EXOT::update(UPDATE_FUNC_ARGS) { parts[i].tmp2 = 1; else if (parts[i].tmp2>6000) { - parts[i].tmp2 = 6000; - sim->part_change_type(i, x, y, PT_WARP); - parts[i].temp = 10000; - return 0; + parts[i].tmp2 = 10000; + if (parts[i].life<1001) + { + sim->part_change_type(i, x, y, PT_WARP); + return 0; + } } - else + else if(parts[i].life<1001) sim->pv[y/CELL][x/CELL] += (parts[i].tmp2*CFDS)/160000; if (sim->pv[y/CELL][x/CELL]>200 && parts[i].temp>9000 && parts[i].tmp2>200) { - sim->part_change_type(i, x, y, PT_WARP); parts[i].tmp2 = 6000; + sim->part_change_type(i, x, y, PT_WARP); return 0; } if (parts[i].tmp2>100) @@ -140,26 +143,46 @@ int Element_EXOT::graphics(GRAPHICS_FUNC_ARGS) int q = cpart->temp; int b = cpart->tmp; int c = cpart->tmp2; - if ((cpart->tmp2 - 1)>rand()%1000) + if (cpart->life < 1001) { - float frequency = 0.04045; - *colr = (sin(frequency*c + 4) * 127 + 150); - *colg = (sin(frequency*c + 6) * 127 + 150); - *colb = (sin(frequency*c + 8) * 127 + 150); - *firea = 100; - *firer = 0; - *fireg = 0; - *fireb = 0; - *pixel_mode |= PMODE_FLAT; - // *pixel_mode |= FIRE_ADD; - *pixel_mode |= PMODE_FLARE; + if ((cpart->tmp2 - 1)>rand()%1000) + { + float frequency = 0.04045; + *colr = (sin(frequency*c + 4) * 127 + 150); + *colg = (sin(frequency*c + 6) * 127 + 150); + *colb = (sin(frequency*c + 8) * 127 + 150); + + *firea = 100; + *firer = 0; + *fireg = 0; + *fireb = 0; + + *pixel_mode |= PMODE_FLAT; + *pixel_mode |= PMODE_FLARE; + } + else + { + float frequency = 0.00045; + *colr = (sin(frequency*q + 4) * 127 + (b/1.7)); + *colg = (sin(frequency*q + 6) * 127 + (b/1.7)); + *colb = (sin(frequency*q + 8) * 127 + (b/1.7)); + *cola = cpart->tmp / 6; + + *firea = *cola; + *firer = *colr; + *fireg = *colg; + *fireb = *colb; + + *pixel_mode |= FIRE_ADD; + *pixel_mode |= PMODE_BLUR; + } } else { - float frequency = 0.00045; - *colr = (sin(frequency*q + 4) * 127 + (b/1.7)); - *colg = (sin(frequency*q + 6) * 127 + (b/1.7)); - *colb = (sin(frequency*q + 8) * 127 + (b/1.7)); + float frequency = 0.01300; + *colr = (sin(frequency*q + 6.00) * 127 + ((b/2.9) + 80)); + *colg = (sin(frequency*q + 6.00) * 127 + ((b/2.9) + 80)); + *colb = (sin(frequency*q + 6.00) * 127 + ((b/2.9) + 80)); *cola = cpart->tmp / 6; *firea = *cola; *firer = *colr; diff --git a/src/simulation/elements/NEUT.cpp b/src/simulation/elements/NEUT.cpp index 5c963e7..0d882d8 100644 --- a/src/simulation/elements/NEUT.cpp +++ b/src/simulation/elements/NEUT.cpp @@ -134,6 +134,8 @@ int Element_NEUT::update(UPDATE_FUNC_ARGS) sim->kill_part(i); return 1; } + else if ((r&0xFF)==PT_EXOT && 5>(rand()%100)) + parts[r>>8].life = 1500; /*if(parts[r>>8].type>1 && parts[r>>8].type!=PT_NEUT && parts[r>>8].type-1!=PT_NEUT && parts[r>>8].type-1!=PT_STKM && (elements[parts[r>>8].type-1].menusection==SC_LIQUID|| elements[parts[r>>8].type-1].menusection==SC_EXPLOSIVE|| |
