コード例 #1
0
 public void SumonTenTimes_n()
 {
     CurrentAltarType = AltarType.n_tenTime;
     if (SDDataManager.Instance.getConsumableNum(Coupon_n_tenTimes.ID) > 0)
     {
         InitDAP();
     }
     else
     {
         if (SDDataManager.Instance.getConsumableNum(Coupon_n_oneTime.ID) > 10)
         {
             InitDAP();
         }
         else
         {
             if (SDDataManager.Instance.PlayerData.damond
                 >= SDConstants.altarDamondCost * 10)
             {
                 if (SDDataManager.Instance.PlayerData.damond >= SDConstants.altarDamondCost)
                 {
                     PopoutController.CreatePopoutAlert
                     (
                         SDGameManager.T("提醒")
                         , SDGameManager.T("确认消耗")
                         + SDConstants.altarDamondCost * 10
                         + SDGameManager.T("钻石")
                         , 25, false,
                         PopoutController.PopoutWIndowAlertType.ConfirmMessage
                         , (PopoutController pop
                            , PopoutController.PopoutWindowAlertActionType type)
                         =>
                     {
                         if (type == PopoutController.PopoutWindowAlertActionType.OnConfirm)
                         {
                             InitDAP();     //pop.Dismiss();
                         }
                         else
                         {
                             //pop.Dismiss();
                         }
                         StartCoroutine(pop.Dismiss());
                     }
                     );
                 }
                 else
                 {
                     Debug.Log("无法获取:道具或钻石不足");
                     return;
                 }
             }
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// 放弃任务
 /// </summary>
 /// <param name="quest">放弃的任务</param>
 /// <param name="loadMode">是否为读档模式</param>
 /// <returns></returns>
 public bool AbandonQuest(Quest quest, bool loadMode = false)
 {
     if (HasOngoingQuest(quest) && quest && quest.Abandonable)
     {
         quest.IsOngoing = false;
         QuestsOngoing.Remove(quest);
         foreach (Objective o in quest.ObjectiveInstances)
         {
             if (o is CollectObjective)
             {
                 CollectObjective co = o as CollectObjective;
                 TriggerManager.Instance.OnGetItemEvent  += co.UpdateCollectAmount;
                 TriggerManager.Instance.OnLoseItemEvent += co.UpdateCollectAmountDown;
             }
             if (o is KillObjective)
             {
                 KillObjective ko = o as KillObjective;
                 ko.CurrentAmount = 0;
                 TriggerManager.Instance.OnUnitDeathEvent -= ko.UpdateKillAmount;
             }
             if (o is TalkObjective)
             {
             }
             if (o is SubmitObjective)
             {
             }
             if (o is CustomObjective)
             {
                 CustomObjective cuo = o as CustomObjective;
                 cuo.CurrentAmount = 0;
                 TriggerManager.Instance.OnTriggerSetEvent -= cuo.UpdateTriggerState;
             }
         }
         if (!quest.SbmtOnOriginalNPC)
         {
         }
         if (QuestsOngoing.Count < 1)
         {
         }
         return(true);
     }
     else if (!quest.Abandonable)
     {
         PopoutController.CreatePopoutAlert("", "该任务无法放弃"
                                            , 50, true, PopoutController.PopoutWIndowAlertType.ConfirmMessage
                                            , null);
     }
     return(false);
 }
コード例 #3
0
 /// <summary>
 /// 放弃当前选中的任务
 /// </summary>
 public void AbandonSelectedQuest()
 {
     if (!selectedQuest)
     {
         return;
     }
     PopoutController.CreatePopoutAlert("", "确认放弃该任务吗(已消耗道具不会退回)", 50
                                        , true, PopoutController.PopoutWIndowAlertType.ConfirmOrCancel
                                        , (PopoutController c, PopoutController.PopoutWindowAlertActionType a)
                                        =>
     {
         if (a == PopoutController.PopoutWindowAlertActionType.OnConfirm)
         {
             AbandonQuest(selectedQuest);
         }
         else
         {
             StartCoroutine(c.IEWaitAndDismiss(0.3f));
         }
     }
                                        );
 }
コード例 #4
0
ファイル: SettingPanel.cs プロジェクト: tuita520/RL_CardGame
    public void BtnGiveUpBattle()
    {
        BattleManager BM = FindObjectOfType <BattleManager>();

        if (BM)
        {
            //SDGameManager.Instance.isGamePaused = true;
            //BM.BattleFail();
            PopoutController.CreatePopoutAlert("警告", "确定放弃战斗吗</n>(有死之荣无生之辱)"
                                               , 50, true, PopoutController.PopoutWIndowAlertType.ConfirmOrCancel
                                               , (PopoutController c, PopoutController.PopoutWindowAlertActionType a) =>
            {
                if (a == PopoutController.PopoutWindowAlertActionType.OnConfirm)
                {
                    SDGameManager.Instance.isGamePaused = true;
                    BM.BattleFail();
                }
                else
                {
                    c.StartCoroutine(c.IEWaitAndDismiss(0.2f));
                }
            });
        }
    }
コード例 #5
0
    public void consumeToGetItems(string itemId, bool useDamond, int itemNum = 1)
    {
        SDConstants.ItemType type = SDDataManager.Instance.getItemTypeById(itemId);
        int allConsume            = 0;

        if (type == SDConstants.ItemType.Consumable)
        {
            consumableItem data = SDDataManager.Instance.getConsumableItemById(itemId);
            if (!useDamond)
            {
                allConsume = data.buyPrice_coin * itemNum;
            }
            else
            {
                allConsume = data.buyPrice_diamond * itemNum;
            }
        }
        else if (type == SDConstants.ItemType.Consumable)
        {
            consumableItem DATA = SDDataManager.Instance.getConsumableItemById(itemId);
            if (!useDamond)
            {
                allConsume = DATA.buyPrice_coin * itemNum;
            }
            else
            {
                allConsume = DATA.buyPrice_diamond * itemNum;
            }
        }
        else if (type == SDConstants.ItemType.Equip)
        {
        }

        if (allConsume <= 0)
        {
            return;
        }

        if (!useDamond)
        {
            if (ConsumeCoinToGetItems(allConsume, itemId, out int surplus, itemNum))
            {
                Debug.Log("消耗 金币 " + allConsume + " 获得 商品id " + itemId
                          + " X" + itemNum + "====== 剩余 金币 " + surplus);
            }
        }
        else
        {
            PopoutController.CreatePopoutAlert
            (
                "",
                SDGameManager.T("是否确认购买"),
                5,
                true,
                PopoutController.PopoutWIndowAlertType.ConfirmMessage,
                (PopoutController c, PopoutController.PopoutWindowAlertActionType d) =>
            {
                if (d == PopoutController.PopoutWindowAlertActionType.OnConfirm)
                {
                    bool a = ConsumeDamondToGetItems
                                 (allConsume, itemId, out int surplus, itemNum);
                    if (a)
                    {
                        Debug.Log("消耗 钻石 " + allConsume + " 获得 商品id " + itemId
                                  + " X" + itemNum + "====== 剩余 钻石 " + surplus);
                        c._dismissAfterTapBtn = true;
                    }
                }