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 diff --git a/src/graphics/engine/pyro.cpp b/src/graphics/engine/pyro.cpp index 6eedf854..c4d31dd9 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,11 @@ 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 +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_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..d414ce93 100644 --- a/src/graphics/engine/pyro_type.h +++ b/src/graphics/engine/pyro_type.h @@ -58,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 diff --git a/src/object/task/taskterraform.cpp b/src/object/task/taskterraform.cpp index 6718bb7c..9fdfda0d 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 || @@ -378,6 +383,8 @@ bool CTaskTerraform::Terraform() type == OBJECT_TNT || type == OBJECT_NEST || type == OBJECT_BOMB || + type == OBJECT_WINFIRE || + type == OBJECT_BAG || type == OBJECT_PLANT0 || type == OBJECT_PLANT1 || type == OBJECT_PLANT2 || @@ -391,18 +398,6 @@ 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_EGG || type == OBJECT_RUINmobilew1 || type == OBJECT_RUINmobilew2 || @@ -412,54 +407,43 @@ 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()); - 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_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? + 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_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? { 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