Ejemplo n.º 1
0
 public void SetBuff(IBuff buff)
 {
     if (buff != null)
     {
         icon.sprite = buff.Icon;
     }
 }
Ejemplo n.º 2
0
 public void OnActivate(IObjAiBase unit, IBuff buff, ISpell ownerSpell)
 {
     StatsModifier.MoveSpeed.PercentBonus   = StatsModifier.MoveSpeed.PercentBonus + (15f + ownerSpell.Level * 10) / 100f;
     StatsModifier.AttackSpeed.PercentBonus = StatsModifier.AttackSpeed.PercentBonus + (5f + ownerSpell.Level * 25) / 100f;
     unit.AddStatModifier(StatsModifier);
     // TODO: add immunity to slows
 }
Ejemplo n.º 3
0
    protected override ApplyBuffOnKillBuffInfo GetBuffInfo(IBuff buff)
    {
        ApplyBuffOnKillBuffInfo info = new ApplyBuffOnKillBuffInfo(buff);

        info.on_kill_callback = (a, b) => AddOnKillStack(info);
        return(info);
    }
        public void OnActivate(IObjAiBase unit, IBuff buff, ISpell ownerSpell)
        {
            if (unit is IChampion c)
            {
                // TODO: Implement Animation Overrides for spells like these
                if (c.Skin == 0)
                {
                    pmodelname = "Aatrox_Base_RModel.troy";
                }
                else if (c.Skin == 1)
                {
                    pmodelname = "Aatrox_Skin01_RModel.troy";
                }
                else if (c.Skin == 2)
                {
                    pmodelname = "Aatrox_Skin02_RModel.troy";
                }
                pmodel = AddParticleTarget(c, pmodelname, c);
                pmodel.SetToRemove();

                StatsModifier.AttackSpeed.PercentBonus = (0.4f + (0.1f * (ownerSpell.Level - 1))) * buff.StackCount; // StackCount included here as an example
                StatsModifier.Range.FlatBonus          = 175f * buff.StackCount;

                unit.AddStatModifier(StatsModifier);
            }
        }
Ejemplo n.º 5
0
    //-------------------------buff----------------------------

    public IBuff AddBuff(IBuff bi)
    {
        bi.AM = this;
        buff_sort_with_guid.Add(bi.Guid, bi);
        changed = true;
        return(bi);
    }
Ejemplo n.º 6
0
    protected override void Ini()
    {
        base.Ini();
        has_energy_buff_instance = has_energy_buff.GetInstance();
        no_energy_buff_instance  = no_energy_buff.GetInstance();

        active_rockets = new List <GameObject>();

        if (target == null)
        {
            target = FindObjectOfType <Player>();
        }

        foreach (RocketSpawner rs in rocket_spawners)
        {
            rs.Ini(homing_projectile, RocketOnHit, target);
        }
        foreach (Electricity en in electricity_nodes)
        {
            en.SetOnHit(ZapOnHit);
        }
        foreach (Spike spike in spikes)
        {
            spike.SetOnHit(SpikeOnHit);
        }
        foreach (Laser laser in lasers)
        {
            laser.SetOnHit(LaserOnHit);
        }
        attacks_occuring = 0;
        lever_pulled     = false;
        enemy.SetDieEvent(DieEvent);
    }
 public BuffTargetCommand(IBuff iBuff, BuffData buffData, TickService tick)
 {                      //takes in this unit
     _buffData = buffData;
     _iBuff    = iBuff; //this is actually bringing in the instance of the wrapper buff, not the "class" iBuff.
     //you can call it IBuff because it extends it, and use the IBuff method because it extends it.
     _tick = tick;
 }
Ejemplo n.º 8
0
 public override void OnOtherBuffAdded(IBuff other)
 {
     if (other is DefendBuff)
     {
         forceExpire = true;
     }
 }
