Exemple #1
0
        public override void AddDrawableAbility(List <IDrawableAbility> drawableAbilities, Unit unit, INotificator notificator)
        {
            var ward = drawableAbilities.OfType <DrawableWardAbility>()
                       .FirstOrDefault(x => x.Unit == null && x.AbilityUnitName == this.UnitName && x.Position.Distance2D(unit.Position) < 400);

            if (ward != null)
            {
                ward.AddUnit(unit);
                return;
            }

            var mod = unit.Modifiers.FirstOrDefault(x => x.Name == "modifier_item_buff_ward");

            var drawableAbility = new DrawableWardAbility
            {
                AbilityUnitName = this.UnitName,
                AbilityTexture  = this.AbilityId.ToString(),
                Position        = unit.Position,
                Unit            = unit,
                Duration        = this.Duration,
                IsShowingRange  = this.ShowRange,
                Range           = this.Range,
                RangeColor      = this.RangeColor,
                AddedTime       = GameManager.RawGameTime - (mod?.ElapsedTime ?? 0),
                ShowUntil       = GameManager.RawGameTime + (mod?.RemainingTime ?? this.Duration)
            };

            drawableAbility.DrawRange();
            drawableAbilities.Add(drawableAbility);
        }
        // Token: 0x060002C7 RID: 711 RVA: 0x0001A628 File Offset: 0x00018828
        public override void AddDrawableAbility(List <IDrawableAbility> drawableAbilities, Unit unit, INotificator notificator)
        {
            DrawableWardAbility drawableWardAbility = drawableAbilities.OfType <DrawableWardAbility>().FirstOrDefault((DrawableWardAbility x) => x.Unit == null && x.AbilityUnitName == this.UnitName && x.Position.Distance2D(unit.Position, false) < 400f);

            if (drawableWardAbility != null)
            {
                drawableWardAbility.AddUnit(unit);
                return;
            }
            Modifier            modifier             = unit.Modifiers.FirstOrDefault((Modifier x) => x.Name == "modifier_item_buff_ward");
            DrawableWardAbility drawableWardAbility2 = new DrawableWardAbility
            {
                AbilityUnitName = this.UnitName,
                AbilityTexture  = base.AbilityId + "_rounded",
                Position        = unit.Position,
                Unit            = unit,
                Duration        = base.Duration,
                IsShowingRange  = base.ShowRange,
                Range           = base.Range,
                RangeColor      = base.RangeColor,
                AddedTime       = Game.RawGameTime - ((modifier != null) ? modifier.ElapsedTime : 0f),
                ShowUntil       = Game.RawGameTime + ((modifier != null) ? modifier.RemainingTime : base.Duration)
            };

            drawableWardAbility2.DrawRange();
            drawableAbilities.Add(drawableWardAbility2);
        }
Exemple #3
0
        public void AddDrawableAbility(List <IDrawableAbility> drawableAbilities, Vector3 position)
        {
            var drawableAbility = new DrawableWardAbility
            {
                AbilityUnitName = this.UnitName,
                AbilityTexture  = this.AbilityId.ToString(),
                Position        = position,
                Duration        = this.Duration,
                IsShowingRange  = this.ShowRange,
                Range           = this.Range,
                RangeColor      = this.RangeColor,
                ShowUntil       = GameManager.RawGameTime + this.Duration,
            };

            drawableAbility.DrawRange();
            drawableAbilities.Add(drawableAbility);
        }
        // Token: 0x060002C6 RID: 710 RVA: 0x0001A598 File Offset: 0x00018798
        public void AddDrawableAbility(List <IDrawableAbility> drawableAbilities, Vector3 position)
        {
            DrawableWardAbility drawableWardAbility = new DrawableWardAbility
            {
                AbilityUnitName = this.UnitName,
                AbilityTexture  = base.AbilityId + "_rounded",
                Position        = position,
                Duration        = base.Duration,
                IsShowingRange  = base.ShowRange,
                Range           = base.Range,
                RangeColor      = base.RangeColor,
                ShowUntil       = Game.RawGameTime + base.Duration
            };

            drawableWardAbility.DrawRange();
            drawableAbilities.Add(drawableWardAbility);
        }