示例#1
0
    public void InitSwitchSkillUI()
    {
        SkillBag.Clear();
        SkillBag.Capacity = 1;
        CSItem    card = CardBag.Singleton.GetCardByGuid(GUID);
        SkillInfo info = GameTable.SkillTableAsset.Lookup(card.SwitchSkillID);

        if (info != null)
        {
            SkillBag.Add(new ActorSkillInfo(info, card.SwitchSkillLevel));
        }
        foreach (var item in card.SkillItemInfoList)
        {
            SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item.m_skillID);
            if (skillInfo == null)
            {
                continue;
            }
            if (skillInfo.SkillType == (int)ENSkillType.enPassive)
            {//被动技能
                IResult r = BattleFactory.Singleton.CreateResult(ENResult.AddBuff, ID, ID, 0, 0, skillInfo.BuffIDList.ToArray());
                if (r != null)
                {
                    r.ResultExpr(skillInfo.BuffIDList.ToArray());
                    BattleFactory.Singleton.DispatchResult(r);
                }
            }
        }
        //通知UISwitchSkill
        //NotifyChanged((int)ENPropertyChanged.enSwitchSkill, null);
    }
示例#2
0
 public override void OnInitSkillBag(bool isNotifyUI = false)
 {
     if (SkillBag == null)
     {
         SkillBag = new List <ActorSkillInfo>();
     }
     SkillBag.Clear();
     //normal skill
     foreach (var item in CurrentTableInfo.NormalSkillIDList)
     {
         SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item);
         if (skillInfo == null)
         {
             continue;
         }
         if (null == SkillBag.Find(info => info.SkillTableInfo.ID == item))
         {
             SkillBag.Add(new ActorSkillInfo(skillInfo, 0));
         }
     }
     {        //open box skill
         SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(CurrentTableInfo.OpenBoxSkillID);
         if (skillInfo != null)
         {
             if (null == SkillBag.Find(info => info.SkillTableInfo.ID == skillInfo.ID))
             {
                 SkillBag.Add(new ActorSkillInfo(skillInfo, 0));
             }
         }
     }
     base.OnInitSkillBag(isNotifyUI);
 }
示例#3
0
    public override void OnInitSkillBag(bool isNotifyUI = false)
    {
        if (SkillBag == null)
        {
            SkillBag = new List <ActorSkillInfo>();
        }
        SkillBag.Clear();
        base.OnInitSkillBag(isNotifyUI);
        //luozhijia test
        //skill bag
        //PropertyValueIntListView tmpPropVal = Props.GetProperty_Custom(ENProperty.SkillList) as PropertyValueIntListView;

        //foreach (var item in tmpPropVal.m_list)
        //{
        //    SkillInfo info = GameTable.SkillTableAsset.Lookup(item);
        //    if (info != null)
        //    {
        //        SkillBag.Add(new ActorSkillInfo(info));
        //    }
        //}

        ////被动技能
        //tmpPropVal = Props.GetProperty_Custom(ENProperty.PassiveSkillList) as PropertyValueIntListView;
        //foreach (var item in tmpPropVal.m_list)
        //{
        //    SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item);
        //    if (skillInfo == null) continue;
        //    if (skillInfo.SkillType == (int)ENSkillType.enPassive)
        //    {
        //        IResult r = BattleFactory.Singleton.CreateResult(ENResult.AddBuff, ID, ID);
        //        if (r != null)
        //        {
        //            r.ResultExpr(skillInfo.BuffIDList.ToArray());
        //            BattleFactory.Singleton.DispatchResult(r);
        //        }
        //    }
        //}
    }