Exemple #1
0
    public static WorldTile createTile(int tileID, Vector2 position)
    {
        string key = getKey(position);

        if (!tiles.ContainsKey(key))
        {
            Debug.Log("Wrong tile");
            return(null);
        }

        if (tiles[key] != null)
        {
            Debug.Log("Tile not empty");
            return(null);
        }

        DataTile tile = WorldData.tiles[tileID];

        if (tile.result == null || tile.result.id < 0)
        {
            Debug.Log("Result not defined");
            return(null);
        }



        tiles[key] = new WorldTile(tile.result.id, position);

        if (OnTileCreate != null)
        {
            OnTileCreate();
        }

        return(tiles[key]);
    }
Exemple #2
0
    public Level(GameObject _inventory)
    {
        Transform main      = _inventory.transform.GetChild(0);
        Transform secondery = _inventory.transform.GetChild(1);
        Transform third     = _inventory.transform.GetChild(2);

        Transform[] containers = new Transform[5];
        containers [0] = main.GetChild(0).GetChild(0);
        containers [1] = main.GetChild(1).GetChild(0);
        containers [2] = main.GetChild(2).GetChild(0);
        containers [3] = secondery.GetChild(0);
        containers [4] = third.GetChild(0);

        for (int i = 0; i < containers.Length; i++)
        {
            Transform container = containers [i];
            for (int j = 0; j < container.childCount; j++)
            {
                Transform  tile      = container.GetChild(j);
                DataItem[] dataItems = new DataItem[tile.childCount];
                for (int k = 0; k < tile.childCount; k++)
                {
                    Item item = tile.GetChild(k).gameObject.GetComponent <Item> ();
                    dataItems [k] = new DataItem(item.itemEnum, item.direction);
                }
                dataTiles [i, j] = new DataTile(dataItems);
            }
        }
    }
Exemple #3
0
    public void setReward(int itemID, int count)
    {
        reward = new DataReward(itemID, count);

        if (imageSprite == null)
        {
            return;
        }

        if (reward.id < 0 || reward.count < 1)
        {
            imageSprite.enabled = false;
        }
        else
        {
            DataTile tile = WorldData.tiles[reward.id];
            if (tile != null)
            {
                imageSprite.sprite  = tile.sprite;
                imageSprite.enabled = true;
            }
            else
            {
                imageSprite.enabled = false;
            }
        }
    }
    void setRecepie()
    {
        DataTile tile = WorldData.tiles[selectedCrafting];

        if (tile == null)
        {
            return;
        }

        resultSlot.setReward(selectedCrafting, tile.result.count);
        for (int i = 0; i < rewardSlots.Length; i++)
        {
            if (i < tile.rewards.Count && tile.rewards[i] != null)
            {
                rewardSlots[i].setReward(tile.rewards[i]);

                if (Inventory.checkCount(tile.rewards[i].id, tile.rewards[i].count))
                {
                    rewardSlots[i].setStatus(1);
                }
                else
                {
                    rewardSlots[i].setStatus(-1);
                }
            }
            else
            {
                rewardSlots[i].setReward(-1);
                rewardSlots[i].setStatus(0);
            }
        }
    }
Exemple #5
0
    /// <summary>
    /// Checks for death against Tilemap Data.
    /// </summary>
    /// <param name="newPosition"></param>
    /// <returns></returns>
    private bool CheckForCollionAgainstTileData(Vector3Int newPosition)
    {
        TileBase baseTile       = LevelData.NeutralMap.GetTile(newPosition);
        DataTile customDataTile = baseTile as DataTile;

        if (customDataTile != null)
        {
            if (customDataTile.TileData == CustomTileData.Kill_Player)
            {
                TriggerPlayerDeath();
                return(true);
            }
            else if (customDataTile.TileData == CustomTileData.Set_Neutral)
            {
                CharacterController.OnNeutralTriggerActivated();
            }
            else if (customDataTile.TileData == CustomTileData.Level_End)
            {
                CharacterController.OnPlayerCompleteLevel();
            }
            else if (customDataTile.TileData == CustomTileData.Display_White_Text)
            {
                PlayerHasControl = false;
                StartCoroutine(DelayNextLevel());
            }
        }

        return(false);
    }
Exemple #6
0
    public override void HandleMovement(Character c)
    {
        if (c.Movement == new Vector3Int(0, 0, 0))
        {
            ToState(c, new StateIdle());
        }
        if (!Input.GetKey(KeyCode.LeftShift))
        {
            ToState(c, new StateWalk());
        }

        c.Animator.ChangeFacingDirection(c.CurrentFacing);

        _whereAmI = WorldGrid.GetGridPositionFromWorld(c.transform.position);
        DataTile dt = WorldGrid.GetCellAt(_whereAmI + c.Movement);

        if (!dt.walkable)
        {
            Debug.LogError("Sorry buddy, you cant move there!");
            return;
        }

        _oldPos     = c.transform.position;
        _nextPos    = WorldGrid.GetWorldPositionFromGrid(_whereAmI + c.Movement);
        _difference = _nextPos - _oldPos;
        _timer      = 0;
    }
Exemple #7
0
 public bool AddConstructInGridData(string nameField, DataTile itemTile, bool isClaerField)
 {
     PaletteMapController.SelCheckOptDel modeDelete = PaletteMapController.SelCheckOptDel.None;
     if (isClaerField)
     {
         modeDelete = PaletteMapController.SelCheckOptDel.DelFull;
     }
     return(AddConstructInGridData(nameField, itemTile, modeDelete));
 }
