Esempio n. 1
0
    private void SettleBuffOnBoutStart(ObjectBase targetObj)
    {
        List <BuffInst> lstBuffInst = new List <BuffInst>(targetObj.lstBuffInst);

        foreach (var buffInst in lstBuffInst)
        {
            BuffTemplate template = BuffTemplateData.GetData(buffInst.tplId);
            if (template == null)
            {
                continue;
            }

            if (template.nType == BuffType.GET_BUFF_ROUND_START)
            {
                _battleModel.AddBuff(targetObj, targetObj, (uint)template.iEffectB, buffInst.effectVal);
            }

            if (buffInst.leftBout != -1)
            {
                //Debug.LogError("DecBuffLeftBout" + buffInst.leftBout);
                if (template.nTrigger == BuffTriggerType.BOUT_START)
                {
                    _battleModel.DecBuffLeftBout(targetObj, buffInst, 1);
                }
            }
        }
    }
Esempio n. 2
0
    public override void DoEffect(BattleManager battlemgr, CardInstance cardInstance, CardEffectTemplate effectTplt, int targetInstId)
    {
        BattleModel battleModel = BattleModel.Inst;
        BuffInst    rmBuff      = battleModel.selfData.GetBuffInst((uint)effectTplt.iEffectValue);

        if (rmBuff != null)
        {
            battleModel.RemoveBuff(battleModel.selfData, rmBuff);
            battleModel.AddBuff(battleModel.selfData, battleModel.selfData, (uint)effectTplt.iEffectValue_2, rmBuff.effectVal);
        }
    }
Esempio n. 3
0
    public override void DoEffect(BattleManager battlemgr, CardInstance cardInstance, CardEffectTemplate effectTplt, int targetInstId)
    {
        int         iCount      = BattleTool.GetCardEffectCount(effectTplt);
        BattleModel battleModel = BattleModel.Inst;

        if (effectTplt.nTarget == CardEffectTargetType.ONE_ENEMY)
        {
            battleModel.AddBuff(battleModel.selfData, battleModel.GetEnemy(targetInstId), (uint)effectTplt.iEffectValue, iCount);
        }
        else if (effectTplt.nTarget == CardEffectTargetType.ALL_ENEMY)
        {
            foreach (KeyValuePair <int, EnemyInstance> pair in battleModel.GetEnemys())
            {
                battleModel.AddBuff(battleModel.selfData, pair.Value, (uint)effectTplt.iEffectValue, iCount);
            }
        }
        else if (effectTplt.nTarget == CardEffectTargetType.SELF)
        {
            battleModel.AddBuff(battleModel.selfData, battleModel.selfData, (uint)effectTplt.iEffectValue, iCount);
        }
        return;
    }