/** Picks a random message to be displayed when a kart is hit by a plunger.
 *  \param The kart that was hit (ignored here).
 *  \returns The string to display.
 */
const core::stringw Plunger::getHitString(const AbstractKart *kart) const
{
    const int PLUNGER_IN_FACE_STRINGS_AMOUNT = 2;
    RandomGenerator r;
    switch (r.get(PLUNGER_IN_FACE_STRINGS_AMOUNT))
    {
        //I18N: shown when a player receives a plunger in his face
        case 0: return _LTR("%0 gets a fancy mask from %1");
        //I18N: shown when a player receives a plunger in his face
        case 1: return _LTR("%1 merges %0's face with a plunger");
        default:assert(false); return L"";   // avoid compiler warning
    }
}   // getHitString
/** Picks a random message to be displayed when a kart is hit by the
 *  rubber ball.
 *  \param The kart that was hit (ignored here).
 *  \returns The string to display.
 */
const core::stringw RubberBall::getHitString(const AbstractKart *kart) const
{
    const int COUNT = 2;
    RandomGenerator r;
    switch (r.get(COUNT))
    {
        //I18N: shown when a player is hit by a rubber ball. %1 is the
        // attacker, %0 is the victim.
        case 0: return _LTR("%s is being bounced around.");
        //I18N: shown when a player is hit by a rubber ball. %1 is the
        // attacker, %0 is the victim.
        case 1: return _LTR("Fetch the ball, %0!");
        default:assert(false); return L"";   // avoid compiler warning
    }
}   // getHitString
Ejemplo n.º 3
0
/** Makes sure at least n guest players exist. This is used by the multiplayer
 *  KartSelection screen to make sure enough guest players can be picked by
 *  the players.
 *  \param n Minimum number of guest players that must exist.
 */
void PlayerManager::createGuestPlayers(int n)
{
    int num_guests = m_all_players.size() - getNumNonGuestPlayers();
    for(int i=num_guests; i<n; i++)
    {
        core::stringw guest_name;
        if(i==0)
        {
            // I18N: Name of first guest player (without number)
            guest_name = _LTR("Guest");
        }
        else
        {
            // I18N: Name of further guest players, with a 1, 2, ... attached
            guest_name = _LTR("Guest %d", i);
        }
        PlayerProfile *guest = new Online::OnlinePlayerProfile(guest_name,
                                                               /*guest*/ true);
        m_all_players.push_back(guest);
    }
}   // createGuestPlayers
/** Picks a random message to be displayed when a kart is hit by a bowling
 *  ball. This function picks a different message if a kart hit itself.
 *  \param kart The kart that was hit.
 *  \returns The string to display.
 */
const core::stringw Bowling::getHitString(const AbstractKart *kart) const
{
    RandomGenerator r;

    if(kart!=m_owner)
    {
        const int BOWLING_STRINGS_AMOUNT = 3;
        switch (r.get(BOWLING_STRINGS_AMOUNT))
        {
            //I18N: shown when hit by bowling ball. %1 is the attacker, %0 is
            // the victim.
        case 0 : return _LTR("%0 will not go bowling with %1 again");
            //I18N: shown when hit by bowling ball. %1 is the attacker, %0 is
            // the victim.
        case 1 : return _LTR("%1 strikes %0");
            //I18N: shown when hit by bowling ball. %1 is the attacker, %0 is
            // the victim.
        case 2 : return _LTR("%0 is bowled over by %1");
        default: assert(false); return L"";  //  avoid compiler warning
        }
    }
    else
    {
        const int SELFBOWLING_STRINGS_AMOUNT = 3;
        switch (r.get(SELFBOWLING_STRINGS_AMOUNT))
        {
            //I18N: shown when hit by own bowling ball. %s is the kart.
        case 0 : return _LTR("%s is practicing with a blue, big, spheric yo-yo");
            //I18N: shown when hit by own bowling ball. %s is the kart.
        case 1 : return _LTR("%s is the world master of the boomerang ball");
            //I18N: shown when hit by own bowling ball. %s is the kart.
        case 2 : return _LTR("%s should play (rubber) darts instead of bowling");
        default: assert(false); return L"";  //  avoid compiler warning
        }   // switch
    }   // if kart_hit==owner


}   // getHitString
Ejemplo n.º 5
0
 /** Returns the name of this achievement. */
 irr::core::stringw getName() const { return _LTR(m_name.c_str()); }