Merge branch 'dev' of https://github.com/colobot/colobot into dev
commit
9a14c8c7e9
|
@ -30,6 +30,7 @@ On some Linux distributions there are also distribution packages available:
|
||||||
* Debian Sid (unstable): http://packages.debian.org/sid/colobot
|
* Debian Sid (unstable): http://packages.debian.org/sid/colobot
|
||||||
* Arch Linux (AUR): https://aur.archlinux.org/packages/colobot-gold
|
* Arch Linux (AUR): https://aur.archlinux.org/packages/colobot-gold
|
||||||
* openSUSE: http://software.opensuse.org/download.html?project=games&package=colobot
|
* openSUSE: http://software.opensuse.org/download.html?project=games&package=colobot
|
||||||
|
* Fedora: https://src.fedoraproject.org/rpms/colobot
|
||||||
|
|
||||||
|
|
||||||
## Compiling and running the game
|
## Compiling and running the game
|
||||||
|
|
|
@ -223,6 +223,10 @@ bool CPyro::Create(PyroType type, CObject* obj, float force)
|
||||||
{
|
{
|
||||||
m_sound->Play(SOUND_EXPLOi, m_pos);
|
m_sound->Play(SOUND_EXPLOi, m_pos);
|
||||||
}
|
}
|
||||||
|
if ( type == PT_FRAGV )
|
||||||
|
{
|
||||||
|
m_sound->Play(SOUND_BOUMv, m_pos);
|
||||||
|
}
|
||||||
if ( type == PT_BURNT ||
|
if ( type == PT_BURNT ||
|
||||||
type == PT_BURNO )
|
type == PT_BURNO )
|
||||||
{
|
{
|
||||||
|
@ -265,7 +269,8 @@ bool CPyro::Create(PyroType type, CObject* obj, float force)
|
||||||
|
|
||||||
if ( m_type == PT_FRAGT ||
|
if ( m_type == PT_FRAGT ||
|
||||||
m_type == PT_FRAGO ||
|
m_type == PT_FRAGO ||
|
||||||
m_type == PT_FRAGW )
|
m_type == PT_FRAGW ||
|
||||||
|
m_type == PT_FRAGV )
|
||||||
{
|
{
|
||||||
m_engine->DeleteShadowSpot(m_object->GetObjectRank(0));
|
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));
|
m_engine->DeleteShadowSpot(m_object->GetObjectRank(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_type != PT_EGG &&
|
if ( m_type != PT_FRAGV &&
|
||||||
m_type != PT_WIN &&
|
m_type != PT_EGG &&
|
||||||
m_type != PT_LOST )
|
m_type != PT_WIN &&
|
||||||
|
m_type != PT_LOST )
|
||||||
{
|
{
|
||||||
float h = 40.0f;
|
float h = 40.0f;
|
||||||
if ( m_type == PT_FRAGO ||
|
if ( m_type == PT_FRAGO ||
|
||||||
|
@ -460,6 +466,7 @@ bool CPyro::Create(PyroType type, CObject* obj, float force)
|
||||||
if ( m_type == PT_FRAGT ||
|
if ( m_type == PT_FRAGT ||
|
||||||
m_type == PT_FRAGO ||
|
m_type == PT_FRAGO ||
|
||||||
m_type == PT_FRAGW ||
|
m_type == PT_FRAGW ||
|
||||||
|
m_type == PT_FRAGV ||
|
||||||
m_type == PT_SPIDER ||
|
m_type == PT_SPIDER ||
|
||||||
m_type == PT_EGG ||
|
m_type == PT_EGG ||
|
||||||
(m_type == PT_EXPLOT && oType == OBJECT_MOBILEtg) ||
|
(m_type == PT_EXPLOT && oType == OBJECT_MOBILEtg) ||
|
||||||
|
@ -1169,6 +1176,7 @@ Error CPyro::IsEnded()
|
||||||
if ( m_type == PT_FRAGT ||
|
if ( m_type == PT_FRAGT ||
|
||||||
m_type == PT_FRAGO ||
|
m_type == PT_FRAGO ||
|
||||||
m_type == PT_FRAGW ||
|
m_type == PT_FRAGW ||
|
||||||
|
m_type == PT_FRAGV ||
|
||||||
m_type == PT_SPIDER ||
|
m_type == PT_SPIDER ||
|
||||||
m_type == PT_EGG )
|
m_type == PT_EGG )
|
||||||
{
|
{
|
||||||
|
@ -1416,7 +1424,11 @@ void CPyro::CreateTriangle(CObject* obj, ObjectType oType, int part)
|
||||||
float percent = 0.10f;
|
float percent = 0.10f;
|
||||||
if (total < 50) percent = 0.25f;
|
if (total < 50) percent = 0.25f;
|
||||||
if (total < 20) percent = 0.50f;
|
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 ||
|
if (oType == OBJECT_POWER ||
|
||||||
oType == OBJECT_ATOMIC ||
|
oType == OBJECT_ATOMIC ||
|
||||||
|
@ -1507,7 +1519,7 @@ void CPyro::CreateTriangle(CObject* obj, ObjectType oType, int part)
|
||||||
|
|
||||||
Math::Matrix* mat = obj->GetWorldMatrix(part);
|
Math::Matrix* mat = obj->GetWorldMatrix(part);
|
||||||
Math::Vector pos = Math::Transform(*mat, offset);
|
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.x = (Math::Rand()-0.5f)*10.0f;
|
||||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||||
|
|
|
@ -58,6 +58,7 @@ enum PyroType
|
||||||
PT_DEADG = 24, //! < shooting death
|
PT_DEADG = 24, //! < shooting death
|
||||||
PT_DEADW = 25, //! < drowning death
|
PT_DEADW = 25, //! < drowning death
|
||||||
PT_FINDING = 26, //! < object discovered
|
PT_FINDING = 26, //! < object discovered
|
||||||
|
PT_FRAGV = 27, //! < fragmentation of plant object
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Gfx
|
} // namespace Gfx
|
||||||
|
|
|
@ -363,7 +363,12 @@ bool CTaskTerraform::Terraform()
|
||||||
type = pObj->GetType();
|
type = pObj->GetType();
|
||||||
if ( type == OBJECT_NULL ) continue;
|
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_POWER ||
|
||||||
type == OBJECT_ATOMIC ||
|
type == OBJECT_ATOMIC ||
|
||||||
type == OBJECT_STONE ||
|
type == OBJECT_STONE ||
|
||||||
|
@ -378,6 +383,8 @@ bool CTaskTerraform::Terraform()
|
||||||
type == OBJECT_TNT ||
|
type == OBJECT_TNT ||
|
||||||
type == OBJECT_NEST ||
|
type == OBJECT_NEST ||
|
||||||
type == OBJECT_BOMB ||
|
type == OBJECT_BOMB ||
|
||||||
|
type == OBJECT_WINFIRE ||
|
||||||
|
type == OBJECT_BAG ||
|
||||||
type == OBJECT_PLANT0 ||
|
type == OBJECT_PLANT0 ||
|
||||||
type == OBJECT_PLANT1 ||
|
type == OBJECT_PLANT1 ||
|
||||||
type == OBJECT_PLANT2 ||
|
type == OBJECT_PLANT2 ||
|
||||||
|
@ -391,18 +398,6 @@ bool CTaskTerraform::Terraform()
|
||||||
type == OBJECT_PLANT17 ||
|
type == OBJECT_PLANT17 ||
|
||||||
type == OBJECT_PLANT18 ||
|
type == OBJECT_PLANT18 ||
|
||||||
type == OBJECT_PLANT19 ||
|
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_EGG ||
|
||||||
type == OBJECT_RUINmobilew1 ||
|
type == OBJECT_RUINmobilew1 ||
|
||||||
type == OBJECT_RUINmobilew2 ||
|
type == OBJECT_RUINmobilew2 ||
|
||||||
|
@ -412,54 +407,43 @@ bool CTaskTerraform::Terraform()
|
||||||
type == OBJECT_RUINsupport ||
|
type == OBJECT_RUINsupport ||
|
||||||
type == OBJECT_RUINradar ||
|
type == OBJECT_RUINradar ||
|
||||||
type == OBJECT_BARRIER0 ||
|
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());
|
dist = Math::Distance(m_terraPos, pObj->GetPosition());
|
||||||
|
|
||||||
if (type == OBJECT_BULLET ||
|
if ( type == OBJECT_BULLET ||
|
||||||
type == OBJECT_NEST ||
|
type == OBJECT_NEST ||
|
||||||
type == OBJECT_EGG) // Alien Organic?
|
type == OBJECT_EGG ) // Alien Organic?
|
||||||
{
|
{
|
||||||
if ( dist > 5.0f ) continue;
|
if ( dist > 5.0f ) continue;
|
||||||
m_engine->GetPyroManager()->Create(Gfx::PT_FRAGO, pObj);
|
m_engine->GetPyroManager()->Create(Gfx::PT_FRAGO, pObj);
|
||||||
}
|
}
|
||||||
else if (type == OBJECT_TNT ||
|
else if ( type == OBJECT_TNT ||
|
||||||
type == OBJECT_BOMB) // Explosives?
|
type == OBJECT_BOMB ) // Explosives?
|
||||||
{
|
{
|
||||||
if ( dist > 5.0f ) continue;
|
if ( dist > 5.0f ) continue;
|
||||||
m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOT, pObj);
|
m_engine->GetPyroManager()->Create(Gfx::PT_EXPLOT, pObj);
|
||||||
dynamic_cast<CDamageableObject*>(m_object)->DamageObject(DamageType::Explosive, 0.9f);
|
dynamic_cast<CDamageableObject*>(m_object)->DamageObject(DamageType::Explosive, 0.9f);
|
||||||
}
|
}
|
||||||
else if (type == OBJECT_PLANT0 ||
|
else if ( type == OBJECT_PLANT0 ||
|
||||||
type == OBJECT_PLANT1 ||
|
type == OBJECT_PLANT1 ||
|
||||||
type == OBJECT_PLANT2 ||
|
type == OBJECT_PLANT2 ||
|
||||||
type == OBJECT_PLANT3 ||
|
type == OBJECT_PLANT3 ||
|
||||||
type == OBJECT_PLANT4 ||
|
type == OBJECT_PLANT4 ||
|
||||||
type == OBJECT_PLANT5 ||
|
type == OBJECT_PLANT5 ||
|
||||||
type == OBJECT_PLANT6 ||
|
type == OBJECT_PLANT6 ||
|
||||||
type == OBJECT_PLANT7 ||
|
type == OBJECT_PLANT7 ||
|
||||||
type == OBJECT_PLANT15 ||
|
type == OBJECT_PLANT15 ||
|
||||||
type == OBJECT_PLANT16 ||
|
type == OBJECT_PLANT16 ||
|
||||||
type == OBJECT_PLANT17 ||
|
type == OBJECT_PLANT17 ||
|
||||||
type == OBJECT_PLANT18 ||
|
type == OBJECT_PLANT18 ||
|
||||||
type == OBJECT_PLANT19 ||
|
type == OBJECT_PLANT19 ) // Plants?
|
||||||
type == OBJECT_MUSHROOM1 ||
|
|
||||||
type == OBJECT_MUSHROOM2) // Plants?
|
|
||||||
{
|
{
|
||||||
if ( dist > 7.5f ) continue;
|
if ( dist > 7.5f ) continue;
|
||||||
m_engine->GetPyroManager()->Create(Gfx::PT_EGG, pObj);
|
m_engine->GetPyroManager()->Create(Gfx::PT_FRAGV, 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<CDamageableObject*>(pObj)->DamageObject(DamageType::Explosive, 0.2f);
|
|
||||||
}
|
}
|
||||||
else // Other?
|
else // Other?
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "CBot/CBot.h"
|
#include "CBot/CBot.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue