public void SetBuff(IBuff buff) { if (buff != null) { icon.sprite = buff.Icon; } }
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 }
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); } }
//-------------------------buff---------------------------- public IBuff AddBuff(IBuff bi) { bi.AM = this; buff_sort_with_guid.Add(bi.Guid, bi); changed = true; return(bi); }
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; }
public override void OnOtherBuffAdded(IBuff other) { if (other is DefendBuff) { forceExpire = true; } }
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; } }); }
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); }
public void AddBuff(IBuff buff) { var go = Instantiate(buff as Buff, buffDomain).GetComponent <IBuff>(); buffs.Add(go); go.OnAwake(this); }
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); } }
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); }
//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); }
public bool IsBuffed() { Type type = Type.GetType(buffType.ToString()); IBuff buff = (IBuff)Activator.CreateInstance(type); return(buff.IsBuffed()); }
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); }
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); }
public byte GetNewBuffSlot(IBuff b) { var slot = GetBuffSlot(); BuffSlots[slot] = b; return(slot); }
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); }
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"); }
public void Remove(IBuff buff) { if (buffs.Remove(buff)) { buff.OnRemoved(); } }
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); }
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); }
public static bool IfSilence(ISkillPlayer player) { IBuff blurBuff = null; return(player.TryGetBuff((int)EnumBlurType.LockMotion, ref blurBuff) || player.TryGetBuff((int)EnumBlurType.LockSkill, ref blurBuff)); }
public void Stack(IBuff self) { if (self is T) { _remainingTime = Mathf.Clamp(_remainingTime + duration, 0, maxDuration); } }
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); }
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); } }
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; }
public IBuff CurrentMotiveBuff(IBuff inBuff) { return mHudModel.CurrentMotiveBuff(inBuff); }
public string GetBuffName(IBuff inBuff) { return mHudModel.GetBuffName(inBuff); }
public void RemoveBuff(IBuff inBuff) { mHudModel.RemoveBuff(inBuff); }
public bool TrySolveBuff(IBuff buff) { return mHudModel.TrySolveBuff(buff); }
public string GetBuffDescription(IBuff inBuff) { return mHudModel.GetBuffDescription(inBuff); }