Esempio n. 1
0
    public void Init(ZhiboGameMode gameMode, ZhiboBuffInfo buffInfo)
    {
        this.bInfo       = buffInfo;
        this.LeftTurn    = buffInfo.TurnLast;
        this.LeftCardNum = buffInfo.CardNum;
        this.gameMode    = gameMode;

        if (bInfo.TurnLast > 0)
        {
            BuffLastType |= (int)eBuffLastType.TURN_BASE;
        }
        if (bInfo.SecLast > 0)
        {
            BuffLastType |= (int)eBuffLastType.TIME_BASE;
        }
        if (bInfo.CardNum > 0)
        {
            BuffLastType |= (int)eBuffLastType.CARD_BASE;
        }



        if (buffInfo.filterString != null && buffInfo.filterString != string.Empty)
        {
            filter = CardFilter.parseFilterFromString(buffInfo.filterString);
        }
        BindView();
        RegisterEvent();
    }
Esempio n. 2
0
 public static bool isCardAffectBuff(ZhiboBuffInfo buff)
 {
     if (buff.BuffType > eBuffType.NC_First)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
    public void GenBuff(ZhiboBuffInfo cinfo)
    {
        ZhiboBuff buff = gameMode.mUICtrl.GenBuff();

        buff.Init(gameMode, cinfo);
        gameMode.state.ZhiboBuffs.Add(buff);
        CalculateBuffExtras();
    }
Esempio n. 4
0
    //public void RemoveCard(int idx){
    //	cards.RemoveAt (idx);
    //}
    //public void RemoveCard(CardInfo c){
    //	cards.Remove (c);
    //}


    public void GenFakeCards()
    {
        for (int i = 0; i < 30; i++)
        {
            CardAsset ca = new CardAsset();
            ca.CardName       = "技能卡";
            ca.CardType       = eCardType.ABILITY;
            ca.CardId         = string.Format("test_{0:00}", i + 1);
            ca.CardEffectDesp = "等级" + (i + 1) + "的攻击卡";
            ca.CatdImageName  = "Image_Bangyigegezuibangla";
            ca.BaseSkillId    = string.Format("test_{0:00}", (i) / 5 + 1);
            ca.GemString      = "2,2,0,0,0,0";
            //ca.Gems = new int[] {2,2,0,0,0,0};
            ca.cost = 2;
            {
                CardEffect ce = new CardEffect();
                ce.effectType   = eEffectType.GetScore;
                ce.effectString = ((i + 1) * 5) + "";
                ca.Effects.Add(ce);
            }
            CardDict.Add(ca.CardId, ca);
        }
        for (int i = 0; i < 30; i++)
        {
            CardAsset ca = new CardAsset();
            ca.CardName       = "回血卡";
            ca.CardType       = eCardType.ABILITY;
            ca.CardId         = string.Format("test_xue_{0:00}", i + 1);
            ca.CardEffectDesp = "等级" + (i + 1) + "的回血卡";
            ca.CatdImageName  = "Image_Kongqibanfan";
            ca.BaseSkillId    = string.Format("test_{0:00}", (i) / 5 + 1);
            ca.GemString      = "2,0,2,0,0,0";
            //ca.Gems = new int[] { 2, 0, 2, 0, 0, 0 };
            ca.cost = 2;
            {
                CardEffect ce = new CardEffect();
                ce.effectType   = eEffectType.AddHp;
                ce.effectString = ((i + 1) * 1) + "";
                ca.Effects.Add(ce);
            }
            CardDict.Add(ca.CardId, ca);
        }
        for (int i = 0; i < 30; i++)
        {
            CardAsset ca = new CardAsset();
            ca.CardName       = "防御卡";
            ca.CardType       = eCardType.ABILITY;
            ca.CardId         = string.Format("test_armor_{0:00}", i + 1);
            ca.CardEffectDesp = "等级" + (i + 1) + "的防御卡";
            ca.GemString      = "1,1,1,0,0,0";
            //ca.Gems = new int[] { 1, 1, 1, 0, 0, 0 };
            ca.CatdImageName = "Image_Zhaohuanshuijun";
            ca.BaseSkillId   = string.Format("test_{0:00}", (i) / 5);;
            ca.cost          = 2;
            {
                CardEffect ce = new CardEffect();
                ce.effectType   = eEffectType.GetArmor;
                ce.effectString = ((i + 1) * 3) + "";
                ca.Effects.Add(ce);
            }
            CardDict.Add(ca.CardId, ca);
        }

        for (int i = 0; i < 40; i++)
        {
            CardAsset ca = new CardAsset();
            ca.CardName       = "道具卡";
            ca.CardType       = eCardType.ITEM;
            ca.CardId         = string.Format("item_{0:00}", i + 1);
            ca.CardEffectDesp = "等级" + (i + 1) + "的道具卡,每回合增加" + ((i + 1)) + "点属性";
            ca.CatdImageName  = "Image_Longju";
            ca.BaseSkillId    = null;
            ca.cost           = 0;
            {
                CardTurnEffect ce = new CardTurnEffect();
                ce.type  = eCardTurnEffectType.Shuxing;
                ce.value = ((i + 1));
                ca.TurnEffects.Add(ce);
            }
            {
                CardEffect ce = new CardEffect();
                ce.isAddBuff = true;
                ZhiboBuffInfo buffInfo = new ZhiboBuffInfo();

                buffInfo.BuffType  = eBuffType.Jiyi_Add;
                buffInfo.BuffLevel = 10 + i * 5;
                buffInfo.TurnLast  = 2;

                ce.buffInfo.Add(buffInfo);
                ca.Effects.Add(ce);
            }
            CardDict.Add(ca.CardId, ca);
        }
    }