Ejemplo n.º 9
0
        public void OnFinishCasting(IChampion owner, ISpell spell, IAttackableUnit target)
        {
            var current    = new Vector2(owner.X, owner.Y);
            var to         = Vector2.Normalize(new Vector2(spell.X, spell.Y) - current);
            var range      = to * 300;
            var trueCoords = current + range;

            DashToLocation(owner, trueCoords.X, trueCoords.Y, 1200, false, "Spell1");

            if (!_listenerAdded)
            {
                //ApiEventManager.OnHitUnit.AddListener(this, owner, OnAutoAttack);
                _listenerAdded = true;
            }
            if (_owningChampion != owner)
            {
                _owningChampion = owner;
            }
            if (_owningSpell != spell)
            {
                _owningSpell = spell;
            }
            _nextAutoBonusDamage = true;
            _tumbleBuff          = AddBuffHudVisual("VayneTumble", 6.0f, 1, BuffType.COMBAT_ENCHANCER, owner);
            CreateTimer(6.0f, () =>
            {
                // If auto has not yet been consumed
                if (_nextAutoBonusDamage == true)
                {
                    RemoveBuffHudVisual(_tumbleBuff);
                    _nextAutoBonusDamage = false;
                }
            });
        }
Ejemplo n.º 10
0
        protected override bool OnAddBuff(IBuff inBuff)
        {
            if (null == inBuff || inBuff.InvalidFlag)
            {
                return(false);
            }
            IBuff obj     = null;
            int   skillId = 0;

            if (null != inBuff.SrcSkill)
            {
                skillId = inBuff.SrcSkill.InnerId;
            }
            if (inBuff.Times < 0)
            {
                skillId = -skillId;
            }
            if (!dicBuff.TryGetValue(skillId, out obj) || null == obj)
            {
                dicBuff[skillId] = inBuff.Clone();
            }
            else
            {
                obj.CoverBuff(inBuff);
            }
            this._syncFlag = false;
            return(true);
        }
Ejemplo n.º 11
0
        public void AddBuff(IBuff buff)
        {
            var go = Instantiate(buff as Buff, buffDomain).GetComponent <IBuff>();

            buffs.Add(go);
            go.OnAwake(this);
        }
Ejemplo n.º 12
0
        public override Task <object[]> execute(IGame game, ICard card, IBuff buff, IEventArg eventArg, object[] args, object[] constValues)
        {
            LogicOperator op = (LogicOperator)constValues[0];

            switch (op)
            {
            case LogicOperator.not:
                return(Task.FromResult(new object[] { !(bool)args[0] }));

            case LogicOperator.and:
                foreach (var value in args.Cast <bool>())
                {
                    if (value == false)
                    {
                        return(Task.FromResult(new object[] { false }));
                    }
                }
                return(Task.FromResult(new object[] { true }));

            case LogicOperator.or:
                foreach (var value in args.Cast <bool>())
                {
                    if (value == true)
                    {
                        return(Task.FromResult(new object[] { true }));
                    }
                }
                return(Task.FromResult(new object[] { false }));

            default:
                throw new InvalidOperationException("未知的操作符" + op);
            }
        }
 static void OnBuffManagerAddRemove(Mobile mobile, IBuff buff)
 {
     if (buff is PoisonImmunity && mobile is PlayerMobile player)
     {
         Timer.DelayCall(TimeSpan.Zero, SendZuluPlayerStatus, player.NetState, player);
     }
 }
Ejemplo n.º 14
0
    protected sealed override T GetBuffInfo(IBuff buff)
    {
        T on_hit_buff_info = GetOnHitBuffInfo(buff);

        on_hit_buff_info.on_hit_callback = (hitter, pre, post, hit) => OnHitEffect(on_hit_buff_info, hitter, pre, post, hit);
        return(on_hit_buff_info);
    }
Ejemplo n.º 15
0
        //IParticle p;

        public void OnActivate(IObjAiBase unit, IBuff buff, ISpell ownerSpell)
        {
            //p = AddParticleTarget(unit, "Overdrive_buf.troy", unit, 1);
            StatsModifier.MoveSpeed.PercentBonus   = StatsModifier.MoveSpeed.PercentBonus + (12f + ownerSpell.Level * 4) / 100f;
            StatsModifier.AttackSpeed.PercentBonus = StatsModifier.AttackSpeed.PercentBonus + (22f + 8f * ownerSpell.Level) / 100f;
            unit.AddStatModifier(StatsModifier);
        }
