Esempio n. 1
0
 public static bool PaymentCheck(ref int target, int payment)
 {
     if (PaymentAbleCheck(ref target, payment))
     {
         if (target == User.coin || target.Equals(User.coin))
         {
             MissionSystem.AddClearPoint(MissionSystem.ClearType.TotalUseCoin, payment);
         }
         else if (target == User.blackCrystal || target.Equals(User.blackCrystal))
         {
             MissionSystem.AddClearPoint(MissionSystem.ClearType.TotalUseCrystal, payment);
         }
         else if (target == User.portalEnergy || target.Equals(User.portalEnergy))
         {
             MissionSystem.AddClearPoint(MissionSystem.ClearType.TotalUseEnergy, payment);
         }
         target -= payment;
         GoogleSignManager.SaveData();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
    public IEnumerator StageClearing()
    {
        isStartGame = false;
        isEndGame   = true;
        HeroSystem.SaveHeros(Common.FindAlly());
        MapSystem.MapClear(stageInfo.mapNumber, stageInfo.stageClearPoint);
        MissionSystem.AddClearPoint(MissionSystem.ClearType.StageClear);
        MissionSystem.AddClearPoint(MissionSystem.ClearType.TotalStageCount);
        MissionSystem.PointSave();
        SaveSystem.AddUserCoin(stageInfo.stageCoin);
        stageInfo.stageExp = Common.GetUserExp(stageInfo.stageNumber);
        SaveSystem.ExpUp(stageInfo.stageExp);
        var getItems = GetStageItems();

        for (var i = 0; i < getItems.Count; i++)
        {
            ItemSystem.SetObtainItem(getItems[i].id);
        }
        GoogleSignManager.SaveData();
        UI_Manager.instance.OpenEndGamePanel(true);
        if (UnityEngine.Random.Range(0, 10) < 2)
        {
            GoogleAdMobManager.instance.OnBtnViewAdClicked();
        }
        yield return(null);
    }
Esempio n. 3
0
 void StateUpdate()
 {
     hp = bossPrefabData.status.hp;
     if (bossPrefabData.isDead)
     {
         isEnd = true;
         MissionSystem.AddClearPoint(MissionSystem.ClearType.BossKill);
         StartCoroutine("BossDead");
     }
 }
Esempio n. 4
0
    public static void SetObtainHero(int id)
    {
        HeroData obtainHero = heros.Find(h => h.id == id || h.id.Equals(id));

        if (obtainHero != null)
        {
            HeroDatabase.AddUser(id);
            userHeros.Add(obtainHero);
            SkillSystem.SetObtainSkill(obtainHero.skill);
            MissionSystem.AddClearPoint(MissionSystem.ClearType.CollectHero);
            Debugging.Log(id + " 영웅 획득 성공!");
        }
        else
        {
            Debugging.LogError("획득할 영웅을 찾지못함 >> " + id);
        }
    }
Esempio n. 5
0
    public static void SetObtainItem(int id, int count = 1)
    {
        Item obtainItem = userItems.Find(item => item.id == id || item.id.Equals(id));

        if (obtainItem != null && obtainItem.itemtype != 0)
        {
            obtainItem.enable = true;
            obtainItem.count += count;
            ItemDatabase.ItemSave(id);
        }
        else
        {
            Item newItem = items.Find(item => item.id == id || item.id.Equals(id));
            if (newItem != null)
            {
                if (newItem.itemtype == 0)
                {
                    Item[] newItems = new Item[count];
                    for (var i = 0; i < count; i++)
                    {
                        Item newCopyItem = newItem.Clone() as Item;
                        newCopyItem.customId = Common.GetRandomItemId(userItems);
                        newCopyItem.enable   = true;
                        newCopyItem.count    = 1;
                        userItems.Add(newCopyItem);
                        newItems[i] = newCopyItem;
                    }
                    MissionSystem.AddClearPoint(MissionSystem.ClearType.CollectEquipment, count);
                    foreach (var item in userItems)
                    {
                        Debugging.Log(item.customId);
                    }
                    ItemDatabase.AddItemListSave(newItems);
                }
                else
                {
                    newItem.customId = Common.GetRandomItemId(userItems);
                    newItem.enable   = true;
                    newItem.count    = count;
                    userItems.Add(newItem);
                    Debugging.Log(newItem.customId);
                    ItemDatabase.AddItemSave(newItem);
                }
            }
        }
    }
Esempio n. 6
0
 public void  GachaClick()
 {
     lastGachaOpen = (ulong)DateTime.Now.Ticks;
     if (type == 0)
     {
         PlayerPrefs.SetString("LastGachaOpen", lastGachaOpen.ToString());
         MissionSystem.AddClearPoint(MissionSystem.ClearType.FreeGacha);
         MissionSystem.AddClearPoint(MissionSystem.ClearType.Gacha);
     }
     else
     {
         PlayerPrefs.SetString("LastCrystalOpen", lastGachaOpen.ToString());
     }
     gachaButton.interactable = false;
     if (buttonScript != null)
     {
         buttonScript.enabled = false;
     }
 }
Esempio n. 7
0
    IEnumerator StartEvolution()
    {
        yield return(new WaitForEndOfFrame());

        //ItemSystem.UseEquipmentItem(targetItem.customId, 1);
        targetItemSlotImage.GetComponent <AiryUIAnimatedElement>().HideElement();
        yield return(new WaitForSeconds(0.1f));

        SoundManager.instance.EffectSourcePlay(AudioClipManager.instance.equip);
        ItemSystem.UseItem(targetItem.customId, 1);
        matItemSlotImage1.GetComponent <AiryUIAnimatedElement>().HideElement();
        matItemSlotImage2.GetComponent <AiryUIAnimatedElement>().HideElement();
        foreach (var i in matItems.Values)
        {
            ItemSystem.UseItem(i.customId, 1);
            yield return(new WaitForSeconds(0.1f));
        }
        yield return(new WaitForSeconds(0.5f));

        EffectManager.SkillUpgradeEffect(resultItemSlot.transform);
        yield return(new WaitForSeconds(0.3f));

        SoundManager.instance.EffectSourcePlay(AudioClipManager.instance.dropItem);
        ItemSystem.SetObtainItem(ItemSystem.GetNextClassItemId(targetItem));
        resultItem = ItemSystem.GetItem(ItemSystem.GetNextClassItemId(targetItem));
        resultItemSlotImage.GetComponent <AiryUIAnimatedElement>().ShowElement();

        Debugging.Log("합성성공!");
        MissionSystem.AddClearPoint(MissionSystem.ClearType.EquipUpgrade);
        targetItem = null;
        matItems.Clear();
        evolutionButton.interactable = true;
        isEndEvolution = true;
        RefreshUI();
        yield return(null);
    }
Esempio n. 8
0
    IEnumerator RandomSelectAbility(int useItemAmount)
    {
        isSelectStart = true;
        int   index     = 0;
        int   tempIndex = 0;
        float time      = 0;

        UI_Manager.instance.PopupInterActiveCover.SetActive(true);
        Random.InitState(User.gachaSeed);
        int selectedIndex = Random.Range(0, abilitySlotList.Count);

        User.gachaSeed = Random.Range(0, 1000);
        SelectImage.GetComponent <Image>().enabled = true;
        while (time < 1)
        {
            tempIndex = Random.Range(0, abilitySlotList.Count);
            if (tempIndex == index)
            {
                index = Mathf.Clamp(tempIndex + 1, 0, abilitySlotList.Count - 1);
            }
            else
            {
                index = tempIndex;
            }
            SelectImage.transform.SetParent(abilitySlotList[index].transform);
            SelectImage.transform.localPosition = Vector3.zero;
            SoundManager.instance.EffectSourcePlay(AudioClipManager.instance.ui_button_default);
            yield return(new WaitForSeconds(Mathf.Clamp(1.0f - (time * 2), 0.1f, 1)));

            time += 0.05f;
        }
        while (index == selectedIndex)
        {
            index += 1;
            if (index > abilitySlotList.Count - 1)
            {
                index = 0;
            }
            SelectImage.transform.SetParent(abilitySlotList[index].transform);
            SelectImage.transform.localPosition = Vector3.zero;
            SoundManager.instance.EffectSourcePlay(AudioClipManager.instance.ui_button_default);
            yield return(new WaitForSeconds(0.1f));
        }
        SelectImage.transform.SetParent(abilitySlotList[selectedIndex].transform);
        SelectImage.transform.localPosition = Vector3.zero;
        yield return(new WaitForSeconds(0.3f));

        SoundManager.instance.EffectSourcePlay(AudioClipManager.instance.ui_pop);
        UI_Manager.instance.PopupInterActiveCover.SetActive(false);
        SelectImage.GetComponent <Image>().enabled = false;
        isSelectStart = false;

        if (ItemSystem.UseItem(ItemSystem.GetUserScroll().customId, useItemAmount))
        {
            AbilitySystem.SetObtainAbility(abilityList[selectedIndex].id);
            MissionSystem.AddClearPoint(MissionSystem.ClearType.TotalUseScroll, useItemAmount);
            RefreshUI();
            UI_Manager.instance.PopupGetAbility(abilityList[selectedIndex]);
        }
        else
        {
            RefreshUI();
        }
        yield return(null);
    }