internal bool CanUseCordial(ushort withinSeconds = 5) { return(CordialSpellData.Cooldown.TotalSeconds < withinSeconds && !HasChum && !HasPatience && !HasFishEyes && ((CordialType == CordialType.WateredCordial && Cordial.HasWateredCordials()) || (CordialType == CordialType.Cordial && (Cordial.HasWateredCordials() || Cordial.HasCordials())) || ((CordialType == CordialType.HiCordial || CordialType == CordialType.Auto) && Cordial.HasAnyCordials()))); }
public ActionResult DeleteConfirmed(long id) { Cordial cordial = db.Cordials.Find(id); db.Cordials.Remove(cordial); db.SaveChanges(); return(RedirectToAction("Index")); }
private async Task <bool> HandleCordial() { if (CordialType == CordialType.None) { // Not using cordials, skip method. return(false); } if (FishingManager.State >= FishingState.Bite) { // Need to wait till we are in the correct state return(false); } CordialSpellData = CordialSpellData ?? Cordial.GetSpellData(); if (CordialSpellData == null) { CordialType = CordialType.None; return(false); } if (!CanUseCordial(8)) { // has a buff or cordial cooldown not ready or we have no cordials. return(false); } var missingGp = ExProfileBehavior.Me.MaxGP - ExProfileBehavior.Me.CurrentGP; if (missingGp < 300 && !ForceCordial) { // Not forcing cordial and less than 300gp missing from max. return(false); } await Coroutine.Wait(10000, () => CanDoAbility(Abilities.Quit)); DoAbility(Abilities.Quit); isSitting = false; await Coroutine.Wait(5000, () => FishingManager.State == FishingState.None); if (missingGp >= 380 && CordialType >= CordialType.HiCordial) { if (await UseCordial(CordialType.HiCordial)) { return(true); } } if (await UseCordial(CordialType.Cordial)) { return(true); } return(false); }
public ActionResult Edit(Cordial cordial) { if (ModelState.IsValid) { db.Entry(cordial).State = EntityState.Modified; db.SaveChanges(); ImageTrans(cordial.Name); return(RedirectToAction("Index")); } return(View(cordial)); }
public ActionResult Create(Cordial cordial) { if (ModelState.IsValid) { db.Cordials.Add(cordial); db.SaveChanges(); ImageTrans(cordial.Name); return(RedirectToAction("Index")); } return(View(cordial)); }
private async Task <bool> HandleCordial() { if (CordialType == CordialType.None) { return(false); } CordialSpellData = CordialSpellData ?? Cordial.GetSpellData(); if (CordialSpellData == null) { CordialType = CordialType.None; return(false); } if (!CanUseCordial(8)) { return(false); } var missingGp = ExProfileBehavior.Me.MaxGP - ExProfileBehavior.Me.CurrentGP; if (missingGp < 300) { return(false); } if (missingGp >= 450 && (CordialType == CordialType.HiCordial || CordialType == CordialType.Auto)) { if (await UseCordial(CordialType.HiCordial)) { return(true); } } if (missingGp < 400 || CordialType != CordialType.Cordial && CordialType != CordialType.Auto) { return(await UseCordial(CordialType.WateredCordial)); } if (await UseCordial(CordialType.Cordial)) { return(true); } return(await UseCordial(CordialType.WateredCordial)); }
// // GET: /Cordial/Details/5 public ViewResult Details(long id) { Cordial Cordial = db.Cordials.Find(id); IngItsCock.Id = (int)id; //IngSum.Id = (int)id; //IngSum.Name = Cordial.Name; IngItsCock.Name = Cordial.Name; ViewBag.Details = "Cocktails with " + Cordial.Name.Replace("_", " "); //IngSum.Cocktails = from a in Cordial.CocktailCordials select new SelectListItem {Value = a.CocktailId.ToString(),Text = a.CockTail.Name }; IngItsCock.ItsCocktails = from b in Cordial.CocktailCordials select new component { Id = b.CocktailId, Name = b.CockTail.Name }; IngItsCock.ItsCocktails = IngItsCock.ItsCocktails.OrderBy(b => b.Name); //IngSum.Cocktails = (from a in Cordial.CocktailCordials select new SelectListItem { Value = a.CocktailId.ToString(), Text = a.CockTail.Name }).OrderBy(o => o.Text); return(View(IngItsCock)); }
public ActionResult Edit(long id) { Cordial cordial = db.Cordials.Find(id); return(View(cordial)); }