Ejemplo n.º 16
0
Archivo: Buff.cs Proyecto: spock254/sza
    public bool IsBuffed()
    {
        Type  type = Type.GetType(buffType.ToString());
        IBuff buff = (IBuff)Activator.CreateInstance(type);

        return(buff.IsBuffed());
    }
Ejemplo n.º 17
0
        public void OnActivate(IObjAiBase unit, IBuff buff, ISpell ownerSpell)
        {
            var    time = 11f - ownerSpell.Level * 1f;
            string name = "Yasuo_Skin1_E_timer" + ownerSpell.Level + ".troy";

            AddParticleTarget(owner, "Yasuo_base_E_timer1.troy", unit);
        }
Ejemplo n.º 18
0
 public void OnActivate(IObjAiBase unit, ISpell ownerSpell)
 {
     _statMod = new StatsModifier();
     _statMod.MoveSpeed.PercentBonus = .15f + (.05f * (ownerSpell.Level - 1));
     unit.AddStatModifier(_statMod);
     _visualBuff = AddBuffHudVisual("KatarinaWHaste", 1.0f, 1, BuffType.HASTE, unit);
 }
Ejemplo n.º 19
0
        public byte GetNewBuffSlot(IBuff b)
        {
            var slot = GetBuffSlot();

            BuffSlots[slot] = b;
            return(slot);
        }
Ejemplo n.º 20
0
 public void OnActivate(IObjAiBase unit, ISpell ownerSpell)
 {
     _statMod.AttackSpeed.PercentBonus = 0.2f + (0.1f * ownerSpell.Level);
     unit.AddStatModifier(_statMod);
     _visualBuff = AddBuffHudVisual("GravesMoveSteroid", 4.0f, 1, BuffType.COMBAT_ENCHANCER,
                                    unit);
 }
Ejemplo n.º 21
0
        public void OnActivate(IObjAiBase unit, IBuff buff, ISpell ownerSpell)
        {
            var    champ    = unit as IChampion;
            string dashBase = "Yasuo_Base_E_Dash.troy";
            string dashHit  = "Yasuo_Base_E_dash_hit.troy";

            //Skine göre kostüm
            if (champ.Skin == 2)
            {
                dashBase = "Yasuo_Skin1_E_Dash.troy";
                dashHit  = "Yasuo_Skin1_E_dash_hit.troy";
            }

            CreateTimer(0.03f, () =>
            {
                unit.IsCastingSpell = true;
            });

            CreateTimer(2 * buff.Duration / 3, () =>
            {
                unit.IsCastingSpell = false;
            });

            AddParticleTarget(unit, dashBase, unit);
            AddParticleTarget(unit, dashHit, target);
            var to = Vector2.Normalize(target.GetPosition() - unit.GetPosition());

            ownerSpell.DashToLocation(unit, target.X + to.X * 300f, target.Y + to.Y * 300f, 1100f, false, "SPELL3");
        }
Ejemplo n.º 22
0
 public void Remove(IBuff buff)
 {
     if (buffs.Remove(buff))
     {
         buff.OnRemoved();
     }
 }
Ejemplo n.º 23
0
 public void OnActivate(IObjAiBase unit, ISpell ownerSpell)
 {
     _statMod = new StatsModifier();
     _statMod.MoveSpeed.PercentBonus = 1.25f;
     unit.AddStatModifier(_statMod);
     _visualBuff = AddBuffHudVisual("SummonerReviveSpeedBoost", 12.0f, 1, BuffType.COMBAT_ENCHANCER, unit);
 }
Ejemplo n.º 24
0
    public IBuff NewBuff(IBuff.BuffType type)
    {
        IBuff buff = null;

        if (mRecoveryBuffList[(int)type].Count > 0)
        {
            buff = mRecoveryBuffList[(int)type].Pop();
        }
        else
        {
            if (type == IBuff.BuffType.Move)
            {
                buff = new MoveBuff();
            }
            else if (type == IBuff.BuffType.Behavior)
            {
                buff = new BehaviorBuff();
            }
            else if (type == IBuff.BuffType.Hurt)
            {
                buff = new HurtBuff();
            }
            else if (type == IBuff.BuffType.Control)
            {
                buff = new ControlBuff();
            }
        }

        buff.mInstId = ++mInstId;
        return(buff);
    }
