Example #1
0
    public void GroundRule2Init()
    {
        double [] d;
        GroundLib gb = GroundScr._instance.groundLib;

        d = gb.ReckonRule2Init();
        if (d != null)
        {
            GameObject[] Enobj = Re_EnemyObj();
            for (int i = 0; i < Enobj.Length; i++)
            {
                if (Enobj[i] != null)
                {
                    Debug.Log("Enobj[" + i + "]" + Enobj[i]);

                    Enobj[i].transform.GetChild(0).GetComponent <EmenyScr>().ChangeDate(d);
                }
            }
            GameObject[] Plaobj = Re_PlayerObj();
            for (int i = 0; i < Plaobj.Length; i++)
            {
                if (Plaobj[i] != null)
                {
                    Debug.Log("Plaobj[" + i + "]" + Plaobj[i]);
                    Plaobj[i].GetComponent <PlayerDate>().ChangeDate(d);
                }
            }
        }
    }
Example #2
0
///<summary>
///	用于合成后改变战斗场景的数据
///</summary>
    public void BmReckon(double[] d)
    {
        Debug.Log("来自BmCardScr的报告:传入的Bm第一位数是 " + d[0]);
        if (d[0] != 0)
        {
            //处理场景影响伤害的部分
            GroundLib gb = GroundScr._instance.groundLib;
            d[0] = gb.ReckonRule1(d);
            int Reckon = (int)d[0];

            if (d[2] == 0)
            {
                PublicFightScr._instance.StarFunction2(Reckon.ToString());
                PublicFightScr._instance.StarFunction("Damaged");
            }
            else if (d[2] == 1)
            {
                DmScr._instance.Dm(Reckon);
            }
            else if (d[2] == 1)
            {
                PublicFightScr._instance.StarFunction("R");
                PublicFightScr._instance.StarFunction2(Reckon.ToString());
            }
        }
        if (d[3] != 0)
        {
            PlayerFightScr._instance.StarFuntion("Cure");
            PlayerFightScr._instance.StarFuntion2(((int)d[3]).ToString());
        }
    }
Example #3
0
    ///<summary>
    /// CheckedPlayer
    /// 目前只用于修改Ui
    ///</summary>
    public void CheckedPlayer()
    {
        if (Player1Speed == 0)   //玩家回合
        {
            Notetext.text = "你的回合";
            IfPlayer      = true;
            if (IfFirst != true)
            {
                GameControoler._instance.SetCardUi(false);
                TestMananger._instance.VisableCard();
            }
            else
            {
                IfFirst = false;
            }
        }

        for (int g = 0; g < Agis.Length; g++)           //敌人回合
        {
            if (Agis[g] == 0)
            {
                Notetext.text = "敌方回合";
                IfPlayer      = false;
            }
        }

        if (BackgroundSpeed == 0)      //背景回合
        {
            //场景
            GroundLib d = GroundScr._instance.groundLib;
            double [] s = d.ReckonRule3();
            Debug.Log("来自收脚本的信息:背景回合取得的数组第一位为 " + s[0]);
            if (s[0] != 0)
            {
                //进入结算的方法
                PulicObjScr._instance.GroundRule3(s);
            }
        }
        if (HelperSpeed == 0)  //帮手回合
        {
            Notetext.text = "帮手回合";
        }
    }
Example #4
0
//----------------------------------------------

    public void GroundRule3(double[] d)
    {
        if (d[0] != 0)
        {
            //执行伤害与受场景Rule1影响的计算
            GroundLib gb = GroundScr._instance.groundLib;
            d[0] = gb.ReckonRule1(d);
            //当第三位数为99时,即为全体无差别伤害
            if (d[2] == 99)
            {
                GameObject[] Enobj = Re_EnemyObj();
                for (int i = 0; i < Enobj.Length; i++)
                {
                    Enobj[i].transform.GetChild(0).GetComponent <EmenyScr>().CountDamaged(true, (int)d[0]);
                }
                GameObject[] Plaobj = Re_PlayerObj();
                for (int i = 0; i < Plaobj.Length; i++)
                {
                    Plaobj[i].GetComponent <PlayerDate>().AttackePlayer((int)d[0]);
                }
            }
        }
    }
Example #5
0
 // Use this for initialization
 void Awake()
 {
     //新建场景数据库的实例
     groundLib = new GroundLib();
 }
