public override bool Parse(Hashtable info) { eCombatEventType type = ParseType(info); if (type != eCombatEventType.SYNC) { EB.Debug.LogWarning("CombatSyncEvent.Parse: invalid type = {0}", type); return(false); } 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(effect.Target.TeamIndex, effect.Target.IndexOnTeam); } } return(true); }
public override bool Parse(Hashtable info) { if (!base.Parse(info)) { return(false); } ImpactData = CombatUtil.ParseImpactData(info, null); return(true); }
protected static eCombatEventType ParseType(Hashtable info) { string type_info = EB.Dot.String("type", info, null); if (string.IsNullOrEmpty(type_info)) { return(eCombatEventType.INVALID); } return(CombatUtil.GetType(type_info)); }
public override bool Parse(Hashtable info) { if (!base.Parse(info)) { return(false); } Attributes = CombatUtil.ParseCombatantAttributes(info, null); return(true); }
public override bool Parse(Hashtable info) { if (!base.Parse(info)) { return(false); } Data = CombatUtil.ParseCombatantData(info["data"] as Hashtable, null); Attributes = CombatUtil.ParseCombatantAttributes(info["status"] as Hashtable, null); return(true); }
protected static eCombatEventTiming ParseTiming(Hashtable info) { eCombatEventTiming timing = eCombatEventTiming.AUTO; string timing_info = EB.Dot.String("timing", info, null); if (!string.IsNullOrEmpty(timing_info)) { timing = CombatUtil.GetTiming(timing_info); } return(timing); }
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); }
public override bool Parse(Hashtable info) { if (!base.Parse(info)) { return(false); } IsCombo = m_timing != eCombatEventTiming.AUTO; ComboDelay = EB.Dot.Single("delay", info, 0.0f); // skip flag m_skip = EB.Dot.Bool("skip", info, false); m_sender = ParseSender(info); if (m_sender == null) { EB.Debug.LogWarning("CombatSkillEvent.Parse: sender is empty {0}", EB.JSON.Stringify(info)); return(false); } // may be empty m_trigger = ParseTrigger(info); m_target = ParseTarget(info); m_skillId = ParseSkillId(info); if (m_skillId < 0) { EB.Debug.LogWarning("CombatSkillEvent.Parse: skill is empty {0}", EB.JSON.Stringify(info)); return(false); } m_targets = ParseTargets(info); if (m_targets == null) { if (m_skip && m_target == null) { m_targets = new HashSet <CombatantIndex>(); } else { EB.Debug.LogWarning("CombatSkillEvent.Parse: targets is empty {0}", EB.JSON.Stringify(info)); return(false); } } m_comboIndex = EB.Dot.Integer("combo_index", info, m_comboIndex); m_children = CombatUtil.ParseEffects(info); if (m_children == null) { if (m_skip && m_target == null) { m_children = new List <CombatEvent>(); } else { EB.Debug.LogWarning("CombatSkillEvent.Parse: effects is empty {0}", EB.JSON.Stringify(info)); return(false); } } 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.RUNTIME; } if (effect.Sender == null) { effect.Sender = new CombatantIndex(m_sender.TeamIndex, m_sender.IndexOnTeam); } } return(true); }