示例#1
0
    public override void DoEffect(BattleManager battlemgr, CardInstance cardInstance, CardEffectTemplate effectTplt, int targetInstId)
    {
        BattleModel battleModel = BattleModel.Inst;
        BuffInst    decBuff     = battleModel.selfData.GetBuffInst((uint)effectTplt.iEffectValue);

        if (decBuff != null)
        {
            battleModel.DecBuffEffectVal(battleModel.selfData, decBuff, effectTplt.iEffectCount);
        }
    }
示例#2
0
    //结算受击效果
    private void OnObjectHitted(ObjectBase caster, ObjectBase target, int reduceHp, int reduceArmor)
    {
        List <BuffInst> lstBuffInst = new List <BuffInst>(target.lstBuffInst);

        foreach (var buffInst in lstBuffInst)
        {
            BuffTemplate template = BuffTemplateData.GetData(buffInst.tplId);
            if (template == null)
            {
                continue;
            }
            switch (template.nType)
            {
            case BuffType.ARMOR_REFLECT:
                if (0 == reduceArmor)
                {
                    continue;
                }

                int reflectValue = (reduceArmor * buffInst.effectVal) / 100;
                _battleModel.ReduceEnemyHp(caster.instId, reflectValue);
                break;

            case BuffType.MULTI_ARMOR:
                if (reduceHp > 0)
                {
                    //受伤少一层护甲
                    _battleModel.DecBuffEffectVal(target, buffInst, 1);
                }
                break;

            default:
                //Debug.LogError("unhandle on hit buff type:" + template.nType);
                break;
            }
        }
    }