diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 3ebd72396..71e569eec 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -3092,6 +3092,12 @@ int Simulation::create_part(int p, int x, int y, int tv) case PT_TSNS: parts[i].tmp2 = 2; break; + case PT_ACEL: + parts[i].ctype = 10; + break; + case PT_DCEL: + parts[i].ctype = 9; + break; default: if (t==PT_FIGH) { diff --git a/src/simulation/elements/ACEL.cpp b/src/simulation/elements/ACEL.cpp index 8dfad7932..81eeaf345 100644 --- a/src/simulation/elements/ACEL.cpp +++ b/src/simulation/elements/ACEL.cpp @@ -62,8 +62,17 @@ int Element_ACEL::update(UPDATE_FUNC_ARGS) continue; if(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) { - parts[r>>8].vx *= 1.1f; - parts[r>>8].vy *= 1.1f; + if (parts[i].ctype) + { + int change = parts[i].ctype > 1000 ? 1000 : parts[i].ctype < 0 ? 0 : parts[i].ctype; + parts[r>>8].vx *= 1+change/100.0f; + parts[r>>8].vy *= 1+change/100.0f; + } + else + { + parts[r>>8].vx *= 1.1f; + parts[r>>8].vy *= 1.1f; + } parts[i].tmp = 1; } } diff --git a/src/simulation/elements/dcel.cpp b/src/simulation/elements/dcel.cpp index 07f930b20..294c84008 100644 --- a/src/simulation/elements/dcel.cpp +++ b/src/simulation/elements/dcel.cpp @@ -62,8 +62,17 @@ int Element_DCEL::update(UPDATE_FUNC_ARGS) continue; if(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) { - parts[r>>8].vx *= 0.9f; - parts[r>>8].vy *= 0.9f; + if (parts[i].ctype) + { + int change = parts[i].ctype > 100 ? 100 : parts[i].ctype < 0 ? 0 : parts[i].ctype; + parts[r>>8].vx *= 1-change/100.0f; + parts[r>>8].vy *= 1-change/100.0f; + } + else + { + parts[r>>8].vx *= 0.9f; + parts[r>>8].vy *= 0.9f; + } parts[i].tmp = 1; } }