Пример #1
0
 public void TriggerBuff(BuffTrigger eTrigger, Actor actor)
 {
     foreach (Buff buff in triggeredBuffs)
     {
         buff.OnTrigger(eTrigger, actor);
     }
 }
 public static void CheckBuff(BuffTrigger trigger, BattleObject source)
 {
     for(int i = 0; i < source.buffList.Count; i++)
     {
         source.buffList[i].Check(trigger);
     }
 }
Пример #3
0
 public void OnTrigger(BuffTrigger eTrigger, Actor triggerer)
 {
     foreach (Pair_BuffTrigger_BuffEffect pair in triggeredEffects)
     {
         if (pair.eTrigger == eTrigger)
         {
             pair.effect.OnTriggered(this, triggerer);
         }
     }
 }
Пример #4
0
 public void TriggerPlayerDebuffsOnMe(BuffTrigger trigger)
 {
     foreach (Minion otherMinion in Core.GetCurrentRoster().minions)
     {
         foreach (Buff buff in otherMinion.template.triggeredBuffs)
         {
             if (buff.ShouldApply(minion.template.element, minion.template.GetSlotType(), minion.template.isZombie, true))
             {
                 buff.OnTrigger(trigger, this);
             }
         }
     }
 }
Пример #5
0
    /// <summary>
    /// 角色死亡,处理依赖caster的buff和buff触发行为
    /// </summary>
    /// <param name="unit"></param>
    public void OnFightUnitDie(FightUnit unit)
    {
        BuffTrigger triggerType = BuffTrigger.None;

        //自己死亡,遗恨
        if (unit == this._unit)
        {
            triggerType = BuffTrigger.SelfDie;
        }

        //友军牺牲,血怒
        if (unit.IsEnemy == this._unit.IsEnemy && unit != this._unit)
        {
            triggerType = BuffTrigger.PartnerDie;
        }

        //敌人是我杀的,破敌
        if (unit.IsEnemy != this._unit.IsEnemy && unit.EnemyUnit == this._unit)
        {
            triggerType = BuffTrigger.Kill;
        }
        for (int idx = 0; idx < _allBuff.Count; ++idx)
        {
            Buff buff = _allBuff[idx];
            if (!buff.IsUsing)
            {
                continue;
            }

            //处理触发类型buff
            if (buff.Type == BuffType.Trigger && buff.Trigger == (int)triggerType)
            {
                //参数表示要求造成死亡的技能是指定技能
                if (buff.TriggerParam == 0 || unit.EnemySkill == buff.TriggerParam)
                {
                    TakeEffect(buff);
                }
            }

            JObject cbuff = JsonMgr.GetSingleton().GetBuff(buff.BuffId);
            if (0 == cbuff["needcaster"].ToObject <int>())
            {
                continue;
            }
            //处理依赖caster的BUff
            if (buff.Caster == unit)
            {
                RemoveBuff(buff.UID);
            }
        }
    }
Пример #6
0
 /*-----BUFF CALLBACK-----*/
 public void Check(BuffTrigger trigger)
 {
     if(data.trigger == trigger)
         this.Execute();
 }
Пример #7
0
    // buff作用的对象
    // public PurposeObj purposeObject;

    public Buff(/*int id, int creatorId,*/ List <Value> buffValue, BuffTrigger trigger)
    {
        this.trigger   = trigger;
        this.buffValue = buffValue;
    }