Esempio n. 1
0
    public override void DoEffect(BattleManager battlemgr, CardInstance cardInstance, CardEffectTemplate effectTplt, int targetInstId)
    {
        BattleModel battleModel = BattleModel.Inst;
        // 如果有脆弱,减少增加的护甲值
        int iAddArmor = effectTplt.iEffectValue;

        iAddArmor = BattleTool.AdjustArmorVal(battleModel.selfData, iAddArmor);

        battleModel.AddArmor(battleModel.selfData, iAddArmor);
        return;
    }
Esempio n. 2
0
    private void SettleBuffOnBoutEnd(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;
            }
            switch (template.nType)
            {
            case BuffType.ADD_ARMOR_ROUND_END:
            case BuffType.MULTI_ARMOR:
                _battleModel.AddArmor(targetObj, buffInst.effectVal);
                break;

            default:
                //Debug.LogError("unhandle bout end buff:" + template.nType);
                break;
            }
        }

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

            if (buffInst.selfAddDebuffThisBout)
            {
                buffInst.selfAddDebuffThisBout = false;
                //Debug.LogError("buffId:" + buffInst.tplId + " selfAddDebuffThisBout");
            }
            else if (buffInst.leftBout != -1)
            {
                //Debug.LogError("DecBuffLeftBout" + buffInst.leftBout);
                if (template.nTrigger != BuffTriggerType.BOUT_START)
                {
                    _battleModel.DecBuffLeftBout(targetObj, buffInst, 1);
                }
            }
        }
    }
Esempio n. 3
0
    public override void OnCharBoutEnd(object obj)
    {
        FighterData charData = obj as FighterData;

        if (0 == charData.armor)
        {
            //获得护甲
            BattleModel   battleModel = BattleModel.Inst;
            RelicTemplate relicTplt   = RelicTemplateData.GetData(this.tplId);
            if (relicTplt != null)
            {
                battleModel.AddArmor(battleModel.selfData, relicTplt.nVal);
            }
        }

        return;
    }