diff --git a/colobot-base/src/graphics/engine/particle.cpp b/colobot-base/src/graphics/engine/particle.cpp index 0d76420d3..2ba463f8a 100644 --- a/colobot-base/src/graphics/engine/particle.cpp +++ b/colobot-base/src/graphics/engine/particle.cpp @@ -1243,7 +1243,7 @@ void CParticle::FrameParticle(float rTime) if (object->Implements(ObjectInterfaceType::Damageable)) { - dynamic_cast(*object).DamageObject(DamageType::Organic, 0.1f, m_particle[i].objFather); // starts explosion + dynamic_cast(*object).DamageObject(DamageType::AlienAnt, 0.1f, m_particle[i].objFather); // starts explosion } } } @@ -1344,7 +1344,7 @@ void CParticle::FrameParticle(float rTime) { if (object->Implements(ObjectInterfaceType::Damageable)) { - dynamic_cast(*object).DamageObject(DamageType::Organic, 0.001f, m_particle[i].objFather); + dynamic_cast(*object).DamageObject(DamageType::OrgaShooter, 0.001f, m_particle[i].objFather); } m_exploGunCounter ++; diff --git a/colobot-base/src/object/interface/damageable_object.h b/colobot-base/src/object/interface/damageable_object.h index 93fe9d318..f20bad757 100644 --- a/colobot-base/src/object/interface/damageable_object.h +++ b/colobot-base/src/object/interface/damageable_object.h @@ -32,7 +32,7 @@ class CObject; enum class DamageType { Fire = 1, //!< fire damage (AlienSpider or Shooter), burns on destruction - Organic = 2, //!< organical damage (AlienAnt or OrgaShooter), explodes on destruction + AlienAnt = 2, //!< organical damage (AlienAnt), explodes on destruction Phazer = 3, //!< damage from PhazerShooter, explodes on destruction Tower = 4, //!< damage from DefenseTower, explodes on destruction FallingObject = 5, //!< damaged by an falling object (OrgaMatter dropped by an AlienWasp), explodes on destruction @@ -40,6 +40,7 @@ enum class DamageType Collision = 7, //!< damage after one object hits another, explodes on destruction Lightning = 8, //!< struck by lightning, explodes on destruction Fall = 9, //!< fall damage, explodes on destruction + OrgaShooter = 10, //!< damage from OrgaShooter, explodes on destruction }; /** diff --git a/colobot-base/src/object/old_object.cpp b/colobot-base/src/object/old_object.cpp index f6ec0dcc2..b5426f251 100644 --- a/colobot-base/src/object/old_object.cpp +++ b/colobot-base/src/object/old_object.cpp @@ -376,8 +376,9 @@ bool COldObject::DamageObject(DamageType type, float force, CObject* killer) m_type == OBJECT_RUINsupport || m_type == OBJECT_RUINradar || m_type == OBJECT_RUINconvert ) && type != DamageType::Explosive ) return false; // Mines and ruins can't be destroyed by shooting - if ( m_type == OBJECT_URANIUM && (type == DamageType::Fire || type == DamageType::Organic) ) return false; // UraniumOre is not destroyable by shooting or aliens (see #777) - if ( m_type == OBJECT_STONE && (type == DamageType::Fire || type == DamageType::Organic) ) return false; // TitaniumOre is not destroyable either + bool isShot = type == DamageType::Fire || type == DamageType::AlienAnt || type == DamageType::OrgaShooter; + if ( m_type == OBJECT_URANIUM && isShot ) return false; // UraniumOre is not destroyable by shooting or aliens (see #777) + if ( m_type == OBJECT_STONE && isShot ) return false; // TitaniumOre is not destroyable either // PowerCell, NuclearCell and Titanium are destroyable by shooting, but not by collisions! if ( m_type == OBJECT_METAL && type == DamageType::Collision ) return false; if ( m_type == OBJECT_POWER && type == DamageType::Collision ) return false; @@ -391,9 +392,10 @@ bool COldObject::DamageObject(DamageType type, float force, CObject* killer) if ( type != DamageType::Phazer && m_type == OBJECT_MOTHER ) return false; // AlienQueen can be destroyed only by PhazerShooter - if ( type == DamageType::Organic ) + if ( type == DamageType::AlienAnt ) { - // TODO: I don't understand, why does it apply damage only once every 0.5 second? + // Balancing: bots and buildings hit by alien ants get 0.5 second invulnerability from the ants. + // This is necessary because PARTIGUN2 do not despawn when they hit and do 0.1 damage per hit compared to e.g. 0.001 per hit that shooters deal. if ( m_shotTime < 0.5f ) return false; m_shotTime = 0.0f; }