private void EnsureLoaded() { using (new ReaderLock(_lock)) { if (_loaded) return; using (new WriterLock(_lock)) { if (_loaded) return; if (null == _cache) _cache = new List<Expansion>(); Connection.ExecuteSql(new Query(EXPANSION_SELECT), delegate(SqlDataReader reader) { while (reader.Read()) { if (null != _cache.Find(c => reader[0].ToString() == c.Name)) return; var newExpansion = new Expansion() { Name = reader[0].ToString() }; _cache.Add(newExpansion); } }); _loaded = true; } } }
public static bool EmptyExpansionExists(Expansion expansion) { if (expansion is NonTerminal) return ((NonTerminal) expansion).Production.IsEmptyPossible; else if (expansion is Action) return true; else if (expansion is RegularExpression) return false; else if (expansion is OneOrMore) return EmptyExpansionExists(((OneOrMore) expansion).Expansion); else if (expansion is ZeroOrMore || expansion is ZeroOrOne) return true; else if (expansion is Lookahead) return true; else if (expansion is Choice) { foreach (var choice in ((Choice) expansion).Choices) { if (EmptyExpansionExists(choice)) return true; } return false; } else if (expansion is Sequence) { foreach (var unit in ((Sequence) expansion).Units) { if (!EmptyExpansionExists(unit)) return false; } return true; } else if (expansion is TryBlock) return EmptyExpansionExists(((TryBlock) expansion).Expansion); else return false; // This should be dead code. }
public HarvestVein(Expansion reqExpansion, double veinChance, double chanceToFallback, HarvestResource primaryResource, HarvestResource fallbackResource ) { ReqExpansion = reqExpansion; VeinChance = veinChance; ChanceToFallback = chanceToFallback; PrimaryResource = primaryResource; FallbackResource = fallbackResource; }
public static void RegisterMap( int mapIndex, int mapID, int fileIndex, int width, int height, Season season, Expansion ex, string name, MapRules rules) { var newMap = new Map(mapID, mapIndex, fileIndex, width, height, season.GetID(), ex, name, rules); Map.Maps[mapIndex] = newMap; Map.AllMaps.Add(newMap); }
public static void LoadExpansion(string name, Expansion expansion) { expansions.Add(name, expansion); foreach (var card in expansion.CardSet) { card.Id = cardSet.Count; cardSet.Add(card); } }
private static Item MakeNewbie(Item item, Expansion e) { if (e < Expansion.AOS) { item.LootType = LootType.Newbied; } return item; }
public RewardEntry( RewardCategory category, int name, Type itemType, params object[] args ) { m_Category = category; m_ItemType = itemType; m_RequiredExpansion = Expansion.None; m_Name = name; m_Args = args; category.Entries.Add( this ); }
public RewardEntry( RewardCategory category, string name, Type itemType, Expansion requiredExpansion, params object[] args ) { m_Category = category; m_ItemType = itemType; m_RequiredExpansion = requiredExpansion; m_NameString = name; m_Args = args; category.Entries.Add( this ); }
public HarvestResource( Expansion reqExpansion, double reqSkill, double minSkill, double maxSkill, object message, params Type[] types ) { ReqExpansion = reqExpansion; ReqSkill = reqSkill; MinSkill = minSkill; MaxSkill = maxSkill; Types = types; SuccessMessage = message; }
protected override void OnExpansionChanged(Expansion old) { base.OnExpansionChanged(old); if (EraML) { Stackable = true; } }
protected override void OnExpansionChanged(Expansion old) { base.OnExpansionChanged(old); if (0.3 > Utility.RandomDouble()) { PackItem(Loot.RandomPossibleReagent(Expansion)); } }
public BonusHarvestResource(Expansion reqExpansion, double reqSkill, double chance, TextDefinition message, Type type) { ReqExpansion = reqExpansion; ReqSkill = reqSkill; Chance = chance; Type = type; SuccessMessage = message; }
protected override void OnExpansionChanged(Expansion old) { base.OnExpansionChanged(old); if (Expansion == Expansion.T2A) { ReplaceWith(new Silver(Amount)); } }
protected override void OnExpansionChanged(Expansion old) { base.OnExpansionChanged(old); if (EraML) { Charges = Utility.RandomMinMax(1, 109); } }
public BankBox(Mobile owner, Expansion e) : base(0xE7C) { Owner = owner; Expansion = e; Movable = false; Layer = Layer.Bank; }
/// <summary> /// Modify an account /// </summary> /// <param name="id">The id of the account</param> /// <param name="username">The new username for the account</param> /// <param name="password">The new password for the account</param> /// <param name="email">The new email for the account</param> /// <param name="lvl">The new GM level for the account</param> /// <param name="exp">The new expansion for the account</param> /// <returns>An awaitable Task object</returns> public async Task EditAccount(int id, string username, string password, string email, GMLevel lvl, Expansion exp) { await ExecuteNonQuery("UPDATE `account` SET username=@username, sha_pass_hash=@hash, expansion=@expansion, email=@email WHERE id=@id", new MySqlParameter("@username", username), new MySqlParameter("@hash", String.Format("{0}:{1}", username.ToUpper(), password.ToUpper()).ToSHA1()), new MySqlParameter("@expansion", (int)exp), new MySqlParameter("@email", email), new MySqlParameter("@id", id)); await ExecuteNonQuery("UPDATE `account_access` SET gmlevel=@gmlevel WHERE id = @id", new MySqlParameter("@gmlevel", (int)lvl), new MySqlParameter("@id", id)); }
public static async Task SetPlayerExpansion(string username, Expansion exp) { if (_tcm.Online) await GetClient().SendMessage(TCCommand.SetPlayerExpansion.BuildCommand(username, ((int)exp).ToString())); else await _tcm.AuthDatabase.ChangeAccountExpansion(username, exp); }
protected override void OnExpansionChanged(Expansion old) { base.OnExpansionChanged(old); if (m_Chest == null || m_Filled) { return; } TreasureMapChest.Fill(m_Chest, 2, Expansion); m_Filled = true; }
public static void reInit() { ostr = null; gensymindex = 0; indentamt = 0; cc2LA = false; phase2list = new List<Lookahead>(); phase3list = new List<Phase3Data>(); phase3table = new Dictionary<Expansion, Phase3Data>(); firstSet = null; xsp_declared = false; cc3_expansion = null; }
private Account(int id, string username, string reg_mail, string email, DateTime joindate, string last_ip, int failed_logins, DateTime last_login, bool online, Expansion expansion, bool locked) { this.id = id; this.username = username; this.reg_mail = reg_mail; this.email = email; this.joindate = joindate; this.last_ip = last_ip; this.failed_logins = failed_logins; this.last_login = last_login; this.online = online; this.expansion = expansion; this.locked = locked; }
protected override void OnExpansionChanged(Expansion old) { base.OnExpansionChanged(old); if (EraSE) { SetHits(140); ControlSlots = 2; } else { SetHits(500); ControlSlots = 1; } }
public static bool CheckExpansion(this ExpansionFlags flags, Expansion ex) { if (flags == ExpansionFlags.None) { return(true); } switch (ex) { case Expansion.T2A: return(flags.HasFlag(ExpansionFlags.T2A)); case Expansion.UOR: return(flags.HasFlag(ExpansionFlags.UOR)); case Expansion.UOTD: return(flags.HasFlag(ExpansionFlags.UOTD)); case Expansion.LBR: return(flags.HasFlag(ExpansionFlags.LBR)); case Expansion.AOS: return(flags.HasFlag(ExpansionFlags.AOS)); case Expansion.SE: return(flags.HasFlag(ExpansionFlags.SE)); case Expansion.ML: return(flags.HasFlag(ExpansionFlags.ML)); case Expansion.SA: return(flags.HasFlag(ExpansionFlags.SA)); case Expansion.HS: return(flags.HasFlag(ExpansionFlags.HS)); case Expansion.TOL: return(flags.HasFlag(ExpansionFlags.TOL)); case Expansion.EJ: return(flags.HasFlag(ExpansionFlags.EJ)); default: return(false); } }
public InternalBuyInfo(Expansion e) { Add(new GenericBuyInfo(typeof(Crossbow), 55, 20, 0xF50, 0)); Add(new GenericBuyInfo(typeof(HeavyCrossbow), 55, 20, 0x13FD, 0)); if (e >= Expansion.AOS) { Add(new GenericBuyInfo(typeof(RepeatingCrossbow), 46, 20, 0x26C3, 0)); Add(new GenericBuyInfo(typeof(CompositeBow), 45, 20, 0x26C2, 0)); } Add(new GenericBuyInfo(typeof(Bolt), 2, Utility.Random(30, 60), 0x1BFB, 0)); Add(new GenericBuyInfo(typeof(Bow), 40, 20, 0x13B2, 0)); Add(new GenericBuyInfo(typeof(Arrow), 4, Utility.Random(30, 60), 0xF3F, 0)); Add(new GenericBuyInfo(typeof(Feather), 2, Utility.Random(30, 60), 0x1BD1, 0)); Add(new GenericBuyInfo(typeof(Shaft), 2, Utility.Random(30, 60), 0x1BD4, 0)); }
public static void LoadExpansion(string name, Expansion expansion) { int newId = cardHandlers.Count; expansions.Add(name, expansion); foreach (var card in expansion.CardSet) { card.Id = cardSet.Count; cardSet.Add(card); string typeName = card.Type.Name; if (!idOfCardHandler.ContainsKey(typeName)) { idOfCardHandler.Add(typeName, newId); cardHandlers.Add(newId, card.Type); newId++; } } }
private TextDefinition RequiredExpansionMessage(Expansion expansion) { switch (expansion) { case Expansion.SE: return(1063363); // * Requires the "Samurai Empire" expansion case Expansion.ML: return(1072651); // * Requires the "Mondain's Legacy" expansion case Expansion.SA: return(1094732); // * Requires the "Stygian Abyss" expansion default: return(String.Format("* Requires the \"{0}\" expansion", ExpansionInfo.GetInfo(expansion).Name)); } }
/// <summary> /// Parses a HTML table in file to get all the card data listed within. /// </summary> /// <param name="filepath"></param> /// <param name="type"></param> /// <returns></returns> private static IEnumerable <InvestigatorCard> Parse(string filepath, InvestigatorCardType type) { List <InvestigatorCard> cards = new List <InvestigatorCard>(); HtmlDocument doc = new HtmlDocument(); doc.Load(filepath); foreach (HtmlNode rowNode in doc.DocumentNode.Descendants("tr")) { IEnumerable <HtmlNode> cardNodes = rowNode.Descendants("td"); string name = cardNodes.ElementAt(0).InnerText.Trim(); string traitsString = cardNodes.ElementAt(1).InnerText.Replace('-', ',').Replace('—', ','); HtmlNode expNode = cardNodes.ElementAt(2); HtmlNode expLinkNode = expNode.SelectSingleNode(".//a"); string expString = "Core"; if (expLinkNode != null) { expString = expLinkNode.GetAttributeValue("title", "Core"); } List <string> traits = new List <string>(); foreach (string traitRaw in traitsString.Split(',')) { traits.Add(traitRaw.ToUpper().Trim()); } Expansion exp = ExpansionExtensions.FromString(expString); InvestigatorCard card; if (type == InvestigatorCardType.Asset) { int cost = int.Parse(cardNodes.ElementAt(3).InnerText); card = new AssetCard(name, type, exp, traits, cost); } else { card = new InvestigatorCard(name, type, exp, traits); } cards.Add(card); } return(cards); }
private string GetExpansion(Expansion expansion) { switch (expansion) { default: case Expansion.ML: return("Mondain's"); case Expansion.SA: return("Stygian"); case Expansion.TOL: return("ToL"); case Expansion.HS: return("HighSeas"); } }
public static void CreateExpansionMainObject() { Expansion[] exists = GameObject.FindObjectsOfType <Expansion>(); if (exists.Length > 0) { EditorUtility.DisplayDialog("Error", "UnityExpansion main object already exists in screne.", "OK"); return; } GameObject gameObject = new GameObject("UnityExpansion"); Expansion expansion = gameObject.AddComponent <Expansion>(); gameObject.transform.position = Vector3.zero; gameObject.transform.SetParent(Selection.activeTransform, false); Selection.activeObject = gameObject; }
public bool[] RegenChord(bool[] lastpass, string name, ref int root, ref int lowlimit, ref int highlimit, int count = 4) { if (name == "X7") { Expansion.BroadcastTo128(lastpass, root, highlimit); Expansion.BroadcastTo128(lastpass, root + 4, highlimit); Expansion.BroadcastTo128(lastpass, root + 7, highlimit); Expansion.BroadcastTo128(lastpass, root + 10, highlimit); } if (name == "Xm7") { Expansion.BroadcastTo128(lastpass, root, highlimit); Expansion.BroadcastTo128(lastpass, root + 3, highlimit); Expansion.BroadcastTo128(lastpass, root + 7, highlimit); Expansion.BroadcastTo128(lastpass, root + 10, highlimit); } return(lastpass); }
private static void PackItem(Item item, Expansion e) { if (e < Expansion.AOS && !(item is Spellbook)) { item.LootType = LootType.Newbied; } Container pack = m_Mobile.Backpack; if (pack != null) { pack.DropItem(item); } else { item.Delete(); } }
public override int ComputeGold( Expansion e, int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type) { int[][][] goldTable = (e >= Expansion.AOS ? m_AosGoldTable : m_OldGoldTable); int typeIndex = ((itemCount == 6 ? 3 : itemCount == 5 ? 2 : itemCount == 4 ? 1 : 0) * 2) + (exceptional ? 1 : 0); int quanIndex = (quantity == 20 ? 2 : quantity == 15 ? 1 : 0); int mtrlIndex = (material == BulkMaterialType.Barbed ? 3 : material == BulkMaterialType.Horned ? 2 : material == BulkMaterialType.Spined ? 1 : 0); int gold = goldTable[typeIndex][quanIndex][mtrlIndex]; int min = (gold * 9) / 10; int max = (gold * 10) / 9; return(Utility.RandomMinMax(min, max)); }
public static string GetAbbreviation(this Expansion expansion) { switch (expansion) { case Expansion.AeonsEnd: return("AE"); case Expansion.WarEternal: return("WE"); case Expansion.TheNameless: return("N"); case Expansion.TheOuterDark: return("OD"); case Expansion.TheVoid: return("V"); case Expansion.TheDepths: return("D"); case Expansion.Legacy: return("L"); case Expansion.BuriedSecrets: return("BS"); case Expansion.TheNewAge: return("NA"); case Expansion.ShatteredDreams: return("SD"); case Expansion.TheAncients: return("A"); case Expansion.IntoTheWild: return("IW"); default: throw new InvalidOperationException(); } }
public static string GetFriendlyName(this Expansion expansion) { switch (expansion) { case Expansion.AeonsEnd: return("Aeon's End"); case Expansion.WarEternal: return("War Eternal"); case Expansion.TheNameless: return("The Nameless"); case Expansion.TheOuterDark: return("The Outer Dark"); case Expansion.TheVoid: return("The Void"); case Expansion.TheDepths: return("The Depths"); case Expansion.Legacy: return("Legacy"); case Expansion.BuriedSecrets: return("Buried Secrets"); case Expansion.TheNewAge: return("The New Age"); case Expansion.ShatteredDreams: return("Shattered Dreams"); case Expansion.TheAncients: return("The Ancients"); case Expansion.IntoTheWild: return("Into The Wild"); default: throw new InvalidOperationException(); } }
internal static void PostOrderWalk(Expansion node, ITreeWalkerOp opObj) { if (opObj.GoDeeper(node)) { if (node is Choice) { foreach (var choice in ((Choice)node).Choices) { PostOrderWalk(choice, opObj); } } else if (node is Sequence) { foreach (var unit in ((Sequence)node).Units) { PostOrderWalk(unit, opObj); } } else if (node is OneOrMore) { PostOrderWalk(((OneOrMore) node).Expansion, opObj); } else if (node is ZeroOrMore) { PostOrderWalk(((ZeroOrMore) node).Expansion, opObj); } else if (node is ZeroOrOne) { PostOrderWalk(((ZeroOrOne) node).Expansion, opObj); } else if (node is Lookahead) { Expansion nestedE = ((Lookahead) node).Expansion; if (!(nestedE is Sequence && ((Sequence) nestedE).Units[0] == node)) { PostOrderWalk(nestedE, opObj); } } else if (node is TryBlock) { PostOrderWalk(((TryBlock) node).Expansion, opObj); } else if (node is RChoice) { foreach (var choice in ((RChoice)node).Choices) { PostOrderWalk(choice, opObj); } } else if (node is RSequence) { foreach (var unit in ((RSequence)node).Units) { PostOrderWalk(unit, opObj); } } else if (node is ROneOrMore) { PostOrderWalk(((ROneOrMore) node).RegularExpression, opObj); } else if (node is RZeroOrMore) { PostOrderWalk(((RZeroOrMore) node).RegularExpression, opObj); } else if (node is RZeroOrOne) { PostOrderWalk(((RZeroOrOne) node).RegularExpression, opObj); } else if (node is RRepetitionRange) { PostOrderWalk(((RRepetitionRange) node).RegularExpression, opObj); } } opObj.Action(node); }
public void TestMobileStatusExtendedSelf( ProtocolChanges changes, string version, ClientFlags clientFlags, Expansion expansion, int mobileStatusVersion ) { var expansionInfo = ExpansionInfo.GetInfo(Core.Expansion); var oldExpansion = Core.Expansion; var oldVersion = expansionInfo.MobileStatusVersion; Core.Expansion = expansion; ExpansionInfo.GetInfo(Core.Expansion).MobileStatusVersion = mobileStatusVersion; var m = new Mobile((Serial)0x1) { Name = "Random Mobile 1" }; m.DefaultMobileInit(); m.Str = 50; m.Hits = 100; m.Int = 75; m.Mana = 100; m.Dex = 25; m.Stam = 100; var ns = PacketTestUtilities.CreateTestNetState(); ns.ProtocolChanges = changes; ns.Version = new ClientVersion(version); ns.Flags = clientFlags; var expected = new MobileStatusExtended(m, ns).Compile(); ns.SendMobileStatus(m, m); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); Core.Expansion = oldExpansion; expansionInfo.MobileStatusVersion = oldVersion; }
public InternalSellInfo(Expansion e) { Add(typeof(Bolt), 1); Add(typeof(Arrow), 1); Add(typeof(Shaft), 1); Add(typeof(Feather), 1); Add(typeof(HeavyCrossbow), 11); Add(typeof(Bow), 7); Add(typeof(Crossbow), 11); if (e < Expansion.AOS) { return; } Add(typeof(CompositeBow), 11); Add(typeof(RepeatingCrossbow), 11); }
public GeneralSettings( string shardName = "My Shard", bool autoDetect = true, string address = null, int port = 2593, Expansion expansion = Expansion.SA, AccessLevel maxPlayerLevel = AccessLevel.VIP, AccessLevel lowestStaffLevel = AccessLevel.Counselor, AccessLevel lowestOwnerLevel = AccessLevel.CoOwner) { ShardName = shardName; AutoDetect = autoDetect; Address = address; Port = port; Expansion = expansion; MaxPlayerLevel = maxPlayerLevel; LowestStaffLevel = lowestStaffLevel; LowestOwnerLevel = lowestOwnerLevel; }
public async Task <IHttpActionResult> PostExpansion(int gameId, Expansion expansion) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var parentGame = db.Games.Find(gameId); if (parentGame == null) { return(NotFound()); } parentGame.Expansions.Add(expansion); await db.SaveChangesAsync(); return(CreatedAtRoute("NewExpansion", new { id = expansion.Id }, new Models.DTO.Expansion(expansion))); }
public Path CalculatePath(Vector2 startGridPosition, Vector2 endGridPosition) { PathNode startNode = GridGraph.instance.pathNodes[(int)startGridPosition.x, (int)startGridPosition.y]; PathNode endNode = GridGraph.instance.pathNodes[(int)endGridPosition.x, (int)endGridPosition.y]; cellVisited = new bool[GridGraph.instance.width, GridGraph.instance.depth]; open = new List <Expansion>(); closed = new HashSet <PathNode>(); startingExpansion = new Expansion(null, startNode, 0f, 0f); open.Add(startingExpansion); best = null; for (;;) { if (open.Count == 0 || best != null && best.current == endNode) { Path foundPath = new Path(); foundPath.pathNodes = new List <PathNode>(); Expansion iterator = best; while (iterator != null) { foundPath.pathNodes.Add(iterator.current); iterator = iterator.previous; } foundPath.pathNodes.Reverse(); return(foundPath); } best = null; foreach (Expansion expansion in open) { if (best == null || expansion.ToltalCost < best.ToltalCost) { best = expansion; } } ExpandPath(); } }
private PlayerSnapshotState EnsureState(Expansion ex) { if (Owner == null || Owner.Deleted) { return(null); } PlayerSnapshotState state; if (!States.TryGetValue(ex, out state)) { States.Add(ex, state = new PlayerSnapshotState(Owner, ex)); } else if (state == null) { States[ex] = state = new PlayerSnapshotState(Owner, ex); } return(state); }
public Path CalculatePath(Vector2 startGridPosition, Vector2 endGridPosition) { PathNode startNode = GridGraph.instance.pathNodes[(int)startGridPosition.x, (int)startGridPosition.y]; PathNode endNode = GridGraph.instance.pathNodes[(int)endGridPosition.x, (int)endGridPosition.y]; cellVisited = new bool[GridGraph.instance.width, GridGraph.instance.depth]; open = new List<Expansion>(); closed = new HashSet<PathNode>(); startingExpansion = new Expansion(null, startNode, 0f, 0f); open.Add(startingExpansion); best = null; for (;;) { if (open.Count == 0 || best != null && best.current == endNode) { Path foundPath = new Path(); foundPath.pathNodes = new List<PathNode>(); Expansion iterator = best; while (iterator != null) { foundPath.pathNodes.Add(iterator.current); iterator = iterator.previous; } foundPath.pathNodes.Reverse(); return foundPath; } best = null; foreach (Expansion expansion in open) { if (best == null || expansion.ToltalCost < best.ToltalCost) best = expansion; } ExpandPath(); } }
private static void AddBackpack(Mobile m, Expansion e) { Container pack = m.Backpack; if (pack == null) { pack = new Backpack { Movable = false }; m.AddItem(pack); } PackItem(MakeNewbie(new RedBook("a book", m.Name, 20, true), e), e); PackItem(new Gold(500), e); // Starting gold can be customized here PackItem(MakeNewbie(new Dagger(), e), e); PackItem(MakeNewbie(new Candle(), e), e); PackItem(new Bandage(100), e); //PackItem(new ForeverWelcomeBag(), e); }
public override void OnInspectorGUI() { Expansion expansion = target as Expansion; EditorGUILayout.LabelField("It is the main UnityExpansion object. If you have any question read the documentation at aokov.se/expansion/"); EditorGUILayout.Space(); if (expansion.LayoutSettings != null) { if (_editor == null) { _editor = Editor.CreateEditor(expansion.LayoutSettings); } if (_editor != null) { _editor.OnInspectorGUI(); } } }
public BonusHarvestResource GetBonusResource(Expansion e) { if (BonusResources == null) { return(null); } double randomValue = Utility.RandomDouble() * 100; foreach (BonusHarvestResource b in BonusResources.Where(b => e > b.ReqExpansion)) { if (randomValue <= b.Chance) { return(b); } randomValue -= b.Chance; } return(null); }
public InternalBuyInfo(Expansion e) { Add(new AnimalBuyInfo(1, typeof(Cat), 132, 10, 201, 0)); Add(new AnimalBuyInfo(1, typeof(Dog), 170, 10, 217, 0)); Add(new AnimalBuyInfo(1, typeof(Horse), 550, 10, 204, 0)); Add(new AnimalBuyInfo(1, typeof(RidableLlama), 1450, 5, 220, 0)); Add(new AnimalBuyInfo(1, typeof(PackHorse), 631, 10, 291, 0)); Add(new AnimalBuyInfo(1, typeof(PackLlama), 565, 10, 292, 0)); Add(new AnimalBuyInfo(1, typeof(Rabbit), 106, 10, 205, 0)); if (e < Expansion.AOS) { return; } Add(new AnimalBuyInfo(1, typeof(Eagle), 402, 10, 5, 0)); Add(new AnimalBuyInfo(1, typeof(BrownBear), 855, 10, 167, 0)); Add(new AnimalBuyInfo(1, typeof(GrizzlyBear), 1767, 10, 212, 0)); Add(new AnimalBuyInfo(1, typeof(Panther), 1271, 10, 214, 0)); Add(new AnimalBuyInfo(1, typeof(TimberWolf), 768, 10, 225, 0)); Add(new AnimalBuyInfo(1, typeof(Rat), 107, 10, 238, 0)); }
public InternalBuyInfo(Expansion e) { Add(new GenericBuyInfo(typeof(Spellbook), 125, 10, 0xEFA, 0)); Add(new GenericBuyInfo(typeof(ScribesPen), 8, 10, 0xFBF, 0)); Add(new GenericBuyInfo(typeof(BlankScroll), 5, 20, 0x0E34, 0)); Add(new GenericBuyInfo("1041072", typeof(MagicWizardsHat), 11, 10, 0x1718, Utility.RandomDyedHue())); Add(new GenericBuyInfo(typeof(RecallRune), 15, 10, 0x1F14, 0)); Add(new GenericBuyInfo(typeof(RefreshPotion), 15, 10, 0xF0B, 0)); Add(new GenericBuyInfo(typeof(AgilityPotion), 15, 10, 0xF08, 0)); Add(new GenericBuyInfo(typeof(NightSightPotion), 15, 10, 0xF06, 0)); Add(new GenericBuyInfo(typeof(LesserHealPotion), 15, 10, 0xF0C, 0)); Add(new GenericBuyInfo(typeof(StrengthPotion), 15, 10, 0xF09, 0)); Add(new GenericBuyInfo(typeof(LesserPoisonPotion), 15, 10, 0xF0A, 0)); Add(new GenericBuyInfo(typeof(LesserCurePotion), 15, 10, 0xF07, 0)); Add(new GenericBuyInfo(typeof(LesserExplosionPotion), 21, 10, 0xF0D, 0)); Add(new GenericBuyInfo(typeof(BlackPearl), 5, 100, 0xF7A, 0)); Add(new GenericBuyInfo(typeof(Bloodmoss), 5, 100, 0xF7B, 0)); Add(new GenericBuyInfo(typeof(Garlic), 3, 100, 0xF84, 0)); Add(new GenericBuyInfo(typeof(Ginseng), 3, 100, 0xF85, 0)); Add(new GenericBuyInfo(typeof(MandrakeRoot), 3, 100, 0xF86, 0)); Add(new GenericBuyInfo(typeof(Nightshade), 3, 100, 0xF88, 0)); Add(new GenericBuyInfo(typeof(SpidersSilk), 3, 100, 0xF8D, 0)); Add(new GenericBuyInfo(typeof(SulfurousAsh), 3, 100, 0xF8C, 0)); if (e >= Expansion.AOS) { Add(new GenericBuyInfo(typeof(BatWing), 3, 20, 0xF78, 0)); Add(new GenericBuyInfo(typeof(DaemonBlood), 6, 20, 0xF7D, 0)); Add(new GenericBuyInfo(typeof(PigIron), 5, 20, 0xF8A, 0)); Add(new GenericBuyInfo(typeof(NoxCrystal), 6, 20, 0xF8E, 0)); Add(new GenericBuyInfo(typeof(GraveDust), 3, 20, 0xF8F, 0)); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: case 0: Level = (SecureLevel)reader.ReadInt(); BookName = reader.ReadString(); Filter = new RecipeScrollFilter(reader); int count = reader.ReadInt(); Recipes = new List <RecipeScrollDefinition>(); for (int i = count; i > 0; i--) { int id = reader.ReadInt(); int rid = reader.ReadInt(); Expansion ex = (Expansion)reader.ReadInt(); RecipeSkillName skill = (RecipeSkillName)reader.ReadInt(); int amount = reader.ReadInt(); int price = reader.ReadInt(); Recipes.Add(new RecipeScrollDefinition(id, rid, ex, skill, amount, price)); } ReLoadDefinitions(); break; } if (version == 0) { LootType = LootType.Blessed; } }
public CardShapedObject(string name, Expansion expansion, Edition edition = Edition.First, bool isDeprecated = false, string pluralName = null) { lock (CardShapedObject.initializedCardTypes) { if (CardShapedObject.initializedCardTypes.Contains(this.GetType())) { throw new Exception("Do not create duplicate cards."); } else { CardShapedObject.initializedCardTypes.Add(this.GetType()); } this.privateIndex = CardShapedObject.lastCardIndex++; } this.name = name; this.expansion = expansion; this.edition = edition; this.pluralName = pluralName != null ? pluralName : name + "s"; this.isDeprecated = isDeprecated; }
private static void AddPants(Mobile m, int pantsHue, Expansion e) { int hue = Utility.ClipDyedHue(pantsHue & 0x3FFF); if (m.Race == Race.Elf) { EquipItem(new ElvenPants(hue), true, e); } else { if (m.Female) { switch (Utility.Random(2)) { case 0: EquipItem(new Skirt(hue), true, e); break; case 1: EquipItem(new Kilt(hue), true, e); break; } } else { switch (Utility.Random(2)) { case 0: EquipItem(new LongPants(hue), true, e); break; case 1: EquipItem(new ShortPants(hue), true, e); break; } } } }
public InternalBuyInfo(Expansion e) { Add(new GenericBuyInfo(typeof(Cutlass), 24, 20, 0x1441, 0)); Add(new GenericBuyInfo(typeof(Katana), 33, 20, 0x13FF, 0)); Add(new GenericBuyInfo(typeof(Kryss), 32, 20, 0x1401, 0)); Add(new GenericBuyInfo(typeof(Broadsword), 35, 20, 0xF5E, 0)); Add(new GenericBuyInfo(typeof(Longsword), 55, 20, 0xF61, 0)); Add(new GenericBuyInfo(typeof(ThinLongsword), 27, 20, 0x13B8, 0)); Add(new GenericBuyInfo(typeof(VikingSword), 55, 20, 0x13B9, 0)); Add(new GenericBuyInfo(typeof(Scimitar), 36, 20, 0x13B6, 0)); if (e < Expansion.AOS) { return; } Add(new GenericBuyInfo(typeof(BoneHarvester), 35, 20, 0x26BB, 0)); Add(new GenericBuyInfo(typeof(CrescentBlade), 37, 20, 0x26C1, 0)); Add(new GenericBuyInfo(typeof(DoubleBladedStaff), 35, 20, 0x26BF, 0)); Add(new GenericBuyInfo(typeof(Lance), 34, 20, 0x26C0, 0)); Add(new GenericBuyInfo(typeof(Pike), 39, 20, 0x26BE, 0)); Add(new GenericBuyInfo(typeof(Scythe), 39, 20, 0x26BA, 0)); }
public override int ComputeGold( Expansion e, int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type) { int[][][] goldTable = m_GoldTable; int typeIndex = ComputeType(type, itemCount); int quanIndex = (quantity == 20 ? 2 : quantity == 15 ? 1 : 0); int mtrlIndex = (material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite) ? 1 + (material - BulkMaterialType.DullCopper) : 0; if (exceptional) { typeIndex++; } int gold = goldTable[typeIndex][quanIndex][mtrlIndex]; int min = (gold * 9) / 10; int max = (gold * 10) / 9; return(Utility.RandomMinMax(min, max)); }
private static void EquipItem(Item item, bool mustEquip, Expansion e) { if (e < Expansion.AOS && !(item is Spellbook)) { item.LootType = LootType.Newbied; } if (m_Mobile.EquipItem(item)) { return; } Container pack = m_Mobile.Backpack; if (!mustEquip && pack != null) { pack.DropItem(item); } else { item.Delete(); } }
private TextDefinition RequiredExpansionMessage(Expansion expansion) { switch (expansion) { case Expansion.SE: return(1063363); // * Requires the "Samurai Empire" expansion case Expansion.ML: return(1072651); // * Requires the "Mondain's Legacy" expansion case Expansion.SA: return(1094732); // * Requires the "Stygian Abyss" expansion case Expansion.HS: return(1116296); // * Requires the "High Seas" booster case Expansion.TOL: return(1155876); // * Requires the "Time of Legends" expansion. default: return(String.Format("* Requires the \"{0}\" expansion", ExpansionInfo.GetInfo(expansion).Name)); } }
public List <Expansion> LoadSingles() { string path = "./Expansions"; List <SingleCard> singleCard = new List <SingleCard>(); List <Expansion> expansions = new List <Expansion>(); foreach (string expansionFile in Directory.GetFiles(path)) { string fileName = expansionFile.Replace(path + "\\", ""); string ExpansionName = fileName.Replace(".xml", ""); string ExpansionNoSpace = "A" + ExpansionName.Replace(" ", ""); XmlDocument expansionDoument = new XmlDocument(); expansionDoument.Load(expansionFile); singleCard = GetSingles(expansionDoument, ExpansionNoSpace); Expansion expansion = new Expansion(ExpansionName, singleCard, GetExpansionLanguage(expansionDoument, ExpansionNoSpace)); expansions.Add(expansion); } return(expansions); }
private static void AddShirt(Mobile m, int shirtHue, Expansion e) { int hue = Utility.ClipDyedHue(shirtHue & 0x3FFF); if (m.Race == Race.Elf) { EquipItem(new ElvenShirt(hue), true, e); } else { switch (Utility.Random(3)) { case 0: EquipItem(new Shirt(hue), true, e); break; case 1: EquipItem(new FancyShirt(hue), true, e); break; case 2: EquipItem(new Doublet(hue), true, e); break; } } }
public static PowerScroll CreateRandomPowerScroll(Expansion e) { int level; double random = Utility.RandomDouble(); if (0.05 >= random) { level = 20; } else if (0.25 >= random) { level = 15; } else if (0.50 >= random) { level = 10; } else { level = 5; } return PowerScroll.CreateRandom(level, level, e); }
public void GetRequiredExpansions(out Expansion[] present, out Expansion[] missing) { var isExpansionRequired = new bool[(int)Expansion.Count]; foreach(Card card in kingdomPiles) { isExpansionRequired[(int)card.expansion] = true; } foreach (Card card in events) { isExpansionRequired[(int)card.expansion] = true; } if (this.baneCard != null) { isExpansionRequired[(int)baneCard.expansion] = true; } var presentList = new List<Expansion>(); var missingList = new List<Expansion>(); for (int i = 0; i < isExpansionRequired.Length; ++i) { if (isExpansionRequired[i]) { presentList.Add((Expansion)i); } else { missingList.Add((Expansion)i); } } present = presentList.ToArray(); missing = missingList.ToArray(); }
public void SetNeededExpansion(int index, Expansion expansion) { CraftItem craftItem = this.m_CraftItems.GetAt(index); craftItem.RequiredExpansion = expansion; }