public AutoAnglerProfile(Profile profile, PathingType pathType, List <uint> poolsToFish)
 {
     HBProfile   = profile;
     PathType    = pathType;
     PoolsToFish = poolsToFish.AsReadOnly();
     LoadWayPoints();
     FishAtHotspot = WayPoints.Count == 1;
 }
 public TileModifier(PathingType pt, IModifierSource ms, GameObject tt)
 {
     pathingType = pt;
     source      = ms;
     source.AddModifier(this);
     tile = tt;
     tile.GetComponent <TileListener>().AddModifier(this);
 }
示例#3
0
        public void Profile_OnUnknownProfileElement(object sender, UnknownProfileElementEventArgs e)
        {
            // hackish way to set variables to default states before loading new profile... wtb OnNewOuterProfileLoading event
            if (_loadProfileTimer.IsFinished)
            {
                _poolsToFish.Clear();
                _pathingType = PathingType.Circle;
                _loadProfileTimer.Reset();
            }

            if (e.Element.Name == "FishingSchool")
            {
                XAttribute entryAttrib = e.Element.Attribute("Entry");
                if (entryAttrib != null)
                {
                    uint entry;
                    UInt32.TryParse(entryAttrib.Value, out entry);
                    if (!_poolsToFish.Contains(entry))
                    {
                        _poolsToFish.Add(entry);
                        XAttribute nameAttrib = e.Element.Attribute("Name");
                        if (nameAttrib != null)
                        {
                            Log("Adding Pool Entry: {0} to the list of pools to fish from", nameAttrib.Value);
                        }
                        else
                        {
                            Log("Adding Pool Entry: {0} to the list of pools to fish from", entry);
                        }
                    }
                }
                else
                {
                    Err(
                        "<FishingSchool> tag must have the 'Entry' Attribute, e.g <FishingSchool Entry=\"202780\"/>\nAlso supports 'Name' attribute but only used for display purposes");
                }
                e.Handled = true;
            }
            else if (e.Element.Name == "Pathing")
            {
                XAttribute typeAttrib = e.Element.Attribute("Type");
                if (typeAttrib != null)
                {
                    _pathingType = (PathingType)
                                   Enum.Parse(typeof(PathingType), typeAttrib.Value, true);

                    Log("Setting Pathing Type to {0} Mode", _pathingType);
                }
                else
                {
                    Err(
                        "<Pathing> tag must have the 'Type' Attribute, e.g <Pathing Type=\"Circle\"/>");
                }
                e.Handled = true;
            }
        }
示例#4
0
 public static float PotentialFieldWeight(PathingType type)
 {
     switch (type)
     {
         case PathingType.Pathable:
             return 0;
         case PathingType.UnPathable:
         default:
             return -1;
     }
 }
示例#5
0
        public PathingResult GetPathToPoint(int level, Point origin, Point dest, PathingType pathingType, PathingPermission permission)
        {
            switch (pathingType)
            {
            case PathingType.CreaturePass:

                return(GetPathToPointPassThroughMonsters(level, origin, dest, permission));

            default:
                return(GetPathToPoint(level, origin, dest, permission));
            }
        }
示例#6
0
        internal PathingResult GetPathToCreature(Creature originCreature, Creature destCreature, PathingType type, PathingPermission permission)
        {
            //If on different levels it's an error
            if (originCreature.LocationLevel != destCreature.LocationLevel)
            {
                string msg = originCreature.Representation + " not on the same level as " + destCreature.Representation;
                LogFile.Log.LogEntry(msg);
                throw new ApplicationException(msg);
            }

            return GetPathToPoint(originCreature.LocationLevel, originCreature.LocationMap, destCreature.LocationMap, type, permission);
        }
示例#7
0
        public PathingResult GetPathToPoint(int level, Point origin, Point dest, PathingType pathingType, PathingPermission permission)
        {
            switch (pathingType)
            {
                case PathingType.CreaturePass:

                    return GetPathToPointPassThroughMonsters(level, origin, dest, permission);

                default:
                    return GetPathToPoint(level, origin, dest, permission);
            }
        }
示例#8
0
    private void Start()
    {
        respawnPos = transform.position;
        halo       = (Behaviour)GetComponent("Halo");



        player = GameObject.FindGameObjectWithTag("Player").transform;

        matList            = new List <Material>();
        baseEmissionColors = new List <Color>();

        Renderer targetRenderer;

        if (transform.childCount > 0)
        {
            targetRenderer = transform.GetChild(0).GetComponent <Renderer>();
        }
        else
        {
            targetRenderer = GetComponent <Renderer>();
        }

        foreach (Material x in targetRenderer.materials)
        {
            x.EnableKeyword("_EMISSION");
            matList.Add(x);
            baseEmissionColors.Add(x.GetColor("_EmissionColor"));
        }

        rend = GetComponent <Renderer>();


        agent = GetComponent <NavMeshAgent>();
        agent.updateRotation = false;
        agent.speed          = moveSpeed;

        layerToIgnore = ~LayerMask.GetMask("Targetable");

        if (pathType == PathingType.Path && pathMovements.Length != 0)
        {
            if (!isPathing)
            {
                StartCoroutine(FollowPath());
            }
        }
        else
        {
            pathType = PathingType.Follow;
        }
        StartCoroutine(Idle());
    }
        public static MapPathingMap Generate(ScenarioMap map)
        {
            var w         = map.width - 1;
            var h         = map.height - 1;
            var width     = w * 4;
            var height    = h * 4;
            var pathTiles = new PathingType[height, width];

            for (uint x = 0; x < w; x++)
            {
                for (uint y = 0; y < h; y++)
                {
                    var tileType = map.terrain[x, y].cnst;
                    if (!_pathingTypes.TryGetValue(tileType, out var pathingType))
                    {
                        pathingType = PaddedPathingType;
                    }

                    for (var i = (x == 0 ? 2 : 0); i < (x == w ? 2 : 4); i++)
                    {
                        for (var j = (y == 0 ? 2 : 0); j < (y == h ? 2 : 4); j++)
                        {
                            pathTiles[4 * y + j - 2, 4 * x + i - 2] = pathingType;
                        }
                    }
                }
            }

            var tiles = new PathingType[width * height];

            Buffer.BlockCopy(pathTiles, 0, tiles, 0, (int)(width * height) * sizeof(PathingType));

            return(new MapPathingMap(MapPathingMapFormatVersion.Normal)
            {
                Width = width,
                Height = height,
                Cells = tiles.ToList(),
            });
        }
 public TileModifier()
 {
     pathingType = PathingType.NONE;
     source      = null;
     tile        = null;
 }
示例#11
0
        internal PathingResult GetPathToCreature(Creature originCreature, Creature destCreature, PathingType type, PathingPermission permission)
        {
            //If on different levels it's an error
            if (originCreature.LocationLevel != destCreature.LocationLevel)
            {
                string msg = originCreature.Representation + " not on the same level as " + destCreature.Representation;
                LogFile.Log.LogEntry(msg);
                throw new ApplicationException(msg);
            }

            return(GetPathToPoint(originCreature.LocationLevel, originCreature.LocationMap, destCreature.LocationMap, type, permission));
        }
示例#12
0
 private void Render_PathingTool()
 {
     EditorGUILayout.LabelField("Current Pathing Type");
     currentPathingType = (PathingType)GUILayout.Toolbar((int)currentPathingType, currentPathingType.Names());
 }
示例#13
0
 public static PathingType ConvertPathingType(int i)
 {
     return(PathingType.GetPathingType(i));
 }