Ejemplo n.º 25
0
        public static bool IfSilence(ISkillPlayer player)
        {
            IBuff blurBuff = null;

            return(player.TryGetBuff((int)EnumBlurType.LockMotion, ref blurBuff) ||
                   player.TryGetBuff((int)EnumBlurType.LockSkill, ref blurBuff));
        }
Ejemplo n.º 26
0
 public void Stack(IBuff self)
 {
     if (self is T)
     {
         _remainingTime = Mathf.Clamp(_remainingTime + duration, 0, maxDuration);
     }
 }
Ejemplo n.º 27
0
        public static bool IfSilence(ISkill srcSkill, ISkillOwner owner)
        {
            IBuff blurBuff = null;

            if (owner.TryGetBuff((int)EnumBlurType.LockMotion, ref blurBuff))
            {
                return(true);
            }
            if (!owner.TryGetBuff((int)EnumBlurType.LockSkill, ref blurBuff))
            {
                return(false);
            }
            int maxRate = SkillDefines.MAXStorePercent;
            int rate    = blurBuff.Rate;

            if (rate >= maxRate)
            {
                return(true);
            }
            if (rate > 0 && rate < maxRate)
            {
                if (srcSkill.Context.RandomPercent(maxRate) <= rate)
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 28
0
        public virtual bool checkCondition(IGame game, ICard card, IBuff buff, IEventArg eventArg)
        {
            TriggerGraph trigger = triggerList.FirstOrDefault(t => t.eventName == game.triggers.getName(eventArg));

            if (trigger != null)
            {
                if (trigger.condition == null)
                {
                    return(true);
                }
                var task = game.doActionAsync(card, buff, eventArg, trigger.condition.action);
                if (task.IsCompleted)
                {
                    object[] returnValues = task.Result;
                    if (returnValues[trigger.condition.index] is bool b)
                    {
                        return(b);
                    }
                    else
                    {
                        throw new InvalidCastException(returnValues[trigger.condition.index] + "不是真值类型");
                    }
                }
                else
                {
                    throw new InvalidOperationException("不能在条件中调用需要等待的动作");
                }
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 29
0
    private void ShowTooltip(IBuff buff)
    {
        var texts = BuffTooltip.gameObject.GetComponentsInChildren <Text>();

        texts.First(t => t.name == "Text_Name").text        = buff.Name;
        texts.First(t => t.name == "Text_Description").text = buff.Description;
        BuffTooltip.SetActive(true);
    }
 public void OnActivate(IObjAiBase unit, IBuff buff, ISpell ownerSpell)
 {
     StatsModifier.MoveSpeed.BaseBonus = StatsModifier.MoveSpeed.BaseBonus - 60;
     unit.ApplyCrowdControl(_crowdDisarm);
     unit.ApplyCrowdControl(_crowdSilence);
     unit.AddStatModifier(StatsModifier);
     var time = 1 + 0.25f * ownerSpell.Level;
 }
Ejemplo n.º 31
0
 public IBuff CurrentMotiveBuff(IBuff inBuff)
 {
     return mHudModel.CurrentMotiveBuff(inBuff);
 }
Ejemplo n.º 32
0
 public string GetBuffName(IBuff inBuff)
 {
     return mHudModel.GetBuffName(inBuff);
 }
Ejemplo n.º 33
0
 public void RemoveBuff(IBuff inBuff)
 {
     mHudModel.RemoveBuff(inBuff);
 }
Ejemplo n.º 34
0
 public bool TrySolveBuff(IBuff buff)
 {
     return mHudModel.TrySolveBuff(buff);
 }
Ejemplo n.º 35
0
 public string GetBuffDescription(IBuff inBuff)
 {
     return mHudModel.GetBuffDescription(inBuff);
 }