public override void SetDefaults(Item item) { base.SetDefaults(item); ItemEdits modItem = item.GetGlobalItem <ItemEdits>(); if (item.accessory == true) { modItem.isBasic = true; } if (item.axe > 0 || item.pick > 0 || item.hammer > 0) { modItem.isBasic = true; } if (item.melee == false && item.thrown == false && item.ranged == false && item.magic == false && item.summon == false && modItem.chemical == false && item.defense == 0) { modItem.isBasic = true; } if (modItem.chemical == true) { item.thrown = false; item.melee = false; item.magic = false; item.ranged = false; item.summon = false; item.crit = 0; } if (item.rare < ItemRarityID.LightRed || item.type == ItemID.SlimeStaff || item.type == ItemID.FlaskofPoison || item.type == ItemID.FlaskofParty || item.type == ItemID.FlaskofFire || item.type == ItemID.GoldenBugNet || item.type == ItemID.EoCShield) { modItem.preHardmode = true; } if (item.type == ItemID.CobaltBreastplate || item.type == ItemID.CobaltLeggings || item.type == ItemID.PalladiumBreastplate || item.type == ItemID.PalladiumLeggings || item.type == ItemID.MythrilChainmail || item.type == ItemID.MythrilGreaves || item.type == ItemID.OrichalcumBreastplate || item.type == ItemID.OrichalcumLeggings || item.type == ItemID.AdamantiteBreastplate || item.type == ItemID.AdamantiteLeggings || item.type == ItemID.TitaniumBreastplate || item.type == ItemID.TitaniumLeggings || item.type == ItemID.HallowedPlateMail || item.type == ItemID.HallowedGreaves || item.type == ItemID.ChlorophytePlateMail || item.type == ItemID.ChlorophyteGreaves ) { modItem.isBasic = true; } if (item.type == ItemID.CobaltHelmet || item.type == ItemID.PalladiumMask || // Knight sets item.type == ItemID.MythrilHelmet || item.type == ItemID.OrichalcumMask || item.type == ItemID.AdamantiteHelmet || item.type == ItemID.TitaniumMask || item.type == ItemID.FrostHelmet || item.type == ItemID.FrostBreastplate || item.type == ItemID.FrostLeggings || item.type == ItemID.HallowedMask || item.type == ItemID.ChlorophyteMask || item.type == ItemID.TurtleHelmet || item.type == ItemID.TurtleScaleMail || item.type == ItemID.TurtleLeggings || item.type == ItemID.BeetleHelmet || item.type == ItemID.BeetleLeggings || item.type == ItemID.BeetleShell || item.type == ItemID.SolarFlareHelmet || item.type == ItemID.SolarFlareBreastplate || item.type == ItemID.SolarFlareLeggings || item.type == ItemID.SquireGreatHelm || item.type == ItemID.SquirePlating || item.type == ItemID.SquireGreaves || item.type == ItemID.SquireAltHead || item.type == ItemID.SquireAltPants || item.type == ItemID.SquireAltShirt ) { modItem.knightItem = true; } if (item.type == ItemID.AnkhShield || item.type == ItemID.PaladinsShield) { modItem.isBasic = false; modItem.knightItem = true; item.defense += 4; } if (item.type == ItemID.PaladinsShield) { item.defense += 2; } if (item.type == ItemID.CobaltShield) { item.defense += 3; } if (item.type == ItemID.ObsidianShield) { item.defense += 4; } if (item.type == ItemID.CobaltMask || item.type == ItemID.PalladiumHelmet || // Ranger sets item.type == ItemID.MythrilHat || item.type == ItemID.OrichalcumHelmet || item.type == ItemID.AdamantiteMask || item.type == ItemID.TitaniumHelmet || item.type == ItemID.FrostHelmet || item.type == ItemID.FrostBreastplate || item.type == ItemID.FrostLeggings || item.type == ItemID.HallowedHelmet || item.type == ItemID.ChlorophyteHelmet || item.type == ItemID.ShroomiteBreastplate || item.type == ItemID.ShroomiteHeadgear || item.type == ItemID.ShroomiteHelmet || item.type == ItemID.ShroomiteMask || item.type == ItemID.ShroomiteLeggings || item.type == ItemID.VortexBreastplate || item.type == ItemID.VortexHelmet || item.type == ItemID.VortexLeggings || item.type == ItemID.HuntressWig || item.type == ItemID.HuntressJerkin || item.type == ItemID.HuntressPants || item.type == ItemID.HuntressAltHead || item.type == ItemID.HuntressAltPants || item.type == ItemID.HuntressAltShirt ) { modItem.rangerItem = true; } if (item.type == ItemID.SpaceGun || item.type == ItemID.LaserRifle || item.type == ItemID.LeafBlower || item.type == ItemID.HeatRay || item.type == ItemID.LaserMachinegun || item.type == ItemID.ChargedBlasterCannon || item.type == ItemID.Razorpine ) { item.magic = false; item.ranged = true; item.autoReuse = true; } if (item.type == ItemID.CobaltHat || item.type == ItemID.PalladiumHeadgear || // Mage sets item.type == ItemID.MythrilHood || item.type == ItemID.OrichalcumHeadgear || item.type == ItemID.AdamantiteHeadgear || item.type == ItemID.TitaniumHeadgear || item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants || item.type == ItemID.HallowedHeadgear || item.type == ItemID.ChlorophyteHeadgear || item.type == ItemID.SpectreHood || item.type == ItemID.SpectreMask || item.type == ItemID.SpectreRobe || item.type == ItemID.SpectrePants || item.type == ItemID.NebulaBreastplate || item.type == ItemID.NebulaHelmet || item.type == ItemID.NebulaLeggings || item.type == ItemID.ApprenticeHat || item.type == ItemID.ApprenticeRobe || item.type == ItemID.ApprenticeTrousers || item.type == ItemID.ApprenticeAltHead || item.type == ItemID.ApprenticeAltPants || item.type == ItemID.ApprenticeAltShirt ) { modItem.mageItem = true; } if (item.type == ItemID.SpiderMask || item.type == ItemID.SpiderBreastplate || // Summoner sets item.type == ItemID.SpiderGreaves || item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientArmorPants || item.type == ItemID.AncientArmorShirt || item.type == ItemID.TikiMask || item.type == ItemID.TikiPants || item.type == ItemID.TikiShirt || item.type == ItemID.SpookyHelmet || item.type == ItemID.SpookyBreastplate || item.type == ItemID.SpookyLeggings || item.type == ItemID.StardustBreastplate || item.type == ItemID.StardustHelmet || item.type == ItemID.StardustLeggings || item.type == ItemID.ApprenticeHat || item.type == ItemID.ApprenticeRobe || item.type == ItemID.ApprenticeTrousers || item.type == ItemID.SquireGreatHelm || item.type == ItemID.SquirePlating || item.type == ItemID.SquireGreaves || item.type == ItemID.HuntressWig || item.type == ItemID.HuntressJerkin || item.type == ItemID.HuntressPants || item.type == ItemID.MonkBrows || item.type == ItemID.MonkShirt || item.type == ItemID.MonkPants || item.type == ItemID.ApprenticeAltHead || item.type == ItemID.ApprenticeAltPants || item.type == ItemID.ApprenticeAltShirt || item.type == ItemID.HuntressAltHead || item.type == ItemID.HuntressAltPants || item.type == ItemID.HuntressAltShirt || item.type == ItemID.MonkAltHead || item.type == ItemID.MonkAltPants || item.type == ItemID.MonkAltShirt || item.type == ItemID.SquireAltHead || item.type == ItemID.SquireAltPants || item.type == ItemID.SquireAltShirt ) { modItem.summonerItem = true; } if (item.type == ItemID.BeesKnees || item.type == ItemID.BeeGun || item.type == ItemID.WaspGun || item.type == ItemID.SpectreStaff || item.type == ItemID.BatScepter || item.type == ItemID.BookofSkulls || item.type == ItemID.HellwingBow || item.type == ItemID.PiranhaGun || item.type == ItemID.ScourgeoftheCorruptor ) { item.ranged = false; item.melee = false; item.magic = false; item.summon = true; } if (item.type == ItemID.BeetleScaleMail || item.type == ItemID.BeetleHelmet || //Rogue sets item.type == ItemID.BeetleLeggings || item.type == ItemID.FrostHelmet || item.type == ItemID.FrostBreastplate || item.type == ItemID.FrostLeggings || item.type == ItemID.MonkBrows || item.type == ItemID.MonkShirt || item.type == ItemID.MonkPants || item.type == ItemID.MonkAltHead || item.type == ItemID.MonkAltPants || item.type == ItemID.MonkAltShirt ) { modItem.rogueItem = true; } if (item.type == ItemID.WoodenBoomerang || item.type == ItemID.EnchantedBoomerang || item.type == ItemID.IceBoomerang || item.type == ItemID.FruitcakeChakram || item.type == ItemID.ThornChakram || item.type == ItemID.Flamarang || item.type == ItemID.FlyingKnife || item.type == ItemID.LightDisc || item.type == ItemID.Bananarang || item.type == ItemID.PossessedHatchet || item.type == ItemID.ShadowFlameKnife || item.type == ItemID.VampireKnives || item.type == ItemID.DayBreak || item.type == ItemID.Anchor || item.type == ItemID.ChainGuillotines || item.type == ItemID.KOCannon || item.type == ItemID.GolemFist || item.type == ItemID.ChainKnife || item.type == ItemID.WoodYoyo || item.type == ItemID.Rally || item.type == ItemID.CorruptYoyo || item.type == ItemID.CrimsonYoyo || item.type == ItemID.JungleYoyo || item.type == ItemID.Code1 || item.type == ItemID.Valor || item.type == ItemID.Cascade || item.type == ItemID.FormatC || item.type == ItemID.Gradient || item.type == ItemID.Chik || item.type == ItemID.HelFire || item.type == ItemID.Amarok || item.type == ItemID.Code2 || item.type == ItemID.Yelets || item.type == ItemID.RedsYoyo || item.type == ItemID.ValkyrieYoyo || item.type == ItemID.Kraken || item.type == ItemID.TheEyeOfCthulhu || item.type == ItemID.Terrarian ) { item.melee = false; item.magic = false; item.thrown = true; } /* * if (item.type == ItemID.ToxicFlask) * { * item.magic = false; * modItem.chemical = true; * item.consumable = true; * item.crit = 0; * item.mana = 0; * item.value = 5000; * item.maxStack = 999; * } */ if (IsCOItem(item) || IsModItem(item) == false) { JobHooks.ApplyClassAssigns(item); } ItemMethods.SetDefaults(item); if (item.type == ItemID.LightDisc || item.type == ItemID.Bananarang || item.type == ItemID.PossessedHatchet || item.type == ItemID.ShadowFlameKnife || item.type == ItemID.VampireKnives || item.type == ItemID.Anchor || item.type == ItemID.ChainGuillotines || item.type == ItemID.KOCannon || item.type == ItemID.GolemFist ) { item.damage += 20; } if (item.type == ItemID.FormatC || item.type == ItemID.DayBreak || item.type == ItemID.Gradient || item.type == ItemID.Chik || item.type == ItemID.HelFire || item.type == ItemID.Amarok || item.type == ItemID.Code2 || item.type == ItemID.Yelets || item.type == ItemID.RedsYoyo || item.type == ItemID.ValkyrieYoyo || item.type == ItemID.Kraken || item.type == ItemID.TheEyeOfCthulhu || item.type == ItemID.Terrarian ) { item.damage -= 15; } if (item.type == ItemID.CobaltHelmet || item.type == ItemID.PalladiumMask || item.type == ItemID.MythrilHelmet || item.type == ItemID.OrichalcumMask || item.type == ItemID.AdamantiteHelmet || item.type == ItemID.TitaniumMask || item.type == ItemID.HallowedMask || item.type == ItemID.ChlorophyteMask || item.type == ItemID.BeetleShell || item.type == ItemID.SolarFlareBreastplate || item.type == ItemID.SquirePlating || item.type == ItemID.SquireAltShirt || item.type == ItemID.TurtleScaleMail ) { item.defense += 10 + (item.rare * 2); } if (item.type == ItemID.FrostBreastplate) { item.defense += 6; } if (item.defense > 0 && IsCOItem(item) == false) { if (modItem.mageItem || modItem.summonerItem) { modItem.magicDefense = item.defense * 3; } if (modItem.knightItem) { modItem.magicDefense = item.defense - item.defense / 10; } if (modItem.rangerItem || modItem.alchemistItem) { modItem.magicDefense = item.defense + item.defense / 4; } if (modItem.rogueItem) { modItem.magicDefense = item.defense + item.defense / 6; } if (modItem.summonerItem && (modItem.knightItem || modItem.rangerItem || modItem.rogueItem || modItem.alchemistItem)) { modItem.magicDefense = item.defense + item.defense / 2; } if (!(modItem.mageItem && modItem.summonerItem && modItem.knightItem && modItem.rogueItem && modItem.rangerItem && modItem.alchemistItem)) { modItem.magicDefense = item.defense; } } if (item.magic == true && IsCOItem(item) == false) { item.damage += (10 + (item.mana / 2) + item.rare); if (item.crit > 4) { item.damage += item.crit - 4; } } if (item.magic == true && IsCOItem(item) == false) { item.crit = 0; } if (item.thrown == true && IsCOItem(item) == false) { if (item.crit >= 4) { item.crit -= 4; } else { item.crit = 0; } } if (item.type == ItemID.BeesKnees) { item.autoReuse = true; item.useAmmo = 0; item.damage += 5; item.mana = 6; } if (item.type == ItemID.HellwingBow) { item.autoReuse = true; item.useAmmo = 0; item.damage += 5; item.mana = 4; } if (item.type == ItemID.PiranhaGun) { item.useAmmo = 0; item.mana = 8; } if (item.type == ItemID.SpectreStaff) { item.damage = 68; } if (item.type == ItemID.SpaceGun) { item.mana = 6; } if (item.type == ItemID.LaserRifle) { item.mana = 7; } if (item.type == ItemID.ChargedBlasterCannon) { item.mana = 10; } if (item.type == ItemID.MeteorStaff) { item.damage = 75; } if (item.type == ItemID.ScourgeoftheCorruptor) { item.mana = 12; } if (item.type == ItemID.AnkhCharm) { item.accessory = false; } if (item.type == ItemID.BookofSkulls) { item.mana = 12; } //if (item.type == ItemID.ImpStaff) //{ // modItem.hasSummon = true; // item.shoot = 0; // modItem.summonNPC = mod.NPCType("Imp"); //} }
public void FinalizarCompra() { WebDriverWait wait = new WebDriverWait(Webdriver, TimeSpan.FromSeconds(40)); HomePageMethods homePageMethods = new HomePageMethods(Webdriver); ItemMethods itemMethods = new ItemMethods(Webdriver); CartPageMethods cartPageMethods = new CartPageMethods(Webdriver); FormPageMethods formPageMethods = new FormPageMethods(Webdriver); AddressPageMethods addressPageMethods = new AddressPageMethods(Webdriver); PaymentPageMethods paymentPageMethods = new PaymentPageMethods(Webdriver); string productName = "Faded Short Sleeve T-shirts"; string consumerEmail = "*****@*****.**"; string consumerFirstName = "Automation"; string consumerLastName = "Test"; string password = "******"; string birthDay = "15"; string birthMonth = "5"; string birthYear = "1990"; string address = "1784 Water Street"; string city = "Los Angeles"; string country = "United States"; string state = "California"; string postalCode = "90007"; string phone = "925-280-1092"; //select an item on homepage homePageMethods.SelectProduct(productName); //add item to cart and proceed to checkout itemMethods.AddToCart(); IWebElement element = wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(ItemPageObjects.layerCart)); itemMethods.GoToCheckout(); Assert.IsTrue(cartPageMethods.GetBreadcrumb().Contains("Your shopping cart")); //assert that item previously selected is on the cart and go to sign in+ //Assert.IsTrue(cartPageMethods.GetProductName().Contains(productName)); //esse assert não funciona cartPageMethods.CheckoutNextStep(); cartPageMethods.SubmitCreate(consumerEmail); formPageMethods.InsertCostumerName(consumerFirstName, consumerLastName); formPageMethods.InsertPasword(password); formPageMethods.InsertDateBirth(birthDay, birthMonth, birthYear); formPageMethods.InsertAddresstName(consumerFirstName, consumerLastName); formPageMethods.InsertAddres(address); formPageMethods.InsertCity(city); formPageMethods.SelectCountry(country); formPageMethods.SelectState(state); formPageMethods.InsertPostalCode(postalCode); formPageMethods.InsertPhone(phone); formPageMethods.FinishRegister(); //Assert.AreEqual(addressPageMethods.GetAddressName(), consumerFirstName + " " + consumerLastName); //Assert.AreEqual(addressPageMethods.GetAddres(), city + ", " + state + " " + postalCode); //Assert.AreEqual(addressPageMethods.GetCountryName(), country); //.AreEqual(addressPageMethods.GetAddressPhone(), phone); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(addressPageMethods.GetProceedButton())); addressPageMethods.GoToShipping(); addressPageMethods.CheckTermsOfService(); addressPageMethods.GoToPayment(); Console.WriteLine(paymentPageMethods.SumTotalPrice()); Assert.AreEqual(paymentPageMethods.GetTotalPrice(), paymentPageMethods.SumTotalPrice()); }