示例#1
0
        public void ExecuteGimmickEffect(Unit gimmick, Unit target, LogMapEvent log = null)
        {
            switch (this.GimmickType)
            {
            case EEventGimmick.Heal:
                int num = 0;
                if (!target.IsUnitCondition(EUnitCondition.DisableHeal))
                {
                    int hp  = (int)target.MaximumStatus.param.hp;
                    int val = hp * this.IntValue / 100;
                    num = Math.Min(target.CalcParamRecover(val), hp - (int)target.CurrentStatus.param.hp);
                }
                target.Heal(num);
                if (log == null)
                {
                    break;
                }
                log.heal = num;
                break;

            case EEventGimmick.AtkUp:
            case EEventGimmick.DefUp:
            case EEventGimmick.MagUp:
            case EEventGimmick.MndUp:
            case EEventGimmick.RecUp:
            case EEventGimmick.SpdUp:
            case EEventGimmick.CriUp:
            case EEventGimmick.LukUp:
            case EEventGimmick.MovUp:
                BuffAttachment buff = this.MakeBuff(gimmick, target);
                target.SetBuffAttachment(buff, false);
                if (log == null)
                {
                    break;
                }
                BattleCore.SetBuffBits(buff.status, ref log.buff, ref log.debuff);
                break;
            }
        }
示例#2
0
        public void ExecuteGimmickEffect(Unit gimmick, Unit target, LogMapEvent log = null)
        {
            switch (this.GimmickType)
            {
            case EEventGimmick.Heal:
                int hp  = (int)target.MaximumStatus.param.hp;
                int num = Math.Min(hp * this.IntValue / 100, hp - (int)target.CurrentStatus.param.hp);
                target.Heal(num);
                if (log == null)
                {
                    break;
                }
                log.heal = num;
                break;

            case EEventGimmick.AtkUp:
            case EEventGimmick.DefUp:
            case EEventGimmick.MagUp:
            case EEventGimmick.MndUp:
            case EEventGimmick.RecUp:
            case EEventGimmick.SpdUp:
            case EEventGimmick.CriUp:
            case EEventGimmick.LukUp:
            case EEventGimmick.MovUp:
                BuffAttachment      buff                = new BuffAttachment();
                FixParam            fixParam            = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;
                int                 gemsBuffValue       = (int)fixParam.GemsBuffValue;
                int                 gemsBuffTurn        = (int)fixParam.GemsBuffTurn;
                SkillParamCalcTypes skillParamCalcTypes = SkillParamCalcTypes.Scale;
                if (this.GimmickType == EEventGimmick.AtkUp)
                {
                    buff.status.param.atk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.DefUp)
                {
                    buff.status.param.def = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MagUp)
                {
                    buff.status.param.mag = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MndUp)
                {
                    buff.status.param.mnd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.RecUp)
                {
                    buff.status.param.rec = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.SpdUp)
                {
                    buff.status.param.spd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.CriUp)
                {
                    buff.status.param.cri = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.LukUp)
                {
                    buff.status.param.luk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MovUp)
                {
                    buff.status.param.mov = (OShort)2;
                    skillParamCalcTypes   = SkillParamCalcTypes.Add;
                }
                buff.user         = gimmick;
                buff.BuffType     = BuffTypes.Buff;
                buff.CalcType     = skillParamCalcTypes;
                buff.CheckTarget  = target;
                buff.CheckTiming  = EffectCheckTimings.ActionStart;
                buff.UseCondition = ESkillCondition.None;
                buff.IsPassive    = (OBool)false;
                buff.turn         = (OInt)gemsBuffTurn;
                target.SetBuffAttachment(buff, false);
                if (log == null)
                {
                    break;
                }
                BattleCore.SetBuffBits(buff.status, ref log.buff, ref log.debuff);
                break;
            }
        }