public void DamageItem(int damage) { RPGSQLContext context = new RPGSQLContext(); RPGRepository repo = new RPGRepository(context); repo.ExecuteDamageToItem(ItemId); }
/// <summary> /// The player comes out of the combat screen and gets an item drop. His weapon also takes durability damage. /// </summary> /// <returns></returns> public ActionResult ReturnFromCombat() { RPGRepository rpgrepo = new RPGRepository(rpgct); int ids = (int)Session["CharId"]; Session["evm"] = null; int itemid = rpgrepo.GetItemDrop((int)Session["CharId"]); Character character = rpgrepo.GetById((int)Session["CharId"]); int itemidweapon = character.Wepid; rpgrepo.ExecuteDamageToItem(itemidweapon); Session["itemdrop"] = itemid; return(RedirectToAction("Play", new { id = ids })); }