Example #1
0
    public bool getSenpouOnlySeaFlg(int senpouId)
    {
        Entity_senpou_mst senpouMst = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;
        bool onlySeaFlg             = senpouMst.param[senpouId - 1].onlySeaFlg;

        return(onlySeaFlg);
    }
Example #2
0
    public List <string> getSenpouNextLv(int senpouId, int nextLv)
    {
        Entity_senpou_mst     senpouMst     = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;
        Entity_senpouItem_mst senpouItemMst = Resources.Load("Data/senpouItem_mst") as Entity_senpouItem_mst;

        List <string> senpouList = new List <string>();

        //Next Status
        object    senpoulst  = senpouMst.param[senpouId - 1];
        Type      t          = senpoulst.GetType();
        String    param      = "lv" + nextLv;
        FieldInfo f          = t.GetField(param);
        int       nextStatus = (int)f.GetValue(senpoulst);

        //Required Item
        string requiredItemTyp = senpouItemMst.param [nextLv - 1].requiredItemTyp;
        int    requiredItemQty = senpouItemMst.param [nextLv - 1].requiredItemQty;
        int    requiredMoney   = senpouItemMst.param [nextLv - 1].requiredMoney;

        senpouList.Add(nextStatus.ToString());
        senpouList.Add(requiredItemTyp);
        senpouList.Add(requiredItemQty.ToString());
        senpouList.Add(requiredMoney.ToString());

        return(senpouList);
    }
Example #3
0
    public bool getSenpouShipFlg(int senpouId)
    {
        Entity_senpou_mst senpouMst = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;
        bool shipFlg = senpouMst.param[senpouId - 1].shipFlg;

        return(shipFlg);
    }
Example #4
0
    public ArrayList getOriginalSenpou(int busyoInt, bool engunFlg)
    {
        ArrayList senpouArray = new ArrayList();

        Entity_busyo_mst  busyoMst  = Resources.Load("Data/busyo_mst") as Entity_busyo_mst;
        Entity_senpou_mst senpouMst = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;

        //Get Senpou Id
        int senpouId = busyoMst.param[busyoInt - 1].senpou_id;

        //Get Senpou Lv
        String senpouLvTmp = "senpou" + busyoInt;
        int    senpouLv    = PlayerPrefs.GetInt(senpouLvTmp, 1);

        //Get Senpou Status
        object    senpoulst    = senpouMst.param[senpouId - 1];
        Type      t            = senpoulst.GetType();
        String    param        = "lv" + senpouLv;
        FieldInfo f            = t.GetField(param);
        int       senpouStatus = (int)f.GetValue(senpoulst);

        //Contain in Array
        senpouArray.Add(senpouId);
        senpouArray.Add(senpouMst.param[senpouId - 1].typ);
        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            senpouArray.Add(senpouMst.param[senpouId - 1].nameEng);
            senpouArray.Add(senpouMst.param[senpouId - 1].effectionEng);
        }
        else
        {
            senpouArray.Add(senpouMst.param[senpouId - 1].name);
            senpouArray.Add(senpouMst.param[senpouId - 1].effection);
        }
        senpouArray.Add(senpouMst.param[senpouId - 1].each);
        senpouArray.Add(senpouMst.param[senpouId - 1].ratio);
        senpouArray.Add(senpouMst.param[senpouId - 1].term);
        senpouArray.Add(senpouStatus);
        senpouArray.Add(senpouLv);

        return(senpouArray);
    }
