From bef6e9ecebe723e40ef67fb5b3ad41e5b2d92c3e Mon Sep 17 00:00:00 2001 From: DavivaD Date: Fri, 21 Jul 2017 20:36:31 +0200 Subject: [PATCH 1/5] Make Thumper Squash transportable/small objects. --- src/object/task/taskterraform.cpp | 41 ++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp index f71b9854..06dc72c2 100644 --- a/src/object/task/taskterraform.cpp +++ b/src/object/task/taskterraform.cpp @@ -363,12 +363,47 @@ bool CTaskTerraform::Terraform() type = pObj->GetType(); if ( type == OBJECT_NULL ) continue; - if ( type == OBJECT_TEEN34 ) // stone? + if ( type == OBJECT_TEEN34 || + type == OBJECT_POWER || + type == OBJECT_ATOMIC || + type == OBJECT_STONE || + type == OBJECT_URANIUM || + type == OBJECT_METAL || + type == OBJECT_BULLET || + type == OBJECT_BBOX || + type == OBJECT_KEYa || + type == OBJECT_KEYb || + type == OBJECT_KEYc || + type == OBJECT_KEYd || + type == OBJECT_TNT || + type == OBJECT_NEST || + type == OBJECT_BOMB || + type == OBJECT_RUINmobilew1 || + type == OBJECT_RUINmobilew2 || + type == OBJECT_RUINmobilet1 || + type == OBJECT_RUINmobilet2 || + type == OBJECT_RUINdoor || + type == OBJECT_RUINsupport || + type == OBJECT_RUINradar ) // small/transportable objects? { dist = Math::Distance(m_terraPos, pObj->GetPosition()); if ( dist > 20.0f ) continue; - - m_engine->GetPyroManager()->Create(Gfx::PT_FRAGT, pObj); + + if (type == OBJECT_BULLET || + type == OBJECT_NEST ) + { + m_engine->GetPyroManager()->Create(Gfx::PT_FRAGO, pObj); + } + else if (type == OBJECT_TNT || + type == OBJECT_BOMB) + { + m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOT, pObj); + dynamic_cast(m_object)->DamageObject(DamageType::Explosive, 0.9f); + } + else + { + m_engine->GetPyroManager()->Create(Gfx::PT_FRAGT, pObj); + } } else { From b5e0f9966f18935bf16ae1705f0e17e4f6734eb8 Mon Sep 17 00:00:00 2001 From: DavivaD Date: Fri, 21 Jul 2017 20:37:18 +0200 Subject: [PATCH 2/5] Make Recycler Recycle small Building Ruins. --- src/object/task/taskrecover.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/object/task/taskrecover.cpp b/src/object/task/taskrecover.cpp index 834811a7..ab5bc52d 100644 --- a/src/object/task/taskrecover.cpp +++ b/src/object/task/taskrecover.cpp @@ -376,5 +376,5 @@ bool CTaskRecover::Abort() CObject* CTaskRecover::SearchRuin() { - return CObjectManager::GetInstancePointer()->FindNearest(nullptr, m_recoverPos, {OBJECT_RUINmobilew1, OBJECT_RUINmobilew2, OBJECT_RUINmobilet1, OBJECT_RUINmobilet2, OBJECT_RUINmobiler1, OBJECT_RUINmobiler2}, 40.0f/g_unit); + return CObjectManager::GetInstancePointer()->FindNearest(nullptr, m_recoverPos, {OBJECT_RUINmobilew1, OBJECT_RUINmobilew2, OBJECT_RUINmobilet1, OBJECT_RUINmobilet2, OBJECT_RUINmobiler1, OBJECT_RUINmobiler2, OBJECT_RUINdoor, OBJECT_RUINsupport, OBJECT_RUINradar}, 40.0f/g_unit); } From a4482f1a7cb493646e2ba78def500a42156fd3a1 Mon Sep 17 00:00:00 2001 From: DavivaD Date: Mon, 24 Jul 2017 23:20:21 +0200 Subject: [PATCH 3/5] Decrease radius of squashing items. --- src/object/task/taskterraform.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp index 06dc72c2..380d26f6 100644 --- a/src/object/task/taskterraform.cpp +++ b/src/object/task/taskterraform.cpp @@ -363,7 +363,7 @@ bool CTaskTerraform::Terraform() type = pObj->GetType(); if ( type == OBJECT_NULL ) continue; - if ( type == OBJECT_TEEN34 || + if ( type == OBJECT_TEEN34 || type == OBJECT_POWER || type == OBJECT_ATOMIC || type == OBJECT_STONE || @@ -387,8 +387,8 @@ bool CTaskTerraform::Terraform() type == OBJECT_RUINradar ) // small/transportable objects? { dist = Math::Distance(m_terraPos, pObj->GetPosition()); - if ( dist > 20.0f ) continue; - + if ( dist > 5.0f ) continue; + if (type == OBJECT_BULLET || type == OBJECT_NEST ) { From 959854ec599c21d6ca339918c86a5d66280e4aef Mon Sep 17 00:00:00 2001 From: DavivaD Date: Wed, 26 Jul 2017 23:05:53 +0200 Subject: [PATCH 4/5] 'Make Thumper Great Again' --- src/object/task/taskterraform.cpp | 85 +++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp index 380d26f6..a7ea3e40 100644 --- a/src/object/task/taskterraform.cpp +++ b/src/object/task/taskterraform.cpp @@ -378,30 +378,97 @@ bool CTaskTerraform::Terraform() type == OBJECT_TNT || type == OBJECT_NEST || type == OBJECT_BOMB || + type == OBJECT_PLANT0 || + type == OBJECT_PLANT1 || + type == OBJECT_PLANT2 || + type == OBJECT_PLANT3 || + type == OBJECT_PLANT4 || + type == OBJECT_PLANT5 || + type == OBJECT_PLANT6 || + type == OBJECT_PLANT7 || + type == OBJECT_PLANT15 || + type == OBJECT_PLANT16 || + type == OBJECT_PLANT17 || + type == OBJECT_PLANT18 || + type == OBJECT_PLANT19 || + type == OBJECT_MUSHROOM1 || + type == OBJECT_MUSHROOM2 || + type == OBJECT_FACTORY || + type == OBJECT_STATION || + type == OBJECT_CONVERT || + type == OBJECT_REPAIR || + type == OBJECT_DESTROYER || + type == OBJECT_ENERGY || + type == OBJECT_LABO || + type == OBJECT_PARA || + type == OBJECT_START || + type == OBJECT_END || + type == OBJECT_EGG || type == OBJECT_RUINmobilew1 || type == OBJECT_RUINmobilew2 || type == OBJECT_RUINmobilet1 || type == OBJECT_RUINmobilet2 || type == OBJECT_RUINdoor || type == OBJECT_RUINsupport || - type == OBJECT_RUINradar ) // small/transportable objects? + type == OBJECT_RUINradar || + type == OBJECT_BARRIER0 || + type == OBJECT_APOLLO4 ) // almost everything? { dist = Math::Distance(m_terraPos, pObj->GetPosition()); - if ( dist > 5.0f ) continue; if (type == OBJECT_BULLET || - type == OBJECT_NEST ) + type == OBJECT_NEST || + type == OBJECT_EGG) // Alien Organic? { + if ( dist > 5.0f ) continue; m_engine->GetPyroManager()->Create(Gfx::PT_FRAGO, pObj); } else if (type == OBJECT_TNT || - type == OBJECT_BOMB) + type == OBJECT_BOMB) // Explosives? { + if ( dist > 5.0f ) continue; m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOT, pObj); dynamic_cast(m_object)->DamageObject(DamageType::Explosive, 0.9f); } - else + else if (type == OBJECT_PLANT0 || + type == OBJECT_PLANT1 || + type == OBJECT_PLANT2 || + type == OBJECT_PLANT3 || + type == OBJECT_PLANT4 || + type == OBJECT_PLANT5 || + type == OBJECT_PLANT6 || + type == OBJECT_PLANT7 || + type == OBJECT_PLANT15 || + type == OBJECT_PLANT16 || + type == OBJECT_PLANT17 || + type == OBJECT_PLANT18 || + type == OBJECT_PLANT19 || + type == OBJECT_MUSHROOM1 || + type == OBJECT_MUSHROOM2) // Plants? { + if ( dist > 7.5f ) continue; + m_engine->GetPyroManager()->Create(Gfx::PT_EGG, pObj); + } + else if (type == OBJECT_FACTORY || + type == OBJECT_STATION || + type == OBJECT_CONVERT || + type == OBJECT_REPAIR || + type == OBJECT_DESTROYER || + type == OBJECT_ENERGY || + type == OBJECT_LABO || + type == OBJECT_PARA) // Buildings? + { + if ( dist > 15.0f ) continue; + dynamic_cast(pObj)->DamageObject(DamageType::Explosive, 0.2f); + } + else if (type == OBJECT_STATION) // PowerStation? + { + if ( dist > 15.0f ) continue; + m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOT, pObj); + } + else // Other? + { + if ( dist > 5.0f ) continue; m_engine->GetPyroManager()->Create(Gfx::PT_FRAGT, pObj); } } @@ -423,6 +490,14 @@ bool CTaskTerraform::Terraform() if (type == OBJECT_SPIDER) actionType = MSS_BACK1; motion->SetAction(actionType, 0.8f+Math::Rand()*0.3f); dynamic_cast(pObj)->SetFixed(true); // not moving + + if ( dist > 5.0f ) continue; + m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOO, pObj); + } + else if ( type == OBJECT_BEE || type == OBJECT_WORM ) + { + if ( dist > 5.0f ) continue; + m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOO, pObj); } } } From ee35d35db3e6ffafa88041414a7964a8f6601d5b Mon Sep 17 00:00:00 2001 From: DavivaD Date: Thu, 27 Jul 2017 02:02:46 +0200 Subject: [PATCH 5/5] Correct Small Mistake --- src/object/task/taskterraform.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp index a7ea3e40..f46c68df 100644 --- a/src/object/task/taskterraform.cpp +++ b/src/object/task/taskterraform.cpp @@ -461,11 +461,6 @@ bool CTaskTerraform::Terraform() if ( dist > 15.0f ) continue; dynamic_cast(pObj)->DamageObject(DamageType::Explosive, 0.2f); } - else if (type == OBJECT_STATION) // PowerStation? - { - if ( dist > 15.0f ) continue; - m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOT, pObj); - } else // Other? { if ( dist > 5.0f ) continue;