Esempio n. 1
0
    public void HandleUse(Item.e_itemType item, Player player)
    {
        if (m_debug)
        {
            Debug.Log(string.Format("GameManager12:HandleUse() => ItemType:{0} Player:{3} - {4}", item, player.NumPlayer, player.Name));
        }

        int    platformCode;
        string playerName;

        SplitPlayerID(player.Name, out platformCode, out playerName);

        string faction = GetFactionStringFromFaction(player.Faction);

        switch (item)
        {
        case Item.e_itemType.GRENADES:
            m_InventoryDisplay.RetireInventaire(faction, player.Faction.ListPlayer.IndexOf(player) + 1, "GRENADE");
            SendMessageToPlayer((Platform)platformCode, playerName, "Vous avez utilisé une grenade!");
            break;

        case Item.e_itemType.SHOVEL:
            m_InventoryDisplay.RetireInventaire(faction, player.Faction.ListPlayer.IndexOf(player) + 1, "PELLE");
            SendMessageToPlayer((Platform)platformCode, playerName, "Vous utilisez maintenant une pelle pour creuser plus vite.");
            SendCommand("AUTODIG", player.Name);
            break;

        default:
            Debug.LogWarning(string.Format("GameManager12: HandleUse() => default switch ({0} received)", item.ToString()));
            break;
        }
    }