Exemplo n.º 1
0
Arquivo: Move.cs Projeto: avidvid/OUP
    private bool IsBlocked(Vector3 itemLocation, ActiveElementType element)
    {
        Vector3 currentPos = itemLocation;
        Vector2 mapPos     = _terrainManager.WorldToMapPosition(currentPos);
        var     terrain    = _terrainManager.SelectTerrain(mapPos.x, mapPos.y);

        if (
            //Terrain Types and charcter type
            (!terrain.Walkable && _characterManager.MyCharacter.Move == Character.CharacterType.Walk) ||
            (!terrain.Flyable && _characterManager.MyCharacter.Move == Character.CharacterType.Fly) ||
            (!terrain.Swimable && _characterManager.MyCharacter.Move == Character.CharacterType.Swim) ||
            //element + character
            (element != null && _characterManager.MyCharacter.Move != Character.CharacterType.Fly)
            )
        {
            return(true);
        }
        return(false);
    }
Exemplo n.º 2
0
 //Element
 internal void SetActiveElement(ActiveElementType currentElement)
 {
     _element = currentElement;
 }
Exemplo n.º 3
0
 float distance = Vector2.Distance(bLoc, pos);
            if (distance < 0.5)
                return element;
        }
        return null;
    }
    internal bool DestroyElement(ActiveElementType element, bool useTool)
    {
        if (useTool)
            if (!_inv.ElementToolUse(element.ElementTypeInUse))
                return false;
        _elements.Remove(element);
        Destroy(element.gameObject);
        return true;
    }
    //Monsters
    private void SetAvailableMarketMonsters(TerrainIns terrain)
    {