Example #1
0
        public ActionResult Random(int size)
        {
            Random      rnd   = new System.Random();
            DungeonList DList = new DungeonList(rnd, size);

            return(View(DList));
        }
Example #2
0
    // Use this for initialization
    void Start()
    {
        //switch room after delay if there is one
        // if (delay > 0){
        //  Debug.Log("gonna switch rooms automatically");
        //  StartCoroutine(LoadLevelAfterDelay(delay));
        // }

        //if current floor index is < 0, you're on the results screen
        //and you'll want to transition to the first level
        if (thisFloorNum == -1)
        {
            nextLevel = DungeonList.GetFloorNameWithDifficulty(0);             //DungeonList.arr_floorInfo[0];
        }
        else if (thisFloorNum == -2)
        {
            nextLevel = DungeonList.dungeon_results.floorName;
        }
        //if you are on the last floor available,
        //you'll want to transition to the results screen
        //if you're on the first floor and you only have that floor unlocked
        //curMaxFloor = 0
        //thisFloorNum + 1 = 1
        //so the next floor should be results
        else if (thisFloorNum + 1 >= DungeonList.curMaxFloor + 1)
        {
            nextLevel = DungeonList.dungeon_upgrademenu.floorName;
        }
        //otherwise, transition to the next level
        else
        {
            nextLevel = DungeonList.GetFloorNameWithDifficulty(thisFloorNum + 1);
        }
    }
Example #3
0
 // Use this for initialization
 void Start()
 {
     //Debug.Log("Start intro screen change");
     if (introPart == 1)
     {
         if (introIndex + 1 >= DungeonList.maxNumIntro1Scenes)
         {
             nextFloor = DungeonList.arr_tutorialFloorNames[0];
         }
         else
         {
             nextFloor = DungeonList.arr_intro1FloorNames[introIndex + 1];
         }
     }
     else
     {
         if (introIndex + 1 >= DungeonList.maxNumIntro2Scenes)
         {
             nextFloor = DungeonList.GetFloorNameWithDifficulty(0);                 //DungeonList.arr_floorInfo[0].floorName;
         }
         else
         {
             nextFloor = DungeonList.arr_intro2FloorNames[introIndex + 1];
         }
     }
 }
Example #4
0
        // GET: Dungeon/Random
        public ActionResult Random()
        {
            Random      rnd         = new System.Random();
            DungeonList DungeonList = new DungeonList(rnd, 1);

            // return View(DungeonList.GetRandomDungeon());
            return(new HttpNotFoundResult());
        }
Example #5
0
 private void OnEnable()
 {
     if (EditorPrefs.HasKey("DungeonListPath"))
     {
         string objectPath = EditorPrefs.GetString("DungeonListPath");
         dungeonList = AssetDatabase.LoadAssetAtPath(objectPath, typeof(DungeonList)) as DungeonList;
     }
 }
Example #6
0
    public static void CheckIfOutOfMoney()
    {
        if (amount < 0)
        {
            SceneManager.LoadScene(DungeonList.dungeon_gameOver.floorName);

            amount = defaultAmount;

            DungeonList.ResetLevels();
            UniversalUpgradeScript.reset = true;
        }
    }
Example #7
0
    void LoadList()
    {
        string absPath = EditorUtility.OpenFilePanel("Select Dungeon List", "Assets/Script/DungeonManager", "");

        if (absPath.StartsWith(Application.dataPath))
        {
            string relPath = absPath.Substring(Application.dataPath.Length - "Assets".Length);
            dungeonList = AssetDatabase.LoadAssetAtPath(relPath, typeof(DungeonList)) as DungeonList;
            if (dungeonList.myDungeons == null)
            {
                dungeonList.myDungeons = new List <DungeonManager>();
            }
            if (dungeonList)
            {
                EditorPrefs.SetString("ObjectPath", relPath);
            }
        }
    }
Example #8
0
        /// <summary>
        /// Method used to add heroes if there aren't enough heroes, remove a group if it doesn't complete a quest, ensure there's always 3 quests, check storage limit, make a temporary list used while determining
        /// if a quest is still in progress.
        /// </summary>
        public void Update()
        {
            // Checks to see if max heroes are in town... More will be added if not
            if (Herolist.Count < HeroAmount)
            {
                MakeHero();
            }
            if (RemoveGrouplist.Count > 0)
            {
                RemoveDeadGroup();
            }
            if (DungeonList.Count < 3)
            {
                MakeDungeon();
                form1.ListOutDungeons();
            }

            CheckMaxStorage();

            List <Dungeon> tempList = new List <Dungeon>();

            tempList = DungeonList.ToList();

            foreach (Dungeon d in tempList)
            {
                d.CheckTimeLeft(this);
                if (d.Delete)
                {
                    DungeonList.Remove(d);
                }
            }
            //Rettet
            foreach (Group group in grouplist)
            {
                if (!group.Available)
                {
                    group.CheckIfHome();
                }
            }
        }
Example #9
0
        public static void HandleTeleportList(Session session, params string[] parameters)
        {
            if (PCapReader.PcapMarkers.Count > 0)
            {
                Console.WriteLine("Help: [Type] [instance], [pcap line number], [timespan from login HH:MM:ss] - [Approx Location]");
                DungeonList dungeons      = new DungeonList();
                var         teleportIndex = 0;
                for (var i = 0; i < PCapReader.PcapMarkers.Count; i++)
                {
                    var pcapMarker = PCapReader.PcapMarkers[i];
                    var line       = pcapMarker.LineNumber;

                    CM_Movement.Position?pos;
                    if ((i + 1) < PCapReader.PcapMarkers.Count)
                    {
                        pos = PCapReader.GetDetailedLocationInfo(line, PCapReader.PcapMarkers[i + 1].LineNumber);
                    }
                    else
                    {
                        pos = PCapReader.GetDetailedLocationInfo(line, PCapReader.EndRecordIndex);
                    }

                    // Set default as "unknown"
                    string loc = "Unable to determine location.";
                    if (pos != null)
                    {
                        // convert the "Position" to a "Position"
                        var acePos = new Position(
                            pos.objcell_id,
                            new System.Numerics.Vector3(pos.x, pos.y, pos.z),
                            new System.Numerics.Quaternion(pos.qw, pos.qx, pos.qy, pos.qz)
                            );
                        var coords = Entity.PositionExtensions.GetMapCoordStr(acePos);
                        if (coords != null)
                        {
                            loc = coords;
                        }
                        else
                        {
                            // Are we in a dungeon?
                            if ((pos.objcell_id & 0xFFFF) >= 0x100)
                            {
                                var landblock = pos.objcell_id >> 16;
                                loc = $"Unable to determine dungeon location (0x{landblock:X4}).";
                                string dungeonName = dungeons.GetDungeonName(landblock);
                                if (dungeonName != "")
                                {
                                    loc = dungeonName;
                                }
                            }
                        }
                    }


                    switch (pcapMarker.Type)
                    {
                    case MarkerType.Login:
                        //Console.WriteLine($"Login/Initial Position: {loc}");
                        Console.WriteLine($"Player Login {pcapMarker.LoginInstance}, line {pcapMarker.LineNumber} - {loc}");
                        teleportIndex = 1;
                        break;

                    case MarkerType.Teleport:
                        string time = PCapReader.GetPcapTime(pcapMarker);
                        Console.WriteLine($"  Teleport {teleportIndex++}, line {pcapMarker.LineNumber}, {time} - {loc}");
                        break;
                    }
                }
            }
            else
            {
                Console.WriteLine("Sorry, there are no login or teleport events in this pcap.");
            }
            Console.WriteLine();
        }