Esempio n. 1
0
            public Ward(AIHeroClient caster, Obj_AI_Base handle, Vector3 position, IWard wardInfo, int duration, GameObjectTeam team)
            {
                // Initialize properties
                Caster       = caster;
                Handle       = handle;
                FakePosition = position;
                Team         = team;
                WardInfo     = wardInfo;
                Duration     = duration * 1000;
                CreationTime = Core.GameTickCount;

                // Initialize rendering
                MinimapSprite = new Sprite(() => MinimapIconTexture);
                TextHandle    = new Text(string.Empty, new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular));

                // Notify player about placement
                if (!MasterMind.IsSpectatorMode && Team.IsEnemy() &&
                    (Player.Instance.IsInRange(Position, NotifyRange.CurrentValue) || Player.Instance.IsInRange(position, NotifyRange.CurrentValue)))
                {
                    if (NotifyPlace.CurrentValue)
                    {
                        Notifications.Show(new SimpleNotification("A ward has been placed!",
                                                                  string.Format("{0} has placed a {1}", caster != null ? caster.ChampionName : "Unknown", WardInfo.FriendlyName)));
                    }
                    if (NotifyPlacePing.CurrentValue)
                    {
                        TacticalMap.ShowPing(PingCategory.Normal, Position, true);
                    }
                }
            }
Esempio n. 2
0
        public bool IsValidTeam(GameObjectTeam team)
        {
            if (team == GameObjectTeam.Unknown)
            {
                return(true);
            }

            switch (Detection)
            {
            case DetectionTeam.AllyTeam:
                return(team.IsAlly());

            case DetectionTeam.EnemyTeam:
                return(team.IsEnemy());

            case DetectionTeam.AnyTeam:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(true);
        }
        public bool IsValidTeam(GameObjectTeam team)
        {
            if (team == GameObjectTeam.Unknown)
                return true;

            switch (TeamDetect)
            {
                case DetectionTeam.AllyTeam:
                    return team.IsAlly();
                case DetectionTeam.EnemyTeam:
                    return team.IsEnemy();
                case DetectionTeam.AnyTeam:
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            return true;
        }
Esempio n. 4
0
            public Ward(AIHeroClient caster, Obj_AI_Base handle, Vector3 position, IWard wardInfo, int duration, GameObjectTeam team)
            {
                // Initialize properties
                Caster = caster;
                Handle = handle;
                FakePosition = position;
                Team = team;
                WardInfo = wardInfo;
                Duration = duration * 1000;
                CreationTime = Core.GameTickCount;

                // Initialize rendering
                MinimapSprite = new Sprite(() => MinimapIconTexture);
                TextHandle = new Text(string.Empty, new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular));

                // Notify player about placement
                if (!MasterMind.IsSpectatorMode && Team.IsEnemy() &&
                    (Player.Instance.IsInRange(Position, NotifyRange.CurrentValue) || Player.Instance.IsInRange(position, NotifyRange.CurrentValue)))
                {
                    if (NotifyPlace.CurrentValue)
                    {
                        Notifications.Show(new SimpleNotification("A ward has been placed!",
                            string.Format("{0} has placed a {1}", caster != null ? caster.ChampionName : "Unknown", WardInfo.FriendlyName)));
                    }
                    if (NotifyPlacePing.CurrentValue)
                    {
                        TacticalMap.ShowPing(PingCategory.Normal, Position, true);
                    }
                }
            }