Example #6
0
/*
 *      合成调用的方法
 */
    public void jo()
    {
        //首先同步卡牌,因为牌库有可能被洗牌,不过好像洗了牌也不影响
        Library2 = TestCardLibrary._instance.Library0;
        int a = 0;

        // Debug.Log("Card1"+Cardid1+" | Card2:"+Cardid2);
        for (int i = 0; i < Library2.Count; i++)
        {
            //优化
            if (a >= 2)
            {
                a = 0;
                break;
            }
            //获取Damage值和AttacakeType
            if (Library2[i].GetCardid == Cardid1)
            {
                CardDamage1       = Library2[i].GetCardDamage;
                CardAttackeType1  = Library2[i].GetAttcakeType;
                Card1Cure         = Library2[i].GetCardCure;
                Card1Element_Type = Library2[i].GetCardElement_type;

                Debug.Log("CardDamage1:" + CardDamage1);
                a++;
            }
            if (Library2[i].GetCardid == Cardid2)
            {
                CardDamage2       = Library2[i].GetCardDamage;
                CardAttackeType2  = Library2[i].GetAttcakeType;
                Card2Cure         = Library2[i].GetCardCure;
                Card2Element_Type = Library2[i].GetCardElement_type;

                Debug.Log("CardDamage2:" + CardDamage2);
                a++;
            }
            // Debug.Log("Id"+i+":"+Library2[i].GetCardid);
        }



//------------------------------------------------------------

        /*
         *      区别于伤害的治疗
         *      2 - 单体治疗
         *      3 - 群体治疗
         *      需要注意的是治疗卡与其他伤害卡组和依然可以造成伤害
         */
        //单体治疗x单体治疗/单体伤害/群体治疗/群体伤害
        if (CardAttackeType1 == (AttcakeType)2)
        {
            //单体治疗+单体治疗
            if (CardAttackeType2 == (AttcakeType)2)
            {
                CureReckon    = Card1Cure + Card2Cure;
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)0;
            }
            //单体治疗+单体伤害
            if (CardAttackeType2 == (AttcakeType)0)
            {
                CureReckon    = Card1Cure + CardDamage2;
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)0;
            }
            //单体治疗+群体治疗
            if (CardAttackeType2 == (AttcakeType)3)
            {
                float linshiCure = Card1Cure * 0.3f + Card2Cure;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 * 0.3f + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //单体治疗+群体伤害
            if (CardAttackeType2 == (AttcakeType)1)
            {
                float linshiCure = Card1Cure * 0.3f + CardDamage2;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 * 0.3f + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //单体治疗+溅射
            if (CardAttackeType2 == (AttcakeType)4)
            {
                float linshiCure = Card1Cure + CardDamage2 * 0.6f;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 + CardDamage2 * 0.6f;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)4;
            }
        }

        //群体治疗x群体治疗/单体治疗/群体伤害/单体伤害
        if (CardAttackeType1 == (AttcakeType)3)
        {
            //群体治疗+群体治疗
            if (CardAttackeType2 == (AttcakeType)3)
            {
                CureReckon    = Card1Cure + Card2Cure;
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)1;
            }
            //群体治疗+单体治疗
            if (CardAttackeType2 == (AttcakeType)2)
            {
                float linshiCure = Card1Cure + CardDamage2 * 0.3f;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //群体治疗+群体伤害
            if (CardAttackeType2 == (AttcakeType)1)
            {
                CureReckon    = Card1Cure + CardDamage2;
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)1;
            }
            //群体治疗+单体伤害
            if (CardAttackeType2 == (AttcakeType)0)
            {
                float linshiCure = Card1Cure + CardDamage2 * 0.3f;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //群体治疗+溅射
            if (CardAttackeType2 == (AttcakeType)4)
            {
                float linshiCure = Card1Cure + CardDamage2 * 0.5f;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 + CardDamage2 * 0.5f;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)4;
            }
        }

