Пример #1
0
        private void LoadMap1()
        {
            size = new int[2];
            size[0] = 5;
            size[1] = 12;

            Wave wav = new Wave();
            wav.AddMonsters(typeof(Mob.Peon), 1);
            wav.AddMonsters(typeof(Mob.Peon), 1);
            wav.AddMonsters(typeof(Mob.Peon), 1);
            wav.AddMonsters(typeof(Mob.Peon), 1);
            //wav.AddMonsters(typeof(Mob.Berserk), 1);
            wav.AddMonsters(typeof(Mob.Tank), 1);
               // wav.AddMonsters(typeof(Mob.Boss), 1);
            wav.AddMonsters(typeof(Mob.Speed), 1);
            wav.AddMonsters(typeof(Mob.Tank), 1);

            ListOfWaves.Add(wav);
            ListOfWaves.Add(wav);
            filled = new EMap[12, 5]
            {
                {0,0,(EMap)1,0,0},
                {0,0,(EMap)1,0,0},
                {0,0,(EMap)1,0,0},
                {0,0,(EMap)1,0,0},
                {0,(EMap)6,(EMap)5,0,0},
                {0,(EMap)1,0,0,0},
                {0,(EMap)1,0,0,0},
                {0,(EMap)4,(EMap)7,0,0},
                {0,0,(EMap)1,0,0},
                {0,0,(EMap)1,0,0},
                {0,0,(EMap)2,0,0},
                {0,0,0,0,0},
            };
        }
Пример #2
0
        private MyTile GetActorTileOnMap(EMap mapType)
        {
            Tilemap    map          = BattleManager.Instance.tilemapDic[mapType].tilemap;
            Vector3Int cellPosition = map.WorldToCell(transform.position);

            return(map.GetTile <MyTile>(cellPosition));
        }
Пример #3
0
    protected override void Awake()
    {
        Brainiacs.SelfInitGame = false;

        EMap map = brainiacs.GameInitInfo.Map;

        if (map == EMap.None)
        {
            Debug.LogError("Map not set");
            map = EMap.Steampunk;
        }

        if (countdown != COUNTDOWN)
        {
            Debug.LogError("Countdown not set to default value [testing?]");
        }

        currentMapConfig = brainiacs.MapManager.GetMapConfig(map);

        SetBackground(0);
        DoInTime(LoadGame, BEEP_DELAY);


        base.Awake();         //always call base.event() at the end
    }
Пример #4
0
        public static SMobMapRule GetRule(EMap Map)
        {
            if (SMobMapRule.Rules.ContainsKey(Map) == false)
            {
                throw new Exception();
            }

            return(SMobMapRule.Rules[Map]);
        }
Пример #5
0
        private void MoveToTile(EMap mapType, Vector3Int tilePos)
        {
            Tilemap map           = BattleManager.Instance.tilemapDic[mapType].tilemap;
            Vector3 tileWorldPos  = map.CellToWorld(tilePos) + map.cellSize / 2;
            Vector3 actorWorldPos = transform.position;

            _moveTimer += Time.deltaTime * _moveSpeed;

            transform.position = Vector3.Lerp(actorWorldPos, tileWorldPos, _moveTimer);
        }
Пример #6
0
 public void RegistMap(EMap mapType, MyTilemap map)
 {
     if (tilemapDic.ContainsKey(mapType))
     {
         tilemapDic[mapType] = map;
     }
     else
     {
         tilemapDic.Add(mapType, map);
     }
 }
Пример #7
0
        public Dictionary <Vector3Int, int> GetMovableArea(EMap mapType)
        {
            Tilemap    map          = BattleManager.Instance.tilemapDic[mapType].tilemap;
            Vector3Int cellPosition = new Vector3Int(0, 0, 0);

            Dictionary <Vector3Int, int> movableTiles = new Dictionary <Vector3Int, int>();

            movableTiles.Add(cellPosition, moveRange);
            Map.GetCanReachTiles(map, cellPosition, moveRange, ref movableTiles);

            return(movableTiles);
        }
Пример #8
0
    public MapConfig GetMapConfig(EMap pMap)
    {
        //GetMapConfig is called on Awake so map configs might not be initialized yet
        Init();

        mapConfigMap.TryGetValue(pMap, out MapConfig config);
        if (config == null)
        {
            Debug.LogError($"No config for map {pMap} found");
            mapConfigMap.TryGetValue(EMap.Wonderland, out config);
        }

        return(config);
    }
