Ejemplo n.º 1
0
 private void EntityOnOnInt32PropertyChange(Entity sender, Int32PropertyChangeEventArgs args)
 {
     if (args.PropertyName == "m_iTaggedAsVisibleByTeam")
     {
         var me = Shrines.Find(x => x.Unit.Equals(sender));
         if (me != null)
         {
             var newValue  = args.NewValue;
             var oldValue  = args.OldValue;
             var isVisible = newValue == 14;
             if (newValue != oldValue)
             {
                 bool visible;
                 if (!_underVision.TryGetValue(me, out visible))
                 {
                     _underVision.Add(me, isVisible);
                 }
                 else
                 {
                     _underVision[me] = isVisible;
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void CreateSplits(object sender, RoutedEventArgs e)
        {
            FileProperties fileProps = GetFileProperties();

            if (fileProps == null)
            {
                return;
            }

            int           safetyEscape  = 0;
            List <string> movementTypes = new List <string> {
            };
            List <string> locations     = new List <string> {
            };
            List <string> finalList     = new List <string> {
            };

            Random rnd = new Random();
            int    locIndex;
            int    movIndex;
            string text;
            string innerText;

            if (cBtb.IsChecked == true)
            {
                AddMovementWithProbability(ref movementTypes, "BTB", cBtbProbability.SelectedIndex);
            }
            ;
            if (cWindbomb.IsChecked == true)
            {
                AddMovementWithProbability(ref movementTypes, "Windbomb", cWindbombProbability.SelectedIndex);
            }
            ;
            if (cStasisLaunch.IsChecked == true)
            {
                AddMovementWithProbability(ref movementTypes, "Stasis Launch", cStasisLaunchProbability.SelectedIndex);
            }
            ;
            if (cHorseback.IsChecked == true)
            {
                AddMovementWithProbability(ref movementTypes, "Horseback", cHorsebackProbability.SelectedIndex);
            }
            ;
            if (cShieldSurf.IsChecked == true)
            {
                AddMovementWithProbability(ref movementTypes, "Shield Surf", cShieldSurfProbability.SelectedIndex);
            }
            ;
            if (cWalk.IsChecked == true)
            {
                AddMovementWithProbability(ref movementTypes, "Walk", cWalkProbability.SelectedIndex);
            }
            ;
            if (cMoonJump.IsChecked == true)
            {
                AddMovementWithProbability(ref movementTypes, "Moon Jump", cMoonJumpProbability.SelectedIndex);
            }
            ;

            if (cShrines.IsChecked == true)
            {
                locations.AddRange(Shrines);
                if (cMasterSwordMode.IsChecked == false)
                {
                    locations.AddRange(LockedShrines);
                }
            }
            ;
            if (cTowers.IsChecked == true)
            {
                locations.AddRange(Towers);
            }
            ;
            if (cBeasts.IsChecked == true)
            {
                locations.AddRange(Beasts);
            }
            ;
            if (cStables.IsChecked == true)
            {
                locations.AddRange(Stables);
            }
            ;
            if (cFairies.IsChecked == true)
            {
                locations.AddRange(Fairies);
            }
            ;

            int shrineCounter = 1;

            if (cRuneShrines.IsChecked == true)
            {
                List <string> tempLocations = RuneShrines;
                for (int i = 0; i <= 3; i++)
                {
                    locIndex = rnd.Next(1, tempLocations.Count) - 1;
                    finalList.Add(tempLocations[locIndex] + " [" + shrineCounter + "]");
                    tempLocations.RemoveAt(locIndex);
                    shrineCounter += 1;
                }
            }
            else
            {
                for (int i = 0; i <= 3; i++)
                {
                    finalList.Add(RuneShrines[i] + " [" + shrineCounter + "]");
                    shrineCounter += 1;
                }
            }

            bool masterSwordExit = false;

            while (locations.Count > 0 && safetyEscape < 1000 && masterSwordExit == false)
            {
                locIndex = rnd.Next(0, locations.Count);
                movIndex = rnd.Next(0, movementTypes.Count);
                if (Shrines.Contains(locations[locIndex]) || RuneShrines.Contains(locations[locIndex]) || LockedShrines.Contains(locations[locIndex]))
                {
                    innerText = " [" + shrineCounter + "] ";
                    if (cMasterSwordMode.IsChecked == true && shrineCounter >= 40)
                    {
                        masterSwordExit = true;
                    }
                    shrineCounter += 1;
                }
                else
                {
                    innerText = " ";
                }
                text = locations[locIndex] + innerText;
                if (movementTypes.Count > 0)
                {
                    text += movementTypes[movIndex];
                }
                finalList.Add(text);
                locations.RemoveAt(locIndex);
                safetyEscape += 1;
            }

            if (cMasterSwordMode.IsChecked == false)
            {
                finalList.AddRange(Ganon);
            }
            else
            {
                finalList.Add("Master Sword");
            }

            using (TextWriter tw = new StreamWriter(fileProps.Path + "\\" + fileProps.Name)) {
                foreach (String s in finalList)
                {
                    tw.WriteLine(s);
                }
            }

            System.Diagnostics.Process.Start(fileProps.Path + "\\" + fileProps.Name);
        }