示例#1
0
文件: Skill.cs 项目: wxz97121/SSRD
    //三倍伤害
    public void TBD(string str, Character Char)
    {
//        Debug.Log("TBD");

        Buff_tripledamage buff = new Buff_tripledamage();

        buff.BuffAdded(Char, str);
    }
示例#2
0
    public override void BuffAdded(Character p_chara, string str = "")
    {
        string[] InstancedEffstr = str.Split('&');

        foreach (string s in InstancedEffstr)
        {
            switch (s.Split(':')[0])
            {
            case ("count"):
                maxMultiCount = int.Parse(s.Split(':')[1]);
                break;

            case ("multi"):

                attackMulti = int.Parse(s.Split(':')[1]);
                break;

            case ("cancel"):
                isAttackedCancel = true;
                break;
            }
        }



        Player.Instance.spec.transform.localScale = new Vector3(0.0195f, 0.0195f, 0.0195f);

        m_name      = "tripledamage";
        remainBeats = -1;

        //角色身上已经有本BUFF的情况,进行叠层
        //Buff_tripledamage oldbuff = p_chara.buffs.FindLast(b => b.m_name == "tripledamage") as Buff_tripledamage;
        Buff_tripledamage oldbuff = p_chara.buffs.FindLast(b => b.GetType() == typeof(Buff_tripledamage)) as Buff_tripledamage;

        if (oldbuff != null)
        {
            //如果层数已满,则什么都不发生
            if (oldbuff.multicount >= maxMultiCount)
            {
                //p_chara.Hit(3);
                //p_chara.buffs.Remove(oldbuff);
                return;
            }

            oldbuff.multicount++;
            oldbuff.damageMulti += attackMulti;

            Player.Instance.spec.gameObject.SetActive(true);
            switch (oldbuff.multicount)
            {
            case 1:
                Player.Instance.spec._specDictionary["SpecTripledamage"].colorMax = Player.Instance.spec.MaxColor1;
                Player.Instance.spec._specDictionary["SpecTripledamage"].colorMin = Player.Instance.spec.MinColor1;


                break;

            case 2:
                Player.Instance.spec._specDictionary["SpecTripledamage"].colorMax = Player.Instance.spec.MaxColor2;
                Player.Instance.spec._specDictionary["SpecTripledamage"].colorMin = Player.Instance.spec.MinColor2;

                break;

            case 3:
                Player.Instance.spec._specDictionary["SpecTripledamage"].colorMax = Player.Instance.spec.MaxColor3;
                Player.Instance.spec._specDictionary["SpecTripledamage"].colorMin = Player.Instance.spec.MinColor3;
                break;
            }
            Player.Instance.spec._specDictionary["SpecTripledamage"].RebuildSpectrum();
            Player.Instance.spec._specDictionary["SpecTripledamage"].isEnabled = true;
            Debug.Log("双倍伤害叠加:" + oldbuff.multicount + "," + oldbuff.damageMulti);
            return;
        }

        base.BuffAdded(p_chara, str);


        multicount  = 1;
        damageMulti = attackMulti;
        Debug.Log("双倍伤害叠加:1,3");


        Player.Instance.spec._specDictionary["SpecTripledamage"].colorMax = Player.Instance.spec.MaxColor1;
        Player.Instance.spec._specDictionary["SpecTripledamage"].colorMin = Player.Instance.spec.MinColor1;

        Player.Instance.spec._specDictionary["SpecTripledamage"].RebuildSpectrum();
        Player.Instance.spec._specDictionary["SpecTripledamage"].isEnabled = true;
    }