コード例 #1
0
    public override void RegisterEvent()
    {
        view.Close.onClick.AddListener(delegate()
        {
            mUIMgr.CloseCertainPanel(this);
        });

        view.NextPage.onClick.AddListener(delegate()
        {
            ShowItems();
        });
        view.PrePage.onClick.AddListener(delegate()
        {
            ShowItems();
        });
        view.Buy.onClick.AddListener(delegate()
        {
            if (pRoleMgr.Money > 0)
            {
                pRoleMgr.GainMoney(-10);
                pCardMgr.GainNewCard("card9001");
                mUIMgr.ShowHint("buy card");
            }
        });
    }
コード例 #2
0
ファイル: UIMainCtrl.cs プロジェクト: nmbswls/CSCI529
    public void TestNextTurn()
    {
        turn       += 1;
        testStatus += turnStatus;
        rm.GainMoney(30 + 50 * turn);
        testResource += 30 + 50 * turn;
        int adddd = (int)((30 + turn * 50 + (testStatus * 10 + testFans * 0.2f + 0) * 0.2f) * 1f);

        testFans += adddd;
        //nandu = 50 + 10 * Mathf.Pow(1.2f,turn);
        testUpdateWords();
        hasAddSkill = false;
    }
コード例 #3
0
ファイル: ZhiboGameMode.cs プロジェクト: DLBL0624/CSCI529
    public void FinishZhibo()
    {
        ZhiboJiesuanUI p = mUIMgr.ShowPanel("ZhiboJiesuanPanel") as ZhiboJiesuanUI;

        spdRate = 0;
        if (true || state.Score > state.MaxScore)
        {
            pRoleMgr.AddFensi(0, 100);
            pRoleMgr.GainMoney(100);
            //根据打过的卡牌 增加主属性 和 经验值
            int[] bonus = new int[5];
            for (int i = 0; i < state.UsedCardsToGetBonus.Count; i++)
            {
                string    cid = state.UsedCardsToGetBonus[i];
                CardAsset ca  = mCardMdl.GetCardInfo(cid);
                if (ca == null)
                {
                    continue;
                }
                if (ca.StatusBonusType > 0)
                {
                    bonus[ca.StatusBonusType - 1] += ca.StatusBonusNum;
                }
                if (ca.SkillBonusType > 0)
                {
                    //
                }
            }
            string bonusString = "";
            for (int i = 0; i < 5; i++)
            {
                if (bonus[i] > 0)
                {
                    bonusString += "p" + i + " add" + bonus[i] + "\n";
                }
            }
            p.SetContent(bonusString);

            //PlatformInfo info = pRoleMgr.GetNowPlatformInfo();
            //float basicReward = state.Score * 0.1 + bonus[0] * info.Xihao[0];
        }
    }
コード例 #4
0
ファイル: TaobaoModule.cs プロジェクト: nmbswls/CSCI529
    public void ConfirmBuy(int wantBuyIdx)
    {
        //if(wantBuyIdx<0|| wantBuyIdx >= fakeList.Count)
        if (wantBuyIdx < 0 || wantBuyIdx >= productList.Count)
        {
            return;
        }
        //int cost = fakeList[wantBuyIdx].Cost;
        int cost = GetDetailItem(wantBuyIdx).Cost;

        pRoleMdl.GainMoney(-cost);
        //if(fakeList[wantBuyIdx].LeftInStock > 0)
        if (CheckAvaiableLeftInStock(wantBuyIdx))
        {
            //fakeList[wantBuyIdx].LeftInStock -= 1;
            //pTaobaoMgr.GetProductList()[wantBuyIdx].LeftInStock -= 1;
            ReduceLeftInStock(wantBuyIdx);
        }

        //pCardMgr.GainNewCard(fakeList[wantBuyIdx].CardRelate);
    }
コード例 #5
0
    public void LearnCurSkill()
    {
        //if(selectedSkill == -1 || selectedSkill >= model.NowSkills.Count)
        //{
        //    return;
        //}

        if (selectedSkillId == "")
        {
            return;
        }
        //string skillId = model.NowSkills[selectedSkill];
        string    skillId = selectedSkillId;
        SkillInfo skill   = pSkillMgr.GetOwnedSkill(skillId);

        //满级则返回
        if (skill != null && skill.SkillLvl == pSkillMgr.GetSkillAsset(skillId).MaxLevel)
        {
            return;
        }
        int targetLevel = 1;

        if (skill != null)
        {
            targetLevel = skill.SkillLvl + 1;
        }
        SkillAsset sa = pSkillMgr.GetSkillAsset(selectedSkillId);

        if (rmgr.Money < sa.Prices[targetLevel - 1])
        {
            mUIMgr.ShowHint("没钱");
            return;
        }
        rmgr.GainMoney(sa.Prices[targetLevel - 1]);

        pSkillMgr.GainSkills(skillId);
        ShowDetail(skillId);
    }