Пример #9
0
        private bool ReachTile(EMap mapType, Vector3Int cellPosition)
        {
            Tilemap map           = BattleManager.Instance.tilemapDic[mapType].tilemap;
            Vector3 tileWorldPos  = map.CellToWorld(cellPosition) + map.cellSize / 2;
            Vector3 actorWorldPos = transform.position;

            if (tileWorldPos == actorWorldPos)
            {
                transform.position = tileWorldPos;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #10
0
        private void BringInstruction()
        {
            EMap map = new EMap();

            // Farklı bir lokasyonda çalışan veriler için programa komut vermek gerekiyor.
            // Lokal veriler için buna gerek yoktur.
            map = ma.Get(ExternalLocation, new TEntity().GetType().Name);

            if (!(map is null))
            {
                SetName           = map.Name;
                SetRoot           = map.Root;
                Single            = map.Single;
                AutomaticIdOnAdd  = map.AutomaticId;
                CheckBeforeAdding = map.CheckBeforeAdding;
                ExternalLocation  = map.ExternalLocation;
                CategoryProperty  = map.CategoryProperty;
            }
        }
Пример #11
0
    public void SetMap(EMap pMap)
    {
        SoundController.PlayMusic(ESound.Music_Game);

        for (int i = 0; i < transform.childCount; i++)
        {
            ActiveMap = transform.GetChild(i).GetComponent <Map>();
            ActiveMap.SetActive(false);
            if (ActiveMap != null && ActiveMap.name.Contains(pMap.ToString()))
            {
                Debug.LogWarning("Map is already present in the scene");
                if (!Brainiacs.SelfInitGame)
                {
                    Debug.LogError("Map object cant be present in the scene [not error if debugging]");
                }

                ActiveMap.SetActive(true);
                return;
            }
        }

        //if(transform.childCount > 0)
        //{
        //	ActiveMap = transform.GetChild(0).GetComponent<Map>();
        //	if(ActiveMap != null)
        //	{
        //		Debug.LogWarning("Map is already present in the scene");
        //		if(!Brainiacs.SelfInitGame)
        //			Debug.LogError("Map object cant be present in the scene [not error if debugging]");
        //		return;
        //	}
        //}

        ActiveMap = Instantiate(brainiacs.MapManager.GetMapConfig(pMap).Prefab);
        if (ActiveMap == null)
        {
            Debug.LogError("No map selected");
            return;
        }

        ActiveMap.transform.parent = transform;
    }
Пример #12
0
		public static SMobMapRule GetRule( EMap Map ) {
			if( SMobMapRule.Rules.ContainsKey( Map ) == false )
				throw new Exception();

			return SMobMapRule.Rules[ Map ];
		}
Пример #13
0
		public SMobPoints( EMap m ) {
			Map = m;
		}
Пример #14
0
 public SMobPoints(EMap m)
 {
     Map = m;
 }
Пример #15
0
        public static string ToName(this EMap map)
        {
            switch (map)
            {
            default:
                return("unknown map");

            // Light Maps
            case EMap.Erina:
                return("Erina (1-20)");

            case EMap.Willieoseu:
                return("Willieoseu (21-35)");

            case EMap.Adellia:
                return("Adellia (36-50)");

            case EMap.Skulleron:
                return("Skulleron (51-60)");

            // Dark Maps
            case EMap.Reikeuseu:
                return("Reikeuseu (1-20)");

            case EMap.Keuraijen:
                return("Keuraijen (21-35)");

            case EMap.Adeurian:
                return("Adeurian (36-50)");

            case EMap.Astenes:
                return("Astenes (51-60)");

            // Light Dungeons
            case EMap.Cornwell:
                return("Ruinen von Cornwell");

            case EMap.Senechios:
                return("Senechios Kerker");

            case EMap.Colorons_1:
                return("Colorons Schlupfwinkel - 1. Ebene");

            case EMap.Colorons_2:
                return("Colorons Schlupfwinkel - 2. Ebene");

            case EMap.Colorons_3:
                return("Colorons Schlupfwinkel - 3. Ebene");

            case EMap.ElementHöhle:
                return("Höhle der Elemente");

            case EMap.Maitrevan_1:
                return("Maitrevan - 1. Ebene");

            case EMap.Maitrevan_2:
                return("Maitrevan - 2. Ebene");

            case EMap.Sigmas:
                return("Sigmas Höhle");

            // Dark Dungeons
            case EMap.Argilla:
                return("Ruinen von Argilla");

            case EMap.Fantasmas_1:
                return("Fantasmas Schlupfwinkel - 1. Ebene");

            case EMap.Fantasmas_2:
                return("Fantasmas Schlupfwinkel - 2. Ebene");

            case EMap.Fantasmas_3:
                return("Fantasmas Schlupfwinkel - 3. Ebene");

            case EMap.Kalamus_Anwesen:
                return("Kalamus Anwesen");

            case EMap.Aidion_Neckria_1:
                return("Aidion Neckria - 1. Ebene");

            case EMap.Aidion_Neckria_2:
                return("Aidion Neckria - 2. Ebene");

            case EMap.RuberChaos:
                return("Ruber Chaos");

            case EMap.Aurizen:
                return("Ruinen von Aurizen");


            // PvP
            case EMap.PvP_1:
                return("PvP 1-15");

            case EMap.PvP_2:
                return("PvP 20-30");

            case EMap.PvP_3:
                return("PvP 1-60");
            }
        }
Пример #16
0
 public scene(List<Node> nod, List<Mob.Mob> mobs, EMap[,] m, string Des, Vector2 posNC)
 {
     _nod = nod;
     _mobs = mobs;
     map = new EMap[,]
     {
         {EMap.BACKGROUND, EMap.CANYON_HORIZONTAL, EMap.BACKGROUND},
         {EMap.BACKGROUND, EMap.CANYON_HORIZONTAL, EMap.BACKGROUND},
         {EMap.BACKGROUND, EMap.CANYON_HORIZONTAL, EMap.BACKGROUND},
     };
     Description = Des;
     posNoConstruct = posNC;
 }