예제 #1
0
    public static void AddEncounter()
    {
        var monsterTypes = GetMonsterTypesForEncounter();
        var numMobs      = RNG.Int(3, 6);
        var position     = OverworldPathfinding.GetValidRandomPosition();
        var baseLevel    = PlayerCharacter.localPlayer.GetComponent <ExperienceGainer>().level;
        var minLevel     = Mathf.Max(baseLevel - 6, 1);
        var maxLevel     = Mathf.Max(baseLevel - 3, 1);

        for (int i = 0; i < numMobs; i++)
        {
            AddMonster(position, minLevel, maxLevel);
        }
    }
예제 #2
0
 private static IEnumerator AddDungeons(int number)
 {
     for (int i = 0; i < number; i++)
     {
         var position = OverworldPathfinding.GetValidRandomPosition();
         var owd      = new OverworldDungeon()
         {
             position = new Vector2(position.x, position.z)
         };
         landmarks.Add(owd);
         var obj = Object.Instantiate(OverworldGenerator.instance.dungeonPrefab, position, new Quaternion());
         obj.GetComponent <DungeonEntrance>().dungeonLevel = PlayerCharacter.localPlayer.GetComponent <ExperienceGainer>().level;
         obj.GetComponent <DungeonEntrance>().dungeonData  = owd;
         OverworldGenerator.instance.UpdateProgress(11, (float)i / number);
         yield return(null);
     }
 }