// awards all contents in TreasureChest object public static void awardChest(TreasureChest chestIn) { foreach (TreasureContents tc in chestIn.contents) { awardChestContentObj(tc); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchant var item = new Item(62005); switch (rnd.Next(6)) { case 0: item.OptionInfo.Suffix = 11105; break; // Health case 1: item.OptionInfo.Suffix = 11106; break; // Blood case 2: item.OptionInfo.Suffix = 11205; break; // Water case 3: item.OptionInfo.Suffix = 11206; break; // Fountain case 4: item.OptionInfo.Suffix = 11304; break; // Patience case 5: item.OptionInfo.Suffix = 11305; break; // Sustainer } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(640, 960)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Dagger var item = new Item(40006); switch (rnd.Next(3)) { case 0: item.OptionInfo.Prefix = 20501; break; // Simple case 1: item.OptionInfo.Prefix = 20502; break; // Scrupulous case 2: item.OptionInfo.Prefix = 20201; break; // Hard } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(1072, 3680)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { switch (rnd.Next(2)) { case 0: treasureChest.Add(Item.CreateEnchanted(16015, 20403, 0)); break; // Victorious Bracelet case 1: treasureChest.Add(Item.CreateEnchanted(40027, 0, 30311)); break; // Twilight Weeding Hoe } } treasureChest.AddGold(rnd.Next(5200, 7120)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchant var enchant = 0; switch (rnd.Next(3)) { case 0: enchant = 1506; break; // Swan Summoner's (Prefix) case 1: enchant = 1706; break; // Good (Prefix) case 2: enchant = 305; break; // Fine (Prefix) } treasureChest.Add(Item.CreateEnchant(enchant)); } treasureChest.AddGold(rnd.Next(153, 768)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public int TreasureChestCount(int playerId) { TreasureChest treasureChest = null; treasureChest = GetByPlayer(playerId); if (treasureChest != null) { return(treasureChest.a + treasureChest.b + treasureChest.c + treasureChest.d + treasureChest.e + treasureChest.f + treasureChest.g + treasureChest.h + treasureChest.i + treasureChest.j + treasureChest.k + treasureChest.l + treasureChest.m + treasureChest.n + treasureChest.o + treasureChest.p + treasureChest.q + treasureChest.r); } else { return(0); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchanted item Item item = null; switch (rnd.Next(2)) { case 0: item = Item.CreateEnchanted(40026, prefix: 20404); break; // Sacrificial Sickle case 1: item = Item.CreateEnchanted(18024, suffix: 30411); break; // Magnolia Hairband case 2: item = Item.CreateEnchanted(40003, suffix: 30514); break; // Hope Short Bow } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(4488, 8160)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Dagger var prefix = 0; switch (rnd.Next(3)) { case 0: prefix = 20501; break; // Simple case 1: prefix = 20502; break; // Scrupulous case 2: prefix = 20201; break; // Hard } treasureChest.Add(Item.CreateEnchanted(40006, prefix, 0)); } treasureChest.AddGold(rnd.Next(1072, 3680)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { var prefix = 0; switch (rnd.Next(3)) { case 0: prefix = 20711; break; // Famous case 1: prefix = 20712; break; // Ornamented case 2: prefix = 20402; break; // Strong } treasureChest.Add(Item.CreateEnchant(prefix)); } treasureChest.AddGold(rnd.Next(1980, 3630)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Cooking Knife int prefix = 0, suffix = 0; switch (rnd.Next(2)) { case 0: prefix = 20206; break; // Nervous case 1: prefix = 20711; break; // Famous } treasureChest.Add(Item.CreateEnchanted(40042, prefix, suffix)); } treasureChest.AddGold(rnd.Next(2880, 4380)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { foreach (var member in dungeon.Party) { member.TalkToNpc("_dungeonlostresident", "Lost Resident"); } var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); // Enchant var enchant = 0; switch (rnd.Next(3)) { case 0: enchant = 1506; break; // Swan Summoner's (Prefix) case 1: enchant = 1706; break; // Good (Prefix) case 2: enchant = 305; break; // Fine (Prefix) } treasureChest.Add(Item.CreateEnchant(enchant)); treasureChest.AddGold(rnd.Next(153, 768)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); var count = Math.Min(7, creators.Count); for (int i = 0; i < count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); treasureChest.AddGold(rnd.Next(320, 1280)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } var orb = new Prop(25032, 0, 0, 0, 0); orb.SetState("off"); orb.Behavior = OnOrbHit; dungeon.AddChest(orb); }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Mace int prefix = 0, suffix = 0; switch (rnd.Next(2)) { case 0: prefix = 20701; break; // Stiff case 1: prefix = 21003; break; // Fatal } switch (rnd.Next(2)) { case 0: suffix = 30506; break; // Belligerent case 1: suffix = 10807; break; // Considerate } treasureChest.Add(Item.CreateEnchanted(40079, prefix, suffix)); } treasureChest.AddGold(rnd.Next(2112, 5200)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); if (dungeon.CountPlayers() == 1) { var member = creators[0]; var treasureChest = new TreasureChest(); // Cores' Healer Suit int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: suffix = 30806; break; // Embroider case 1: suffix = 30805; break; // Falcon case 2: suffix = 30701; break; // Golem } treasureChest.Add(Item.CreateEnchanted(15030, prefix, suffix)); treasureChest.Add(Item.Create(id: 2000, amountMin: 1140, amountMax: 5040)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } else { for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Wave-patterned Long Boots int prefix = 20204, suffix = 0; switch (rnd.Next(3)) { case 0: suffix = 30902; break; // The dawn case 1: suffix = 30602; break; // Healer case 2: suffix = 30505; break; // Direwolf } treasureChest.Add(Item.CreateEnchanted(17032, prefix, suffix)); } treasureChest.Add(Item.Create(id: 2000, amountMin: 608, amountMax: 2688)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchanted item Item item = null; switch (rnd.Next(2)) { case 0: item = Item.CreateEnchanted(40043, prefix: 20105); break; // Maltreat Rolling Pin case 1: item = Item.CreateEnchanted(40001, prefix: 20612); break; // Careful Wooden Stick } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(3360, 6272)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public static DM_LootContainer ParseLootContainer(TreasureChest loot) { var lootHolder = new DM_LootContainer { Name = loot.Name?.Trim(), ItemID = loot.ItemID, UID = loot.UID }; if (lootHolder.Name == "Pocket") { lootHolder.Name = "Corpse"; } if (At.GetField(loot as SelfFilledItemContainer, "m_drops") is List <Dropable> droppers) { foreach (Dropable dropper in droppers) { var dropableHolder = DM_DropTable.ParseDropable(dropper, null, lootHolder.Name); lootHolder.DropTables.Add(dropableHolder.Name); } } string dir = Serializer.Folders.Scenes + "/" + SceneManager.Instance.GetCurrentRegion() + "/" + SceneManager.Instance.GetCurrentLocation(loot.transform.position); string saveName = lootHolder.Name + "_" + lootHolder.UID; Serializer.SaveToXml(dir + "/LootContainers", saveName, lootHolder); return(lootHolder); }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); // Warhammer int prefix = 0, suffix = 0; switch (rnd.Next(4)) { case 0: prefix = 1704; break; // Imitation case 1: prefix = 1705; break; // Cheap case 2: prefix = 1706; break; // Good case 3: prefix = 305; break; // Fine } treasureChest.Add(Item.CreateEnchanted(40016, prefix, suffix)); treasureChest.AddGold(rnd.Next(2140, 2859)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { int suffix = 0; switch (rnd.Next(3)) { case 0: suffix = 30808; break; // Captain's case 1: suffix = 30307; break; // Red Bear case 2: suffix = 30515; break; // Pirate } treasureChest.Add(Item.CreateEnchant(suffix)); } treasureChest.AddGold(rnd.Next(6480, 10800)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); // Fluted Short Sword int prefix = 0, suffix = 0; switch (rnd.Next(4)) { case 0: suffix = 30702; break; // Raven case 1: suffix = 30602; break; // Healer case 2: suffix = 30504; break; // Gold Goblin case 3: suffix = 30501; break; // Giant } treasureChest.Add(Item.CreateEnchanted(40015, prefix, suffix)); treasureChest.AddGold(rnd.Next(2384, 2992)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Cores' Angel wing int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: prefix = 20601; break; // Blessed case 1: prefix = 20406; break; // Convenient case 2: suffix = 30307; break; // Red Bear } treasureChest.Add(Item.CreateEnchanted(18052, prefix, suffix)); } treasureChest.AddGold(rnd.Next(3906, 6390)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; member.TalkToNpc("_dungeonlostresident", "Lost Resident"); var treasureChest = new TreasureChest(); // Enchant var enchant = 0; switch (rnd.Next(3)) { case 0: enchant = 1506; break; // Swan Summoner's (Prefix) case 1: enchant = 1706; break; // Good (Prefix) case 2: enchant = 305; break; // Fine (Prefix) } treasureChest.Add(Item.CreateEnchant(enchant)); treasureChest.AddGold(rnd.Next(153, 768)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { foreach (var member in dungeon.Party) member.TalkToNpc("_dungeonlostresident", "Lost Resident"); var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); // Enchant var enchant = new Item(62005); switch (rnd.Next(3)) { case 0: enchant.OptionInfo.Prefix = 1506; break; // Swan Summoner's case 1: enchant.OptionInfo.Prefix = 1706; break; // Good case 2: enchant.OptionInfo.Prefix = 305; break; // Fine } treasureChest.Add(enchant); treasureChest.AddGold(rnd.Next(153, 768)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public IEnumerator Test_ChestPlaysAnimationAfterOpening() { Player player = CreatePlayer(); TreasureChest chest = CreateChest(true); chest.player = player; yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); Assert.IsNotNull(chest.animator, "There was no animator added to the chest!"); Assert.IsNotNull(chest.animator.runtimeAnimatorController, "There was no animator controller added to the chest's animator!"); chest.transform.position = new Vector3(chest.openDistance - 1, 0, 0); yield return(new WaitForEndOfFrame()); Assert.IsTrue(chest.animator.IsInTransition(0), "Animator was not in transition to next animation!"); yield return(new WaitForSeconds(chest.animator.GetAnimatorTransitionInfo(0).duration)); Assert.IsTrue(chest.animator.GetCurrentAnimatorStateInfo(0).IsName("Open"), "Current animation did not have a matching name!"); Assert.IsTrue(chest.animator.GetCurrentAnimatorStateInfo(0).IsTag("Open"), "Current animation did not have a matching tag!"); // Here we can also test animation speed, playback time, and more. WRITE }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchanted item Item item = null; switch (rnd.Next(2)) { case 0: item = Item.CreateEnchanted(40043, prefix: 20105); break; // Maltreat Rolling Pin case 1: item = Item.CreateEnchanted(40001, prefix: 20612); break; // Careful Wooden Stick } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(3360, 6272)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
private void StartDungeon() { Destroy(pfGoPopup); Destroy(pfGoPopupParticle); TreasureChest.CreateTreasureChest(GameDataHandler.instance.listLevel[GameDataHandler.instance.currentLevel].itemChest, GameDataHandler.instance.listLevel[GameDataHandler.instance.currentLevel].maxItemPerTreasure, GameObject.FindGameObjectWithTag("Player").transform.position); }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchanted item Item item = null; switch (rnd.Next(2)) { case 0: item = Item.CreateEnchanted(40026, prefix: 20404); break; // Sacrificial Sickle case 1: item = Item.CreateEnchanted(18024, prefix: 30411); break; // Magnolia Hairband case 2: item = Item.CreateEnchanted(40003, prefix: 30514); break; // Hope Short Bow } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(4488, 8160)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public static void Load() { var directoryAll = Application.streamingAssetsPath + "/Treasures/TreasureListAll"; var directoryGot = Application.streamingAssetsPath + "/Treasures/TreasureListGot"; string jsonStringAll; string jsonStringGot; if (Application.platform == RuntimePlatform.Android) { var readerAll = new WWW(directoryAll); while (!readerAll.isDone) { } var readerGot = new WWW(directoryAll); while (!readerGot.isDone) { } jsonStringAll = readerAll.text; jsonStringGot = readerGot.text; } else { jsonStringAll = File.ReadAllText(directoryAll); jsonStringGot = File.ReadAllText(directoryGot); } TreasureListAll = JsonUtility.FromJson <TreasureChest>(jsonStringAll); TreasureListGot = JsonUtility.FromJson <TreasureChest>(jsonStringGot); }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { switch (rnd.Next(3)) { case 0: treasureChest.Add(Item.CreateEnchanted(40023, 20611, 0)); break; // Strict Gathering Knife case 1: treasureChest.Add(Item.CreateEnchanted(18006, 0, 30807)); break; // Prophet Wizard Hat case 2: treasureChest.Add(Item.CreateEnchanted(18012, 0, 30521)); break; // Fancy Tork Merchant Cap } } treasureChest.AddGold(rnd.Next(6630, 8670)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
private void ClearMap(int x, int y) { for (int i = Mathf.Max(0, x - 30); i < Mathf.Min(mapWidth * 10, x + 30); i++) { for (int j = Mathf.Max(0, y - 30); j < Mathf.Min(mapHeight * 10, y + 30); j++) { if (tileMapTiles[i, j] != null) { tilePool.ReplaceTile(tileMap[i, j], tileMapTiles[i, j]); tileMapTiles[i, j] = null; } if (enemyMapCreatures[i, j] != null) { creaturePool.ReplaceCreature(enemyMap[i, j], enemyMapCreatures[i, j]); enemyMapCreatures[i, j] = null; } } } while (treasureChests.Count > 0) { TreasureChest chest = treasureChests[0]; treasureChests.Remove(chest); chest.gameObject.SetActive(false); Destroy(chest.gameObject); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchanted item Item item = null; switch (rnd.Next(2)) { case 0: item = Item.CreateEnchanted(40004, prefix: 20105); break; // Artless Lute case 1: item = Item.CreateEnchanted(15022, prefix: 20612); break; // Splendit Popo's Skirt } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(2080, 4160)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchant var enchant = 0; switch (rnd.Next(6)) { case 0: enchant = 11105; break; // Health (Suffix) case 1: enchant = 11106; break; // Blood (Suffix) case 2: enchant = 11205; break; // Water (Suffix) case 3: enchant = 11206; break; // Fountain (Suffix) case 4: enchant = 11304; break; // Patience (Suffix) case 5: enchant = 11305; break; // Sustainer (Suffix) } treasureChest.Add(Item.CreateEnchant(enchant)); } treasureChest.AddGold(rnd.Next(640, 960)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Tail Cap int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: prefix = 20701; break; // Stiff case 1: prefix = 20406; break; // Convenient case 2: prefix = 20104; break; // Green } treasureChest.Add(Item.CreateEnchanted(18017, prefix, suffix)); } treasureChest.AddGold(rnd.Next(1386, 2772)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public IEnumerator Test_LightIncreasesIfChestOpened() { Player player = CreatePlayer(); TreasureChest chest = CreateChest(); IUnityStaticService staticService = CreateUnityService(0.1f, 0, 0); chest.player = player; chest.staticService = staticService; player.transform.position = new Vector3(chest.openDistance, 0, 0); yield return(new WaitForEndOfFrame()); Assert.Zero(chest.flareLight.intensity, "Flare light intensity was not 0 on start!"); chest.isOpen = true; yield return(new WaitForEndOfFrame()); Assert.NotZero(chest.flareLight.intensity, "Flare light intensity was not increased!"); chest.flareLight.intensity = chest.maxLightIntensity; yield return(new WaitForEndOfFrame()); Assert.AreEqual(chest.maxLightIntensity, chest.flareLight.intensity, "Flare light intensity was increased beyond max intensity!"); }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); // Warhammer int prefix = 0, suffix = 0; switch (rnd.Next(4)) { case 0: prefix = 1704; break; // Imitation case 1: prefix = 1705; break; // Cheap case 2: prefix = 1706; break; // Good case 3: prefix = 305; break; // Fine } treasureChest.Add(Item.CreateEnchanted(40016, prefix, suffix)); treasureChest.AddGold(rnd.Next(688, 1728)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchanted item Item item = null; switch (rnd.Next(2)) { case 0: item = Item.CreateEnchanted(40004, prefix: 20105); break; // Artless Lute case 1: item = Item.CreateEnchanted(15022, prefix: 20612); break; // Splendit Popo's Skirt } treasureChest.Add(item); } treasureChest.AddGold(rnd.Next(2080, 4160)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { switch (rnd.Next(3)) { case 0: treasureChest.Add(Item.CreateEnchanted(40023, 20611, 0)); break; // Strict Gathering Knife case 1: treasureChest.Add(Item.CreateEnchanted(18006, 0, 30807)); break; // Prophet Wizard Hat case 2: treasureChest.Add(Item.CreateEnchanted(18012, 0, 30521)); break; // Fancy Tork Merchant Cap } } treasureChest.AddGold(rnd.Next(6630, 8670)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchant var enchant = new Item(62005); switch (rnd.Next(3)) { case 0: enchant.OptionInfo.Prefix = 1506; break; // Swan Summoner's case 1: enchant.OptionInfo.Prefix = 1706; break; // Good case 2: enchant.OptionInfo.Prefix = 305; break; // Fine } treasureChest.Add(enchant); } treasureChest.AddGold(rnd.Next(153, 768)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public PostGameScreen() { _playersProcessed = new List <Player>(); _currentPlayer = Globals.GameState.Zerds.First().Player; _selectedChest = _currentPlayer.Zerd.TreasureChests.FirstOrDefault(); var recapMenuWidth = (int)(Globals.ViewportBounds.Width * RecapMenuSize - SidePadding - MiddlePadding); _recapBounds = new Rectangle(SidePadding, SidePadding, recapMenuWidth, Globals.ViewportBounds.Height - 2 * SidePadding); var treasureMenuWidth = Globals.ViewportBounds.Width - 2 * SidePadding - 2 * MiddlePadding - recapMenuWidth; var left = SidePadding + recapMenuWidth + MiddlePadding * 2; var treasureMenuHeight = (Globals.ViewportBounds.Height - SidePadding * 2 - MiddlePadding * 2) / 2; _treasureInfoBounds = new Rectangle(left, SidePadding, treasureMenuWidth, treasureMenuHeight); _treasureBounds = new Rectangle(left, SidePadding + treasureMenuHeight + MiddlePadding * 2, treasureMenuWidth, treasureMenuHeight); _numTreasuresWide = (int)Math.Floor((_treasureBounds.Width - MenuPadding * 2) / TreasureWidth); Globals.GameState.Zerds.ForEach(z => { z.Width *= 2; z.Height *= 2; z.X = _recapBounds.Center.X; z.Y = _recapBounds.Top + MenuPadding + z.Height / 2; z.Health = z.MaxHealth; z.ZerdAnimations.ResetAll(); z.Facing = new Vector2(0, -1); z.Keys.ForEach(k => { k.Width *= 0.75f; k.Height *= 0.75f; }); }); _highlightTexture = new Texture2D(Globals.SpriteDrawer.GraphicsDevice, 1, 1); _highlightTexture.SetData(new[] { new Color(0.15f, 0.55f, 0.15f, 0.45f) }); }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Cooking Knife int prefix = 0, suffix = 0; switch (rnd.Next(2)) { case 0: prefix = 20206; break; // Nervous case 1: prefix = 20711; break; // Famous } treasureChest.Add(Item.CreateEnchanted(40042, prefix, suffix)); } treasureChest.AddGold(rnd.Next(2880, 4380)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Dagger var prefix = 0; switch (rnd.Next(3)) { case 0: prefix = 20501; break; // Simple case 1: prefix = 20502; break; // Scrupulous case 2: prefix = 20201; break; // Hard } treasureChest.Add(Item.CreateEnchanted(40006, prefix, 0)); } treasureChest.AddGold(rnd.Next(1072, 3680)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
private void NextPlayer() { _currentPlayer.SaveSyncronous(); _playersProcessed.Add(_currentPlayer); _currentPlayer = Globals.GameState.Zerds.FirstOrDefault(z => !_playersProcessed.Contains(z.Player))?.Player; _selectedChest = _currentPlayer?.Zerd.TreasureChests.FirstOrDefault(); Ready = _currentPlayer == null; }
private void CreateChest(int x, int y) { TreasureChest newChest = Instantiate(treasureChestPrefabs[0], new Vector3(x - mapWidth * 5, -y, 1), Quaternion.identity); newChest.SetGold(250 + 5 * y); treasureChests.Add(newChest); }
public void RPCGenerateStash(int itemID, string UID, float x, float y, float z) { TreasureChest chest = ItemManager.Instance.GenerateItemNetwork(itemID).GetComponent <TreasureChest>(); chest.UID = UID; chest.SaveType = Item.SaveTypes.Savable; chest.transform.position = new Vector3(x, y, z); BattleRoyale.Instance.ActiveItemContainers.Add(chest.gameObject); }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); treasureChest.AddGold(rnd.Next(153, 768)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); treasureChest.AddGold(rnd.Next(58, 86)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest", member.EntityId)); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Broad Stick int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: prefix = 207; break; // Fox case 1: prefix = 306; break; // Sharp case 2: prefix = 303; break; // Rusty } switch (rnd.Next(3)) { case 0: suffix = 11106; break; // Blood case 1: suffix = 10806; break; // Understanding case 2: suffix = 10704; break; // Slug } treasureChest.Add(Item.CreateEnchanted(40019, prefix, suffix)); // Goro's Ring (G1) if (member.Keywords.Has("g1_13")) treasureChest.Add(Item.Create(73060)); } treasureChest.AddGold(rnd.Next(1232, 4064)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (member.Keywords.Has("g1_25")) treasureChest.Add(Item.Create(73054)); // Book of Revenge Vol 2 treasureChest.AddGold(rnd.Next(326, 800)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); // Lute int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: prefix = 4; break; // Donkey Hunter's case 1: prefix = 1506; break; // Swan Summoner's case 2: prefix = 1707; break; // Sturdy } switch (rnd.Next(3)) { case 0: suffix = 10806; break; // Understanding case 1: suffix = 10504; break; // Topaz case 2: suffix = 10706; break; // Wind } switch (rnd.Next(3)) { case 0: treasureChest.Add(Item.CreateEnchanted(40042, prefix, suffix)); break; case 1: treasureChest.Add(Item.CreateEnchanted(40042, prefix, 0)); break; case 2: treasureChest.Add(Item.CreateEnchanted(40042, 0, suffix)); break; } treasureChest.AddGold(rnd.Next(576, 2880)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); // Fomor Medal if (member.Keywords.Has("g1_medal_of_fomor")) treasureChest.Add(Item.Create(73021)); treasureChest.AddGold(rnd.Next(576, 1440)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); var creators = dungeon.GetCreators(); for (int i = 0; i < creators.Count; ++i) { var member = creators[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Mongo's Fashion Cap int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: prefix = 20401; break; // Smart case 1: prefix = 20601; break; // Blessing case 2: prefix = 20202; break; // Wild Dog } switch (rnd.Next(3)) { case 0: suffix = 30307; break; // Red Bear case 1: suffix = 30601; break; // Thief case 2: suffix = 30503; break; // White Spider } treasureChest.Add(Item.CreateEnchanted(18004, prefix, suffix)); } treasureChest.AddGold(rnd.Next(1500, 3600)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Broad Stick int prefix = 0, suffix = 0; switch (rnd.Next(4)) { case 0: prefix = 207; break; // Fox case 1: prefix = 306; break; // Sharp case 2: prefix = 303; break; // Rusty case 3: prefix = 7; break; // Fox Hunter's } switch (rnd.Next(3)) { case 0: suffix = 11106; break; // Blood case 1: suffix = 10806; break; // Understanding case 2: suffix = 10704; break; // Slug } treasureChest.Add(Item.CreateEnchanted(40019, prefix, suffix)); } treasureChest.AddGold(rnd.Next(979, 2400)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Enchant var enchant = 0; switch (rnd.Next(3)) { case 0: enchant = 1506; break; // Swan Summoner's (Prefix) case 1: enchant = 1706; break; // Good (Prefix) case 2: enchant = 305; break; // Fine (Prefix) } treasureChest.Add(Item.CreateEnchant(enchant)); } treasureChest.AddGold(rnd.Next(153, 768)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } }
protected void initializePlayer () { target = null; lootItem = null; treasureChest = null; startPosition = transform.position; }
public override void OnCleared(Dungeon dungeon) { var rnd = RandomProvider.Get(); if (dungeon.CountPlayers() == 1) { var member = dungeon.Party[0]; var treasureChest = new TreasureChest(); // Bracelet int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: prefix = 206; break; // Snake case 1: prefix = 305; break; // Fine case 2: prefix = 303; break; // Rusty } switch (rnd.Next(3)) { case 0: suffix = 10504; break; // Topaz case 1: suffix = 10605; break; // Soldier case 2: suffix = 11206; break; // Fountain } treasureChest.Add(Item.CreateEnchanted(16015, prefix, suffix)); treasureChest.Add(Item.Create(id: 2000, amountMin: 570, amountMax: 2520)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } else { for (int i = 0; i < dungeon.Party.Count; ++i) { var member = dungeon.Party[i]; var treasureChest = new TreasureChest(); if (i == 0) { // Bracelet int prefix = 0, suffix = 0; switch (rnd.Next(3)) { case 0: suffix = 10504; break; // Topaz case 1: suffix = 10605; break; // Soldier case 2: suffix = 11205; break; // Water } treasureChest.Add(Item.CreateEnchanted(16015, prefix, suffix)); } treasureChest.Add(Item.Create(id: 2000, amountMin: 896, amountMax: 3600)); // Gold treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item dungeon.AddChest(treasureChest); member.GiveItemWithEffect(Item.CreateKey(70028, "chest")); } } }