Beispiel #1
0
// ----------------------------------------------------------------------------
void addAttachment(Attachment::AttachmentType type)
{
    World* world = World::getWorld();
    if (world == NULL) return;
    for (unsigned int i = 0; i < world->getNumKarts(); i++)
    {
        AbstractKart *kart = world->getKart(i);
        if (!kart->getController()->isLocalPlayerController())
            continue;
        if (type == Attachment::ATTACH_ANVIL)
        {
            kart->getAttachment()
                ->set(type, kart->getKartProperties()->getAnvilDuration());
            kart->adjustSpeed(kart->getKartProperties()->getAnvilSpeedFactor());
            kart->updateWeight();
        }
        else if (type == Attachment::ATTACH_PARACHUTE)
        {
            kart->getAttachment()
                ->set(type, kart->getKartProperties()->getParachuteDuration());
        }
        else if (type == Attachment::ATTACH_BOMB)
        {
            kart->getAttachment()
                ->set(type, stk_config->m_bomb_time);
        }
    }

}   // addAttachment
Beispiel #2
0
void addAttachment(Attachment::AttachmentType type)
{
    World* world = World::getWorld();
        if (world == NULL) return;
        for(unsigned int i = 0; i < world->getNumKarts(); i++)
        {
        AbstractKart *kart = world->getKart(i);
        if (kart->getController()->isPlayerController()) {
            if (type == Attachment::ATTACH_ANVIL)
            {
                kart->getAttachment()
                    ->set(type, stk_config->m_anvil_time);
                kart->adjustSpeed(stk_config->m_anvil_speed_factor);
                kart->updateWeight();
            }
            else if (type == Attachment::ATTACH_PARACHUTE)
            {
                kart->getAttachment()
                        ->set(type, stk_config->m_parachute_time);
            }
            else if (type == Attachment::ATTACH_BOMB)
            {
                kart->getAttachment()
                        ->set(type, stk_config->m_bomb_time);
            }
        }
        }

}