From 2ed53a99aee2c12f1a362f5d879bab3f23d4d713 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sat, 3 Nov 2012 15:57:32 +0000 Subject: Change EXOT properties to match TPT diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp index 2f96254..4f68af3 100644 --- a/src/simulation/elements/EXOT.cpp +++ b/src/simulation/elements/EXOT.cpp @@ -22,16 +22,16 @@ Element_EXOT::Element_EXOT() Flammable = 0; Explosive = 0; Meltable = 0; - Hardness = 20; + Hardness = 2; - Weight = 45; + Weight = 46; Temperature = R_TEMP-2.0f +273.15f; - HeatConduct = 29; + HeatConduct = 250; Description = "Exotic matter. Explodes with excess exposure to electrons."; State = ST_LIQUID; - Properties = TYPE_LIQUID|PROP_NEUTPENETRATE; + Properties = TYPE_LIQUID; LowPressure = IPL; LowPressureTransition = NT; -- cgit v0.9.2-21-gd62e From d586a6d0abbc690ef6a0b9708a2343fe553adbc7 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Wed, 3 Oct 2012 23:47:42 -0400 Subject: PPIP doesn't break with pressure, to match TPT diff --git a/src/simulation/elements/PPIP.cpp b/src/simulation/elements/PPIP.cpp index 799c25d..03830a7 100644 --- a/src/simulation/elements/PPIP.cpp +++ b/src/simulation/elements/PPIP.cpp @@ -35,8 +35,8 @@ Element_PPIP::Element_PPIP() LowPressure = IPL; LowPressureTransition = NT; - HighPressure = 10.0f; - HighPressureTransition = PT_BRMT; + HighPressure = IPH; + HighPressureTransition = NT; LowTemperature = ITL; LowTemperatureTransition = NT; HighTemperature = ITH; -- cgit v0.9.2-21-gd62e From 12eb085d20dbb57cbbe79d92c9077dcc9de60330 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 4 Nov 2012 20:35:43 +0000 Subject: VIBR changes from jacob1 Including: Molten TTAN + EXOT = VIBR. VIBR + ANAR = BVBR. (BOYL reaction removed) All absorbed heat/particles/pressure are stored in one property, tmp. Graphics changes diff --git a/src/simulation/elements/BOMB.cpp b/src/simulation/elements/BOMB.cpp index 8aaa722..0335e59 100644 --- a/src/simulation/elements/BOMB.cpp +++ b/src/simulation/elements/BOMB.cpp @@ -58,7 +58,7 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)!=PT_BOMB && (r&0xFF)!=PT_EMBR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_BCLN) + if ((r&0xFF)!=PT_BOMB && (r&0xFF)!=PT_EMBR && (r&0xFF)!=PT_DMND && (r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_VIBR) { int rad = 8; int nxi; @@ -67,7 +67,7 @@ int Element_BOMB::update(UPDATE_FUNC_ARGS) for (nxj=-rad; nxj<=rad; nxj++) for (nxi=-rad; nxi<=rad; nxi++) if ((pow((float)nxi,2))/(pow((float)rad,2))+(pow((float)nxj,2))/(pow((float)rad,2))<=1) - if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN) + if ((pmap[y+nxj][x+nxi]&0xFF)!=PT_DMND && (pmap[y+nxj][x+nxi]&0xFF)!=PT_CLNE && (pmap[y+nxj][x+nxi]&0xFF)!=PT_PCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_BCLN && (pmap[y+nxj][x+nxi]&0xFF)!=PT_VIBR) { sim->delete_part(x+nxi, y+nxj, 0); sim->pv[(y+nxj)/CELL][(x+nxi)/CELL] += 0.1f; diff --git a/src/simulation/elements/BVBR.cpp b/src/simulation/elements/BVBR.cpp index 994027e..dfff186 100644 --- a/src/simulation/elements/BVBR.cpp +++ b/src/simulation/elements/BVBR.cpp @@ -4,7 +4,7 @@ Element_BVBR::Element_BVBR() { Identifier = "DEFAULT_PT_BVBR"; Name = "BVBR"; - Colour = PIXPACK(0x002900); + Colour = PIXPACK(0x005000); MenuVisible = 1; MenuSection = SC_POWDERS; Enabled = 1; @@ -16,7 +16,7 @@ Element_BVBR::Element_BVBR() Collision = 0.0f; Gravity = 0.15f; Diffusion = 0.00f; - HotAir = 0.0003f * CFDS; + HotAir = 0.0000f * CFDS; Falldown = 1; Flammable = 0; diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp index 4f68af3..03eca2f 100644 --- a/src/simulation/elements/EXOT.cpp +++ b/src/simulation/elements/EXOT.cpp @@ -56,7 +56,7 @@ int Element_EXOT::update(UPDATE_FUNC_ARGS) { r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)==PT_WARP) + if ((r&0xFF) == PT_WARP) { if (parts[r>>8].tmp2>2000) if (1>rand()%100) @@ -64,8 +64,22 @@ int Element_EXOT::update(UPDATE_FUNC_ARGS) { parts[i].tmp2 += 100; } } - if ((r&0xFF)==PT_EXOT && parts[r>>8].life==1500 && 1>rand()%1000) + else if ((r&0xFF) == PT_EXOT && parts[r>>8].life == 1500 && 1>rand()%1000) parts[i].life = 1500; + else if ((r&0xFF) == PT_LAVA) + { + if (parts[r>>8].ctype == PT_TTAN && 1>rand()%10) + { + parts[r>>8].ctype = PT_VIBR; + sim->kill_part(i); + return 1; + } + /*else if (parts[r>>8].ctype == PT_VIBR && 1>rand()%1000) + { + sim->kill_part(i); + return 1; + }*/ + } 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) { @@ -179,7 +193,7 @@ int Element_EXOT::graphics(GRAPHICS_FUNC_ARGS) } else { - float frequency = 0.01300; + 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)); diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index 02c97fa..e6ee082 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -4,9 +4,9 @@ Element_VIBR::Element_VIBR() { Identifier = "DEFAULT_PT_VIBR"; Name = "VIBR"; - Colour = PIXPACK(0x002900); + Colour = PIXPACK(0x005000); MenuVisible = 1; - MenuSection = SC_SOLIDS; + MenuSection = SC_NUCLEAR; Enabled = 1; Advection = 0.0f; @@ -26,7 +26,7 @@ Element_VIBR::Element_VIBR() Weight = 100; - Temperature = R_TEMP+0.0f +273.15f; + Temperature = 273.15f; HeatConduct = 251; Description = "Vibranium. Stores energy and releases it in violent explosions."; @@ -57,7 +57,7 @@ void transferProp(UPDATE_FUNC_ARGS, int propOffset) if (x+rx>=0 && y+ry>0 && x+rx *((int*)(((char*)&parts[r>>8])+propOffset))) { @@ -81,152 +81,156 @@ void transferProp(UPDATE_FUNC_ARGS, int propOffset) //#TPT-Directive ElementHeader Element_VIBR static int update(UPDATE_FUNC_ARGS) int Element_VIBR::update(UPDATE_FUNC_ARGS) { - int r, rx, ry, transfer, trade; - if (!parts[i].life) + int r, rx, ry; + if (parts[i].ctype == 1) //leaving in, just because + { + if (sim->pv[y/CELL][x/CELL] > -2.5 || parts[i].tmp) + { + parts[i].ctype = 0; + sim->part_change_type(i, x, y, PT_VIBR); + } + } + else if (!parts[i].life) //if not exploding { //Heat absorption code - if (parts[i].temp>274.65f) + if (parts[i].temp > 274.65f) { - parts[i].ctype++; - parts[i].temp-=3; + parts[i].tmp++; + parts[i].temp -= 3; } - if (parts[i].temp<271.65f) + if (parts[i].temp < 271.65f) { - parts[i].ctype--; - parts[i].temp+=3; + parts[i].tmp--; + parts[i].temp += 3; } //Pressure absorption code - if (sim->pv[y/CELL][x/CELL]>2.5) + if (sim->pv[y/CELL][x/CELL] > 2.5) { - parts[i].tmp++; + parts[i].tmp += 7; sim->pv[y/CELL][x/CELL]--; } - if (sim->pv[y/CELL][x/CELL]<-2.5) + if (sim->pv[y/CELL][x/CELL] < -2.5) { - parts[i].tmp--; + parts[i].tmp -= 2; sim->pv[y/CELL][x/CELL]++; } + //initiate explosion counter + if (parts[i].tmp > 1000) + parts[i].life = 750; } - //Release sparks before explode - if (parts[i].life && parts[i].life < 300) + else //if it is exploding { - rx = rand()%3-1; - ry = rand()%3-1; - r = pmap[y+ry][x+rx]; - if ((r&0xFF) && (r&0xFF) != PT_BREC && (sim->elements[r&0xFF].Properties&PROP_CONDUCTS) && !parts[r>>8].life) + //Release sparks before explode + if (parts[i].life < 300) { - parts[r>>8].life = 4; - parts[r>>8].ctype = r>>8; - sim->part_change_type(r>>8,x+rx,y+ry,PT_SPRK); + rx = rand()%3-1; + ry = rand()%3-1; + r = pmap[y+ry][x+rx]; + if ((r&0xFF) && (r&0xFF) != PT_BREC && (sim->elements[r&0xFF].Properties&PROP_CONDUCTS) && !parts[r>>8].life) + { + parts[r>>8].life = 4; + parts[r>>8].ctype = r&0xFF; + sim->part_change_type(r>>8,x+rx,y+ry,PT_SPRK); + } } - } - //initiate explosion counter - if (!parts[i].life && (parts[i].ctype > 1200 || parts[i].tmp > 100 || parts[i].tmp2 > 100)) - parts[i].life = 750; - //Release all heat - if (parts[i].life && parts[i].life < 500) - { - int random = rand(); - rx = random%7-3; - ry = (random>>3)%7-3; - if(x+rx>=0 && y+ry>0 && x+rx>3)%7-3; + if(x+rx>=0 && y+ry>0 && x+rx>8].temp += parts[i].ctype*6; - parts[i].ctype -= parts[i].ctype*2; + r = pmap[y+ry][x+rx]; + if ((r&0xFF) && (r&0xFF) != parts[i].type) + { + parts[r>>8].temp += parts[i].tmp*6; + parts[i].tmp -= parts[i].tmp*2; + } } } - } - //Explosion code - if (parts[i].life == 1) - { - sim->create_part(i, x, y, PT_EXOT); - parts[i].tmp2 = 100; - int random = rand(), index; - index = sim->create_part(-3,x+(random&3)-1,y+((random>>2)&3)-1,PT_ELEC); - if (index != -1) - parts[index].temp = 7000; - index = sim->create_part(-3,x+((random>>4)&3)-1,y+((random>>6)&3)-1,PT_NEUT); - if (index != -1) - parts[index].temp = 7000; - index = sim->create_part(-3,x+((random>>8)&3)-1,y+((random>>10)&3)-1,PT_PHOT); - if (index != -1) - parts[index].temp = 7000; - index = sim->create_part(-3,x+((random>>12)&3)-1,y+rand()%3-1,PT_BREC); - if (index != -1) - parts[index].temp = 7000; - parts[i].temp=9000; - sim->pv[y/CELL][x/CELL]=200; + //Explosion code + if (parts[i].life == 1) + { + int random = rand(), index; + sim->create_part(i, x, y, PT_EXOT); + parts[i].tmp2 = rand()%1000; + index = sim->create_part(-3,x+((random>>4)&3)-1,y+((random>>6)&3)-1,PT_ELEC); + if (index != -1) + parts[index].temp = 7000; + index = sim->create_part(-3,x+((random>>8)&3)-1,y+((random>>10)&3)-1,PT_PHOT); + if (index != -1) + parts[index].temp = 7000; + index = sim->create_part(-1,x+((random>>12)&3)-1,y+rand()%3-1,PT_BREC); + if (index != -1) + parts[index].temp = 7000; + parts[i].temp=9000; + sim->pv[y/CELL][x/CELL] += 50; + } } //Neighbor check loop - for (rx=-3; rx<4; rx++) - for (ry=-3; ry<4; ry++) + for (rx=-2; rx<3; rx++) + for (ry=-2; ry<3; ry++) if (x+rx>=0 && y+ry>0 && x+rxphotons[y+ry][x+rx]; if (!r) continue; //Melts into EXOT - if ((r&0xFF)==PT_EXOT && !(rand()%250)) + if ((r&0xFF) == PT_EXOT && !(rand()%250)) { - sim->part_change_type(i,x,y,PT_EXOT); + sim->create_part(i, x, y, PT_EXOT); } - //Absorbs energy particles - if (sim->elements[r&0xFF].Properties & TYPE_ENERGY) + else if ((r&0xFF) == PT_ANAR) { - parts[i].tmp2++; - sim->kill_part(r>>8); + sim->part_change_type(i,x,y,PT_BVBR); + sim->pv[y/CELL][x/CELL] -= 1; } - if ((r&0xFF)==PT_BOYL) + else if (parts[i].life && (r&0xFF) == parts[i].type && !parts[r>>8].life) { - sim->part_change_type(i,x,y,PT_BVBR); + parts[r>>8].tmp += 10; + } + //Absorbs energy particles + if ((sim->elements[r&0xFF].Properties & TYPE_ENERGY)) + { + parts[i].tmp += 20; + sim->kill_part(r>>8); } } transferProp(UPDATE_FUNC_SUBCALL_ARGS, offsetof(Particle, tmp)); - transferProp(UPDATE_FUNC_SUBCALL_ARGS, offsetof(Particle, tmp2)); - transferProp(UPDATE_FUNC_SUBCALL_ARGS, offsetof(Particle, ctype)); + if (parts[i].tmp < 0) + parts[i].tmp = 0; // only preventing because negative tmp doesn't save return 0; } //#TPT-Directive ElementHeader Element_VIBR static int graphics(GRAPHICS_FUNC_ARGS) int Element_VIBR::graphics(GRAPHICS_FUNC_ARGS) { - float maxtemp = std::max((float)cpart->tmp, cpart->temp); - int gradient = std::max(cpart->ctype/12.0f, (float)cpart->tmp); - gradient = std::max(gradient, cpart->tmp2); + int gradient = cpart->tmp/10; if (gradient >= 100 || cpart->life) { - *pixel_mode = PMODE_NONE; - *pixel_mode |= FIRE_BLEND; + *colr = (int)(fabs(sin(exp((750.0f-cpart->life)/170)))*200.0f); + *colg = 255; + *colb = (int)(fabs(sin(exp((750.0f-cpart->life)/170)))*200.0f); *firea = 90; - *colr = 146; - *colg = 158; - *colb = 113; *firer = *colr; *fireg = *colg; *fireb = *colb; + *pixel_mode = PMODE_NONE; + *pixel_mode |= FIRE_BLEND; } - else if (gradient >= 94 && gradient < 100) - { - *colr += (int)restrict_flt((gradient-94)*19.7+100,100,218); - *colg += (int)restrict_flt((gradient-94)*17.5+87,87,192); - *colb += (int)restrict_flt((gradient-94)*19.7+100,100,218); - } - else if (gradient >= 63 && gradient < 94) - { - *colr += (int)restrict_flt((gradient-63)*1.58+51,51,100); - *colg += (int)restrict_flt((gradient-63)*1.03+55,55,87); - *colb += (int)restrict_flt((gradient-63)*1.58+51,51,100); - } - else if (gradient > 31 && gradient < 63) + else if (gradient < 100) { - *colr += (int)restrict_flt((gradient-31)*1.59,0,51); - *colg += (int)restrict_flt((gradient-31)*1.72,0,55); - *colb += (int)restrict_flt((gradient-31)*1.59,0,51); + *colr += (int)restrict_flt(gradient*2.0f,0,255); + *colg += (int)restrict_flt(gradient*2.0f,0,175); + *colb += (int)restrict_flt(gradient*2.0f,0,255); + *firea = (int)restrict_flt(gradient*.6f,0,60); + *firer = *colr/2; + *fireg = *colg/2; + *fireb = *colb/2; + *pixel_mode |= FIRE_BLEND; } return 0; } -- cgit v0.9.2-21-gd62e From 828623f9ec4c704fd0507f96fec1638f72ca90c5 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 4 Nov 2012 21:10:27 +0000 Subject: Change freezing point of VIBR lava, and make sure VIBR always absorbs energy particles diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 5b18118..ee4634c 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1994,6 +1994,11 @@ void Simulation::init_can_move() can_move[t][PT_VOID] = 3; can_move[t][PT_EMBR] = 0; can_move[PT_EMBR][t] = 0; + if (elements[t].Properties&TYPE_ENERGY) + { + can_move[t][PT_VIBR] = 1; + can_move[t][PT_BVBR] = 1; + } } for (t=0;t>8].tmp += 20; + kill_part(i); + return 0; + } if (parts[i].type==PT_CNCT && y0 && parts[i].ctype=elements[PT_BMTL].HighTemperature) s = 0; + else if ((parts[i].ctype==PT_VIBR || parts[i].ctype==PT_BVBR) && pt>=273.15f) s = 0; else if (elements[parts[i].ctype].HighTemperatureTransition==PT_LAVA) { if (pt>=elements[parts[i].ctype].HighTemperature) s = 0; } -- cgit v0.9.2-21-gd62e From ca42162e5efd5a81870878be605cf8a803ac1afb Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 4 Nov 2012 16:31:13 -0500 Subject: fix heat release during explosion diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index e6ee082..35ba930 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -144,8 +144,8 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { r = pmap[y+ry][x+rx]; if ((r&0xFF) && (r&0xFF) != parts[i].type) { - parts[r>>8].temp += parts[i].tmp*6; - parts[i].tmp -= parts[i].tmp*2; + parts[r>>8].temp += parts[i].tmp*3; + parts[i].tmp = 0; } } } -- cgit v0.9.2-21-gd62e From 9b8357f822a7c280fa75b5b5ef391a08e9bff5d6 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 4 Nov 2012 16:26:56 -0500 Subject: update version number diff --git a/src/Config.h b/src/Config.h index 8baefd2..e810221 100644 --- a/src/Config.h +++ b/src/Config.h @@ -17,15 +17,15 @@ //VersionInfoStart #ifndef SAVE_VERSION -#define SAVE_VERSION 83 +#define SAVE_VERSION 84 #endif #ifndef MINOR_VERSION -#define MINOR_VERSION 9 +#define MINOR_VERSION 0 #endif #ifndef BUILD_NUM -#define BUILD_NUM 232 +#define BUILD_NUM 246 #endif #ifndef SNAPSHOT_ID -- cgit v0.9.2-21-gd62e From dc41e46c81d5d21e1ef8c459e4f0bd3670cedb49 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 4 Nov 2012 16:24:31 -0500 Subject: fix two red BRAYS not being able to turn off swch from certain angles diff --git a/src/simulation/elements/SWCH.cpp b/src/simulation/elements/SWCH.cpp index fa8e49e..818af27 100644 --- a/src/simulation/elements/SWCH.cpp +++ b/src/simulation/elements/SWCH.cpp @@ -46,6 +46,11 @@ Element_SWCH::Element_SWCH() Graphics = &Element_SWCH::graphics; } +bool isRedBRAY(UPDATE_FUNC_ARGS, int xc, int yc) +{ + return (pmap[yc][xc]&0xFF) == PT_BRAY && parts[pmap[yc][xc]>>8].tmp == 2; +} + //#TPT-Directive ElementHeader Element_SWCH static int update(UPDATE_FUNC_ARGS) int Element_SWCH::update(UPDATE_FUNC_ARGS) { @@ -78,15 +83,13 @@ int Element_SWCH::update(UPDATE_FUNC_ARGS) } } } - //turn off SWCH from two red BRAYS - if (parts[i].life==10 && (!(pmap[y-1][x-1]&0xFF) && ((pmap[y-1][x]&0xFF)==PT_BRAY&&parts[pmap[y-1][x]>>8].tmp==2) && !(pmap[y-1][x+1]&0xFF) && ((pmap[y][x+1]&0xFF)==PT_BRAY&&parts[pmap[y][x+1]>>8].tmp==2))) - { - parts[i].life = 9; - } - //turn on SWCH from two red BRAYS - else if (parts[i].life<=5 && (!(pmap[y-1][x-1]&0xFF) && (((pmap[y-1][x]&0xFF)==PT_BRAY&&parts[pmap[y-1][x]>>8].tmp==2) || ((pmap[y+1][x]&0xFF)==PT_BRAY&&parts[pmap[y+1][x]>>8].tmp==2)) && !(pmap[y-1][x+1]&0xFF) && (((pmap[y][x+1]&0xFF)==PT_BRAY&&parts[pmap[y][x+1]>>8].tmp==2) || ((pmap[y][x-1]&0xFF)==PT_BRAY&&parts[pmap[y][x-1]>>8].tmp==2)))) + //turn SWCH on/off from two red BRAYS. There must be one either above or below, and one either left or right to work, and it can't come from the side, it must be a diagonal beam + if (!(pmap[y-1][x-1]&0xFF) && !(pmap[y-1][x+1]&0xFF) && (isRedBRAY(UPDATE_FUNC_SUBCALL_ARGS, x, y-1) || isRedBRAY(UPDATE_FUNC_SUBCALL_ARGS, x, y+1)) && (isRedBRAY(UPDATE_FUNC_SUBCALL_ARGS, x+1, y) || isRedBRAY(UPDATE_FUNC_SUBCALL_ARGS, x-1, y))) { - parts[i].life = 14; + if (parts[i].life == 10) + parts[i].life = 9; + else if (parts[i].life <= 5) + parts[i].life = 14; } return 0; } -- cgit v0.9.2-21-gd62e From 3cae63c733767394ebb8dbc2ad2481a8a60bca13 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Mon, 5 Nov 2012 14:18:28 +0000 Subject: VIBR: don't dump heat into elements that don't conduct heat, and put any remaining heat into EXOT at the end of the explosion diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index 35ba930..25f7a41 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -142,7 +142,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { if(x+rx>=0 && y+ry>0 && x+rxelements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10)) { parts[r>>8].temp += parts[i].tmp*3; parts[i].tmp = 0; @@ -153,8 +153,10 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { if (parts[i].life == 1) { int random = rand(), index; + float temperature = parts[i].temp + parts[i].tmp*3; sim->create_part(i, x, y, PT_EXOT); parts[i].tmp2 = rand()%1000; + parts[i].temp = temperature; index = sim->create_part(-3,x+((random>>4)&3)-1,y+((random>>6)&3)-1,PT_ELEC); if (index != -1) parts[index].temp = 7000; @@ -166,6 +168,8 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { parts[index].temp = 7000; parts[i].temp=9000; sim->pv[y/CELL][x/CELL] += 50; + + return 1; } } //Neighbor check loop @@ -188,7 +192,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { sim->part_change_type(i,x,y,PT_BVBR); sim->pv[y/CELL][x/CELL] -= 1; } - else if (parts[i].life && (r&0xFF) == parts[i].type && !parts[r>>8].life) + else if (parts[i].life && ((r&0xFF)==PT_VIBR || (r&0xFF)==PT_BVBR) && !parts[r>>8].life) { parts[r>>8].tmp += 10; } -- cgit v0.9.2-21-gd62e From 956fb39124a54f4f421170ef9412be920931d937 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Mon, 5 Nov 2012 14:42:06 +0000 Subject: Oops, didn't see that parts[i].temp at the bottom, ignore the second half of that last commit message diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index 25f7a41..0a7c470 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -153,10 +153,8 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { if (parts[i].life == 1) { int random = rand(), index; - float temperature = parts[i].temp + parts[i].tmp*3; sim->create_part(i, x, y, PT_EXOT); parts[i].tmp2 = rand()%1000; - parts[i].temp = temperature; index = sim->create_part(-3,x+((random>>4)&3)-1,y+((random>>6)&3)-1,PT_ELEC); if (index != -1) parts[index].temp = 7000; -- cgit v0.9.2-21-gd62e From 7da144fbae1dac390ddf3bbcc69a990cf91398ac Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Mon, 5 Nov 2012 14:45:46 +0000 Subject: Fix INVS staying dark blue even when pressure is removed diff --git a/src/simulation/elements/INVIS.cpp b/src/simulation/elements/INVIS.cpp index 03f2d69..54d722d 100644 --- a/src/simulation/elements/INVIS.cpp +++ b/src/simulation/elements/INVIS.cpp @@ -51,6 +51,8 @@ int Element_INVIS::update(UPDATE_FUNC_ARGS) { if (sim->pv[y/CELL][x/CELL]>4.0f || sim->pv[y/CELL][x/CELL]<-4.0f) parts[i].tmp = 1; + else + parts[i].tmp = 0; return 0; } -- cgit v0.9.2-21-gd62e