예제 #1
0
        public EmptyResult Drop(int id)
        {
            PlayerItem item = PlayerItem.Load(id);

            item.Delete();
            return(null);
        }
예제 #2
0
 public ActionResult Modal_Item(int playerItemId)
 {
     if (Player.CurrentPlayer == null)
     {
         return(Content(""));
     }
     return(View(PlayerItem.Load(playerItemId)));
 }
예제 #3
0
        public EmptyResult RemoveItem(int id)
        {
            PlayerItem playerItem = PlayerItem.Load(id);

            playerItem.Delete();

            return(null);
        }
예제 #4
0
        public EmptyResult DoNotPress(int id)
        {
            PlayerItem item = PlayerItem.Load(id);

            if (item.itemId != "timemachine")
            {
                return(null);                                          // hax0rs
            }
            // put session into TimeWarp state - central display takes care of the flow from here on out
            Halloween_Game.Session.CurrentSession.SetState(Halloween_Game.Session.SessionState.TimeWarp);
            System.Web.HttpContext.Current.Application["TimeWarp PlayerItem Id"] = item.id;

            return(null);
        }
예제 #5
0
        public JsonResult GetPlayerItemStatus(string transferCode)
        {
            PlayerItem item = PlayerItem.Load(transferCode);

            if (item == null)
            {
                return(Json(new PlayerItem_JSON()
                {
                    id = 0
                }, JsonRequestBehavior.AllowGet));
            }

            return(Json(item.GetJSON, JsonRequestBehavior.AllowGet));
        }
예제 #6
0
        // routine that runs at the end of a game session
        private static ActionResult TimeWarp()
        {
            double secElapsed = Halloween_Game.Session.CurrentSession.TimeSinceLastModified.TotalSeconds;

            if (Halloween_Game.Session.TimeWarpLevel == 0)
            {
                PlayerItem finalItem = PlayerItem.Load((int)System.Web.HttpContext.Current.Application["TimeWarp PlayerItem Id"]);
                // all that initial stuff
                Newsfeed.Create("BREAKING - massive gravitation waves resulting from an experiment at <b>" + finalItem.GetPlayer.GetTeam.name + "</b> research laboratories is causing wide-spread damage and chaos through the local coordinated star systems.", Newsfeed.Context.danger);
                // global notification
                Notification.CreateGlobal("Anomalies in local spacetime have disrupted all normal activities.");

                // remove all player tasks & items
                foreach (Player player in Player.GetAll())
                {
                    foreach (PlayerTask playerTask in player.GetTasks)
                    {
                        playerTask.Delete();
                    }
                    foreach (PlayerItem playerItem in player.GetItems)
                    {
                        playerItem.Delete();
                    }
                    player.MustReload = true;
                }

                Halloween_Game.Session.TimeWarpLevel++;
            }
            else if (secElapsed > 10 && Halloween_Game.Session.TimeWarpLevel == 1)
            {
                Notification.CreateGlobal("Direct all queries to Central Display.");
                Halloween_Game.Session.TimeWarpLevel++;
            }
            else if (secElapsed > 30 && Halloween_Game.Session.TimeWarpLevel == 2)
            {
                Newsfeed.Create("Atomic chronometers reportedly becoming unreliable. Scientists puzzled. Clocks are running slowly, or stopping completely.", Newsfeed.Context.warning);
                Halloween_Game.Session.TimeWarpLevel++;
            }
            else if (secElapsed > 40 && Halloween_Game.Session.TimeWarpLevel == 3)
            {
                Newsfeed.Create("System-wide entropy decreasing. Natural processes have begun running backwards.", Newsfeed.Context.danger);
                Halloween_Game.Session.TimeWarpLevel++;
            }
            else if (secElapsed > 48 && Halloween_Game.Session.TimeWarpLevel == 4)
            {
                Newsfeed.Create("Some hope that a cure for aging has been discovered.", Newsfeed.Context.success);
                Notification.CreateGlobal("You feel yourself becoming younger. Knowledge is slipping from your mind. Mistakes and accomplishments are being unmade.");
                Halloween_Game.Session.TimeWarpLevel++;
            }
            else if (secElapsed > 64 && Halloween_Game.Session.TimeWarpLevel == 5)
            {
                Newsfeed.Create("Connection lost. Critical system failure imminent.", Newsfeed.Context.warning);
                Halloween_Game.Session.TimeWarpLevel++;
            }
            else if (secElapsed > 74 && Halloween_Game.Session.TimeWarpLevel == 6)
            {
                for (int i = 0; i < 7; i++)
                {
                    Newsfeed.Create("GENERAL SYSTEM ERROR", Newsfeed.Context.danger);
                }
                Halloween_Game.Session.TimeWarpLevel++;
            }
            else if (secElapsed > 90 && Halloween_Game.Session.TimeWarpLevel == 7)
            {
                Halloween_Game.Session.CurrentSession.SetState(Halloween_Game.Session.SessionState.Reset);
                foreach (Player player in Player.GetAll())
                {
                    player.MustReload = true;
                    player.Save();
                }
            }

            return(null);
        }