Make Wrecks destroyable; make TargetBot more fragile

modernize-cmake-1
Fiftytwo 2019-07-17 02:57:47 +02:00
parent ed8dc04d94
commit 62620a93cd
2 changed files with 25 additions and 13 deletions

View File

@ -357,6 +357,12 @@ bool COldObject::DamageObject(DamageType type, float force, CObject* killer)
else if ( Implements(ObjectInterfaceType::Fragile) )
{
if ((m_type == OBJECT_BOMB ||
m_type == OBJECT_RUINmobilew1 ||
m_type == OBJECT_RUINmobilew2 ||
m_type == OBJECT_RUINmobilet1 ||
m_type == OBJECT_RUINmobilet2 ||
m_type == OBJECT_RUINmobiler1 ||
m_type == OBJECT_RUINmobiler2 ||
m_type == OBJECT_RUINfactory ||
m_type == OBJECT_RUINdoor ||
m_type == OBJECT_RUINsupport ||
@ -840,7 +846,13 @@ void COldObject::SetType(ObjectType type)
m_implementedInterfaces[static_cast<int>(ObjectInterfaceType::Fragile)] = false;
m_implementedInterfaces[static_cast<int>(ObjectInterfaceType::Shielded)] = false;
}
else if (m_type == OBJECT_RUINfactory ||
else if (m_type == OBJECT_RUINmobilew1 ||
m_type == OBJECT_RUINmobilew2 ||
m_type == OBJECT_RUINmobilet1 ||
m_type == OBJECT_RUINmobilet2 ||
m_type == OBJECT_RUINmobiler1 ||
m_type == OBJECT_RUINmobiler2 ||
m_type == OBJECT_RUINfactory ||
m_type == OBJECT_RUINdoor ||
m_type == OBJECT_RUINsupport ||
m_type == OBJECT_RUINradar ||

View File

@ -2720,7 +2720,7 @@ bool CPhysics::ExploOther(ObjectType iType,
if (pObj->GetType() == OBJECT_STONE ) { destructionForce = 25.0f; } // TitaniumOre
if (pObj->GetType() == OBJECT_URANIUM ) { destructionForce = 25.0f; } // UraniumOre
if (pObj->GetType() == OBJECT_MOBILEtg) { destructionForce = 10.0f; damageType = DamageType::Explosive; } // TargetBot (something running into it)
if (iType == OBJECT_MOBILEtg) { destructionForce = 10.0f; damageType = DamageType::Explosive; } // TargetBot (it running into something)
if (iType == OBJECT_MOBILEtg) { destructionForce = 0.0f; damageType = DamageType::Explosive; } // TargetBot (it running into something)
if (pObj->GetType() == OBJECT_TNT ) { destructionForce = 10.0f; damageType = DamageType::Explosive; } // TNT
if (pObj->GetType() == OBJECT_BOMB ) { destructionForce = 0.0f; damageType = DamageType::Explosive; } // Mine
@ -2810,7 +2810,7 @@ int CPhysics::ExploHimself(ObjectType iType, ObjectType oType, float force)
float destructionForce = -1.0f; // minimal force required to destroy an object using this explosive, default: not explosive
if ( oType == OBJECT_TNT ) destructionForce = 10.0f; // TNT
if ( oType == OBJECT_MOBILEtg ) destructionForce = 10.0f; // TargetBot (something running into it)
if ( iType == OBJECT_MOBILEtg ) destructionForce = 10.0f; // TargetBot (it running into something)
if ( iType == OBJECT_MOBILEtg ) destructionForce = 0.0f; // TargetBot (it running into something)
if ( oType == OBJECT_BOMB ) destructionForce = 0.0f; // Mine
if ( force > destructionForce && destructionForce >= 0.0f )