Ejemplo n.º 1
0
 private void RequestBuff()
 {
     if (this.m_Owner == null)
     {
         return;
     }
     for (int index1 = 0; index1 < this.m_Owner.BuffAttachments.Count; ++index1)
     {
         BuffAttachment buffAttachment = this.m_Owner.BuffAttachments[index1];
         if (!(bool)buffAttachment.IsPassive && this.GetObject(buffAttachment) == null)
         {
             foreach (UnitBuffDisplayNode.Param obj in UnitBuffDisplayNode.CreateParams(this, this.m_Owner, buffAttachment))
             {
                 UnitBuffDisplay.Object @object = (UnitBuffDisplay.Object)null;
                 for (int index2 = 0; index2 < this.m_Objects.Count; ++index2)
                 {
                     if (this.m_Objects[index2].IsEqual(obj))
                     {
                         @object = this.m_Objects[index2];
                         break;
                     }
                 }
                 if (@object == null)
                 {
                     this.m_Objects.Add(new UnitBuffDisplay.Object(obj));
                 }
                 else
                 {
                     @object.Add(obj);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private bool actionBuff(Unit target, EffectCheckTimings chk_timing, RandXorshift rand = null)
        {
            if (this.mBuffEffect == null || target == null || !this.mBuffEffect.CheckEnableBuffTarget(target))
            {
                return(false);
            }
            if (rand != null)
            {
                int rate = (int)this.mBuffEffect.param.rate;
                if (0 < rate && rate < 100 && (int)(rand.Get() % 100U) > rate)
                {
                    return(true);
                }
            }
            BaseStatus status1 = new BaseStatus();
            BaseStatus status2 = new BaseStatus();
            BaseStatus status3 = new BaseStatus();
            BaseStatus status4 = new BaseStatus();
            BaseStatus status5 = new BaseStatus();
            BaseStatus status6 = new BaseStatus();

            this.mBuffEffect.CalcBuffStatus(ref status1, target.Element, BuffTypes.Buff, true, false, SkillParamCalcTypes.Add, 0);
            this.mBuffEffect.CalcBuffStatus(ref status2, target.Element, BuffTypes.Buff, true, true, SkillParamCalcTypes.Add, 0);
            this.mBuffEffect.CalcBuffStatus(ref status3, target.Element, BuffTypes.Buff, false, false, SkillParamCalcTypes.Scale, 0);
            this.mBuffEffect.CalcBuffStatus(ref status4, target.Element, BuffTypes.Debuff, true, false, SkillParamCalcTypes.Add, 0);
            this.mBuffEffect.CalcBuffStatus(ref status5, target.Element, BuffTypes.Debuff, true, true, SkillParamCalcTypes.Add, 0);
            this.mBuffEffect.CalcBuffStatus(ref status6, target.Element, BuffTypes.Debuff, false, false, SkillParamCalcTypes.Scale, 0);
            if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Add, false))
            {
                BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Buff, false, SkillParamCalcTypes.Add, status1, chk_timing);
                target.SetBuffAttachment(buffAttachment, false);
            }
            if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Add, true))
            {
                BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Buff, true, SkillParamCalcTypes.Add, status2, chk_timing);
                target.SetBuffAttachment(buffAttachment, false);
            }
            if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Scale))
            {
                BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Buff, false, SkillParamCalcTypes.Scale, status3, chk_timing);
                target.SetBuffAttachment(buffAttachment, false);
            }
            if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Add, false))
            {
                BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Debuff, false, SkillParamCalcTypes.Add, status4, chk_timing);
                target.SetBuffAttachment(buffAttachment, false);
            }
            if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Add, true))
            {
                BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Debuff, true, SkillParamCalcTypes.Add, status5, chk_timing);
                target.SetBuffAttachment(buffAttachment, false);
            }
            if (this.mBuffEffect.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Scale))
            {
                BuffAttachment buffAttachment = this.createBuffAttachment(target, BuffTypes.Debuff, false, SkillParamCalcTypes.Scale, status6, chk_timing);
                target.SetBuffAttachment(buffAttachment, false);
            }
            return(true);
        }
Ejemplo n.º 3
0
 private UnitBuffDisplay.Object GetObject(BuffAttachment buff)
 {
     for (int index = 0; index < this.m_Objects.Count; ++index)
     {
         if (this.m_Objects[index].paramlist.FindIndex((Predicate <UnitBuffDisplayNode.Param>)(prop => prop.buff == buff)) != -1)
         {
             return(this.m_Objects[index]);
         }
     }
     return((UnitBuffDisplay.Object)null);
 }
Ejemplo n.º 4
0
        private bool attachBuffPassive(Unit target)
        {
            if (target == null)
            {
                return(false);
            }
            bool flag = false;

            using (List <BuffEffect> .Enumerator enumerator = this.mBuffEffectLists.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    BuffEffect current = enumerator.Current;
                    if (current != null && current.param.chk_timing == EffectCheckTimings.Eternal && current.CheckEnableBuffTarget(target))
                    {
                        BaseStatus status1 = new BaseStatus();
                        BaseStatus status2 = new BaseStatus();
                        BaseStatus status3 = new BaseStatus();
                        BaseStatus status4 = new BaseStatus();
                        current.CalcBuffStatus(ref status1, BuffTypes.Buff, SkillParamCalcTypes.Add);
                        current.CalcBuffStatus(ref status2, BuffTypes.Buff, SkillParamCalcTypes.Scale);
                        current.CalcBuffStatus(ref status3, BuffTypes.Debuff, SkillParamCalcTypes.Add);
                        current.CalcBuffStatus(ref status4, BuffTypes.Debuff, SkillParamCalcTypes.Scale);
                        if (current.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Add))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Buff, SkillParamCalcTypes.Add, status1);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        if (current.CheckBuffCalcType(BuffTypes.Buff, SkillParamCalcTypes.Scale))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Buff, SkillParamCalcTypes.Scale, status2);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        if (current.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Add))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Debuff, SkillParamCalcTypes.Add, status3);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        if (current.CheckBuffCalcType(BuffTypes.Debuff, SkillParamCalcTypes.Scale))
                        {
                            BuffAttachment buffAttachment = this.createBuffAttachment(target, current, BuffTypes.Debuff, SkillParamCalcTypes.Scale, status4);
                            target.SetBuffAttachment(buffAttachment, false);
                        }
                        flag = true;
                    }
                }
            }
            return(flag);
        }
Ejemplo n.º 5
0
 public void CopyTo(BuffAttachment dsc)
 {
     dsc.user                  = this.user;
     dsc.turn                  = this.turn;
     dsc.IsPassive             = this.IsPassive;
     dsc.skill                 = this.skill;
     dsc.skilltarget           = this.skilltarget;
     dsc.mParam                = this.mParam;
     dsc.BuffType              = this.BuffType;
     dsc.IsNegativeValueIsBuff = this.IsNegativeValueIsBuff;
     dsc.CalcType              = this.CalcType;
     dsc.CheckTarget           = this.CheckTarget;
     dsc.CheckTiming           = this.CheckTiming;
     dsc.UseCondition          = this.UseCondition;
     dsc.DuplicateCount        = this.DuplicateCount;
     dsc.LinkageID             = this.LinkageID;
     dsc.UpBuffCount           = this.UpBuffCount;
     this.status.CopyTo(dsc.status);
 }
Ejemplo n.º 6
0
        public static int GetValue(UnitBuffDisplayNode.BuffType buffType, BuffAttachment buff)
        {
            switch (buffType)
            {
            case UnitBuffDisplayNode.BuffType.ATK:
                return((int)buff.status.param.atk);

            case UnitBuffDisplayNode.BuffType.DEF:
                return((int)buff.status.param.def);

            case UnitBuffDisplayNode.BuffType.MAG:
                return((int)buff.status.param.mag);

            case UnitBuffDisplayNode.BuffType.MND:
                return((int)buff.status.param.mnd);

            default:
                return(0);
            }
        }
Ejemplo n.º 7
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;
            }
        }
Ejemplo n.º 8
0
        private BuffAttachment createBuffAttachment(Unit target, BuffTypes buff_type, SkillParamCalcTypes calc_type, BaseStatus status, EffectCheckTimings chk_timing)
        {
            if (this.mBuffEffect == null)
            {
                return((BuffAttachment)null);
            }
            BuffAttachment buffAttachment = new BuffAttachment(this.mBuffEffect.param);

            buffAttachment.user           = this.mCreateUnit;
            buffAttachment.skill          = (SkillData)null;
            buffAttachment.skilltarget    = SkillEffectTargets.Self;
            buffAttachment.IsPassive      = (OBool)false;
            buffAttachment.CheckTarget    = (Unit)null;
            buffAttachment.DuplicateCount = 0;
            buffAttachment.CheckTiming    = chk_timing;
            buffAttachment.turn           = (OInt)1;
            buffAttachment.BuffType       = buff_type;
            buffAttachment.CalcType       = calc_type;
            buffAttachment.UseCondition   = this.mBuffEffect.param.cond;
            status.CopyTo(buffAttachment.status);
            return(buffAttachment);
        }
Ejemplo n.º 9
0
        private BuffAttachment createBuffAttachment(Unit target, BuffEffect effect, BuffTypes buff_type, SkillParamCalcTypes calc_type, BaseStatus status)
        {
            if (effect == null)
            {
                return((BuffAttachment)null);
            }
            BuffAttachment buffAttachment = new BuffAttachment(effect.param);

            buffAttachment.user           = this.mModifyUnit;
            buffAttachment.skill          = (SkillData)null;
            buffAttachment.skilltarget    = SkillEffectTargets.Self;
            buffAttachment.IsPassive      = (OBool)true;
            buffAttachment.CheckTarget    = (Unit)null;
            buffAttachment.DuplicateCount = 0;
            buffAttachment.CheckTiming    = effect.param.chk_timing;
            buffAttachment.turn           = effect.param.turn;
            buffAttachment.BuffType       = buff_type;
            buffAttachment.CalcType       = calc_type;
            buffAttachment.UseCondition   = ESkillCondition.Weather;
            status.CopyTo(buffAttachment.status);
            return(buffAttachment);
        }
Ejemplo n.º 10
0
 private void detachPassive(Unit target)
 {
     if (target == null)
     {
         return;
     }
     for (int index = 0; index < target.BuffAttachments.Count; ++index)
     {
         BuffAttachment buffAttachment = target.BuffAttachments[index];
         if (buffAttachment.UseCondition == ESkillCondition.Weather && (bool)buffAttachment.IsPassive)
         {
             target.BuffAttachments.RemoveAt(index--);
         }
     }
     for (int index = 0; index < target.CondAttachments.Count; ++index)
     {
         CondAttachment condAttachment = target.CondAttachments[index];
         if (condAttachment.UseCondition == ESkillCondition.Weather && (bool)condAttachment.IsPassive)
         {
             target.CondAttachments.RemoveAt(index--);
         }
     }
 }
Ejemplo n.º 11
0
 public Param(Unit _owner, BuffAttachment _buff, UnitBuffDisplay.NodeData _data)
 {
     this.owner = _owner;
     this.buff  = _buff;
     this.data  = _data;
 }
Ejemplo n.º 12
0
        public static UnitBuffDisplayNode.Param[] CreateParams(UnitBuffDisplay parent, Unit owner, BuffAttachment buff)
        {
            List <UnitBuffDisplayNode.Param> objList = new List <UnitBuffDisplayNode.Param>();

            for (int index = 1; index < 5; ++index)
            {
                UnitBuffDisplayNode.BuffType buffType = (UnitBuffDisplayNode.BuffType)index;
                if ((double)UnitBuffDisplayNode.GetValue(buffType, buff) != 0.0)
                {
                    UnitBuffDisplay.NodeData nodeData = parent.GetNodeData(buffType);
                    if (nodeData != null)
                    {
                        objList.Add(new UnitBuffDisplayNode.Param(owner, buff, nodeData));
                    }
                }
            }
            if (objList.Count == 0)
            {
                objList.Add(new UnitBuffDisplayNode.Param(owner, buff, (UnitBuffDisplay.NodeData)null));
            }
            return(objList.ToArray());
        }
Ejemplo n.º 13
0
        public BuffAttachment MakeBuff(Unit gimmick, Unit target)
        {
            BuffAttachment buffAttachment = new BuffAttachment();

            switch (this.GimmickType)
            {
            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:
                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)
                {
                    buffAttachment.status.param.atk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.DefUp)
                {
                    buffAttachment.status.param.def = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MagUp)
                {
                    buffAttachment.status.param.mag = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MndUp)
                {
                    buffAttachment.status.param.mnd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.RecUp)
                {
                    buffAttachment.status.param.rec = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.SpdUp)
                {
                    buffAttachment.status.param.spd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.CriUp)
                {
                    buffAttachment.status.param.cri = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.LukUp)
                {
                    buffAttachment.status.param.luk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MovUp)
                {
                    buffAttachment.status.param.mov = (OShort)2;
                    skillParamCalcTypes             = SkillParamCalcTypes.Add;
                }
                buffAttachment.user         = gimmick;
                buffAttachment.BuffType     = BuffTypes.Buff;
                buffAttachment.CalcType     = skillParamCalcTypes;
                buffAttachment.CheckTarget  = target;
                buffAttachment.CheckTiming  = EffectCheckTimings.ActionStart;
                buffAttachment.UseCondition = ESkillCondition.None;
                buffAttachment.IsPassive    = (OBool)false;
                buffAttachment.turn         = (OInt)gemsBuffTurn;
                break;
            }
            return(buffAttachment);
        }
