Beispiel #1
0
    public void AddBuff(int buffID, int buffLevel, int buffTurn)
    {
        StrBuffInfo buff;

        if (GetBuffLevel(buffID) > 0)
        {
            BuffList.Param buffParam = Excel <BuffList> .Item.list.Find(o => o.BuffID == buffID);

            if (buffParam.CumulativeFlag > 1)
            {
                int index = buffs.FindIndex(o => o.ID == buffID);
                buff         = buffs[index];
                buff.Turn    = buffTurn;
                buff.Level  += 1;
                buffs[index] = buff;
                return;
            }
            CureBuff(buffID);
        }
        buff       = new StrBuffInfo();
        buff.ID    = buffID;
        buff.Level = buffLevel;
        buff.Turn  = buffTurn;
        buffs.Add(buff);
    }
Beispiel #2
0
    public IEnumerator CheckBuff()
    {
        Debug.Log(data.name + "CheckBuff");
        if (IsDead())
        {
            yield break;
        }
        charaButton.GetComponent <Image>().color = Color.white;
        Debug.Log(buffs.Count);
        for (int i = 0; i < buffs.Count; ++i)
        {
            StrBuffInfo buffInfo  = buffs[i];
            int         buffLevel = buffInfo.Level;
            buffInfo.Turn -= 1;
            int buffTurn = buffInfo.Turn;
            buffs[i] = buffInfo;
            Debug.Log(buffs[i].Turn);
            //Debug.Log( + "さんの" + buffInfo.ID + "バフ(LV:" + buffLevel + ") あと" + buffTurn);

            if (buffInfo.ID == BUFF_BLIZZARD)
            {
                StrAttack attack = CreateAttack();
                attack.pow    = 10 + buffInfo.Level * 5;
                attack.target = Chara.TARGET_ALL;
                attack.type   = ATK_TYPE_MAGIC;
                BattleManager.I.PopMana(tag, 0, 3, 0, 0, 0);
                BattleManager.I.Attack(attack);
                BattleManager.I.StartCoroutine("SkillMessage", "氷嵐");
                AddBuff(BUFF_WAIT, 1, 1);
                yield return(new WaitForSeconds(1));
            }

            if (buffInfo.ID == BUFF_REGENERATION)
            {
                Heal(buffLevel * 10, false);
                yield return(new WaitForSeconds(1));
            }

            if (buffInfo.ID == BUFF_POISON)
            {
                StrAttack attack = CreateAttack();
                attack.pow  = GetBuffLevel(BUFF_POISON) * 5;
                attack.type = ATK_TYPE_SPECIAL;
                Damage(attack);
                yield return(new WaitForSeconds(1));
            }

            if (buffTurn <= 0)
            {
                if (buffInfo.ID == BUFF_ROCK)
                {
                    AddBuff(BUFF_WAIT, 1, 2);
                    Sound.I.PlaySound("Heli");
                    yield return(new WaitForSeconds(1));
                }
            }
        }
        CureBuffAuto();
    }