Example #5
0
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        audioSources [0].Play();

        string     pathOfBack = "Prefabs/Common/TouchBack";
        GameObject back       = Instantiate(Resources.Load(pathOfBack)) as GameObject;

        back.transform.parent        = GameObject.Find("Panel").transform;
        back.transform.localScale    = new Vector2(1, 1);
        back.transform.localPosition = new Vector2(0, 0);

        string     pathOfPop = "Prefabs/Zukan/busyoPop";
        GameObject pop       = Instantiate(Resources.Load(pathOfPop)) as GameObject;

        pop.transform.parent        = GameObject.Find("Panel").transform;
        pop.transform.localScale    = new Vector2(1, 1);
        pop.transform.localPosition = new Vector2(0, 0);

        //Kamon
        GameObject kamon     = pop.transform.FindChild("kamon").gameObject;
        string     imagePath = "Prefabs/Kamon/MyDaimyoKamon/" + daimyoId.ToString();

        kamon.GetComponent <Image> ().sprite =
            Resources.Load(imagePath, typeof(Sprite)) as Sprite;

        //Busyo Icon
        string     busyoPath = "Prefabs/Player/Unit/BusyoUnit";
        GameObject busyo     = Instantiate(Resources.Load(busyoPath)) as GameObject;

        busyo.name = busyoId.ToString();
        busyo.transform.SetParent(pop.transform);
        busyo.transform.localScale = new Vector2(7, 7);
        busyo.GetComponent <DragHandler>().enabled = false;
        RectTransform busyoRect = busyo.GetComponent <RectTransform>();

        busyoRect.anchoredPosition3D = new Vector3(180, 400, 0);
        busyoRect.sizeDelta          = new Vector2(40, 40);
        busyo.transform.FindChild("Text").GetComponent <Text> ().enabled = false;

        //Ship Rank
        string     shipPath = "Prefabs/Busyo/ShipSts";
        GameObject ShipObj  = Instantiate(Resources.Load(shipPath)) as GameObject;

        ShipObj.transform.SetParent(busyo.transform);
        preKaisen kaisenScript = new preKaisen();
        int       shipId       = kaisenScript.getShipSprite(ShipObj, busyoId);

        ShipObj.transform.localPosition = new Vector3(-10, -15, 0);
        ShipObj.transform.localScale    = new Vector2(0.2f, 0.2f);
        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            if (shipId == 1)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "High";
            }
            else if (shipId == 2)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "Mid";
            }
            else if (shipId == 3)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "Low";
            }
        }
        else
        {
            if (shipId == 1)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "上";
            }
            else if (shipId == 2)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "中";
            }
            else if (shipId == 3)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "下";
            }
        }
        //Name
        GameObject.Find("busyoNameValue").GetComponent <Text> ().text = busyoName;
        string  heisyuName = "";
        Message msg        = new Message();

        if (heisyu == "YR")
        {
            heisyuName = msg.getMessage(56);
        }
        else if (heisyu == "KB")
        {
            heisyuName = msg.getMessage(55);
        }
        else if (heisyu == "YM")
        {
            heisyuName = msg.getMessage(58);
        }
        else if (heisyu == "TP")
        {
            heisyuName = msg.getMessage(57);
        }

        GameObject.Find("ChildNameValue").GetComponent <Text> ().text = heisyuName;
        int newHp = hp * 100;

        GameObject.Find("TosotsuValue").GetComponent <Text> ().text = newHp.ToString();
        int newAtk = atk * 10;

        GameObject.Find("BuyuuValue").GetComponent <Text> ().text = newAtk.ToString();
        int newDfc = dfc * 10;

        GameObject.Find("ChiryakuValue").GetComponent <Text> ().text = newDfc.ToString();
        GameObject.Find("SpeedValue").GetComponent <Text> ().text    = spd.ToString();

        //Senpou
        Entity_senpou_mst senpouMst = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;

        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            GameObject.Find("SenpouValue").GetComponent <Text>().text = senpouMst.param[senpouId - 1].nameEng;
        }
        else
        {
            GameObject.Find("SenpouValue").GetComponent <Text>().text = senpouMst.param[senpouId - 1].name;
        }
        int    senpouStatus = senpouMst.param [senpouId - 1].lv20;
        int    each         = (int)senpouMst.param [senpouId - 1].each;
        int    ratio        = (int)senpouMst.param [senpouId - 1].ratio;
        int    term         = (int)senpouMst.param [senpouId - 1].term;
        string senpouExp    = "";

        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            senpouExp = senpouMst.param [senpouId - 1].effectionEng;
        }
        else
        {
            senpouExp = senpouMst.param[senpouId - 1].effection;
        }

        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            senpouExp = senpouExp.Replace("ABC", senpouStatus.ToString());
            senpouExp = senpouExp.Replace("DEF", each.ToString());
            senpouExp = senpouExp.Replace("GHI", ratio.ToString());
            senpouExp = senpouExp.Replace("JKL", term.ToString());
        }
        else
        {
            senpouExp = senpouExp.Replace("A", senpouStatus.ToString());
            senpouExp = senpouExp.Replace("B", each.ToString());
            senpouExp = senpouExp.Replace("C", ratio.ToString());
            senpouExp = senpouExp.Replace("D", term.ToString());
        }



        GameObject.Find("SenpouExpValue").GetComponent <Text>().text = senpouExp;


        //Saku
        Saku          saku     = new Saku();
        List <string> sakuList = new List <string>();

        sakuList = saku.getSakuInfoLvMax(busyoId);

        string     sakuPath   = "Prefabs/Saku/saku" + sakuList[0];
        GameObject sakuIcon   = Instantiate(Resources.Load(sakuPath)) as GameObject;
        GameObject StatusSaku = GameObject.Find("StatusSaku").gameObject;

        foreach (Transform n in StatusSaku.transform)
        {
            if (n.tag == "Saku")
            {
                GameObject.Destroy(n.gameObject);
            }
        }
        sakuIcon.transform.SetParent(StatusSaku.transform);
        sakuIcon.transform.localScale            = new Vector2(0.85f, 0.85f);
        sakuIcon.GetComponent <Button>().enabled = false;
        RectTransform sakuIcon_transform = sakuIcon.GetComponent <RectTransform>();

        sakuIcon_transform.anchoredPosition = new Vector3(-360, 0, 0);

        StatusSaku.transform.FindChild("SakuExp").transform.FindChild("SakuExpValue").GetComponent <Text>().text = sakuList[2];
    }