Exemple #8
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.tag == "Goop")
     {
         DataTile striked = col.gameObject.GetComponent <LesserGoopDuplicatation>().personnalInfo;
         striked.isGoop = false;
         striked.obj    = striked.baseObj;
         Destroy(col.gameObject);
     }
 }
Exemple #9
0
    public static Sprite getWeaponSprite(int weaponID = -1)
    {
        if (weaponID < 0)
        {
            weaponID = currentWeapon;
        }
        DataTile tile = WorldData.tiles[weapons[weaponID]];

        return(tile.sprite);
    }
Exemple #10
0
    public static void DestroyCellAt(Vector3Int gridPos)
    {
        bool isTileBase = _tilemap.GetTile(gridPos) is DataTile;

        if (isTileBase)
        {
            DataTile dt = (DataTile)_tilemap.GetTile(gridPos);
            _tilemap.SetTile(gridPos, null);
        }
    }
Exemple #11
0
 void FindGameObjectInMap()
 {
     foreach (var tile in dataInfo)
     {
         if (gameObject == tile.obj)
         {
             personnalInfo = tile;
         }
     }
 }
Exemple #12
0
    private void createTile(int tileID, float x, float y)
    {
        this.tileID = tileID;
        this.x      = (int)x;
        this.y      = (int)y;
        this.key    = World.getKey(this.x, this.y);

        tile = WorldData.tiles[tileID];
        name = tile.name;

        create();
    }
Exemple #13
0
    /// <summary>
    /// Initializes a new instance of the <see cref="Level"/> class according to the given data.
    /// </summary>
    /// <param name="_data">Data.</param>
    public Level(string _data)
    {
        _data = cutEnds(_data);
        string[] containers = _data.Split('c');
        for (int i = 0; i < containers.Length; i++)
        {
            string container = containers [i];
            container = cutEnds(container);
            string[] tiles = container.Split('t');
            for (int j = 0; j < tiles.Length; j++)
            {
                string tile = tiles [j];
                tile = cutEnds(tile);
                string[]   items     = tile.Split('i');
                DataItem[] dataItems = new DataItem[items.Length];
                for (int k = 0; k < items.Length; k++)
                {
                    string item = items [k];
                    if (item.Equals(""))
                    {
                        dataItems[k] = null;
                        continue;
                    }
                    item = cutEnds(item);
                    try {
                        int itemEnumInt = System.Int32.Parse(item.Split('x')[0]);
                        if (highestItem < itemEnumInt)
                        {
                            highestItem = itemEnumInt;
                        }
                        int      directionInt = System.Int32.Parse(item.Split('x')[1]);
                        ItemEnum itemEnum;
                        try {
                            itemEnum = (ItemEnum)itemEnumInt;
                        } catch {
                            throw new PuzzleGameExeption("Missing item.");
                        }
                        if (itemEnumInt >= System.Enum.GetNames(typeof(ItemEnum)).Length)
                        {
                            throw new PuzzleGameExeption("Missing item.");
                        }

                        Direction direction = (Direction)directionInt;
                        dataItems[k] = new DataItem(itemEnum, direction);
                    } catch {
                        dataItems[k] = null;
                    }
                }
                dataTiles [i, j] = new DataTile(dataItems);
            }
        }
    }
Exemple #14
0
    public DataTile getDataTileFromWorld(Vector3 worldPoint)
    {
        Vector3Int cell = tilemap.WorldToCell(worldPoint);

        TileBase tilebase = tilemap.GetTile(cell);
        DataTile dataTile = null;

        if (tilebase != null)
        {
            dataTile = tilebase as DataTile;
        }
        return(dataTile);
    }
Exemple #15
0
    public static DataTile GetCellAt(Vector3Int gridPos)
    {
        bool isTileBase = _tilemap.GetTile(gridPos) is DataTile;

        if (isTileBase)
        {
            DataTile dt = (DataTile)_tilemap.GetTile(gridPos);
            return(dt);
        }
        else
        {
            throw new UnityException("Is not a data tile");
        }
    }
Exemple #16
0
    static void fireEvent(int itemID, int count, int changes)
    {
        if (OnInventoryChange != null)
        {
            OnInventoryChange(itemID, count);
        }
        DataTile tile = WorldData.tiles[itemID];

        if (tile == null)
        {
            return;
        }
        Logger.addLog("Added " + tile.name + " count " + changes.ToString());
    }
Exemple #17
0
    public static bool addReward(int tileID, int count)
    {
        DataTile tile = WorldData.tiles[tileID];

        if (tile == null)
        {
            return(false);
        }


        for (int i = 0; i < slotCount; i++)
        {
            if (rewards[i].id == tileID)
            {
                rewards[i].count += count;
                fireEvent(rewards[i].id, rewards[i].count, count);

                if (rewards[i].count < 1)
                {
                    rewards[i].id    = -1;
                    rewards[i].count = 0;
                    slots[i].setReward(-1);
                }
                else
                {
                    slots[i].setReward(rewards[i]);
                }

                return(true);
            }
        }
        if (count < 0)
        {
            return(false);
        }
        for (int i = 0; i < slotCount; i++)
        {
            if (rewards[i].id < 0)
            {
                rewards[i].id    = tileID;
                rewards[i].count = count;
                slots[i].setReward(rewards[i]);
                fireEvent(rewards[i].id, rewards[i].count, count);
                return(true);
            }
        }

        return(false);
    }
