From 8658d6da8060cdb741c668d4be1b571ef064d01d Mon Sep 17 00:00:00 2001 From: krzys-h Date: Wed, 13 Feb 2013 16:57:59 +0100 Subject: Added Destroyer from Ceebot-Teen. We need a new icon for it. --- src/object/auto/autodestroyer.cpp | 90 ++++++++++++++++++++++++++++++++++----- 1 file changed, 79 insertions(+), 11 deletions(-) (limited to 'src/object/auto/autodestroyer.cpp') diff --git a/src/object/auto/autodestroyer.cpp b/src/object/auto/autodestroyer.cpp index ecf7c94..644071c 100644 --- a/src/object/auto/autodestroyer.cpp +++ b/src/object/auto/autodestroyer.cpp @@ -111,18 +111,39 @@ bool CAutoDestroyer::EventProcess(const Event &event) if ( SearchVehicle() ) { - m_phase = ADEP_WAIT; // still waiting ... - m_progress = 0.0f; - m_speed = 1.0f/0.5f; + if ( m_progress < 20.0f ) { + m_phase = ADEP_WAIT; // still waiting ... + //m_progress = 0.0f; + m_speed = 1.0f/0.5f; + } else { + if ( m_object->GetLock() ) { // If still building... + m_phase = ADEP_WAIT; // still waiting ... + m_progress = 0.0f; + m_speed = 1.0f/0.5f; + } else { + m_sound->Play(SOUND_PSHHH2, m_object->GetPosition(0), 1.0f, 1.0f); + + m_phase = ADEP_DOWN; + m_progress = 0.0f; + m_speed = 1.0f/1.0f; + m_bExplo = false; + } + } } else { - m_sound->Play(SOUND_PSHHH2, m_object->GetPosition(0), 1.0f, 1.0f); - - m_phase = ADEP_DOWN; - m_progress = 0.0f; - m_speed = 1.0f/1.0f; - m_bExplo = false; + if ( m_object->GetLock() ) { // If still building... + m_phase = ADEP_WAIT; // still waiting ... + m_progress = 0.0f; + m_speed = 1.0f/0.5f; + } else { + m_sound->Play(SOUND_PSHHH2, m_object->GetPosition(0), 1.0f, 1.0f); + + m_phase = ADEP_DOWN; + m_progress = 0.0f; + m_speed = 1.0f/1.0f; + m_bExplo = false; + } } } } @@ -243,8 +264,55 @@ CObject* CAutoDestroyer::SearchPlastic() if ( pObj == nullptr ) break; type = pObj->GetType(); - if ( type != OBJECT_SCRAP4 && - type != OBJECT_SCRAP5 ) continue; + //if ( type != OBJECT_SCRAP4 && + // type != OBJECT_SCRAP5 ) continue; + if ( type != OBJECT_FRET && + type != OBJECT_STONE && + type != OBJECT_URANIUM && + type != OBJECT_METAL && + type != OBJECT_POWER && + type != OBJECT_ATOMIC && + type != OBJECT_TNT && + type != OBJECT_SCRAP1 && + type != OBJECT_SCRAP2 && + type != OBJECT_SCRAP3 && + type != OBJECT_SCRAP4 && + type != OBJECT_SCRAP5 && + // Robots: + type != OBJECT_HUMAN && + type != OBJECT_MOBILEfa && + type != OBJECT_MOBILEta && + type != OBJECT_MOBILEwa && + type != OBJECT_MOBILEia && + type != OBJECT_MOBILEfc && + type != OBJECT_MOBILEtc && + type != OBJECT_MOBILEwc && + type != OBJECT_MOBILEic && + type != OBJECT_MOBILEfi && + type != OBJECT_MOBILEti && + type != OBJECT_MOBILEwi && + type != OBJECT_MOBILEii && + type != OBJECT_MOBILEfs && + type != OBJECT_MOBILEts && + type != OBJECT_MOBILEws && + type != OBJECT_MOBILEis && + type != OBJECT_MOBILErt && + type != OBJECT_MOBILErc && + type != OBJECT_MOBILErr && + type != OBJECT_MOBILErs && + type != OBJECT_MOBILEsa && + type != OBJECT_MOBILEtg && + type != OBJECT_MOBILEft && + type != OBJECT_MOBILEtt && + type != OBJECT_MOBILEwt && + type != OBJECT_MOBILEit && + type != OBJECT_MOBILEdr && + type != OBJECT_MOTHER && + type != OBJECT_ANT && + type != OBJECT_SPIDER && + type != OBJECT_BEE && + type != OBJECT_WORM ) continue; + oPos = pObj->GetPosition(0); dist = Math::Distance(oPos, sPos); -- cgit v1.2.3-1-g7c22