Example #6
0
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        audioSources [0].Play();

        //Panel
        GameObject.Find("Touyou").GetComponent <Canvas>().sortingLayerName = "unit";

        //Pop View
        BusyoStatusButton pop   = new BusyoStatusButton();
        GameObject        board = pop.commonPopup(27);

        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            GameObject.Find("popText").GetComponent <Text> ().text = "Samurai Recruitment";
        }
        else
        {
            GameObject.Find("popText").GetComponent <Text>().text = "武将登用";
        }
        //Kamon
        string     kamonPath = "Prefabs/Touyou/kamon";
        GameObject kamon     = Instantiate(Resources.Load(kamonPath)) as GameObject;

        kamon.transform.SetParent(board.transform);
        kamon.transform.localScale    = new Vector2(1, 1);
        kamon.transform.localPosition = new Vector2(-310, 0);
        BusyoInfoGet busyoScript = new BusyoInfoGet();
        int          daimyoId    = busyoScript.getDaimyoId(busyoId);

        if (daimyoId == 0)
        {
            daimyoId = busyoScript.getDaimyoHst(busyoId);
        }
        string imagePath = "Prefabs/Kamon/MyDaimyoKamon/" + daimyoId.ToString();

        kamon.GetComponent <Image> ().sprite =
            Resources.Load(imagePath, typeof(Sprite)) as Sprite;

        //Busyo View
        string     path  = "Prefabs/Player/Unit/BusyoUnit";
        GameObject Busyo = Instantiate(Resources.Load(path)) as GameObject;

        Busyo.name = busyoId.ToString();
        Busyo.transform.SetParent(board.transform);
        Busyo.transform.localScale = new Vector2(3.5f, 3.5f);
        Busyo.GetComponent <DragHandler>().enabled = false;
        RectTransform busyo_transform = Busyo.GetComponent <RectTransform>();

        busyo_transform.anchoredPosition = new Vector3(350, 300, 0);
        busyo_transform.sizeDelta        = new Vector2(100, 100);

        //Ship Rank
        string     shipPath = "Prefabs/Busyo/ShipSts";
        GameObject ShipObj  = Instantiate(Resources.Load(shipPath)) as GameObject;

        ShipObj.transform.SetParent(Busyo.transform);
        preKaisen kaisenScript = new preKaisen();
        int       shipId       = kaisenScript.getShipSprite(ShipObj, busyoId);

        ShipObj.transform.localPosition = new Vector3(-40, -40, 0);
        ShipObj.transform.localScale    = new Vector2(0.5f, 0.5f);
        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            if (shipId == 1)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "High";
            }
            else if (shipId == 2)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "Mid";
            }
            else if (shipId == 3)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "Low";
            }
        }
        else
        {
            if (shipId == 1)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "上";
            }
            else if (shipId == 2)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "中";
            }
            else if (shipId == 3)
            {
                ShipObj.transform.FindChild("Text").GetComponent <Text>().text = "下";
            }
        }


        //Text Modification
        Busyo.transform.FindChild("Text").gameObject.GetComponent <Text>().enabled = false;

        //Rank Text Modification
        GameObject    rank           = Busyo.transform.FindChild("Rank").gameObject;
        RectTransform rank_transform = rank.GetComponent <RectTransform>();

        rank_transform.anchoredPosition     = new Vector3(0, -50, 0);
        rank_transform.sizeDelta            = new Vector2(200, 200);
        rank.GetComponent <Text>().fontSize = 200;

        /*Status*/
        string     statusPath = "Prefabs/Touyou/busyoStatus";
        GameObject status     = Instantiate(Resources.Load(statusPath)) as GameObject;

        status.transform.SetParent(board.transform);
        status.transform.localScale = new Vector2(1, 1);
        RectTransform status_transform = status.GetComponent <RectTransform>();

        status_transform.anchoredPosition = new Vector3(245, -40, 0);


        Entity_busyo_mst  busyoMst  = Resources.Load("Data/busyo_mst") as Entity_busyo_mst;
        Entity_senpou_mst senpouMst = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;
        string            busyoName = busyoScript.getName(busyoId);

        GameObject.Find("busyoNameValue").GetComponent <Text>().text = busyoName;
        GameObject.Find("TosotsuValue").GetComponent <Text>().text   = busyoMst.param [busyoId - 1].minHp.ToString() + "00";
        GameObject.Find("BuyuuValue").GetComponent <Text> ().text    = busyoMst.param [busyoId - 1].minAtk.ToString() + "0";
        GameObject.Find("ChiryakuValue").GetComponent <Text>().text  = busyoMst.param [busyoId - 1].minDfc.ToString() + "0";
        GameObject.Find("SpeedValue").GetComponent <Text>().text     = busyoMst.param [busyoId - 1].minSpd.ToString();

        string  heisyuType = busyoMst.param [busyoId - 1].heisyu;
        string  heisyu     = "";
        Message msg        = new Message();

        if (heisyuType == "KB")
        {
            heisyu = msg.getMessage(55);
        }
        else if (heisyuType == "YR")
        {
            heisyu = msg.getMessage(56);
        }
        else if (heisyuType == "TP")
        {
            heisyu = msg.getMessage(57);
        }
        else if (heisyuType == "YM")
        {
            heisyu = msg.getMessage(58);
        }

        GameObject.Find("ChildNameValue").GetComponent <Text>().text = heisyu;

        int senpouId = busyoMst.param [busyoId - 1].senpou_id;

        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            GameObject.Find("SenpouValue").GetComponent <Text>().text = senpouMst.param[senpouId - 1].nameEng;
        }
        else
        {
            GameObject.Find("SenpouValue").GetComponent <Text>().text = senpouMst.param[senpouId - 1].name;
        }
        int    senpouStatus = senpouMst.param [senpouId - 1].lv1;
        int    each         = (int)senpouMst.param [senpouId - 1].each;
        int    ratio        = (int)senpouMst.param [senpouId - 1].ratio;
        int    term         = (int)senpouMst.param [senpouId - 1].term;
        string senpouExp    = "";

        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            senpouExp = senpouMst.param [senpouId - 1].effectionEng;
        }
        else
        {
            senpouExp = senpouMst.param[senpouId - 1].effection;
        }
        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            senpouExp = senpouExp.Replace("ABC", senpouStatus.ToString());
            senpouExp = senpouExp.Replace("DEF", each.ToString());
            senpouExp = senpouExp.Replace("GHI", ratio.ToString());
            senpouExp = senpouExp.Replace("JKL", term.ToString());
        }
        else
        {
            senpouExp = senpouExp.Replace("A", senpouStatus.ToString());
            senpouExp = senpouExp.Replace("B", each.ToString());
            senpouExp = senpouExp.Replace("C", ratio.ToString());
            senpouExp = senpouExp.Replace("D", term.ToString());
        }
        GameObject.Find("SenpouExpValue").GetComponent <Text>().text = senpouExp;


        /*Saku*/
        Saku          saku     = new Saku();
        List <string> sakuList = new List <string>();

        sakuList = saku.getSakuInfo(busyoId);

        //Icon
        string     sakuPath   = "Prefabs/Saku/saku" + sakuList[0];
        GameObject sakuIcon   = Instantiate(Resources.Load(sakuPath)) as GameObject;
        GameObject StatusSaku = status.transform.FindChild("StatusSaku").gameObject;

        foreach (Transform n in StatusSaku.transform)
        {
            if (n.tag == "Saku")
            {
                GameObject.Destroy(n.gameObject);
            }
        }
        sakuIcon.transform.SetParent(StatusSaku.transform);
        sakuIcon.transform.localScale            = new Vector2(0.7f, 0.7f);
        sakuIcon.GetComponent <Button>().enabled = false;
        RectTransform sakuIcon_transform = sakuIcon.GetComponent <RectTransform>();

        sakuIcon_transform.anchoredPosition = new Vector3(-235, 0, 0);

        StatusSaku.transform.FindChild("SakuExp").transform.FindChild("SakuExpValue").GetComponent <Text>().text = sakuList[2];

        /*daimyo busyo check*/
        Daimyo daimyo = new Daimyo();

        daimyoFlg = daimyo.daimyoBusyoCheck(busyoId);

        //pass data to button
        GameObject touyouBtn = GameObject.Find("TouyouButton").gameObject;

        touyouBtn.GetComponent <DoTouyou> ().busyoId   = busyoId;
        touyouBtn.GetComponent <DoTouyou> ().busyoName = busyoName;
        touyouBtn.GetComponent <DoTouyou> ().heisyu    = heisyuType;
        touyouBtn.GetComponent <DoTouyou> ().sequence  = int.Parse(name);
        touyouBtn.GetComponent <DoTouyou> ().rank      = busyoRank;
        touyouBtn.GetComponent <DoTouyou> ().daimyoFlg = daimyoFlg;


        //Tutorial
        if (Application.loadedLevelName == "tutorialTouyou")
        {
            TutorialController tutorialScript = new TutorialController();
            Vector2            vect           = new Vector2(0, 50);
            GameObject         btn            = tutorialScript.SetPointer(touyouBtn, vect);
            btn.transform.localScale = new Vector2(150, 150);
        }

        //Hired Check
        if (Application.loadedLevelName != "tutorialTouyou")
        {
            string myBusyo        = PlayerPrefs.GetString("myBusyo");
            char[] delimiterChars = { ',' };

            if (myBusyo != null && myBusyo != "")
            {
                List <string> myBusyoList = new List <string>();
                if (myBusyo.Contains(","))
                {
                    myBusyoList = new List <string>(myBusyo.Split(delimiterChars));
                }
                else
                {
                    myBusyoList.Add(myBusyo);
                }

                if (myBusyoList.Contains(busyoId.ToString()))
                {
                    msg.makeMessage(msg.getMessage(137));
                }
            }
            //Zukan Check
            string zukanBusyoHst = PlayerPrefs.GetString("zukanBusyoHst");
            if (zukanBusyoHst != null && zukanBusyoHst != "")
            {
                List <string> myZukanList = new List <string>();
                if (zukanBusyoHst.Contains(","))
                {
                    myZukanList = new List <string>(zukanBusyoHst.Split(delimiterChars));
                }
                else
                {
                    myZukanList.Add(zukanBusyoHst);
                }

                if (myZukanList.Contains(busyoId.ToString()))
                {
                    string     zukanPath = "Prefabs/Touyou/Zukan";
                    GameObject zukan     = Instantiate(Resources.Load(zukanPath)) as GameObject;
                    zukan.transform.SetParent(board.transform);
                    zukan.transform.localScale    = new Vector2(1, 1);
                    zukan.transform.localPosition = new Vector2(-41, 167);
                }
            }
        }
    }