//--------------------------------------------------------------------------



        /*
         *      根据传回类型AttcakeType来确定不同的伤害伤害计算和不同的伤害类别
         *      0 = 单体
         *      1 = 群体
         *      4 = 溅射
         */
        //群体+?
        if (CardAttackeType1 == (AttcakeType)1)
        {
            //群体+单体=A+B*1/3   群体DmScr
            if (CardAttackeType2 == (AttcakeType)0)
            {
                float linshi = CardDamage1 + CardDamage2 * 0.35f;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //群体+群体=A+B   群体DmScr
            if (CardAttackeType2 == (AttcakeType)1)
            {
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)1;
            }
            //群体+溅射=A+B*1/2   群体DmScr
            if (CardAttackeType2 == (AttcakeType)4)
            {
                float linshi = CardDamage1 + CardDamage2 * 0.5f;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //群体+单体治疗
            if (CardAttackeType2 == (AttcakeType)3)
            {
                float linshiCure = Card1Cure + Card2Cure * 0.3f;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 + CardDamage2 * 0.3f;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //群体+群体治疗
            if (CardAttackeType2 == (AttcakeType)3)
            {
                CureReckon    = Card1Cure + Card2Cure;
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)1;
            }
        }
        //单体+?
        if (CardAttackeType1 == (AttcakeType)0)
        {
            //单体+单体=A+B   单体
            if (CardAttackeType2 == (AttcakeType)0)
            {
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)0;
            }
            //单体+群体=A*1/3+B  群体DmScr
            if (CardAttackeType2 == (AttcakeType)1)
            {
                float linshi = CardDamage1 * 0.35f + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //单体+溅射=A*2/3+B  溅射R
            if (CardAttackeType2 == (AttcakeType)4)
            {
                float linshi = CardDamage1 * 0.6f + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)4;
            }
            //单体+单体治疗
            if (CardAttackeType2 == (AttcakeType)2)
            {
                CureReckon    = CardDamage1 + Card2Cure;
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)0;
            }
            //单体+群体治疗
            if (CardAttackeType2 == (AttcakeType)3)
            {
                float linshiCure = CardDamage1 * 0.3f + Card2Cure;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 * 0.3f + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
        }
        //溅射+?
        if (CardAttackeType1 == (AttcakeType)4)
        {
            //溅射+单体=A+B*2/3 溅射R
            if (CardAttackeType2 == (AttcakeType)0)
            {
                float linshi = CardDamage1 + CardDamage2 * 0.6f;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)4;
            }
            //溅射+群体=A*1/2+B 群体DmScr
            if (CardAttackeType2 == (AttcakeType)1)
            {
                float linshi = CardDamage1 * 0.5f + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
            //溅射+溅射=A+B*2/3 溅射R
            if (CardAttackeType2 == (AttcakeType)4)
            {
                Reckon        = CardDamage1 + CardDamage2;
                BmAttackeType = (AttcakeType)4;
            }
            //溅射+单体治疗
            if (CardAttackeType2 == (AttcakeType)2)
            {
                float linishiCure = CardDamage1 + Card1Cure * 0.6f;
                CureReckon = (int)linishiCure;
                float linshi = CardDamage1 + CardDamage2 * 0.6f;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)4;
            }
            //溅射+群体治疗
            if (CardAttackeType2 == (AttcakeType)3)
            {
                float linshiCure = CardDamage1 * 0.5f + Card1Cure;
                CureReckon = (int)linshiCure;
                float linshi = CardDamage1 * 0.5f + CardDamage2;
                Reckon        = (int)linshi;
                BmAttackeType = (AttcakeType)1;
            }
        }
//-----------------------------------------

        /*
         *      执行合成后的属性判断
         *      规则:
         *      第一张卡牌的合成为优先属性,第一张卡片属性是什么后面的卡牌属性就是什么
         */

        if (Card1Element_Type == (Element_type)0 && Card2Element_Type == (Element_type)0)
        {
            BmElementCardType = (Element_type)0;
        }
        else
        {
            BmElementCardType = Card1Element_Type;
        }

//-----------------------------------------



//--------------------------------------------------------------------------

/*
 *      将Reckon传入地形运算脚本
 *      重新给Reckon赋值
 */
        //准备数据传参
        double [] numObj = { Reckon, (double)BmElementCardType, (double)BmAttackeType };

        //新建用于接受 GroundScr 中 场景数据库变量?对象?
        GroundLib gb = GroundScr._instance.groundLib;

        Reckon = gb.ReckonRule1(numObj);


//--------------------------------------------------------------------------


/*
 *      根据上方计算的BmAttackeType结果来使用传参
 */
        //伤害结算
        if (BmAttackeType == (AttcakeType)0)
        {
            PublicFightScr._instance.StarFunction("Damaged");
            PublicFightScr._instance.StarFunction2(Reckon.ToString());
        }
        else if (BmAttackeType == (AttcakeType)1)
        {
            DmScr._instance.Dm(Reckon);
        }
        else if (BmAttackeType == (AttcakeType)4)
        {
            PublicFightScr._instance.StarFunction("R");
            PublicFightScr._instance.StarFunction2(Reckon.ToString());
        }
        //神奇输入↓
        else
        {
            Debug.Log("The AttcakeType is Wrong! 你输入了什么鬼?");
        }
        Debug.Log("jo方法末端 Cure:" + CureReckon);
        //治疗结算↓
        if (CureReckon != 0)
        {
            PlayerFightScr._instance.StarFuntion("Cure");
            PlayerFightScr._instance.StarFuntion2(CureReckon.ToString());
        }

/*
 *      执行 BuffScr 脚本,进行buff计算
 */
        BuffScr._instance.Card1_Buff(Cardid1);
        BuffScr._instance.Card2_Buff(Cardid2);
        BuffScr._instance.ReckonBuff();
        Debug.Log("-------------------");
    }
Example #7
0
 // Use this for initialization
 void Start()
 {
     Library2  = new List <TestCard>();
     groundLib = new GroundLib();
 }