Exemplo n.º 1
0
        private void ctrl_MouseDown(object sender, MouseEventArgs e)
        {
            eClickedPosition = isAtEdges(e.X, e.Y);
            if (e.Button == MouseButtons.Left)
            {
                pOriginClick = e.Location;
            }
            bIsResizable = true;

            this.OnMouseDown(e);
        }
Exemplo n.º 2
0
		/// <summary>
		/// Converts the enumeration into a string (for rendering the option).
		/// </summary>
		/// <param name="position">Option to be converted</param>
		/// <returns>Converted string</returns>
		public static string PositionToString(ePosition position) {
			switch (position) {
				case ePosition.None: return "";
				case ePosition.Bottom: return "bottom";
				case ePosition.Centre: return "center";
				case ePosition.Left: return "left";
				case ePosition.Right: return "right";
				case ePosition.Top: return "top";
			}

			throw new ArgumentException(string.Format("Position has an invalid value ({0}).", position.ToString()));
		}
Exemplo n.º 3
0
    /// <summary>
    /// Altera a posição do objeto
    /// </summary>
    /// <param name="stNewPos">
    /// A <see cref="System.String"/>
    /// </param>
    public void SetPosition(string stNewPos)
    {
        //
        if(stNewPos == "Norte") {

            Position = ePosition.Norte;
            return;
        }
        if(stNewPos == "Leste") {

            Position = ePosition.Leste;
            return;
        }
        if(stNewPos == "Oeste") {

            Position = ePosition.Oeste;
            return;
        }
        if(stNewPos == "Sul") {

            Position = ePosition.Sul;
            return;
        }
    }
Exemplo n.º 4
0
        private static BannerCode[] Fetch(int? id, ePosition? position, bool? getDefault, eSortColumn sortColumn)
        {
            string cacheKey = String.Format("BannerCode_Fetch_{0}_{1}_{2}_{3}", id, position, getDefault, sortColumn);

            if (HttpContext.Current != null && HttpContext.Current.Cache[cacheKey] != null)
            {
                return HttpContext.Current.Cache[cacheKey] as BannerCode[];
            }

            using (var db = new Model.AspNetDatingDataContext())
            {
                var bannerCodes = from bc in db.BannerCodes
                                  where (!id.HasValue || bc.bc_id == id)
                                        && (!position.HasValue || bc.bc_position == (int?) position)
                                        && (!getDefault.HasValue || bc.bc_target == null)
                                  select new BannerCode
                                             {
                                                 id = bc.bc_id,
                                                 position = (ePosition) bc.bc_position,
                                                 priority = bc.bc_priority,
                                                 target = bc.bc_target,
                                                 code = bc.bc_code
                                             };
                switch (sortColumn)
                {
                    case eSortColumn.None :
                        break;
                    case eSortColumn.Priority :
                        bannerCodes = bannerCodes.OrderByDescending(bc => bc.priority);
                        break;
                }

                if (HttpContext.Current != null)
                {
                    HttpContext.Current.Cache.Insert(cacheKey, bannerCodes.ToArray(), CacheDependencies.Get(), DateTime.Now.AddMinutes(30),
                        Cache.NoSlidingExpiration);
                }

                return bannerCodes.ToArray();
            }
        }
Exemplo n.º 5
0
        public static BannerCode FetchDefault(ePosition position)
        {
            BannerCode[] codes = Fetch(null, position, true, eSortColumn.None);

            if (codes.Length > 0) return codes[0];

            return null;
        }
Exemplo n.º 6
0
 public static BannerCode[] Fetch(ePosition position, eSortColumn sortColumn)
 {
     return Fetch(null, position, null, sortColumn);
 }
Exemplo n.º 7
0
 public InspectorButtonAttribute(string _buttonName, string _invokeMethod, ePosition _position = ePosition.TOP)
 {
     Name         = _buttonName;
     InvokeMethod = _invokeMethod;
     Position     = _position;
 }
		public InspectorButtonAttribute (string _buttonName, string _invokeMethod, ePosition _position = ePosition.TOP)
		{
			Name			= _buttonName;
			InvokeMethod	= _invokeMethod;
			Position		= _position;
		}
