Ejemplo n.º 1
0
    public void ApplyEquips(BattleActionTime actionTime)
    {
        List <BattleEquipData> removeList = new List <BattleEquipData>();

        foreach (var equip in this.Data.EquipList)
        {
            for (int i = 0; i < equip.Data.ActionTimes.Count; i++)
            {
                if (equip.Data.ActionTimes[i] == (int)actionTime)
                {
                    ApplyAction(equip.Data.ActionTypes[i], equip.Data.ActionPrarms[i], equip.Data.ActionParams2[i], equip, this, null, equip);
                    //equip.Time--;
                    //if (equip.Time == 0)
                    //{
                    //    removeList.Add(equip);
                    //}
                    //if (equip.Time < 0)
                    //{
                    //    equip.Time = -1;
                    //}
                }
            }
        }
        foreach (var item in removeList)
        {
            this.Data.EquipList.Remove(item);
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 触发buff的时机
    /// </summary>
    /// <param name="playerData"></param>
    /// <param name="actionTime">当前使用特效的时机</param>
    public void ApplyBuffs(BattleActionTime actionTime)
    {
        List <BattleBuffData> removeList = new List <BattleBuffData>();
        bool remove = false;

        foreach (var buff in this.Data.BuffList)
        {
            for (int i = 0; i < buff.Data.ActionTimes.Count; i++)
            {
                if (buff.Data.ActionTimes[i] == (int)actionTime)
                {
                    ApplyAction(buff.Data.ActionTypes[i], buff.Data.ActionParams[i], buff.Data.ActionParams2[i], buff, this, this, buff);
                    if (buff.Layer > 0)
                    {
                        buff.Layer--;
                    }
                    if (buff.Layer == 0)
                    {
                        remove = true;
                    }
                }
            }
            if (actionTime == BattleActionTime.RoundEnd)
            {
                if (buff.Time > 0)
                {
                    buff.Time--;
                }
                if (buff.Time == 0)
                {
                    remove = true;
                }
            }
            if (remove)
            {
                removeList.Add(buff);
                remove = false;
            }
        }

        foreach (var item in removeList)
        {
            this.Data.BuffList.Remove(item);
            Game.BattleManager.AddUIAction(new UIAction.UIRemoveBuff(this, item.BuffId, -1));
        }
    }
Ejemplo n.º 3
0
 /// <summary>
 /// 应用触发效果
 /// </summary>
 public void ApplyTimeEffects(BattleActionTime actionTime)
 {
     ApplyBuffs(actionTime);
     ApplyEquips(actionTime);
 }