Exemple #18
0
    /// <summary>
    /// Checks to see if the player is goiing to collide with a wall.
    /// </summary>
    /// <param name="newPosition"></param>
    /// <returns></returns>
    private bool CheckForCollision(Vector3Int newPosition)
    {
        TileBase baseTile       = LevelData.WallMap.GetTile(newPosition);
        DataTile customDataTile = baseTile as DataTile;

        if (customDataTile != null)
        {
            if (customDataTile.TileData == CustomTileData.Block_Movement)
            {
                return(true);
            }
        }

        return(false);
    }
Exemple #19
0
    public void setReward(int itemID, int count = 0)
    {
        this.itemID = itemID;
        this.count  = count;

        if (itemID < 0)
        {
            setImage(null);
            setText("");
        }
        else
        {
            DataTile tile = WorldData.tiles[itemID];

            setImage(tile.sprite);
            setText(count > 0 ? count.ToString() : "");
        }
    }
    public void onCraftingClick()
    {
        Debug.Log("Start crafting");
        if (selectedCrafting < 0)
        {
            return;
        }
        DataTile tile = WorldData.tiles[selectedCrafting];

        if (tile == null)
        {
            return;
        }

        if (!Inventory.checkStorage(tile.result.id, tile.result.count))
        {
            return;
        }

        bool canCraft = true;

        for (int i = 0; i < tile.rewards.Count; i++)
        {
            if (!Inventory.checkCount(tile.rewards[i].id, tile.rewards[i].count))
            {
                canCraft = false;
                break;
            }
        }

        if (!canCraft)
        {
            return;
        }

        Inventory.addReward(tile.result);
        for (int i = 0; i < tile.rewards.Count; i++)
        {
            Inventory.addReward(tile.rewards[i].id, -tile.rewards[i].count);
        }
    }
Exemple #21
0
    public List <DataTile> CreateStructDataTile(string NameStructMap, Rect boundsStruct, TileBase[] allTiles, BoundsInt boundsMap, TypesStructure p_tag)
    {
        int             countFindTiles = 0;
        List <DataTile> listDataTiles  = new List <DataTile>();

        int startX      = (int)boundsStruct.x + Math.Abs(boundsMap.x);
        int startY      = (int)boundsStruct.y + Math.Abs(boundsMap.y);
        int boundsSizeX = startX + (int)boundsStruct.width;
        int boundsSizeY = startY + (int)boundsStruct.height;

        for (int x = startX; x < boundsSizeX; x++)
        {
            for (int y = startY; y < boundsSizeY; y++)
            {
                TileBase tile = allTiles[x + y * boundsMap.size.x];


                if (tile != null)
                {
                    int cellX = x + -startX;
                    int cellY = y + -startY;

                    DataTile dataTiles = new DataTile()
                    {
                        X    = cellX,
                        Y    = cellY,
                        Name = tile.name,
                        Tag  = p_tag.ToString(),
                    };

                    listDataTiles.Add(dataTiles);
                    countFindTiles++;
                }
            }
        }

        return(listDataTiles);
        //m_CollectionDataMapTiles.Add(NameStructMap, listDataTiles);
    }
Exemple #22
0
    void OnSceneGUI()
    {
        DataTilemap dataMap  = target as DataTilemap;
        Vector3     position = dataMap.gameObject.transform.position;

        BoundsInt bounds  = dataMap.getVisibleBounds();
        Tilemap   tilemap = dataMap.GetComponent <Tilemap>();

        TileBase[] tiles = tilemap.GetTilesBlock(bounds);
        Handles.color = Color.white;
        //TODO need some intelligent boundaries where to find data, now they are 0 to 10 for x, and 0 to 10 for y values.

        BoardData boardData = dataMap.GetBoardData();
        int       minX      = 0;
        int       maxX      = 0;
        int       minY      = 0;
        int       maxY      = 0;

        if (boardData != null)
        {
            minX = boardData.getMinX();
            maxX = boardData.getMaxX();
            minY = boardData.getMinY();
            maxY = boardData.getMaxY();
        }


        for (int x = minX; x < maxX; x++)
        {
            for (int y = minY; y < maxY; y++)
            {
                DataTile  dataTile  = tilemap.GetTile(new Vector3Int(x, y, 0)) as DataTile;
                DataEntry dataEntry = dataMap.GetBoardData().Read(x, y);//dataMap.dataEntries[x,y];
                DrawDatatileSceneSymbols(new Vector2(x, y), dataEntry);
            }
        }

        DrawBoardDataSceneVisualization(dataMap.GetBoardData());
    }
    void handleMovement(Vector3Int movement)
    {
        if (movement == new Vector3Int(0, 0, 0))
        {
            return;
        }

        animator.ChangeFacingDirection(currentFacing);

        _whereAmI = WorldGrid.GetGridPositionFromWorld(transform.position);
        DataTile dt = WorldGrid.GetCellAt(_whereAmI + movement);

        if (!dt.walkable)
        {
            return;
        }

        _oldPos     = transform.position;
        _nextPos    = WorldGrid.GetWorldPositionFromGrid(_whereAmI + movement);
        _difference = _nextPos - _oldPos;
        _timer      = 0;
    }
