Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's impossible to destroy Titanium/Uranium Ores by crashing with that objects #635

Closed
ghost opened this issue Sep 14, 2015 · 5 comments
Closed

Comments

@ghost
Copy link

@ghost ghost commented Sep 14, 2015

In previous GOLD and official Colobot versions you could destroy that objects by landing on them violently.

I propose that also Titanium, PowerCell, NuclearCell and OrgaMatter should can be destroyed in that way. KeyA..D and BlackBox should stay indestructible. TNT is also good as it is now.

@ghost ghost added this to the alpha-0.1.7 milestone Sep 14, 2015
@krzys-h
Copy link
Member

@krzys-h krzys-h commented Dec 19, 2015

According to the code, it should be possible, you just have to hit them hard enough:

    if (pObj->Implements(ObjectInterfaceType::Fragile))
    {
        // TODO: CFragileObject::GetDestructionForce (I can't do this now because you can't inherit both in COldObject ~krzys_h)
        DamageType damageType = DamageType::Collision;
        float destructionForce = 50.0f; // Titanium, PowerCell, NuclearCell, default
        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
        if (pObj->GetType() == OBJECT_TNT     ) { destructionForce = 10.0f; damageType = DamageType::Explosive; } // TNT
        if (pObj->GetType() == OBJECT_BOMB    ) { destructionForce =  0.0f; damageType = DamageType::Explosive; } // Mine

        if ( force > destructionForce )
        {
            dynamic_cast<CDamageableObject*>(pObj)->DamageObject(damageType);
        }
    }
@ghost
Copy link
Author

@ghost ghost commented Dec 19, 2015

That's strange, in official 0.1.6 builds that doesn't work.

@tomangelo2
Copy link
Member

@tomangelo2 tomangelo2 commented Dec 19, 2015

I've just killed a bot, and Titanium was still "alive", even after some hits by Me. How much is bots destructionForce?

@krzys-h
Copy link
Member

@krzys-h krzys-h commented Dec 19, 2015

force = fabs(m_linMotion.realSpeed.x);
force *= crashSphere.hardness*2.0f;

Note that I'm not saying that it works for me because I'm terrible at aiming at such a small object :P

@krzys-h
Copy link
Member

@krzys-h krzys-h commented Dec 19, 2015

Also note that on collision the robot gets 1/200th of the force variable applied as damage (assuming damage is in range from 0 to 1/magnifyDamage)

krzys-h added a commit that referenced this issue Feb 13, 2016
@krzys-h krzys-h closed this Feb 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants