示例#1
0
        public override bool Parse(Hashtable info)
        {
            if (!base.Parse(info))
            {
                return(false);
            }

            ImpactData = CombatUtil.ParseImpactData(info, null);

            return(true);
        }
示例#2
0
        public override bool Parse(Hashtable info)
        {
            m_owner = CombatantIndex.Parse(info["sender"] as Hashtable);
            if (m_owner == null)
            {
                EB.Debug.LogWarning("CombatImpactEvent.Parse: owner is empty {0}", EB.JSON.Stringify(info));
                return(false);
            }

            ImpactData = CombatUtil.ParseImpactData(info["impact_data"] as Hashtable, null);

            List <CombatEvent> children = CombatUtil.ParseEffects(info);

            if (children != null)
            {
                m_children = children;
            }

            int len = m_children.Count;

            for (int i = 0; i < len; i++)
            {
                CombatEffectEvent effect = m_children[i] as CombatEffectEvent;
                if (effect.Timing == eCombatEventTiming.AUTO)
                {
                    effect.Timing = eCombatEventTiming.ON_START;
                }

                if (effect.Sender == null)
                {
                    effect.Sender = new CombatantIndex(m_owner.TeamIndex, m_owner.IndexOnTeam);
                }
            }

            return(true);
        }