Exemple #24
0
    void OnDrawGizmos()
    {
        if (showGrid && _gridHash != null)
        {
            foreach (KeyValuePair <Vector2, WorldGridNode> entry in _gridHash)
            {
                bool isTileBase = _tilemap.GetTile(entry.Value.gridPositon) is DataTile;

                if (isTileBase)
                {
                    DataTile dt = (DataTile)_tilemap.GetTile(entry.Value.gridPositon);
                    Gizmos.color = dt.gizmosColor;
                }
                else
                {
                    Gizmos.color = Color.green;
                }

                Vector3 centerPosition = _tilemap.GetCellCenterWorld(entry.Value.gridPositon);
                Gizmos.DrawWireCube(centerPosition, _nodeDimensions);
            }
        }
    }
 void LoadDatabase()
 {
     string[] tilesFile = System.IO.File.ReadAllLines("Assets/DB_IO/DB_Tiles.txt");
     Sprite[] tileSprites = Resources.LoadAll<Sprite>("Sprites/tileTextures");
     for (int i = 0; i < tilesFile.Length;)
     {
         string tileName = tilesFile[i++];
         int tileSpriteIndex = int.Parse(tilesFile[i++]);
         Sprite tileSprite;
         if (tileSpriteIndex >= 0 && tileSpriteIndex < tileSprites.Length)
         {
             tileSprite = tileSprites[tileSpriteIndex];
         }
         else
         {
             Debug.LogError("The tile sprite with index " + tileSpriteIndex.ToString() + " could not be loaded: out of bounds.");
             tileSprite = null;
         }
         tileDictionary[tileName] = new DataTile(
             tileName,
             tileSprite
             );
     }
 }
Exemple #26
0
    /// <summary>
    /// Custs the level into inventory.
    /// </summary>
    /// <returns>The level inventory as a GameObject.</returns>
    /// <param name="_level">Level.</param>
    /// <param name="_inventory">The inventory to cast the level to.</param>
    public void custLevelToInventory(Level _level, GameObject _inventory)
    {
        Transform main      = _inventory.transform.GetChild(0);
        Transform secondery = _inventory.transform.GetChild(1);
        Transform third     = _inventory.transform.GetChild(2);

        Transform[] containers = new Transform[5];
        containers [0] = main.GetChild(0).GetChild(0);
        containers [1] = main.GetChild(1).GetChild(0);
        containers [2] = main.GetChild(2).GetChild(0);
        containers [3] = secondery.GetChild(0);
        containers [4] = third.GetChild(0);

        for (int i = 0; i < containers.Length; i++)
        {
            Transform container = containers [i];
            for (int j = 0; j < container.childCount; j++)
            {
                Transform tile     = container.GetChild(j);
                DataTile  dataTile = _level.getDataTiles() [i, j];
                if (dataTile == null)
                {
                    continue;
                }
                if (dataTile.items == null)
                {
                    continue;
                }
                foreach (DataItem dataItem in dataTile.items)
                {
                    if (dataItem == null)
                    {
                        continue;
                    }
                    GameObject itemPrefab = null;
                    switch (dataItem.itemEnum)
                    {
                    case ItemEnum.arrow:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/arrow");
                        break;

                    case ItemEnum.arrowKiller:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/arrow_killer");
                        break;

                    case ItemEnum.enemy:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/enemy");
                        break;

                    case ItemEnum.goal:
                        itemPrefab = (GameObject)Resources.Load("prefabs/goal");
                        break;

                    case ItemEnum.key:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/key");
                        break;

                    case ItemEnum.locK:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/lock");
                        break;

                    case ItemEnum.player:
                        itemPrefab = (GameObject)Resources.Load("prefabs/player");
                        break;

                    case ItemEnum.rotatorClocwise:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/rotator_clockwise");
                        break;

                    case ItemEnum.rotatorCounterClocwise:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/rotator_counter_clockwise");
                        break;

                    case ItemEnum.skull:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/skull");
                        break;

                    case ItemEnum.bomb:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/bomb");
                        break;

                    case ItemEnum.mimic:
                        itemPrefab = (GameObject)Resources.Load("prefabs/randomable/mimic");
                        break;
                    }
                    if (itemPrefab != null)
                    {
                        GameObject item = (GameObject)Instantiate(itemPrefab, tile);
                        item.GetComponent <Item> ().direction = dataItem.direction;
                    }
                }
            }
        }
    }
Exemple #27
0
    private void createTile(int tileID, float x, float y)
    {
        this.tileID = tileID;
        this.x = (int)x;
        this.y = (int)y;
        this.key = World.getKey(this.x,this.y);

        tile = WorldData.tiles[tileID];
        name = tile.name;

        create();
    }
