From 9a0ca32372f4386c5929dde2ff824c28d8e71d1c Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sat, 27 Oct 2012 00:51:01 +0100 Subject: [PATCH 1/3] Make conversion of PHOT to ELEC using BIZR, and enrichment of DEUT with ELEC, work better --- src/simulation/Simulation.cpp | 18 +++++++++++++++++- src/simulation/elements/ELEC.cpp | 1 - 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 09b0da947..488c7fb87 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2017,6 +2017,7 @@ void Simulation::init_can_move() //whol eats anar can_move[PT_ANAR][PT_WHOL] = 1; can_move[PT_ANAR][PT_NWHL] = 1; + can_move[PT_ELEC][PT_DEUT] = 1; can_move[PT_THDR][PT_THDR] = 2; can_move[PT_EMBR][PT_EMBR] = 2; } @@ -2185,6 +2186,11 @@ int Simulation::try_move(int i, int x, int y, int nx, int ny) if (temp_bin > 25) temp_bin = 25; parts[i].ctype = 0x1F << temp_bin; } + if (((r&0xFF)==PT_BIZR || (r&0xFF)==PT_BIZRG || (r&0xFF)==PT_BIZRS) && parts[i].type==PT_PHOT) + { + part_change_type(i, x, y, PT_ELEC); + parts[i].ctype = 0; + } return 1; } //else e=1 , we are trying to swap the particles, return 0 no swap/move, 1 is still overlap/move, because the swap takes place later @@ -2218,6 +2224,14 @@ int Simulation::try_move(int i, int x, int y, int nx, int ny) kill_part(i); return 0; } + if ((r&0xFF)==PT_DEUT && parts[i].type==PT_ELEC) + { + if(parts[r>>8].life < 6000) + parts[r>>8].life += 1; + parts[r>>8].temp = 0; + kill_part(i); + return 0; + } if (parts[i].type==PT_CNCT && y>8].life==10) &&(t!=PT_FILT||(rt!=PT_BRAY&&rt!=PT_BIZR&&rt!=PT_BIZRG)) - &&(rt!=PT_FILT||(t!=PT_BRAY&&t!=PT_PHOT&&t!=PT_BIZR&&t!=PT_BIZRG))) + &&(rt!=PT_FILT||(t!=PT_BRAY&&t!=PT_PHOT&&t!=PT_BIZR&&t!=PT_BIZRG)) + &&(t!=PT_ELEC||rt!=PT_DEUT) + &&(t!=PT_DEUT||rt!=PT_ELEC)) { surround_hconduct[j] = r>>8; #ifdef REALISTIC diff --git a/src/simulation/elements/ELEC.cpp b/src/simulation/elements/ELEC.cpp index e9d1f5af5..c602da889 100644 --- a/src/simulation/elements/ELEC.cpp +++ b/src/simulation/elements/ELEC.cpp @@ -123,7 +123,6 @@ int Element_ELEC::update(UPDATE_FUNC_ARGS) if(parts[r>>8].life < 6000) parts[r>>8].life += 1; parts[r>>8].temp = 0; - parts[i].temp = 0; sim->kill_part(i); return 1; } From caf262ed60f6c7d7dfc1fa41c1c0a771484792ab Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sat, 27 Oct 2012 00:52:10 +0100 Subject: [PATCH 2/3] Decrease absorption chance for SPNG, to make release of water from saturated SPNG look a bit less strange --- src/simulation/elements/SPNG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulation/elements/SPNG.cpp b/src/simulation/elements/SPNG.cpp index 37f5a08bd..95dd12f62 100644 --- a/src/simulation/elements/SPNG.cpp +++ b/src/simulation/elements/SPNG.cpp @@ -53,7 +53,7 @@ int Element_SPNG::update(UPDATE_FUNC_ARGS) int limit = 50; if (parts[i].lifepv[y/CELL][x/CELL]<=3&&sim->pv[y/CELL][x/CELL]>=-3&&parts[i].temp<=374.0f) { - int absorbChanceDenom = parts[i].life*1000/limit + 500; + int absorbChanceDenom = parts[i].life*10000/limit + 500; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) if (x+rx>=0 && y+ry>0 && x+rx Date: Sun, 28 Oct 2012 21:11:18 -0400 Subject: [PATCH 3/3] VIBR fixes --- src/simulation/elements/VIBR.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp index 370c69f2f..02c97fa0b 100644 --- a/src/simulation/elements/VIBR.cpp +++ b/src/simulation/elements/VIBR.cpp @@ -161,11 +161,13 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) { sim->pv[y/CELL][x/CELL]=200; } //Neighbor check loop - for (rx=-2; rx<3; rx++) - for (ry=-2; ry<3; ry++) + for (rx=-3; rx<4; rx++) + for (ry=-3; ry<4; ry++) if (x+rx>=0 && y+ry>0 && x+rxphotons[y+ry][x+rx]; if (!r) continue; //Melts into EXOT @@ -229,4 +231,4 @@ int Element_VIBR::graphics(GRAPHICS_FUNC_ARGS) return 0; } -Element_VIBR::~Element_VIBR() {} \ No newline at end of file +Element_VIBR::~Element_VIBR() {}