示例#1
0
 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));
 }
示例#2
0
        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));
        }
示例#3
0
        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"));
        }