示例#1
0
 public void EquipItem(Item item)
 {
     // Update the cache
     if (item.type == ItemType.eq_head)
     {
         equippedHead = item;
         StoreInventory.EquipVirtualGood(item.itemId);
     }
     else if (item.type == ItemType.eq_body)
     {
         equippedBody = item;
         StoreInventory.EquipVirtualGood(item.itemId);
     }
     else if (item.type == ItemType.eq_legs)
     {
         equippedLegs = item;
         StoreInventory.EquipVirtualGood(item.itemId);
     }
     else if (item.type == ItemType.item_consumable)
     {
         for (int i = 0; i < Game.instance.bagSlots; i++)
         {
             if (equippedConsumables[i].itemId == "empty")
             {
                 equippedConsumables[i] = item;
                 itemsConsumable[item.itemId].balance--;
                 break;
             }
         }
     }
 }
示例#2
0
    // Use this for initialization
    void Start()
    {
        ChartBoostAndroid.onStart();

        StoreController.Initialize(new AndysApplesAssets());

        //if (StoreInventory.GetItemBalance(AndysApplesAssets.SUPER_SEED_GOOD.ItemId) == 0)
        //    StoreInventory.GiveItem(AndysApplesAssets.SUPER_SEED_GOOD.ItemId, 2);

        // Acquire default player skin "Andy" and equip him for use in game.
        // This is is only run on the first startup of the game or if data is deleted.
        if (StoreInventory.GetItemBalance(AndysApplesAssets.ANDY_GOOD.ItemId) == 0)
        {
            StoreInventory.GiveItem(AndysApplesAssets.ANDY_GOOD.ItemId, 1);
            StoreInventory.EquipVirtualGood(AndysApplesAssets.ANDY_GOOD.ItemId);
        }

        // Acquire default background and equip it for use in game.
        // This is is only run on the first startup of the game or if data is deleted.
        if (StoreInventory.GetItemBalance(AndysApplesAssets.DEFAULT_BG.ItemId) == 0)
        {
            StoreInventory.GiveItem(AndysApplesAssets.DEFAULT_BG.ItemId, 1);
            StoreInventory.EquipVirtualGood(AndysApplesAssets.DEFAULT_BG.ItemId);
        }
    }
    /// <summary>
    /// Equips the specified character.
    /// </summary>
    /// <param name="character">The character to equip.</param>
    public void EquipCharacter(CharacterType character)
    {
        StoreInventory.EquipVirtualGood(CRCAssets.CharactersLTVGArray[(int)character].ItemId);
        // When a character is equipped, it is considered "used"
        SoomlaDataSystem dataSystem = (SoomlaDataSystem)Locator.GetDataSystem();

        dataSystem.SetCharacterUsed(character, true);
    }
示例#4
0
 void OnEquip()
 {
     StoreInventory.EquipVirtualGood(id);
     GameControl.current.CharacterChanged(index);
     if (OnCharacterChanged != null)
     {
         OnCharacterChanged(index);
     }
 }
示例#5
0
    public void EquipPirate()
    {
        string itemId = AndysApplesAssets.PIRATE_GOOD.ItemId;

        AndyUtils.LogDebug(TAG, "StoreInventory.IsVirtualGoodEquipped(" + itemId + ") is " + !StoreInventory.IsVirtualGoodEquipped(itemId));
        if (!StoreInventory.IsVirtualGoodEquipped(itemId))
        {
            StoreInventory.EquipVirtualGood(itemId);
            pirate.displayEquipStats(true);

            // turn all others off
            if (StoreInventory.GetItemBalance(AndysApplesAssets.ANDY_GOOD.ItemId) == 1)
            {
                if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.ANDY_GOOD.ItemId))
                {
                    StoreInventory.UnEquipVirtualGood(AndysApplesAssets.ANDY_GOOD.ItemId);
                }
                andy.displayEquipStats(false);
            }
            if (StoreInventory.GetItemBalance(AndysApplesAssets.KELLY_GOOD.ItemId) == 1)
            {
                if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.KELLY_GOOD.ItemId))
                {
                    StoreInventory.UnEquipVirtualGood(AndysApplesAssets.KELLY_GOOD.ItemId);
                }
                kelly.displayEquipStats(false);
            }
            if (StoreInventory.GetItemBalance(AndysApplesAssets.NINJA_GOOD.ItemId) == 1)
            {
                if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.NINJA_GOOD.ItemId))
                {
                    StoreInventory.UnEquipVirtualGood(AndysApplesAssets.NINJA_GOOD.ItemId);
                }
                ninja.displayEquipStats(false);
            }
            if (StoreInventory.GetItemBalance(AndysApplesAssets.PIG_GOOD.ItemId) == 1)
            {
                if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.PIG_GOOD.ItemId))
                {
                    StoreInventory.UnEquipVirtualGood(AndysApplesAssets.PIG_GOOD.ItemId);
                }
                pig.displayEquipStats(false);
            }
            if (StoreInventory.GetItemBalance(AndysApplesAssets.WIZARD_GOOD.ItemId) == 1)
            {
                if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.WIZARD_GOOD.ItemId))
                {
                    StoreInventory.UnEquipVirtualGood(AndysApplesAssets.WIZARD_GOOD.ItemId);
                }
                wizard.displayEquipStats(false);
            }
        }
    }
示例#6
0
    public void EquipBlossomBG()
    {
        string itemId = AndysApplesAssets.CBLOSSOM_BG.ItemId;

        AndyUtils.LogDebug(TAG, "StoreInventory.IsVirtualGoodEquipped(" + itemId + ") is " + !StoreInventory.IsVirtualGoodEquipped(itemId));
        if (!StoreInventory.IsVirtualGoodEquipped(itemId))
        {
            StoreInventory.EquipVirtualGood(itemId);
            blossomBG.displayEquipStats(true);

            // turn all others off
            if (StoreInventory.GetItemBalance(AndysApplesAssets.DEFAULT_BG.ItemId) == 1)
            {
                if (StoreInventory.IsVirtualGoodEquipped(AndysApplesAssets.DEFAULT_BG.ItemId))
                {
                    StoreInventory.UnEquipVirtualGood(AndysApplesAssets.DEFAULT_BG.ItemId);
                }
                defaultBG.displayEquipStats(false);
            }
        }
    }
示例#7
0
    void OnSoomlaStoreInitialized()
    {
        if (!firstLaunchReward.Owned)
        {
            firstLaunchReward.Give();
            StoreInventory.EquipVirtualGood(AnimineStoreAssets.PIGGY_VG_ITEM_ID);
            missionIndex.SetTempScore(0);
            missionIndex.Reset(true);
            gameScore.SetTempScore(0);
            gameScore.Reset(true);
//			coinScore.SetTempScore(0);
//			coinScore.Reset(true);

            //CHECK_IN_FINAL_BUILD :delete these 2 line in final build
            StoreInventory.GiveItem(AnimineStoreAssets.GOLD_COIN_VC_ITEM_ID, 550000);
            //StoreInventory.GiveItem(AnimineStoreAssets.DYNAMITE_VG_ITEM_ID,2);
            StoreInventory.GiveItem(AnimineStoreAssets.BATTERY_VG_ITEM_ID, 1);
        }

        compMList = PlayerPrefs.GetString(PENDING_WORK_KEY, "");
        CompletePendingWork();
        setBlankCall();
        Invoke("setAllMissionDelegate", 1f);
    }