Exemple #28
0
    public bool AddConstructInGridData(string nameField, DataTile itemTile,
                                       PaletteMapController.SelCheckOptDel p_TypeModeOptStartDelete = PaletteMapController.SelCheckOptDel.None,
                                       PaletteMapController.SelCheckOptDel p_TypeModeOptStartCheck  = PaletteMapController.SelCheckOptDel.None)
    {
        TypePrefabs prefabName        = TypePrefabs.PrefabField;
        string      personTextureName = "";

        if (itemTile == null)
        {
            Debug.Log("####### AddConstructInGridData  itemTile == null");
            return(false);
        }

        //ArgumentException: The requested value 'SpriteBossAlien(Clone)' was not found.

        TypesStructure structType = (TypesStructure)Enum.Parse(typeof(TypesStructure), itemTile.Tag);;

        if (structType == TypesStructure.Terra)
        {
            prefabName = TypePrefabs.PrefabField;
        }
        if (structType == TypesStructure.Person)
        {
            personTextureName = itemTile.Name.ClearClone();
            prefabName        = TypePrefabs.PrefabBoss;
        }
        if (structType == TypesStructure.Prefab)
        {
            //ArgumentException: The requested value 'SpriteBossAlien(Clone)' was not found.
            prefabName = (TypePrefabs)Enum.Parse(typeof(TypePrefabs), itemTile.Name);
        }

        Vector2 posStruct = Helper.GetPositByField(nameField);
        int     x         = (int)posStruct.x;
        int     y         = (int)posStruct.y;
        int     _y        = y * (-1);
        Vector3 pos       = new Vector3(x, _y, 0) * Spacing;

        pos.z = -1;
        if (prefabName == TypePrefabs.PrefabUfo)
        {
            pos.z = -2;
        }

        string nameObject = Helper.CreateName(prefabName.ToString(), nameField, "-1");// prefabName.ToString() + "_" + nameFiled + "_" + i;

        ModelNPC.ObjectData objDataSave = BilderGameDataObjects.BildObjectData(prefabName);
        objDataSave.CreateID(nameObject);
        objDataSave.SetNameObject(nameObject, true);

        if (PoolGameObjects.IsUseTypePoolPrefabs)
        {
            objDataSave.ModelView = itemTile.Name;
        }
        else
        {
            if (structType == TypesStructure.Terra)
            {
                var objTerra = objDataSave as ModelNPC.TerraData;
                if (objTerra == null)
                {
                    Debug.Log("####### AddConstructInGridData: structType is TypesStructure.Terra   objDataSave Not is ModelNPC.TerraData !!!!");
                    return(false);
                }
                objTerra.ModelView = itemTile.Name;
            }
            if (structType == TypesStructure.TerraPrefab)
            {
                var objTerraPrefab = objDataSave as ModelNPC.WallData;
                if (objTerraPrefab == null)
                {
                    Debug.Log("####### AddConstructInGridData: structType is TypesStructure.TerraPrefab   objDataSave Not is ModelNPC.TerraData !!!!");
                    return(false);
                }
                objTerraPrefab.ModelView = itemTile.Name;
            }
        }

        if (structType == TypesStructure.Person)
        {
            var objPerson = objDataSave as ModelNPC.GameDataBoss;
            if (objPerson == null)
            {
                Debug.Log("####### AddConstructInGridData: structType is TypesStructure.Terra   objDataSave Not is ModelNPC.TerraData !!!!");
                return(false);
            }
        }

        bool res = Storage.Data.AddDataObjectInGrid(objDataSave, nameField, "CreateDataGamesObjectsWorld",
                                                    p_TypeModeOptStartDelete, p_TypeModeOptStartCheck);


        objDataSave.SetPosition(pos);
        return(res);
    }
Exemple #29
0
 public void Initilalize(DataTile dTile)
 {
     spriterenderer = GetComponent<SpriteRenderer>();
     spriterenderer.sprite = dTile.Sprite;
 }
