From b8b2d32bc15d9fb363e73172a39b498b16fe20a2 Mon Sep 17 00:00:00 2001 From: DavivaD Date: Mon, 22 Jul 2019 01:15:11 +0200 Subject: [PATCH 1/5] Thumper Patch --- src/graphics/engine/pyro.cpp | 26 ++++++++++--- src/graphics/engine/pyro_type.h | 1 + src/object/task/taskterraform.cpp | 65 +++++++++++++++++-------------- 3 files changed, 56 insertions(+), 36 deletions(-) diff --git a/src/graphics/engine/pyro.cpp b/src/graphics/engine/pyro.cpp index 6eedf854..5ab995cc 100644 --- a/src/graphics/engine/pyro.cpp +++ b/src/graphics/engine/pyro.cpp @@ -223,6 +223,10 @@ bool CPyro::Create(PyroType type, CObject* obj, float force) { m_sound->Play(SOUND_EXPLOi, m_pos); } + if ( type == PT_FRAGV ) + { + m_sound->Play(SOUND_BOUMv, m_pos); + } if ( type == PT_BURNT || type == PT_BURNO ) { @@ -265,7 +269,8 @@ bool CPyro::Create(PyroType type, CObject* obj, float force) if ( m_type == PT_FRAGT || m_type == PT_FRAGO || - m_type == PT_FRAGW ) + m_type == PT_FRAGW || + m_type == PT_FRAGV ) { m_engine->DeleteShadowSpot(m_object->GetObjectRank(0)); } @@ -391,9 +396,10 @@ bool CPyro::Create(PyroType type, CObject* obj, float force) m_engine->DeleteShadowSpot(m_object->GetObjectRank(0)); } - if ( m_type != PT_EGG && - m_type != PT_WIN && - m_type != PT_LOST ) + if ( m_type != PT_FRAGV && + m_type != PT_EGG && + m_type != PT_WIN && + m_type != PT_LOST ) { float h = 40.0f; if ( m_type == PT_FRAGO || @@ -460,6 +466,7 @@ bool CPyro::Create(PyroType type, CObject* obj, float force) if ( m_type == PT_FRAGT || m_type == PT_FRAGO || m_type == PT_FRAGW || + m_type == PT_FRAGV || m_type == PT_SPIDER || m_type == PT_EGG || (m_type == PT_EXPLOT && oType == OBJECT_MOBILEtg) || @@ -1169,6 +1176,7 @@ Error CPyro::IsEnded() if ( m_type == PT_FRAGT || m_type == PT_FRAGO || m_type == PT_FRAGW || + m_type == PT_FRAGV || m_type == PT_SPIDER || m_type == PT_EGG ) { @@ -1416,7 +1424,12 @@ void CPyro::CreateTriangle(CObject* obj, ObjectType oType, int part) float percent = 0.10f; if (total < 50) percent = 0.25f; if (total < 20) percent = 0.50f; - if (m_type == PT_EGG) percent = 0.30f; + + if (m_type == PT_FRAGV || + m_type == PT_EGG) + { + percent = 0.30f; + } if (oType == OBJECT_POWER || oType == OBJECT_ATOMIC || @@ -1507,7 +1520,8 @@ void CPyro::CreateTriangle(CObject* obj, ObjectType oType, int part) Math::Matrix* mat = obj->GetWorldMatrix(part); Math::Vector pos = Math::Transform(*mat, offset); - if ( m_type == PT_EGG ) + if ( m_type == PT_FRAGV || + m_type == PT_EGG ) { speed.x = (Math::Rand()-0.5f)*10.0f; speed.z = (Math::Rand()-0.5f)*10.0f; diff --git a/src/graphics/engine/pyro_type.h b/src/graphics/engine/pyro_type.h index ad2daffd..9693cbde 100644 --- a/src/graphics/engine/pyro_type.h +++ b/src/graphics/engine/pyro_type.h @@ -37,6 +37,7 @@ enum PyroType PT_FRAGT = 1, //! < fragmentation of technical object PT_FRAGO = 2, //! < fragmentation of organic object PT_FRAGW = 4, //! < fragmentation of object under water + PT_FRAGV = 27, //! < fragmentation of plant object PT_EXPLOT = 5, //! < explosion of technical object PT_EXPLOO = 6, //! < explosion of organic object PT_EXPLOW = 8, //! < explosion of object under water diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp index 6718bb7c..1883ea30 100644 --- a/src/object/task/taskterraform.cpp +++ b/src/object/task/taskterraform.cpp @@ -363,7 +363,12 @@ bool CTaskTerraform::Terraform() type = pObj->GetType(); if ( type == OBJECT_NULL ) continue; - if ( type == OBJECT_TEEN34 || + if ( type == OBJECT_TEEN0 || + type == OBJECT_TEEN1 || + type == OBJECT_TEEN2 || + type == OBJECT_TEEN4 || + type == OBJECT_TEEN5 || + type == OBJECT_TEEN34 || type == OBJECT_POWER || type == OBJECT_ATOMIC || type == OBJECT_STONE || @@ -371,6 +376,7 @@ bool CTaskTerraform::Terraform() type == OBJECT_METAL || type == OBJECT_BULLET || type == OBJECT_BBOX || + type == OBJECT_WAYPOINT || type == OBJECT_KEYa || type == OBJECT_KEYb || type == OBJECT_KEYc || @@ -378,6 +384,15 @@ bool CTaskTerraform::Terraform() type == OBJECT_TNT || type == OBJECT_NEST || type == OBJECT_BOMB || + type == OBJECT_MARKPOWER || + type == OBJECT_MARKSTONE || + type == OBJECT_MARKURANIUM || + type == OBJECT_MARKKEYa || + type == OBJECT_MARKKEYb || + type == OBJECT_MARKKEYc || + type == OBJECT_MARKKEYd || + type == OBJECT_WINFIRE || + type == OBJECT_BAG || type == OBJECT_PLANT0 || type == OBJECT_PLANT1 || type == OBJECT_PLANT2 || @@ -391,18 +406,7 @@ bool CTaskTerraform::Terraform() 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_QUARTZ0 || type == OBJECT_EGG || type == OBJECT_RUINmobilew1 || type == OBJECT_RUINmobilew2 || @@ -412,7 +416,10 @@ bool CTaskTerraform::Terraform() type == OBJECT_RUINsupport || type == OBJECT_RUINradar || type == OBJECT_BARRIER0 || - type == OBJECT_APOLLO4 ) // almost everything? + type == OBJECT_BARRIER1 || + type == OBJECT_BARRIER2 || + type == OBJECT_BARRIER3 || + type == OBJECT_APOLLO4 ) // everything what fits? { dist = Math::Distance(m_terraPos, pObj->GetPosition()); @@ -430,6 +437,18 @@ bool CTaskTerraform::Terraform() m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOT, pObj); dynamic_cast(m_object)->DamageObject(DamageType::Explosive, 0.9f); } + else if (type == OBJECT_WAYPOINT || + type == OBJECT_MARKPOWER || + type == OBJECT_MARKSTONE || + type == OBJECT_MARKURANIUM || + type == OBJECT_MARKKEYa || + type == OBJECT_MARKKEYb || + type == OBJECT_MARKKEYc || + type == OBJECT_MARKKEYd) // Marks? + { + if ( dist > 5.0f ) continue; + CObjectManager::GetInstancePointer()->DeleteObject(pObj); + } else if (type == OBJECT_PLANT0 || type == OBJECT_PLANT1 || type == OBJECT_PLANT2 || @@ -442,24 +461,10 @@ bool CTaskTerraform::Terraform() type == OBJECT_PLANT16 || type == OBJECT_PLANT17 || type == OBJECT_PLANT18 || - type == OBJECT_PLANT19 || - type == OBJECT_MUSHROOM1 || - type == OBJECT_MUSHROOM2) // Plants? + type == OBJECT_PLANT19) // 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); + m_engine->GetPyroManager()->Create(Gfx::PT_FRAGV, pObj); } else // Other? { From 9c2ea5f488883d16fc433f92f86f2053a017858c Mon Sep 17 00:00:00 2001 From: DavivaD Date: Mon, 22 Jul 2019 17:04:15 +0200 Subject: [PATCH 2/5] Undo some changes + space fixes --- src/graphics/engine/pyro.cpp | 6 ++-- src/graphics/engine/pyro_type.h | 6 ++-- src/object/task/taskterraform.cpp | 57 ++++++++++--------------------- 3 files changed, 23 insertions(+), 46 deletions(-) diff --git a/src/graphics/engine/pyro.cpp b/src/graphics/engine/pyro.cpp index 5ab995cc..c4d31dd9 100644 --- a/src/graphics/engine/pyro.cpp +++ b/src/graphics/engine/pyro.cpp @@ -1425,8 +1425,7 @@ void CPyro::CreateTriangle(CObject* obj, ObjectType oType, int part) if (total < 50) percent = 0.25f; if (total < 20) percent = 0.50f; - if (m_type == PT_FRAGV || - m_type == PT_EGG) + if ( m_type == PT_FRAGV || m_type == PT_EGG ) { percent = 0.30f; } @@ -1520,8 +1519,7 @@ void CPyro::CreateTriangle(CObject* obj, ObjectType oType, int part) Math::Matrix* mat = obj->GetWorldMatrix(part); Math::Vector pos = Math::Transform(*mat, offset); - if ( m_type == PT_FRAGV || - m_type == PT_EGG ) + if ( m_type == PT_FRAGV || m_type == PT_EGG ) { speed.x = (Math::Rand()-0.5f)*10.0f; speed.z = (Math::Rand()-0.5f)*10.0f; diff --git a/src/graphics/engine/pyro_type.h b/src/graphics/engine/pyro_type.h index 9693cbde..a4fc4158 100644 --- a/src/graphics/engine/pyro_type.h +++ b/src/graphics/engine/pyro_type.h @@ -37,9 +37,9 @@ enum PyroType PT_FRAGT = 1, //! < fragmentation of technical object PT_FRAGO = 2, //! < fragmentation of organic object PT_FRAGW = 4, //! < fragmentation of object under water - PT_FRAGV = 27, //! < fragmentation of plant object - PT_EXPLOT = 5, //! < explosion of technical object - PT_EXPLOO = 6, //! < explosion of organic object + PT_FRAGV = 5, //! < fragmentation of plant object + PT_EXPLOT = 6, //! < explosion of technical object + PT_EXPLOO = 7, //! < explosion of organic object PT_EXPLOW = 8, //! < explosion of object under water PT_SHOTT = 9, //! < hit technical object PT_SHOTH = 10, //! < hit human diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp index 1883ea30..9fdfda0d 100644 --- a/src/object/task/taskterraform.cpp +++ b/src/object/task/taskterraform.cpp @@ -376,7 +376,6 @@ bool CTaskTerraform::Terraform() type == OBJECT_METAL || type == OBJECT_BULLET || type == OBJECT_BBOX || - type == OBJECT_WAYPOINT || type == OBJECT_KEYa || type == OBJECT_KEYb || type == OBJECT_KEYc || @@ -384,13 +383,6 @@ bool CTaskTerraform::Terraform() type == OBJECT_TNT || type == OBJECT_NEST || type == OBJECT_BOMB || - type == OBJECT_MARKPOWER || - type == OBJECT_MARKSTONE || - type == OBJECT_MARKURANIUM || - type == OBJECT_MARKKEYa || - type == OBJECT_MARKKEYb || - type == OBJECT_MARKKEYc || - type == OBJECT_MARKKEYd || type == OBJECT_WINFIRE || type == OBJECT_BAG || type == OBJECT_PLANT0 || @@ -406,7 +398,6 @@ bool CTaskTerraform::Terraform() type == OBJECT_PLANT17 || type == OBJECT_PLANT18 || type == OBJECT_PLANT19 || - type == OBJECT_QUARTZ0 || type == OBJECT_EGG || type == OBJECT_RUINmobilew1 || type == OBJECT_RUINmobilew2 || @@ -423,45 +414,33 @@ bool CTaskTerraform::Terraform() { dist = Math::Distance(m_terraPos, pObj->GetPosition()); - if (type == OBJECT_BULLET || - type == OBJECT_NEST || - type == OBJECT_EGG) // Alien Organic? + if ( type == OBJECT_BULLET || + 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) // Explosives? + else if ( type == OBJECT_TNT || + 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 if (type == OBJECT_WAYPOINT || - type == OBJECT_MARKPOWER || - type == OBJECT_MARKSTONE || - type == OBJECT_MARKURANIUM || - type == OBJECT_MARKKEYa || - type == OBJECT_MARKKEYb || - type == OBJECT_MARKKEYc || - type == OBJECT_MARKKEYd) // Marks? - { - if ( dist > 5.0f ) continue; - CObjectManager::GetInstancePointer()->DeleteObject(pObj); - } - 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) // Plants? + 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 ) // Plants? { if ( dist > 7.5f ) continue; m_engine->GetPyroManager()->Create(Gfx::PT_FRAGV, pObj); From 190e04fdd70e07f705a6e98c01ea29b00fe44801 Mon Sep 17 00:00:00 2001 From: DavivaD Date: Fri, 26 Jul 2019 17:33:04 +0200 Subject: [PATCH 3/5] Move PT_FRAGV to the end of the pyro_type.h list + Undo reordering --- src/graphics/engine/pyro_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics/engine/pyro_type.h b/src/graphics/engine/pyro_type.h index a4fc4158..d414ce93 100644 --- a/src/graphics/engine/pyro_type.h +++ b/src/graphics/engine/pyro_type.h @@ -37,9 +37,8 @@ enum PyroType PT_FRAGT = 1, //! < fragmentation of technical object PT_FRAGO = 2, //! < fragmentation of organic object PT_FRAGW = 4, //! < fragmentation of object under water - PT_FRAGV = 5, //! < fragmentation of plant object - PT_EXPLOT = 6, //! < explosion of technical object - PT_EXPLOO = 7, //! < explosion of organic object + PT_EXPLOT = 5, //! < explosion of technical object + PT_EXPLOO = 6, //! < explosion of organic object PT_EXPLOW = 8, //! < explosion of object under water PT_SHOTT = 9, //! < hit technical object PT_SHOTH = 10, //! < hit human @@ -59,6 +58,7 @@ enum PyroType PT_DEADG = 24, //! < shooting death PT_DEADW = 25, //! < drowning death PT_FINDING = 26, //! < object discovered + PT_FRAGV = 27, //! < fragmentation of plant object }; } // namespace Gfx From 11e67cc61bae2b9f8a0a8e0b629a4bba55f5d663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zaj=C4=85czkowski?= Date: Wed, 6 May 2020 18:52:37 +0200 Subject: [PATCH 4/5] Add info about Fedora package to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c7d4a9a5..353dbbf5 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ On some Linux distributions there are also distribution packages available: * Debian Sid (unstable): http://packages.debian.org/sid/colobot * Arch Linux (AUR): https://aur.archlinux.org/packages/colobot-gold * openSUSE: http://software.opensuse.org/download.html?project=games&package=colobot + * Fedora: https://src.fedoraproject.org/rpms/colobot ## Compiling and running the game From f3ae4b420932a44a8b06733e8caa53e88bad873a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 14 May 2020 10:35:01 +0200 Subject: [PATCH 5/5] Fix missing include Add missing include for std::numeric_limits. This fixes build failure after boost stopped implicitly including it for us. --- src/script/script.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script/script.h b/src/script/script.h index bc64dc23..dd4e02ff 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -27,6 +27,7 @@ #include "CBot/CBot.h" #include +#include #include #include