Exemplo n.º 9
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);

            //byte distance = monster.Distance;
            monster.Target();
            recast.Refresh(2.0);
            user.Refresh();

            ePosition position = monster.Position(user);

            Hotkeys hotkeys = new Hotkeys();

            Hotkeys.Hotkey highlightedAbility = null;

            hotkeys.RefreshAbilities();

            if (hotkeys.Abilities[92].InRange == 0)
            {
                return;
            }

            foreach (KeyValuePair <short, Hotkeys.Hotkey> hk in hotkeys.Abilities)
            {
                if (hk.Value.Highlighted && hk.Value.ID != 89)
                {
                    highlightedAbility = hk.Value;
                }
            }


            if (recast.Abilities.Contains(2) == false && user.TP_Current < 450)
            {
                hotkeys.Abilities[80].UseAbility(); // Invigorate
            }
            else if (recast.WeaponSpecials.Count == 0 && hotkeys.Abilities[75].InRange == 1)
            {
                //if (distance > 7)
                //{
                //    hotkeys.Abilities[90].UseAbility(); // Piercing Talon
                //} else
                if (highlightedAbility != null)
                {
                    if (highlightedAbility.ID == 84 && recast.Abilities.Contains(4) == false)
                    {
                        hotkeys.Abilities[83].UseAbility(); // Life Surge for Full Thrust
                    }
                    else
                    {
                        highlightedAbility.UseAbility();
                    }
                }
                else if (user.ContainsStatusEffect(115, 0, false) == false && position == ePosition.Side)
                //Heavy Thrust Dmg Buff From Side
                {
                    hotkeys.Abilities[79].UseAbility();
                }
                else if (monster.ContainsStatusEffect(119, user.ID, true) == false) //Phlebotomize DOT
                {
                    hotkeys.Abilities[91].UseAbility();
                }
                else if (position == ePosition.Back && monster.ContainsStatusEffect(121, user.ID, true) == false)
                {
                    hotkeys.Abilities[81].UseAbility(); // Start Impulse Drive Combo
                }
                else
                {
                    hotkeys.Abilities[75].UseAbility(); // Start True Thrust Combo
                }
            }
            else
            {
                if ((recast.Abilities.Contains(5) == false || recast.SubAbilities.Contains(59) == false) && hotkeys.Abilities[75].InRange == 1)
                // Blood for Blood or Internal Release
                {
                    Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.D0);
                }

                if (monster.Name.Contains("Titan") == false)
                {
                    if (recast.Abilities.Contains(7) == false && recast.Abilities.Contains(10) == false)
                    {
                        hotkeys.Abilities[93].UseAbility(); // Power Surge
                    }
                    else if (recast.Abilities.Contains(10) == false)
                    {
                        hotkeys.Abilities[96].UseAbility(); // Dragonfire Dive
                    }
                    else if (recast.Abilities.Contains(6) == false)
                    {
                        hotkeys.Abilities[92].UseAbility(); // Jump
                    }
                    else if (recast.Abilities.Contains(9) == false)
                    {
                        hotkeys.Abilities[95].UseAbility(); // Spineshatter drive
                    }
                }
            }
        }
Exemplo n.º 10
0
        public override void Fight(Character user, Character monster, Recast recast)
        {
            base.Fight(user, monster, recast);
            bool dotNeeded        = !monster.ContainsStatusEffect(246, user.ID, true);
            bool dragonkickNeeded = !monster.ContainsStatusEffect(98, 0, false);
            bool lockIcon;

            monster.Target();
            recast.Refresh(2.0);



            try
            {
                ePosition position = monster.Position(user);

                Hotkeys        hotkeys            = new Hotkeys();
                Hotkeys.Hotkey highlightedAbility = null;

                hotkeys.RefreshAbilities();

                _mnkHelper.txt_Title.Content = "Position: " + position.ToString();


                if (user.ContainsStatusEffect(103, 0, false) == false && hotkeys[63].PercentReady == 100)
                {
                    hotkeys[63].UseAbility();
                }

                int colorOffset = (int)((hotkeys.Abilities[53].PercentReady - 25) * 3.4);
                if (colorOffset > 255)
                {
                    colorOffset = 255;
                }

                if (hotkeys.Abilities[53].PercentReady < 75)
                {
                    _mnkHelper.txt_Current.Foreground =
                        new SolidColorBrush(Color.FromRgb(255, 0, 255));
                    lockIcon = true;
                }
                else
                {
                    lockIcon = false;
                    _mnkHelper.txt_Current.Foreground = new SolidColorBrush(Color.FromRgb((byte)(255 - colorOffset), (byte)colorOffset, 0));
                }


                if (user.ContainsStatusEffect(110, 0, false))
                {
                    if (position == ePosition.Side)
                    {
                        highlightedAbility = hotkeys.Abilities[56]; // Snap Punch
                    }
                    else if (position == ePosition.Back)
                    {
                        highlightedAbility = hotkeys.Abilities[54]; // True Strike
                    }
                    else
                    {
                        highlightedAbility = hotkeys.Abilities[56]; // Snap Punch
                    }
                    if (hotkeys.Abilities[53].PercentReady > 50 && lockIcon == false)
                    {
                        SetCurrentAbilityImage(highlightedAbility.ID, recast, true, dotNeeded, dragonkickNeeded);
                    }
                }
                else
                {
                    foreach (KeyValuePair <short, Hotkeys.Hotkey> hk in hotkeys.Abilities)
                    {
                        if (hk.Value.Highlighted)
                        {
                            if (user.ContainsStatusEffect(101, 0, false) == false && hk.Value.ID == 61 && user.TP_Current >= 60) // Twin Snakes if damage buff is down
                            {
                                highlightedAbility = hk.Value;
                                break;
                            }
                            else if (hk.Value.ID == 58 && user.TP_Current >= 40) // Haymaker
                            {
                                highlightedAbility = hk.Value;
                                break;
                            }
                            else if (position == ePosition.Side)
                            {
                                if (hk.Value.ID == 61 && user.TP_Current >= 60) // Twin Snakes
                                {
                                    highlightedAbility = hk.Value;
                                }
                                else if (hk.Value.ID == 56 && user.TP_Current >= 50) // Snap Punch
                                {
                                    highlightedAbility = hk.Value;
                                }
                            }
                            else if (position == ePosition.Back)
                            {
                                if (hk.Value.ID == 54 && user.TP_Current >= 50) // True Strike
                                {
                                    highlightedAbility = hk.Value;
                                }
                                else if (hk.Value.ID == 66 && monster.ContainsStatusEffect(246, user.ID, true) == false && user.TP_Current >= 50) // Demolish DOT
                                {
                                    highlightedAbility = hk.Value;
                                }
                                else if (hk.Value.ID == 56 && user.TP_Current >= 50) // Snap Punch
                                {
                                    if (highlightedAbility != null)
                                    {
                                        if (highlightedAbility.ID == 66)
                                        {
                                            continue;
                                        }
                                    }

                                    highlightedAbility = hk.Value;
                                }
                            }
                            else
                            {
                                if (hk.Value.ID != 72 && hk.Value.ID != 36 && user.TP_Current >= 60)
                                {
                                    highlightedAbility = hk.Value;
                                }
                            }
                        }
                    }

                    // Check for highlighted abilities if there is no position combos available.
                    if (highlightedAbility == null)
                    {
                        foreach (KeyValuePair <short, Hotkeys.Hotkey> hk in hotkeys.Abilities)
                        {
                            if (hk.Value.Highlighted)
                            {
                                if (user.ContainsStatusEffect(101, 0, false) == false && hk.Value.ID == 61 && user.TP_Current >= 60)
                                // Twin Snakes if damage buff is down
                                {
                                    highlightedAbility = hk.Value;
                                    break;
                                }

                                if (hk.Value.ID == 66 && monster.ContainsStatusEffect(246, user.ID, true) == false && user.TP_Current >= 50)
                                // Demolish DOT
                                {
                                    highlightedAbility = hk.Value;
                                    break;
                                }

                                if (hk.Value.ID != 72 && hk.Value.ID != 36 && user.TP_Current >= 60)
                                {
                                    highlightedAbility = hk.Value;
                                }
                            }
                        }
                    }

                    if (highlightedAbility == null)
                    {
                        if (lockIcon == false)
                        {
                            if (monster.ContainsStatusEffect(106, user.ID, true) == false)
                            {
                                SetCurrentAbilityImage(68, recast, false, dotNeeded, dragonkickNeeded);
                                // Touch of Death
                            }
                            else if (position == ePosition.Back)
                            {
                                SetCurrentAbilityImage(53, recast, false, dotNeeded, dragonkickNeeded);
                            }
                            else if (position == ePosition.Side)
                            {
                                SetCurrentAbilityImage(74, recast, false, dotNeeded, dragonkickNeeded);
                            }
                            else
                            {
                                SetCurrentAbilityImage(53, recast, false, dotNeeded, dragonkickNeeded);
                            }
                        }
                    }
                    else
                    {
                        if (hotkeys.Abilities[53].PercentReady > 75 && lockIcon == false)
                        {
                            SetCurrentAbilityImage(highlightedAbility.ID, recast, false, dotNeeded, dragonkickNeeded);
                        }
                    }
                }



                if (recast.SubAbilities.Contains(80) == false && user.TP_Current < 450)
                {
                    hotkeys.Abilities[80].UseAbility(); // Invigorate
                }
                else if (hotkeys.Abilities[53].PercentReady > 80 && hotkeys.Abilities[53].InRange == 1)
                {
                    if (highlightedAbility != null) // Use Combo
                    {
                        highlightedAbility.UseAbility();
                    }
                    else if (monster.ContainsStatusEffect(106, user.ID, true) == false && user.TP_Current >= 80) // Touch of Death
                    {
                        hotkeys.Abilities[68].UseAbility();
                    }
                    else if (position == ePosition.Back && user.TP_Current >= 60)
                    {
                        hotkeys.Abilities[53].UseAbility(); // Start Bootshine Combo
                    }
                    else if (position == ePosition.Side && user.TP_Current >= 60)
                    {
                        hotkeys.Abilities[74].UseAbility(); // Start Dragonkick
                    }
                    else if (user.TP_Current >= 60)
                    {
                        hotkeys.Abilities[53].UseAbility();
                    }
                }
                else if (hotkeys.Abilities[53].InRange == 1)
                {
                    if (recast.Abilities.Contains(3) == false || recast.SubAbilities.Contains(85) == false)
                    {
                        Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.Dash);
                    }
                    else if (recast.Abilities.Contains(8) == false && user.ContainsStatusEffect(112, 0, false) == false && user.ContainsStatusEffect(113, 0, false) == false && user.Level >= 50)
                    {
                        hotkeys.Abilities[69].UseAbility(); // Perfect Balance
                    }
                    else if (recast.Abilities.Contains(5) == false)
                    {
                        hotkeys.Abilities[64].UseAbility(); // Steel Peak
                    }
                    else if (recast.Abilities.Contains(7) == false)
                    {
                        hotkeys.Abilities[67].UseAbility();                                                     // Howling Fist
                    }
                    else if (hotkeys[36].PercentReady >= 99 && hotkeys[36].IsInHotbar && hotkeys[36].Activated) // Mercy Stroke
                    {
                        hotkeys[36].UseAbility();
                    }
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.StackTrace.ToString());
            }
        }