Exemple #30
0
    public static void initTiles()
    {
        DataTile tile;

        int wid = 0;
        tile = new DataTile(wid,0,TILE_TYPE_NONE);
        tile.name = "Parasta zāle";
        tile.addReward(39,2);
        tiles.Add(wid, tile);

        wid = 1;
        tile = new DataTile(wid,1,TILE_TYPE_NONE);
        tile.name = "Krūms";
        tile.addReward(28,2);
        tile.speed = 0.5f;
        tiles.Add(wid, tile);

        wid = 2;
        tile = new DataTile(wid,2,TILE_TYPE_NONE);
        tile.name = "Kaktuss";
        tile.addReward(39,1);
        tile.addReward(28,1);
        tiles.Add(wid, tile);

        wid = 3;
        tile = new DataTile(wid,3,TILE_TYPE_NONE);
        tile.name = "Kaktuss";
        tile.addReward(39,1);
        tile.addReward(28,1);
        tiles.Add(wid, tile);

        wid = 4;
        tile = new DataTile(wid,4,TILE_TYPE_NONE);
        tile.name = "Agave";
        tile.addReward(35,2);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 5;
        tile = new DataTile(wid,5,TILE_TYPE_NONE);
        tile.name = "Lillija";
        tile.addReward(39,4);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 6;
        tile = new DataTile(wid,6,TILE_TYPE_NONE);
        tile.name = "Puķe";
        tile.addReward(39,1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 7;
        tile = new DataTile(wid,7,TILE_TYPE_PLANT);
        tile.name = "Kartupelis";
        tile.addReward(33,3);
        tile.speed = 0.3f;
        tile.growTime = 15f;
        tiles.Add(wid, tile);

        wid = 8;
        tile = new DataTile(wid,8,TILE_TYPE_PLANT);
        tile.name = "Ogas";
        tile.addReward(34,1);
        tile.addReward(2,1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 9;
        tile = new DataTile(wid,9,TILE_TYPE_PLANT);
        tile.name = "Kokvilna";
        tile.addReward(40,2);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 11;
        tile = new DataTile(wid,10,TILE_TYPE_PLANT);
        tile.name = "Zemeņogas";
        tile.addReward(1,1);
        tile.addReward(2,1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 12;
        tile = new DataTile(wid,11,TILE_TYPE_PLANT);
        tile.name = "Priede";
        tile.addReward(1,1);
        tile.addReward(2,1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 13;
        tile = new DataTile(wid,12,TILE_TYPE_PLANT);
        tile.name = "Osis";
        tile.addReward(1,1);
        tile.addReward(2,1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 14;
        tile = new DataTile(wid,13,TILE_TYPE_PLANT);
        tile.name = "Liepa";
        tile.addReward(1,1);
        tile.addReward(2,1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 15;
        tile = new DataTile(wid,14,TILE_TYPE_PLANT);
        tile.name = "Ozols";
        tile.addReward(1,1);
        tile.addReward(2,1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 16;
        tile = new DataTile(wid,12,TILE_TYPE_WEAPON);
        tile.name = "Rokas parastās";
        tiles.Add(wid, tile);

        wid = 17;
        tile = new DataTile(wid,1,TILE_TYPE_WEAPON);
        tile.name = "Koka vāle";
        tiles.Add(wid, tile);

        wid = 18;
        tile = new DataTile(wid,2,TILE_TYPE_WEAPON);
        tile.name = "Akmens cirvis";
        tiles.Add(wid, tile);

        wid = 19;
        tile = new DataTile(wid,3,TILE_TYPE_WEAPON);
        tile.name = "Bronzas cirvis";
        tiles.Add(wid, tile);

        wid = 20;
        tile = new DataTile(wid,4,TILE_TYPE_WEAPON);
        tile.name = "Dzelzs cirvis";
        tiles.Add(wid, tile);

        wid = 21;
        tile = new DataTile(wid,5,TILE_TYPE_WEAPON);
        tile.name = "Tērauda cirvis";
        tiles.Add(wid, tile);

        wid = 22;
        tile = new DataTile(wid,6,TILE_TYPE_WEAPON);
        tile.name = "Mačete";
        tiles.Add(wid, tile);

        wid = 23;
        tile = new DataTile(wid,7,TILE_TYPE_WEAPON);
        tile.name = "Koka cirtnis";
        tiles.Add(wid, tile);

        wid = 24;
        tile = new DataTile(wid,8,TILE_TYPE_WEAPON);
        tile.name = "Dzelzs cirtnis";
        tiles.Add(wid, tile);

        wid = 25;
        tile = new DataTile(wid,9,TILE_TYPE_WEAPON);
        tile.name = "Tērauda cirtnis";
        tiles.Add(wid, tile);

        wid = 26;
        tile = new DataTile(wid,10,TILE_TYPE_WEAPON);
        tile.name = "Mednieka loks";
        tiles.Add(wid, tile);

        wid = 27;
        tile = new DataTile(wid,11,TILE_TYPE_WEAPON);
        tile.name = "Arbalets";
        tiles.Add(wid, tile);

        wid = 28;
        tile = new DataTile(wid,0,TILE_TYPE_RESOURCE);
        tile.name = "Malka";
        tiles.Add(wid, tile);

        wid = 29;
        tile = new DataTile(wid,1,TILE_TYPE_RESOURCE);
        tile.name = "Baļķi";
        tiles.Add(wid, tile);

        wid = 30;
        tile = new DataTile(wid,2,TILE_TYPE_RESOURCE);
        tile.name = "Dēļi";
        tiles.Add(wid, tile);

        wid = 31;
        tile = new DataTile(wid,3,TILE_TYPE_RESOURCE);
        tile.name = "Akmeņi";
        tiles.Add(wid, tile);

        wid = 32;
        tile = new DataTile(wid,4,TILE_TYPE_RESOURCE);
        tile.name = "Sudrabs";
        tiles.Add(wid, tile);

        wid = 33;
        tile = new DataTile(wid,5,TILE_TYPE_RESOURCE);
        tile.name = "Kartupeļi";
        tile.result = new DataReward(7,1);
        tiles.Add(wid, tile);

        wid = 34;
        tile = new DataTile(wid,6,TILE_TYPE_RESOURCE);
        tile.name = "Ogas";
        tiles.Add(wid, tile);

        wid = 35;
        tile = new DataTile(wid,7,TILE_TYPE_RESOURCE);
        tile.name = "Dārzeņi";
        tiles.Add(wid, tile);

        wid = 36;
        tile = new DataTile(wid,8,TILE_TYPE_RESOURCE);
        tile.name = "Gaļa";
        tiles.Add(wid, tile);

        wid = 37;
        tile = new DataTile(wid,9,TILE_TYPE_RESOURCE);
        tile.name = "Gaļa";
        tiles.Add(wid, tile);

        wid = 38;
        tile = new DataTile(wid,10,TILE_TYPE_RESOURCE);
        tile.name = "Gaļa";
        tiles.Add(wid, tile);

        wid = 39;
        tile = new DataTile(wid,21,TILE_TYPE_RESOURCE);
        tile.name = "Salmi";
        tiles.Add(wid, tile);

        wid = 40;
        tile = new DataTile(wid,15,TILE_TYPE_RESOURCE);
        tile.name = "Audums";
        tiles.Add(wid, tile);

        wid = 41;
        tile = new DataTile(wid,2,TILE_TYPE_CRAFTING);
        tile.name = "Dēļi";
        tile.result = new DataReward(30, 1);
        tile.addReward(28,3);
        tiles.Add(wid, tile);

        wid = 42;
        tile = new DataTile(wid,5,TILE_TYPE_CRAFTING);
        tile.name = "Kartupeli";
        tile.result = new DataReward(33, 3);
        tile.addReward(39,5);
        tiles.Add(wid, tile);

        wid = 43;
        tile = new DataTile(wid,22,TILE_TYPE_RESOURCE);
        tile.name = "Benkitis";
        tile.result = new DataReward(45,1);
        tiles.Add(wid, tile);

        wid = 44;
        tile = new DataTile(wid,22,TILE_TYPE_CRAFTING);
        tile.name = "Benkitis";
        tile.result = new DataReward(43, 1);
        tile.addReward(30,2);
        tiles.Add(wid, tile);

        wid = 45;
        tile = new DataTile(wid,16,TILE_TYPE_FURNITURE);
        tile.name = "Benkitis";
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 46;
        tile = new DataTile(wid,23,TILE_TYPE_RESOURCE);
        tile.name = "Akmens siena";
        tile.result = new DataReward(47,1);
        tiles.Add(wid, tile);

        wid = 47;
        tile = new DataTile(wid,16,TILE_TYPE_WALL);
        tile.name = "Akmens siena";
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid = 48;
        tile = new DataTile(wid,23,TILE_TYPE_CRAFTING);
        tile.name = "Siena";
        tile.result = new DataReward(46, 1);
        tile.addReward(28,5);
        tiles.Add(wid, tile);
    }
Exemple #31
0
    public static void initTiles()
    {
        DataTile tile;

        int wid = 0;

        tile      = new DataTile(wid, 0, TILE_TYPE_NONE);
        tile.name = "Parasta zāle";
        tile.addReward(39, 2);
        tiles.Add(wid, tile);

        wid       = 1;
        tile      = new DataTile(wid, 1, TILE_TYPE_NONE);
        tile.name = "Krūms";
        tile.addReward(28, 2);
        tile.speed = 0.5f;
        tiles.Add(wid, tile);

        wid       = 2;
        tile      = new DataTile(wid, 2, TILE_TYPE_NONE);
        tile.name = "Kaktuss";
        tile.addReward(39, 1);
        tile.addReward(28, 1);
        tiles.Add(wid, tile);

        wid       = 3;
        tile      = new DataTile(wid, 3, TILE_TYPE_NONE);
        tile.name = "Kaktuss";
        tile.addReward(39, 1);
        tile.addReward(28, 1);
        tiles.Add(wid, tile);

        wid       = 4;
        tile      = new DataTile(wid, 4, TILE_TYPE_NONE);
        tile.name = "Agave";
        tile.addReward(35, 2);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 5;
        tile      = new DataTile(wid, 5, TILE_TYPE_NONE);
        tile.name = "Lillija";
        tile.addReward(39, 4);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 6;
        tile      = new DataTile(wid, 6, TILE_TYPE_NONE);
        tile.name = "Puķe";
        tile.addReward(39, 1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 7;
        tile      = new DataTile(wid, 7, TILE_TYPE_PLANT);
        tile.name = "Kartupelis";
        tile.addReward(33, 3);
        tile.speed    = 0.3f;
        tile.growTime = 15f;
        tiles.Add(wid, tile);

        wid       = 8;
        tile      = new DataTile(wid, 8, TILE_TYPE_PLANT);
        tile.name = "Ogas";
        tile.addReward(34, 1);
        tile.addReward(2, 1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 9;
        tile      = new DataTile(wid, 9, TILE_TYPE_PLANT);
        tile.name = "Kokvilna";
        tile.addReward(40, 2);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 11;
        tile      = new DataTile(wid, 10, TILE_TYPE_PLANT);
        tile.name = "Zemeņogas";
        tile.addReward(1, 1);
        tile.addReward(2, 1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 12;
        tile      = new DataTile(wid, 11, TILE_TYPE_PLANT);
        tile.name = "Priede";
        tile.addReward(1, 1);
        tile.addReward(2, 1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 13;
        tile      = new DataTile(wid, 12, TILE_TYPE_PLANT);
        tile.name = "Osis";
        tile.addReward(1, 1);
        tile.addReward(2, 1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 14;
        tile      = new DataTile(wid, 13, TILE_TYPE_PLANT);
        tile.name = "Liepa";
        tile.addReward(1, 1);
        tile.addReward(2, 1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 15;
        tile      = new DataTile(wid, 14, TILE_TYPE_PLANT);
        tile.name = "Ozols";
        tile.addReward(1, 1);
        tile.addReward(2, 1);
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid       = 16;
        tile      = new DataTile(wid, 12, TILE_TYPE_WEAPON);
        tile.name = "Rokas parastās";
        tiles.Add(wid, tile);

        wid       = 17;
        tile      = new DataTile(wid, 1, TILE_TYPE_WEAPON);
        tile.name = "Koka vāle";
        tiles.Add(wid, tile);

        wid       = 18;
        tile      = new DataTile(wid, 2, TILE_TYPE_WEAPON);
        tile.name = "Akmens cirvis";
        tiles.Add(wid, tile);

        wid       = 19;
        tile      = new DataTile(wid, 3, TILE_TYPE_WEAPON);
        tile.name = "Bronzas cirvis";
        tiles.Add(wid, tile);

        wid       = 20;
        tile      = new DataTile(wid, 4, TILE_TYPE_WEAPON);
        tile.name = "Dzelzs cirvis";
        tiles.Add(wid, tile);

        wid       = 21;
        tile      = new DataTile(wid, 5, TILE_TYPE_WEAPON);
        tile.name = "Tērauda cirvis";
        tiles.Add(wid, tile);

        wid       = 22;
        tile      = new DataTile(wid, 6, TILE_TYPE_WEAPON);
        tile.name = "Mačete";
        tiles.Add(wid, tile);

        wid       = 23;
        tile      = new DataTile(wid, 7, TILE_TYPE_WEAPON);
        tile.name = "Koka cirtnis";
        tiles.Add(wid, tile);

        wid       = 24;
        tile      = new DataTile(wid, 8, TILE_TYPE_WEAPON);
        tile.name = "Dzelzs cirtnis";
        tiles.Add(wid, tile);

        wid       = 25;
        tile      = new DataTile(wid, 9, TILE_TYPE_WEAPON);
        tile.name = "Tērauda cirtnis";
        tiles.Add(wid, tile);

        wid       = 26;
        tile      = new DataTile(wid, 10, TILE_TYPE_WEAPON);
        tile.name = "Mednieka loks";
        tiles.Add(wid, tile);

        wid       = 27;
        tile      = new DataTile(wid, 11, TILE_TYPE_WEAPON);
        tile.name = "Arbalets";
        tiles.Add(wid, tile);

        wid       = 28;
        tile      = new DataTile(wid, 0, TILE_TYPE_RESOURCE);
        tile.name = "Malka";
        tiles.Add(wid, tile);

        wid       = 29;
        tile      = new DataTile(wid, 1, TILE_TYPE_RESOURCE);
        tile.name = "Baļķi";
        tiles.Add(wid, tile);

        wid       = 30;
        tile      = new DataTile(wid, 2, TILE_TYPE_RESOURCE);
        tile.name = "Dēļi";
        tiles.Add(wid, tile);

        wid       = 31;
        tile      = new DataTile(wid, 3, TILE_TYPE_RESOURCE);
        tile.name = "Akmeņi";
        tiles.Add(wid, tile);

        wid       = 32;
        tile      = new DataTile(wid, 4, TILE_TYPE_RESOURCE);
        tile.name = "Sudrabs";
        tiles.Add(wid, tile);

        wid         = 33;
        tile        = new DataTile(wid, 5, TILE_TYPE_RESOURCE);
        tile.name   = "Kartupeļi";
        tile.result = new DataReward(7, 1);
        tiles.Add(wid, tile);

        wid       = 34;
        tile      = new DataTile(wid, 6, TILE_TYPE_RESOURCE);
        tile.name = "Ogas";
        tiles.Add(wid, tile);

        wid       = 35;
        tile      = new DataTile(wid, 7, TILE_TYPE_RESOURCE);
        tile.name = "Dārzeņi";
        tiles.Add(wid, tile);

        wid       = 36;
        tile      = new DataTile(wid, 8, TILE_TYPE_RESOURCE);
        tile.name = "Gaļa";
        tiles.Add(wid, tile);

        wid       = 37;
        tile      = new DataTile(wid, 9, TILE_TYPE_RESOURCE);
        tile.name = "Gaļa";
        tiles.Add(wid, tile);

        wid       = 38;
        tile      = new DataTile(wid, 10, TILE_TYPE_RESOURCE);
        tile.name = "Gaļa";
        tiles.Add(wid, tile);

        wid       = 39;
        tile      = new DataTile(wid, 21, TILE_TYPE_RESOURCE);
        tile.name = "Salmi";
        tiles.Add(wid, tile);

        wid       = 40;
        tile      = new DataTile(wid, 15, TILE_TYPE_RESOURCE);
        tile.name = "Audums";
        tiles.Add(wid, tile);

        wid         = 41;
        tile        = new DataTile(wid, 2, TILE_TYPE_CRAFTING);
        tile.name   = "Dēļi";
        tile.result = new DataReward(30, 1);
        tile.addReward(28, 3);
        tiles.Add(wid, tile);

        wid         = 42;
        tile        = new DataTile(wid, 5, TILE_TYPE_CRAFTING);
        tile.name   = "Kartupeli";
        tile.result = new DataReward(33, 3);
        tile.addReward(39, 5);
        tiles.Add(wid, tile);

        wid         = 43;
        tile        = new DataTile(wid, 22, TILE_TYPE_RESOURCE);
        tile.name   = "Benkitis";
        tile.result = new DataReward(45, 1);
        tiles.Add(wid, tile);

        wid         = 44;
        tile        = new DataTile(wid, 22, TILE_TYPE_CRAFTING);
        tile.name   = "Benkitis";
        tile.result = new DataReward(43, 1);
        tile.addReward(30, 2);
        tiles.Add(wid, tile);

        wid        = 45;
        tile       = new DataTile(wid, 16, TILE_TYPE_FURNITURE);
        tile.name  = "Benkitis";
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid         = 46;
        tile        = new DataTile(wid, 23, TILE_TYPE_RESOURCE);
        tile.name   = "Akmens siena";
        tile.result = new DataReward(47, 1);
        tiles.Add(wid, tile);

        wid        = 47;
        tile       = new DataTile(wid, 16, TILE_TYPE_WALL);
        tile.name  = "Akmens siena";
        tile.speed = 0.3f;
        tiles.Add(wid, tile);

        wid         = 48;
        tile        = new DataTile(wid, 23, TILE_TYPE_CRAFTING);
        tile.name   = "Siena";
        tile.result = new DataReward(46, 1);
        tile.addReward(28, 5);
        tiles.Add(wid, tile);
    }