public ActionResult NewWeapon(int weaponID) { KillerFUNwebApp1._0.Models.Player player = Session["selected_character"] as Player; player.PickUpWeapon(weaponID); Session["selected_character"] = player; return(Json(player.CurrentWeapon, JsonRequestBehavior.AllowGet)); }
public ActionResult ChangedRoom(int roomID) { KillerFUNwebApp1._0.Models.Player player = Session["selected_character"] as Player; player.CurrentRoomID = roomID; playerRepo.updatePlayer(player); Session["selected_character"] = player; Room newRoom = roomRepo.GetRoom(roomID); Session["current_room"] = newRoom; return(Json(newRoom, JsonRequestBehavior.AllowGet)); }
public ActionResult LvlUp(string stat) { if (stat == "max_hp") { KillerFUNwebApp1._0.Models.Player p = Session["selected_character"] as Player; p.levelUp(Stat.MaxHealth); Session["selected_character"] = p; } else if (stat == "attack") { KillerFUNwebApp1._0.Models.Player p = Session["selected_character"] as Player; p.levelUp(Stat.Attack); Session["selected_character"] = p; } else if (stat == "defence") { KillerFUNwebApp1._0.Models.Player p = Session["selected_character"] as Player; p.levelUp(Stat.Defence); Session["selected_character"] = p; } return(Redirect("/Map/Player")); }