protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) { chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 250)); } // Enchant if (isEnchantChest) { var enchant = 0; switch (Random(10)) { case 0: case 1: case 2: case 3: enchant = 20205; break; // Restfull (Prefix) case 4: case 5: case 6: enchant = 20204; break; // Foggy (Prefix) case 7: case 8: enchant = 30501; break; // Giant (Suffix) case 9: enchant = 30602; break; // Healer (Suffix) } chest.Add(Item.CreateEnchant(enchant)); } }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) { chest.Add(Item.Create(id: 2000, amountMin: 250, amountMax: 400)); } // Enchant if (isEnchantChest) { var enchant = 0; switch (Random(10)) { case 0: case 1: case 2: enchant = 20401; break; // Smart (Prefix) case 3: case 4: case 5: enchant = 20402; break; // Strong (Prefix) case 6: case 7: enchant = 30702; break; // Raven (Suffix) case 8: enchant = 30704; break; // Deadly (Suffix) case 9: enchant = 30805; break; // Falcon (Suffix) } chest.Add(Item.CreateEnchant(enchant)); } }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) { chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 250)); } // Enchant if (isEnchantChest) { var enchant = 0; switch (Random(10)) { case 0: case 1: case 2: enchant = 30802; break; // Counter (Suffix) case 3: case 4: case 5: enchant = 30803; break; // Windmill (Suffix) case 6: case 7: case 8: enchant = 30804; break; // Smash (Suffix) case 9: enchant = 30706; break; // Formal (Suffix) } chest.Add(Item.CreateEnchant(enchant)); } }
protected override void AddChestDrops(Chest chest, int chestNum, bool monsterChest) { if (!monsterChest) { chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 250)); } // Enchant int prefix = 0, suffix = 0; switch (Random(10)) { case 0: case 1: case 2: case 3: prefix = 20205; break; // Restfull case 4: case 5: case 6: prefix = 20204; break; // Foggy case 7: case 8: suffix = 30501; break; // Giant case 9: suffix = 30602; break; // Healer } chest.Add(Item.CreateEnchanted(62005, prefix, suffix)); }
protected override void AddChestDrops(Chest chest, int chestNum, bool monsterChest) { if (!monsterChest) { chest.Add(Item.Create(id: 2000, amountMin: 250, amountMax: 400)); } // Enchant int prefix = 0, suffix = 0; switch (Random(10)) { case 0: case 1: case 2: prefix = 20401; break; // Smart case 3: case 4: case 5: prefix = 20402; break; // Strong case 6: case 7: suffix = 30702; break; // Raven case 8: suffix = 30704; break; // Deadly case 9: suffix = 30805; break; // Falcon } chest.Add(Item.CreateEnchanted(62005, prefix, suffix)); }
protected virtual void AddChestDrops(Chest chest) { switch (Random(5)) { case 0: chest.Add(Item.Create(id: 63002, amountMin: 1, amountMax: 5)); break; // Firewood case 1: chest.Add(Item.Create(id: 60005, amountMin: 1, amountMax: 5)); break; // Bandage case 2: chest.Add(Item.Create(id: 51001, amountMin: 1, amountMax: 2)); break; // HP 10 Potion case 3: chest.Add(Item.Create(id: 52002, amountMin: 1, amountMax: 3)); break; // Small Gem case 4: chest.Add(Item.Create(id: 50009, amountMin: 1, amountMax: 3)); break; // Egg } }
public override void OnPuzzleCreate(Puzzle puzzle) { var lockedPlace = puzzle.GetPlace("LockedPlace"); var key = puzzle.LockPlace(lockedPlace, "Boss"); var chest = new Chest(puzzle, "KeyChest"); lockedPlace.AddProp(chest, Placement.Center); chest.Info.Direction = MabiMath.DegreeToRadian(90); chest.Add(Item.Create(GoddessPass)); chest.Add(key); }
protected virtual void AddChestDrops(Chest chest) { if (Random(100) != 0) { for (int i = 0; i < 2; ++i) chest.Add(Item.Create(id: 2000, amountMin: 10, amountMax: 50)); } else { for (int i = 0; i < 5; ++i) chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 200)); } }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 250)); // Enchant if (isEnchantChest) { int prefix = 0, suffix = 0; switch (Random(10)) { case 0: case 1: case 2: case 3: prefix = 20205; break; // Restfull case 4: case 5: case 6: prefix = 20204; break; // Foggy case 7: case 8: suffix = 30501; break; // Giant case 9: suffix = 30602; break; // Healer } chest.Add(Item.CreateEnchanted(62005, prefix, suffix)); } }
public override void OnPuzzleCreate(Puzzle puzzle) { var lockedPlace = puzzle.GetPlace("LockedPlace"); var chestPlace = puzzle.GetPlace("ChestPlace"); var key = puzzle.LockPlace(lockedPlace, "Lock"); var chest = new Chest(puzzle, "KeyChest"); chest.Add(Item.Create(id: 2000, amountMin: 10, amountMax: 30)); chest.Add(key); chestPlace.AddProp(chest, Placement.Corner4); chestPlace.SpawnSingleMob("Trap", "Mob3", Placement.Corner4); chestPlace.SpawnSingleMob("ChestMob1", "Mob1"); lockedPlace.SpawnSingleMob("ChestMob2", "Mob2"); }
protected virtual void AddChestDrops(Chest chest) { if (Random(100) != 0) { for (int i = 0; i < 2; ++i) { chest.Add(Item.Create(id: 2000, amountMin: 10, amountMax: 50)); } } else { for (int i = 0; i < 5; ++i) { chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 200)); } } }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) { chest.Add(Item.Create(id: 2000, amountMin: 250, amountMax: 1000)); } }
protected override void AddChestDrops(Chest chest) { if (Random(100) != 0) { switch (Random(5)) { case 0: chest.Add(Item.Create(id: 63002, amountMin: 1, amountMax: 5)); break; case 1: chest.Add(Item.Create(id: 60005, amountMin: 1, amountMax: 5)); break; case 2: chest.Add(Item.Create(id: 51001, amountMin: 1, amountMax: 2)); break; case 3: chest.Add(Item.Create(id: 52002, amountMin: 1, amountMax: 3)); break; case 4: chest.Add(Item.Create(id: 50009, amountMin: 1, amountMax: 3)); break; } } else { for (int i = 0; i < 5; ++i) { chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 200)); } } }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) { chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 250)); } // Enchant if (isEnchantChest) { var enchant = 0; switch (Random(10)) { case 0: case 1: enchant = 201; break; // Hamster (Prefix) case 2: case 3: case 4: enchant = 20601; break; // Blessed (Prefix) case 5: case 6: enchant = 20204; break; // Foggy (Prefix) case 7: case 8: if (!IsEnabled("RaccoonCubEnchant")) { goto case 9; } enchant = 31301; break; // Raccoon Cub (Suffix) case 9: enchant = 30714; break; // Easy Peaca (Suffix) } chest.Add(Item.CreateEnchant(enchant)); } }
public Chest BuyChest(int instanceId, Chest.ChestType type) { var chests = Csv.Tables.Get(Csv.Files.TreasureChests); var mainchest = chests.GetDataWithInstanceId <TreasureChests>(instanceId); var baseChest = chests.GetData <TreasureChests>(mainchest.BaseChest); var random = new Random(); var chest = new Chest { ChestId = instanceId, IsDraft = mainchest.DraftChest, Type = type }; // Common { if (type == Chest.ChestType.Shop) { for (var i = 0; i < random.Next(2, 5); i++) { if (random.Next(1, 2) == 1) { var card = Cards.Random(Card.Rarity.Common); card.Count = random.Next(40, 60); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } else { for (var i = 0; i < random.Next(2, 4); i++) { if (random.Next(1, 2) == 1) { var card = Cards.Random(Card.Rarity.Common); card.Count = random.Next(10, 20); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } } // Rare { if (type == Chest.ChestType.Shop) { for (var i = 0; i < random.Next(1, 4); i++) { if (random.Next(1, 2) == 1) { var card = Cards.Random(Card.Rarity.Rare); card.Count = random.Next(10, 30); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } else { for (var i = 0; i < random.Next(1, 2); i++) { if (random.Next(1, 4) == 1) { var card = Cards.Random(Card.Rarity.Rare); card.Count = random.Next(5, 15); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } } // Epic { if (type == Chest.ChestType.Shop) { for (var i = 0; i < random.Next(1, 2); i++) { if (random.Next(1, 3) == 1) { var card = Cards.Random(Card.Rarity.Epic); card.Count = random.Next(1, 8); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } else { if (random.Next(1, 20) == 1) { var card = Cards.Random(Card.Rarity.Epic); card.Count = random.Next(1, 5); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } // Legendary { if (type == Chest.ChestType.Shop) { if (random.Next(1, 10) == 1) { var card = Cards.Random(Card.Rarity.Legendary); card.Count = 1; card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } else { if (random.Next(1, 50) == 1) { var card = Cards.Random(Card.Rarity.Legendary); card.Count = 1; card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } if (type == Chest.ChestType.Shop) { // TODO: Cost if (random.Next(1, 5) == 1) { chest.Gems = random.Next(5, 15); } if (random.Next(1, 4) == 1) { chest.Gold = random.Next(100, 250); } } else { if (random.Next(1, 10) == 1) { chest.Gems = random.Next(1, 5); } if (random.Next(1, 8) == 1) { chest.Gold = random.Next(10, 75); } } Home.Gold += chest.Gold; Home.Diamonds += chest.Gems; return(chest); }
protected override void AddChestDrops(Chest chest) { if (Random(100) != 0) { switch (Random(5)) { case 0: chest.Add(Item.Create(id: 63002, amountMin: 1, amountMax: 5)); break; case 1: chest.Add(Item.Create(id: 60005, amountMin: 1, amountMax: 5)); break; case 2: chest.Add(Item.Create(id: 51001, amountMin: 1, amountMax: 2)); break; case 3: chest.Add(Item.Create(id: 52002, amountMin: 1, amountMax: 3)); break; case 4: chest.Add(Item.Create(id: 50009, amountMin: 1, amountMax: 3)); break; } } else { for (int i = 0; i < 5; ++i) chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 200)); } }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) chest.Add(Item.Create(id: 2000, amountMin: 250, amountMax: 400)); // Enchant if (isEnchantChest) { var enchant = 0; switch (Random(10)) { case 0: case 1: case 2: enchant = 20401; break; // Smart (Prefix) case 3: case 4: case 5: enchant = 20402; break; // Strong (Prefix) case 6: case 7: enchant = 30702; break; // Raven (Suffix) case 8: enchant = 30704; break; // Deadly (Suffix) case 9: enchant = 30805; break; // Falcon (Suffix) } chest.Add(Item.CreateEnchant(enchant)); } }
protected override void AddChestDrops(Chest chest, int chestNum, bool monsterChest) { if (!monsterChest) chest.Add(Item.Create(id: 2000, amountMin: 250, amountMax: 400)); // Enchant int prefix = 0, suffix = 0; switch (Random(10)) { case 0: case 1: case 2: prefix = 20401; break; // Smart case 3: case 4: case 5: prefix = 20402; break; // Strong case 6: case 7: suffix = 30702; break; // Raven case 8: suffix = 30704; break; // Deadly case 9: suffix = 30805; break; // Falcon } chest.Add(Item.CreateEnchanted(62005, prefix, suffix)); }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) chest.Add(Item.Create(id: 2000, amountMin: 250, amountMax: 1000)); }
protected override void AddChestDrops(Chest chest, int chestNum, bool isMonsterChest, bool isEnchantChest) { // Gold if (!isMonsterChest) chest.Add(Item.Create(id: 2000, amountMin: 100, amountMax: 250)); // Enchant if (isEnchantChest) { var enchant = 0; switch (Random(10)) { case 0: case 1: case 2: case 3: enchant = 20205; break; // Restfull (Prefix) case 4: case 5: case 6: enchant = 20204; break; // Foggy (Prefix) case 7: case 8: enchant = 30501; break; // Giant (Suffix) case 9: enchant = 30602; break; // Healer (Suffix) } chest.Add(Item.CreateEnchant(enchant)); } }
public Chest BuyChest(int instanceId, Chest.ChestType type) { var chests = Csv.Tables.Get(Csv.Files.TreasureChests); var mainchest = chests.GetDataWithInstanceId <TreasureChests>(instanceId); var baseChest = chests.GetData <TreasureChests>(mainchest.BaseChest); var chestArenas = Home.Arena.GetChestArenaNames(); var random = new Random(); var chest = new Chest { ChestId = instanceId, IsDraft = mainchest.DraftChest, Type = type }; // Common { if (type == Chest.ChestType.Shop) { for (var i = 0; i < random.Next(2, 5); i++) { if (random.Next(1, 2) == 1) { var card = Cards.RandomByArena(Card.Rarity.Common, chestArenas); if (card == null) { continue; } card.Count = random.Next(40, 80); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } else { for (var i = 0; i < random.Next(2, 4); i++) { if (random.Next(1, 2) == 1) { var card = Cards.RandomByArena(Card.Rarity.Common, chestArenas); if (card == null) { continue; } card.Count = random.Next(15, 25); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } } // Rare { if (type == Chest.ChestType.Shop) { for (var i = 0; i < random.Next(1, 4); i++) { if (random.Next(1, 2) == 1) { var card = Cards.RandomByArena(Card.Rarity.Rare, chestArenas); if (card == null) { continue; } card.Count = random.Next(15, 35); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } else { for (var i = 0; i < random.Next(1, 2); i++) { if (random.Next(1, 4) == 1) { var card = Cards.RandomByArena(Card.Rarity.Rare, chestArenas); if (card == null) { continue; } card.Count = random.Next(8, 18); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } } // Epic { if (type == Chest.ChestType.Shop) { for (var i = 0; i < random.Next(1, 2); i++) { if (random.Next(1, 3) == 1) { var card = Cards.RandomByArena(Card.Rarity.Epic, chestArenas); if (card == null) { continue; } card.Count = random.Next(2, 10); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } else { if (random.Next(1, 20) == 1) { var card = Cards.RandomByArena(Card.Rarity.Epic, chestArenas); if (card != null) { card.Count = random.Next(1, 5); card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } } // Legendary { if (type == Chest.ChestType.Shop) { if (random.Next(1, 8) == 1) { var card = Cards.RandomByArena(Card.Rarity.Legendary, chestArenas); if (card != null) { card.Count = 1; card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } else { if (random.Next(1, 50) == 1) { var card = Cards.RandomByArena(Card.Rarity.Legendary, chestArenas); if (card != null) { card.Count = 1; card.IsNew = true; chest.Add(card); Home.Deck.Add(card); } } } } if (type == Chest.ChestType.Shop) { // TODO: Cost if (random.Next(1, 5) == 1) { chest.Gems = random.Next(5, 15); } if (random.Next(1, 4) == 1) { chest.Gold = random.Next(100, 250); } } else { if (random.Next(1, 10) == 1) { chest.Gems = random.Next(1, 5); } if (random.Next(1, 8) == 1) { chest.Gold = random.Next(10, 75); } } Home.Gold += chest.Gold; Home.Diamonds += chest.Gems; /*var price = * ((baseChest.ShopPriceWithoutSpeedUp * Home.Arena.GetCurrentArenaData().ChestShopPriceMultiplier) / 100); * * Console.WriteLine(RoundPrice(price));*/ return(chest); }
protected override void UpdateCards() { ClearChoices(); Chest.Clear(); Deck.Clear(); foreach (Card c in Program.ActivePlayer.Chest) { if ((SpellMode && c is Spell) || (!SpellMode && c is Monster)) { if (Chest.ContainsKey(c.ID)) { Chest[c.ID]++; } else { Chest.Add(c.ID, 1); } } } foreach (Card c in Program.ActivePlayer.Deck) { if ((SpellMode && c is Spell) || (!SpellMode && c is Monster)) { if (Deck.ContainsKey(c.ID)) { Deck[c.ID]++; } else { Deck.Add(c.ID, 1); } } } if (Deck.Count == 0) { SetTexts(new[] { "There are no cards in your deck. Head to your chest to fill it up!" }); return; } foreach (int id in Deck.Keys) { Card c; if (SpellMode) { c = new Spell(id); } else { c = new Monster(id); } Dictionary <string, Action> choices = new Dictionary <string, Action>(); choices.Add("Add to Deck", delegate() { AddToDeck(c); UpdateCards(); }); choices.Add("Add to Chest", delegate() { AddToChest(c); UpdateCards(); }); choices.Add("Back", delegate() { Program.SceneManager.EndSubscene(); }); int noInDeck = 0; if (Deck.ContainsKey(c.ID)) { noInDeck = Deck[c.ID]; } int noInChest = 0; if (Chest.ContainsKey(c.ID)) { noInChest = Chest[c.ID]; } AddChoice( "(" + id.ToString("000") + ") " + c.Name + " [" + noInDeck + "-" + noInChest + "]", delegate() { Program.SceneManager.AddSubscene( new TextScene(new CardSprite(c).Render() + "\nDeck: " + noInDeck + " Chest: " + noInChest, "What do you want to do?", choices) ); } ); } AddChoice("Back", delegate() { Program.SceneManager.EndSubscene(); }); }