Пример #1
0
    public void playerEngunInstance(string playerEngunList, float mntMinusRatio, float seaMinusRatio, float rainMinusRatio, float snowMinusRatio)
    {
        List <string> daimyoEnguniList = new List <string> ();

        char[] delimiterChars  = { ':' };
        char[] delimiterChars2 = { '-' };
        if (playerEngunList.Contains(":"))
        {
            daimyoEnguniList = new List <string> (playerEngunList.Split(delimiterChars));
        }
        else
        {
            daimyoEnguniList.Add(playerEngunList);
        }

        for (int i = 0; i < daimyoEnguniList.Count; i++)
        {
            StatusGet     sts = new StatusGet();
            string        daimyoEngunString = daimyoEnguniList[i];
            List <string> unitEnguniList    = new List <string> ();
            unitEnguniList = new List <string> (daimyoEngunString.Split(delimiterChars2));
            int    busyoId = int.Parse(unitEnguniList[1]);
            string heisyu  = sts.getHeisyu(busyoId);

            if (busyoId != 0)
            {
                int busyoLv  = int.Parse(unitEnguniList[2]);
                int butaiQty = int.Parse(unitEnguniList[3]);
                int butaiLv  = int.Parse(unitEnguniList[4]);


                int       hp          = sts.getHp(busyoId, busyoLv);
                int       atk         = sts.getAtk(busyoId, busyoLv);
                int       dfc         = sts.getDfc(busyoId, busyoLv);
                int       spd         = sts.getSpd(busyoId, busyoLv);
                string    busyoName   = sts.getBusyoName(busyoId);
                ArrayList senpouArray = sts.getSenpou(busyoId, true);

                if (mntMinusRatio != 0)
                {
                    if (heisyu == "KB")
                    {
                        float tmp = (float)spd * mntMinusRatio;
                        if (tmp < 1)
                        {
                            tmp = 1;
                        }
                        spd = Mathf.FloorToInt(tmp);
                    }
                }
                else if (seaMinusRatio != 0)
                {
                    if (heisyu == "TP")
                    {
                        float tmp = (float)dfc * seaMinusRatio;
                        if (tmp < 1)
                        {
                            tmp = 1;
                        }
                        dfc = Mathf.FloorToInt(tmp);
                    }
                    else if (heisyu == "YM")
                    {
                        float tmp = (float)dfc * seaMinusRatio;
                        if (tmp < 1)
                        {
                            tmp = 1;
                        }
                        dfc = Mathf.FloorToInt(tmp);
                    }
                }
                if (rainMinusRatio != 0)
                {
                    if (heisyu == "TP")
                    {
                        float tmp = (float)atk * rainMinusRatio;
                        if (tmp < 1)
                        {
                            tmp = 1;
                        }
                        atk = Mathf.FloorToInt(tmp);
                    }
                    else if (heisyu == "YM")
                    {
                        float tmp = (float)atk * rainMinusRatio;
                        if (tmp < 1)
                        {
                            tmp = 1;
                        }
                        atk = Mathf.FloorToInt(tmp);
                    }
                }
                else if (snowMinusRatio != 0)
                {
                    float tmp = (float)spd * 0.5f;
                    if (tmp < 1)
                    {
                        tmp = 1;
                    }
                    spd = Mathf.FloorToInt(tmp);

                    if (heisyu == "TP")
                    {
                        float tmp2 = (float)atk * snowMinusRatio;
                        if (tmp2 < 1)
                        {
                            tmp2 = 1;
                        }
                        atk = Mathf.FloorToInt(tmp2);
                    }
                    else if (heisyu == "YM")
                    {
                        float tmp2 = (float)atk * snowMinusRatio;
                        if (tmp2 < 1)
                        {
                            tmp2 = 1;
                        }
                        atk = Mathf.FloorToInt(tmp2);
                    }
                    else if (heisyu == "KB")
                    {
                        float tmp2 = (float)dfc * snowMinusRatio;
                        if (tmp2 < 1)
                        {
                            tmp2 = 1;
                        }
                        dfc = Mathf.FloorToInt(tmp2);
                    }
                }

                //View Object & pass status to it.
                PlayerInstance inst = new PlayerInstance();
                if (Application.loadedLevelName != "kaisen")
                {
                    inst.makeEngunInstance(busyoId, hp, atk, dfc, spd, senpouArray, busyoName, butaiQty, butaiLv);
                }
                else
                {
                    BusyoInfoGet busyoScript = new BusyoInfoGet();
                    int          shipId      = busyoScript.getShipId(busyoId);
                    inst.makeKaisenInstance(busyoId, shipId, 25, hp, atk, dfc, spd, senpouArray, busyoName, butaiQty, butaiLv, true, butaiQty, butaiLv);
                }
            }
        }

        //auto check
        if (GameObject.Find("AutoBtn"))
        {
            if (GameObject.Find("AutoBtn").GetComponent <AutoAttack>().onFlg)
            {
                AutoAttack autoScript = new AutoAttack();
                autoScript.changeAutoScript();
            }
        }

        Message msg = new Message();

        msg.makeKassenMessage(msg.getMessage(130));
    }