Example #7
0
    public ArrayList getEnemySenpou(int busyoId, int senpouLv, string kahouList)
    {
        ArrayList senpouArray = new ArrayList();

        Entity_busyo_mst  busyoMst  = Resources.Load("Data/busyo_mst") as Entity_busyo_mst;
        Entity_senpou_mst senpouMst = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;

        if (senpouLv < 1)
        {
            senpouLv = 1;
        }
        //Get Senpou Id
        int senpouId = busyoMst.param [busyoId - 1].senpou_id;
        //Get Senpou Status
        object    senpoulst    = senpouMst.param[senpouId - 1];
        Type      t            = senpoulst.GetType();
        String    param        = "lv" + senpouLv;
        FieldInfo f            = t.GetField(param);
        int       senpouStatus = (int)f.GetValue(senpoulst);

        bool pvpFlg = false;

        if (GameObject.Find("GameScene").GetComponent <GameScene>())
        {
            pvpFlg = GameObject.Find("GameScene").GetComponent <GameScene>().pvpFlg;
        }
        if (pvpFlg)
        {
            //Kahou Adjustment
            char[]   delimiterChars = { ',' };
            string[] busyoKahouList = kahouList.Split(delimiterChars);

            Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst;
            for (int i = 0; i < busyoKahouList.Length; i++)
            {
                if (i == 6)
                {
                    int kahouId = int.Parse(busyoKahouList[i]);
                    if (kahouId != 0)
                    {
                        float calcSenpou = ((float)senpouStatus * (float)Mst.param[kahouId - 1].kahouEffect) / 100;
                        senpouStatus = Mathf.CeilToInt((float)senpouStatus + calcSenpou);
                    }
                }
            }
        }

        //Contain in Array
        senpouArray.Add(senpouId);
        senpouArray.Add(senpouMst.param[senpouId - 1].typ);
        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            senpouArray.Add(senpouMst.param[senpouId - 1].nameEng);
            senpouArray.Add(senpouMst.param[senpouId - 1].effectionEng);
        }
        else
        {
            senpouArray.Add(senpouMst.param[senpouId - 1].name);
            senpouArray.Add(senpouMst.param[senpouId - 1].effection);
        }
        senpouArray.Add(senpouMst.param[senpouId - 1].each);
        senpouArray.Add(senpouMst.param[senpouId - 1].ratio);
        senpouArray.Add(senpouMst.param[senpouId - 1].term);
        senpouArray.Add(senpouStatus);
        senpouArray.Add(senpouLv);

        return(senpouArray);
    }