Ejemplo n.º 14
0
        private static BattleSuspend.Data makeSaveData()
        {
            SceneBattle instance = SceneBattle.Instance;

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instance))
            {
                return((BattleSuspend.Data)null);
            }
            BattleCore battle = instance.Battle;

            if (battle == null)
            {
                return((BattleSuspend.Data)null);
            }
            BattleSuspend.Data        data = new BattleSuspend.Data();
            BattleSuspend.Data.Header hdr  = data.hdr;
            hdr.apv = Application.get_version();
            hdr.arv = AssetManager.AssetRevision;
            hdr.qid = battle.QuestID;
            hdr.bid = battle.BtlID;
            hdr.cat = GameUtility.Config_AutoMode_Treasure.Value;
            hdr.cad = GameUtility.Config_AutoMode_DisableSkill.Value;
            data.uil.Clear();
            using (List <Unit> .Enumerator enumerator1 = battle.AllUnits.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    Unit current1 = enumerator1.Current;
                    if (current1 != null)
                    {
                        BattleSuspend.Data.UnitInfo unitInfo = new BattleSuspend.Data.UnitInfo();
                        unitInfo.nam = current1.UnitName;
                        unitInfo.nhp = (int)current1.CurrentStatus.param.hp;
                        unitInfo.gem = current1.Gems;
                        unitInfo.ugx = current1.x;
                        unitInfo.ugy = current1.y;
                        unitInfo.dir = (int)current1.Direction;
                        unitInfo.ufg = current1.UnitFlag;
                        unitInfo.isb = current1.IsSub;
                        unitInfo.crt = (int)current1.ChargeTime;
                        unitInfo.tgi = BattleSuspend.GetIdxFromAllUnits(battle, current1.Target);
                        unitInfo.rti = BattleSuspend.GetIdxFromAllUnits(battle, current1.RageTarget);
                        unitInfo.cti = -1;
                        if (current1.CastSkill != null)
                        {
                            unitInfo.csi = current1.CastSkill.SkillParam.iname;
                            unitInfo.ctm = (int)current1.CastTime;
                            unitInfo.cid = (int)current1.CastIndex;
                            if (current1.CastSkillGridMap != null)
                            {
                                unitInfo.cgw = current1.CastSkillGridMap.w;
                                unitInfo.cgh = current1.CastSkillGridMap.h;
                                if (current1.CastSkillGridMap.data != null)
                                {
                                    unitInfo.cgm = new int[current1.CastSkillGridMap.data.Length];
                                    for (int index = 0; index < current1.CastSkillGridMap.data.Length; ++index)
                                    {
                                        unitInfo.cgm[index] = !current1.CastSkillGridMap.data[index] ? 0 : 1;
                                    }
                                }
                            }
                            unitInfo.ctx = current1.GridTarget == null ? -1 : current1.GridTarget.x;
                            unitInfo.cty = current1.GridTarget == null ? -1 : current1.GridTarget.y;
                            unitInfo.cti = BattleSuspend.GetIdxFromAllUnits(battle, current1.UnitTarget);
                        }
                        unitInfo.dct = current1.DeathCount;
                        unitInfo.ajw = current1.AutoJewel;
                        unitInfo.wtt = current1.WaitClock;
                        unitInfo.mvt = current1.WaitMoveTurn;
                        unitInfo.acc = current1.ActionCount;
                        unitInfo.tuc = current1.TurnCount;
                        unitInfo.trc = current1.EventTrigger == null ? 0 : current1.EventTrigger.Count;
                        unitInfo.klc = current1.KillCount;
                        if (current1.EntryTriggers != null)
                        {
                            unitInfo.etr = new int[current1.EntryTriggers.Count];
                            for (int index = 0; index < current1.EntryTriggers.Count; ++index)
                            {
                                unitInfo.etr[index] = !current1.EntryTriggers[index].on ? 0 : 1;
                            }
                        }
                        unitInfo.aid = (int)current1.AIActionIndex;
                        unitInfo.atu = (int)current1.AIActionTurnCount;
                        unitInfo.apt = (int)current1.AIPatrolIndex;
                        unitInfo.boi = current1.CreateBreakObjId;
                        unitInfo.boc = current1.CreateBreakObjClock;
                        unitInfo.sul.Clear();
                        using (Dictionary <SkillData, OInt> .Enumerator enumerator2 = current1.GetSkillUseCount().GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                KeyValuePair <SkillData, OInt> current2 = enumerator2.Current;
                                unitInfo.sul.Add(new BattleSuspend.Data.UnitInfo.SkillUse()
                                {
                                    sid = current2.Key.SkillParam.iname,
                                    ctr = (int)current2.Value
                                });
                            }
                        }
                        unitInfo.bfl.Clear();
                        using (List <BuffAttachment> .Enumerator enumerator2 = current1.BuffAttachments.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                BuffAttachment current2 = enumerator2.Current;
                                if ((!(bool)current2.IsPassive || current2.skill != null && !current2.skill.IsSubActuate()) && current2.CheckTiming != EffectCheckTimings.Moment)
                                {
                                    unitInfo.bfl.Add(new BattleSuspend.Data.UnitInfo.Buff()
                                    {
                                        sid = current2.skill == null ? (string)null : current2.skill.SkillParam.iname,
                                        stg = (int)current2.skilltarget,
                                        tur = (int)current2.turn,
                                        uni = BattleSuspend.GetIdxFromAllUnits(battle, current2.user),
                                        cui = BattleSuspend.GetIdxFromAllUnits(battle, current2.CheckTarget),
                                        tim = (int)current2.CheckTiming,
                                        ipa = (bool)current2.IsPassive,
                                        ucd = (int)current2.UseCondition,
                                        btp = (int)current2.BuffType,
                                        ctp = (int)current2.CalcType
                                    });
                                }
                            }
                        }
                        unitInfo.cdl.Clear();
                        using (List <CondAttachment> .Enumerator enumerator2 = current1.CondAttachments.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                CondAttachment current2 = enumerator2.Current;
                                if (!(bool)current2.IsPassive || current2.skill != null && !current2.skill.IsSubActuate())
                                {
                                    unitInfo.cdl.Add(new BattleSuspend.Data.UnitInfo.Cond()
                                    {
                                        sid = current2.skill == null ? (string)null : current2.skill.SkillParam.iname,
                                        tur = (int)current2.turn,
                                        uni = BattleSuspend.GetIdxFromAllUnits(battle, current2.user),
                                        cui = BattleSuspend.GetIdxFromAllUnits(battle, current2.CheckTarget),
                                        tim = (int)current2.CheckTiming,
                                        ipa = (bool)current2.IsPassive,
                                        ucd = (int)current2.UseCondition,
                                        cdt = (int)current2.CondType,
                                        cnd = (int)current2.Condition,
                                        icu = current2.IsCurse
                                    });
                                }
                            }
                        }
                        unitInfo.shl.Clear();
                        using (List <Unit.UnitShield> .Enumerator enumerator2 = current1.Shields.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                Unit.UnitShield current2 = enumerator2.Current;
                                unitInfo.shl.Add(new BattleSuspend.Data.UnitInfo.Shield()
                                {
                                    inm = current2.skill_param.iname,
                                    nhp = (int)current2.hp,
                                    mhp = (int)current2.hpMax,
                                    ntu = (int)current2.turn,
                                    mtu = (int)current2.turnMax,
                                    drt = (int)current2.damage_rate,
                                    dvl = (int)current2.damage_value
                                });
                            }
                        }
                        data.uil.Add(unitInfo);
                    }
                }
            }
            data.itl.Clear();
            using (Dictionary <OString, OInt> .Enumerator enumerator = battle.GetQuestRecord().used_items.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <OString, OInt> current = enumerator.Current;
                    data.itl.Add(new BattleSuspend.Data.UsedItem()
                    {
                        iti = (string)current.Key,
                        num = (int)current.Value
                    });
                }
            }
            data.trl.Clear();
            using (List <TrickData> .Enumerator enumerator = TrickData.GetEffectAll().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    TrickData current = enumerator.Current;
                    data.trl.Add(new BattleSuspend.Data.TrickInfo()
                    {
                        tid = current.TrickParam.Iname,
                        val = (bool)current.Valid,
                        cun = BattleSuspend.GetIdxFromAllUnits(battle, current.CreateUnit),
                        rnk = (int)current.Rank,
                        rcp = (int)current.RankCap,
                        grx = (int)current.GridX,
                        gry = (int)current.GridY,
                        rac = (int)current.RestActionCount,
                        ccl = (int)current.CreateClock,
                        tag = current.Tag
                    });
                }
            }
            data.sel.Clear();
            using (Dictionary <string, BattleCore.SkillExecLog> .KeyCollection.Enumerator enumerator = battle.SkillExecLogs.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    data.sel.Add(new BattleSuspend.Data.SkillExecLogInfo()
                    {
                        inm  = current,
                        ucnt = battle.SkillExecLogs[current].use_count,
                        kcnt = battle.SkillExecLogs[current].kill_count
                    });
                }
            }
            BattleSuspend.Data.Variables var = data.var;
            var.wtc = battle.WinTriggerCount;
            var.ltc = battle.LoseTriggerCount;
            var.act = battle.ActionCount;
            var.kls = battle.Killstreak;
            var.mks = battle.MaxKillstreak;
            var.thl = battle.TotalHeal;
            var.tdt = battle.TotalDamagesTaken;
            var.tdm = battle.TotalDamages;
            var.nui = battle.NumUsedItems;
            var.nus = battle.NumUsedSkills;
            var.ctm = battle.ClockTime;
            var.ctt = battle.ClockTimeTotal;
            var.coc = battle.ContinueCount;
            var.fns = battle.FinisherIname;
            var.glc = instance.GoldCount;
            var.trc = instance.TreasureCount;
            var.rsd = battle.Seed;
            uint[] seed = battle.Rand.GetSeed();
            if (seed != null)
            {
                var.ris = new uint[seed.Length];
                seed.CopyTo((Array)var.ris, 0);
            }
            var.gsl.Clear();
            using (List <GimmickEvent> .Enumerator enumerator = battle.GimmickEventList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GimmickEvent current = enumerator.Current;
                    var.gsl.Add(new BattleSuspend.Data.Variables.GimmickEvent()
                    {
                        ctr = current.count,
                        cmp = !current.IsCompleted ? 0 : 1
                    });
                }
            }
            var.ssl.Clear();
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance.EventScript, (UnityEngine.Object)null) && instance.EventScript.mSequences != null)
            {
                foreach (EventScript.ScriptSequence mSequence in instance.EventScript.mSequences)
                {
                    var.ssl.Add(new BattleSuspend.Data.Variables.ScriptEvent()
                    {
                        trg = mSequence.Triggered
                    });
                }
            }
            var.tkk     = battle.TargetKillstreak.Keys.ToArray <string>();
            var.tkv     = battle.TargetKillstreak.Values.ToArray <int>();
            var.mtk     = battle.MaxTargetKillstreak.Keys.ToArray <string>();
            var.mtv     = battle.MaxTargetKillstreak.Values.ToArray <int>();
            var.pbm     = battle.PlayByManually;
            var.uam     = battle.IsUseAutoPlayMode;
            var.wti.wid = (string)null;
            WeatherData currentWeatherData = WeatherData.CurrentWeatherData;

            if (currentWeatherData != null)
            {
                var.wti.wid = currentWeatherData.WeatherParam.Iname;
                var.wti.mun = BattleSuspend.GetIdxFromAllUnits(battle, currentWeatherData.ModifyUnit);
                var.wti.rnk = (int)currentWeatherData.Rank;
                var.wti.rcp = (int)currentWeatherData.RankCap;
                var.wti.ccl = (int)currentWeatherData.ChangeClock;
            }
            data.ivl = true;
            return(data);
        }
Ejemplo n.º 15
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;
            }
        }