internal static CashEffect Parse(WZProperty wZProperty) { CashEffect effect = new CashEffect(); bool isOnlyDefault = false; effect.isFollow = wZProperty.ResolveFor <bool>("follow") ?? false; foreach (WZProperty obj in wZProperty.Children.Where(c => c.NameWithoutExtension != "follow" && c.NameWithoutExtension != "info")) { int frameTest = 0; if (isOnlyDefault = (obj.Type == PropertyType.Canvas || int.TryParse(obj.NameWithoutExtension, out frameTest))) { break; } if (obj.Children.Count() == 0) { continue; } effect.framebooks.Add(obj.NameWithoutExtension, FrameBook.Parse(obj)); } if (isOnlyDefault) { effect.framebooks.Add("default", FrameBook.Parse(wZProperty)); } return(effect); }
public static Effects Parse(WZProperty effectContainer) { Effects effects = new Effects(); int?z = effectContainer.ResolveFor <int>("effect/z");//itemEffect["effect"].HasChild("z") ? itemEffect["effect"]["z"].ValueOrDefault<int>(0) : 0; effects.entries = effectContainer.Children .Where(c => !blacklistEntries.Contains(c.NameWithoutExtension)) .ToDictionary(c => c.NameWithoutExtension, c => FrameBook.Parse(c)); return(effects); }
public static Frame GetFirstFrame(WZProperty anyWz, string id) { WZProperty npcImg = anyWz.ResolveOutlink($"Npc/{id}"); if (npcImg == null) { return(null); } string linksTo = npcImg.ResolveForOrNull <string>("info/link"); if (linksTo != null) { return(GetFirstFrame(anyWz, linksTo)); } return(FrameBook.Parse(npcImg.Children.Where(c => c.NameWithoutExtension != "info").Select(c => c).FirstOrDefault()) .FirstOrDefault().frames.FirstOrDefault()); }
public static Pet Parse(WZProperty stringWz) { int id; if (!int.TryParse(stringWz.NameWithoutExtension, out id)) { return(null); } Pet p = new Pet(id); WZProperty petEntry = stringWz.ResolveOutlink($"Item/Pet/{id}"); p.frameBooks = petEntry.Children.Where(c => c.NameWithoutExtension != "info").ToDictionary(c => c.NameWithoutExtension, c => FrameBook.Parse(c)); p.Description = ItemDescription.Parse(stringWz, id); p.MetaInfo = ItemInfo.Parse(petEntry); return(p ?? null); }
public IEnumerable <FrameBook> GetFrameBook(string bookName = null) => bookName == null && Framebooks.Count == 0 ? null : FrameBook.Parse(npcImg.Resolve(bookName ?? Framebooks.First().Key));
public IEnumerable <FrameBook> GetFrameBook(string bookName = null) => FrameBook.Parse(mobImage.Resolve(bookName ?? Framebooks.First().Key));