Example #8
0
    public ArrayList getSenpou(int busyoInt, bool engunFlg)
    {
        ArrayList senpouArray = new ArrayList();

        Entity_busyo_mst  busyoMst  = Resources.Load("Data/busyo_mst") as Entity_busyo_mst;
        Entity_senpou_mst senpouMst = Resources.Load("Data/senpou_mst") as Entity_senpou_mst;

        //Get Senpou Id
        int senpouId = busyoMst.param [busyoInt - 1].senpou_id;

        //Get Senpou Lv
        String senpouLvTmp = "senpou" + busyoInt;
        int    senpouLv    = PlayerPrefs.GetInt(senpouLvTmp, 1);

        if (senpouLv > 20)
        {
            senpouLv = 20;
            PlayerPrefs.SetInt(senpouLvTmp, senpouLv);
            PlayerPrefs.Flush();
        }

        //Get Senpou Status
        object    senpoulst    = senpouMst.param[senpouId - 1];
        Type      t            = senpoulst.GetType();
        String    param        = "lv" + senpouLv;
        FieldInfo f            = t.GetField(param);
        int       senpouStatus = (int)f.GetValue(senpoulst);

        if (Application.loadedLevelName != "touyou" && Application.loadedLevelName != "tutorialTouyou" && !engunFlg)
        {
            //Kahou Adjustment
            string   kahouTemp      = "kahou" + busyoInt;
            string   busyoKahou     = PlayerPrefs.GetString(kahouTemp);
            char[]   delimiterChars = { ',' };
            string[] busyoKahouList = busyoKahou.Split(delimiterChars);

            Entity_kahou_heihousyo_mst Mst = Resources.Load("Data/kahou_heihousyo_mst") as Entity_kahou_heihousyo_mst;
            for (int i = 0; i < busyoKahouList.Length; i++)
            {
                if (i == 6)
                {
                    int kahouId = int.Parse(busyoKahouList[i]);
                    if (kahouId != 0)
                    {
                        //Senpou
                        float calcSenpou = ((float)senpouStatus * (float)Mst.param[kahouId - 1].kahouEffect) / 100;
                        senpouStatus = Mathf.CeilToInt((float)senpouStatus + calcSenpou);
                    }
                }
            }
        }

        //Contain in Array
        senpouArray.Add(senpouId);
        senpouArray.Add(senpouMst.param[senpouId - 1].typ);
        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            senpouArray.Add(senpouMst.param[senpouId - 1].nameEng);
            senpouArray.Add(senpouMst.param[senpouId - 1].effectionEng);
        }
        else
        {
            senpouArray.Add(senpouMst.param[senpouId - 1].name);
            senpouArray.Add(senpouMst.param[senpouId - 1].effection);
        }
        senpouArray.Add(senpouMst.param[senpouId - 1].each);
        senpouArray.Add(senpouMst.param[senpouId - 1].ratio);
        senpouArray.Add(senpouMst.param[senpouId - 1].term);
        senpouArray.Add(senpouStatus);
        senpouArray.Add(senpouLv);

        return(senpouArray);
    }