Ejemplo n.º 1
0
	public void OnClick(){

		string Text = "";
		Kahou kahou = new Kahou ();

		if (!isNanbansenFlg) {
			Text = "贈り物を受け取りました。";

			if (itemCd == "money") {
				//Money
				int nowMoney = PlayerPrefs.GetInt ("money");
				nowMoney = nowMoney + itemQty;
				PlayerPrefs.SetInt ("money", nowMoney);

				
				//Label
				Text nowMoneyLabelText = GameObject.Find ("MoneyValue").GetComponent<Text> ();
				int nowMoneyLabel = int.Parse (nowMoneyLabelText.text) + itemQty;
				nowMoneyLabelText.text = nowMoneyLabel.ToString ();

			} else if (itemCd == "hyourou") {
				//Hyourou

				//Check
				int maxHyourou = PlayerPrefs.GetInt ("hyourouMax");
				int nowHyourou = PlayerPrefs.GetInt ("hyourou");
				nowHyourou = nowHyourou + itemQty;

				if (maxHyourou <= nowHyourou) {
					nowHyourou = maxHyourou;
					PlayerPrefs.SetInt ("hyourou", nowHyourou);

					Text = "兵糧はこれ以上受け取れませんぞ。";

					//Label
					Text nowHyourouLabelText = GameObject.Find ("HyourouCurrentValue").GetComponent<Text> ();
					nowHyourouLabelText.text = nowHyourou.ToString ();

				} else {

					PlayerPrefs.SetInt ("hyourou", nowHyourou);

					//Label
					Text nowHyourouLabelText = GameObject.Find ("HyourouCurrentValue").GetComponent<Text> ();
					nowHyourouLabelText.text = nowHyourou.ToString ();

				}
			} else if (itemCd == "kengou") {

				string kengouString = PlayerPrefs.GetString ("kengouItem");
				List<string> kengouList = new List<string> ();
				char[] delimiterChars = {','};
				kengouList = new List<string> (kengouString.Split (delimiterChars));

				string qty = kengouList [itemId - 1];
				int newQty = int.Parse (qty) + itemQty;
				kengouList [itemId - 1] = newQty.ToString ();

				string newKengouString = "";
				for (int i=0; i<kengouList.Count; i++) {

					if (i == 0) {
						newKengouString = kengouList [i];
					} else {
						newKengouString = newKengouString + "," + kengouList [i];
					}
				}

				PlayerPrefs.SetString ("kengouItem", newKengouString);


			} else if (itemCd == "gokui") {
				string gokuiString = PlayerPrefs.GetString ("gokuiItem");
				List<string> gokuiList = new List<string> ();
				char[] delimiterChars = {','};
				gokuiList = new List<string> (gokuiString.Split (delimiterChars));
				
				string qty = gokuiList [itemId - 1];
				int newQty = int.Parse (qty) + itemQty;
				gokuiList [itemId - 1] = newQty.ToString ();
				
				string newGokuiString = "";
				for (int i=0; i<gokuiList.Count; i++) {
					
					if (i == 0) {
						newGokuiString = gokuiList [i];
					} else {
						newGokuiString = newGokuiString + "," + gokuiList [i];
					}
				}
				
				PlayerPrefs.SetString ("gokuiItem", newGokuiString);
			
			
			} else if (itemCd == "CyouheiTP") {

				registerTP();

			} else if (itemCd.Contains ("nanban")) {
				registerNanban();

			} else if (itemCd == "bugu") {
				kahou.registerBugu (itemId);
			} else if (itemCd == "gusoku") {
				kahou.registerGusoku (itemId);
			} else if (itemCd == "kabuto") {
				kahou.registerKabuto (itemId);
			} else if (itemCd == "meiba") {
				kahou.registerMeiba (itemId);
			} else if (itemCd == "cyadougu") {
				kahou.registerCyadougu (itemId);
			} else if (itemCd == "chishikisyo") {
				kahou.registerChishikisyo (itemId);
			} else if(itemCd == "heihousyo"){
				kahou.registerHeihousyo (itemId);

			}else if(itemCd == "cyoutei"||itemCd == "koueki"){
				registerKouekiOrCyoutei(itemCd, itemId);
			}

			PlayerPrefs.Flush ();

			//Delete Tap Button
			Destroy (popButton);
		
		} else {
			//Nanbansen
			if(moneyCheckFlg){

				//Money Handling
				int money = PlayerPrefs.GetInt ("money");
				money = money - paiedMoney;
				PlayerPrefs.SetInt ("money",money);
				PlayerPrefs.Flush();
				GameObject.Find("MoneyValue").GetComponent<Text>().text = money.ToString();
				
				//Fadeout & Button false
				shipObj.GetComponent<FadeoutImage>().enabled = true;
				shipObj.GetComponent<Button>().enabled = false;

				//nanbansen flg change
				GameObject.Find("NaiseiController").GetComponent<NaiseiController>().isNanbansenFlg = false;

				//Register Item
				if(itemCd.Contains("CyouheiTP")){
					registerTP();
				}else if(itemCd.Contains("nanban")){
					registerNanban();
				} else if (itemCd == "bugu") {
					kahou.registerBugu (itemId);
				} else if (itemCd == "gusoku") {
					kahou.registerGusoku (itemId);
				} else if (itemCd == "kabuto") {
					kahou.registerKabuto (itemId);
				} else if (itemCd == "meiba") {
					kahou.registerMeiba (itemId);
				} else if (itemCd == "cyadougu") {
					kahou.registerCyadougu (itemId);
				} else if (itemCd == "chishikisyo") {
					kahou.registerChishikisyo (itemId);
				}

				Text = "有リ難ウゴゼマス。\tマタオ願イシマス。";
			}else{		
				Text = "金ガ足リナイヨウデスヨ。\tマタオ願イシマス。";
			}
		}

		//Message
		Message msg = new Message(); 
		msg.makeMessage(Text);

		//Close
		GameObject.Find ("close").GetComponent<CloseBoard> ().onClick ();

	}
Ejemplo n.º 2
0
	public void OnClick(){

		if (name == "DoKahouButton") {

			reduceActionQty ();

			int money = PlayerPrefs.GetInt ("money");
			int paiedMoney = int.Parse (Money.GetComponent<Text> ().text);
			Message msg = new Message ();
			Kahou kahou = new Kahou ();

			if (paiedMoney <= money) {

				//reduce money
				int calc = money - paiedMoney;
				PlayerPrefs.SetInt ("money", calc);
				PlayerPrefs.Flush ();
				GameObject.Find ("MoneyValue").GetComponent<Text> ().text = calc.ToString ();

				if (kahouCd == "bugu") {
					kahou.registerBugu (kahouId);
				} else if (kahouCd == "gusoku") {
					kahou.registerGusoku (kahouId);
				} else if (kahouCd == "kabuto") {
					kahou.registerKabuto (kahouId);
				} else if (kahouCd == "meiba") {
					kahou.registerMeiba (kahouId);
				} else if (kahouCd == "cyadougu") {
					kahou.registerCyadougu (kahouId);
				} else if (kahouCd == "chishikisyo") {
					kahou.registerChishikisyo (kahouId);
				} else if (kahouCd == "heihousyo") {
					kahou.registerHeihousyo (kahouId);					
				}

				msg.makeMessage ("御屋形様、家宝を手に入れましたぞ。");

				//Close
				GameObject.Find ("MenuKahou").transform.FindChild ("Close").GetComponent<CloseMenu> ().OnClick ();

				Color enableImageColor = new Color (35f / 255f, 35f / 255f, 35f / 255f, 155f / 255f);
				Color enableTextColor = new Color (125f / 255f, 125f / 255f, 125f / 255f, 255f / 255f);
				

				GameObject btn = GameObject.Find ("SyouninBoard").transform.FindChild ("Kahou").gameObject;
				btn.GetComponent<Button> ().enabled = false;
				btn.GetComponent<Image> ().color = enableImageColor;
				btn.transform.FindChild ("Text").GetComponent<Text> ().color = enableTextColor;


			} else {
				msg.makeMessage ("御屋形様、金が不足しておりますぞ。");
			}


		} else if (name == "DoBusshiButton") {
			
			reduceActionQty ();

			int money = PlayerPrefs.GetInt ("money");
			int paiedMoney = int.Parse (Money.GetComponent<Text> ().text);
			Message msg = new Message ();

			if (paiedMoney <= money) {
				
				//reduce money
				int calc = money - paiedMoney;
				PlayerPrefs.SetInt ("money", calc);
				PlayerPrefs.Flush ();
				GameObject.Find ("MoneyValue").GetComponent<Text> ().text = calc.ToString ();
				char[] delimiterChars = {','};

				if (busshiCd.Contains ("Cyouhei") == true) {
					if (busshiCd.Contains ("YR") == true) {
						string cyouheiYRString = PlayerPrefs.GetString ("cyouheiYR");

						string[] cyouheiYR_list = cyouheiYRString.Split (delimiterChars);
						string newCyouheiYRString = "";
						
						if (busshiCd == "CyouheiYR1") {
							int newQty = 0;
							newQty = int.Parse (cyouheiYR_list [0]) + busshiQty;
							newCyouheiYRString = newQty.ToString () + "," + cyouheiYR_list [1] + "," + cyouheiYR_list [2];
							
						} else if (busshiCd == "CyouheiYR2") {
							int newQty = 0;
							newQty = int.Parse (cyouheiYR_list [1]) + busshiQty;
							newCyouheiYRString = cyouheiYR_list [0] + "," + newQty.ToString () + "," + cyouheiYR_list [2];
							
						} else if (busshiCd == "CyouheiYR3") {
							int newQty = 0;
							newQty = int.Parse (cyouheiYR_list [2]) + busshiQty;
							newCyouheiYRString = cyouheiYR_list [0] + "," + cyouheiYR_list [1] + "," + newQty.ToString ();
							
						}
						PlayerPrefs.SetString ("cyouheiYR", newCyouheiYRString);
						
					} else if (busshiCd.Contains ("KB") == true) {
						string cyouheiKBString = PlayerPrefs.GetString ("cyouheiKB");
						string[] cyouheiKB_list = cyouheiKBString.Split (delimiterChars);
						string newCyouheiKBString = "";
						
						if (busshiCd == "CyouheiKB1") {
							int newQty = 0;
							newQty = int.Parse (cyouheiKB_list [0]) + busshiQty;
							newCyouheiKBString = newQty.ToString () + "," + cyouheiKB_list [1] + "," + cyouheiKB_list [2];
							
							
						} else if (busshiCd == "CyouheiKB2") {
							int newQty = 0;
							newQty = int.Parse (cyouheiKB_list [1]) + busshiQty;
							newCyouheiKBString = cyouheiKB_list [0] + "," + newQty.ToString () + "," + cyouheiKB_list [2];
							
						} else if (busshiCd == "CyouheiKB3") {
							int newQty = 0;
							newQty = int.Parse (cyouheiKB_list [2]) + busshiQty;
							newCyouheiKBString = cyouheiKB_list [0] + "," + cyouheiKB_list [1] + "," + newQty.ToString ();
							
						}
						PlayerPrefs.SetString ("cyouheiKB", newCyouheiKBString);
						
					} else if (busshiCd.Contains ("TP") == true) {
						string cyouheiTPString = PlayerPrefs.GetString ("cyouheiTP");
						string[] cyouheiTP_list = cyouheiTPString.Split (delimiterChars);
						string newCyouheiTPString = "";
						
						if (busshiCd == "CyouheiTP1") {
							int newQty = 0;
							newQty = int.Parse (cyouheiTP_list [0]) + busshiQty;
							newCyouheiTPString = newQty.ToString () + "," + cyouheiTP_list [1] + "," + cyouheiTP_list [2];
							
							
						} else if (busshiCd == "CyouheiTP2") {
							int newQty = 0;
							newQty = int.Parse (cyouheiTP_list [1]) + busshiQty;
							newCyouheiTPString = cyouheiTP_list [0] + "," + newQty.ToString () + "," + cyouheiTP_list [2];
							
						} else if (busshiCd == "CyouheiTP3") {
							int newQty = 0;
							newQty = int.Parse (cyouheiTP_list [2]) + busshiQty;
							newCyouheiTPString = cyouheiTP_list [0] + "," + cyouheiTP_list [1] + "," + newQty.ToString ();
							
						}
						PlayerPrefs.SetString ("cyouheiTP", newCyouheiTPString);
						
					} else if (busshiCd.Contains ("YM") == true) {
						string cyouheiYMString = PlayerPrefs.GetString ("cyouheiYM");
						string[] cyouheiYM_list = cyouheiYMString.Split (delimiterChars);
						string newCyouheiYMString = "";
						
						if (busshiCd == "CyouheiYM1") {
							int newQty = 0;
							newQty = int.Parse (cyouheiYM_list [0]) + busshiQty;
							newCyouheiYMString = newQty.ToString () + "," + cyouheiYM_list [1] + "," + cyouheiYM_list [2];
							
							
						} else if (busshiCd == "CyouheiYM2") {
							int newQty = 0;
							newQty = int.Parse (cyouheiYM_list [1]) + busshiQty;
							newCyouheiYMString = cyouheiYM_list [0] + "," + newQty.ToString () + "," + cyouheiYM_list [2];
							
						} else if (busshiCd == "CyouheiYM3") {
							int newQty = 0;
							newQty = int.Parse (cyouheiYM_list [2]) + busshiQty;
							newCyouheiYMString = cyouheiYM_list [0] + "," + cyouheiYM_list [1] + "," + newQty.ToString ();
							
						}
						PlayerPrefs.SetString ("cyouheiYM", newCyouheiYMString);
					}

				} else if (busshiCd.Contains ("Shinobi") == true) {
					if (busshiCd == "Shinobi1") {
						int newQty = 0;
						int shinobiQty = PlayerPrefs.GetInt ("shinobiGe");
						newQty = shinobiQty + busshiQty;
						PlayerPrefs.SetInt ("shinobiGe", newQty);
						
					} else if (busshiCd == "Shinobi2") {
						int newQty = 0;
						int shinobiQty = PlayerPrefs.GetInt ("shinobiCyu");
						newQty = shinobiQty + busshiQty;
						PlayerPrefs.SetInt ("shinobiCyu", newQty);
						
					} else if (busshiCd == "Shinobi3") {
						int newQty = 0;
						int shinobiQty = PlayerPrefs.GetInt ("shinobiJyo");
						newQty = shinobiQty + busshiQty;
						PlayerPrefs.SetInt ("shinobiJyo", newQty);
						
					}
					
				}
				PlayerPrefs.Flush ();


				
				msg.makeMessage ("御屋形様、物資を手に入れましたぞ。");
				
				//Close
				GameObject.Find ("MenuBusshi").transform.FindChild ("Close").GetComponent<CloseMenu> ().OnClick ();
				
				Color enableImageColor = new Color (35f / 255f, 35f / 255f, 35f / 255f, 155f / 255f);
				Color enableTextColor = new Color (125f / 255f, 125f / 255f, 125f / 255f, 255f / 255f);
				
				
				GameObject btn = GameObject.Find ("SyouninBoard").transform.FindChild ("Busshi").gameObject;
				btn.GetComponent<Button> ().enabled = false;
				btn.GetComponent<Image> ().color = enableImageColor;
				btn.transform.FindChild ("Text").GetComponent<Text> ().color = enableTextColor;
				
				
			} else {
				msg.makeMessage ("御屋形様、金が不足しておりますぞ。");
			}


		} else if (name == "DoRouninButton") {
			
			reduceActionQty ();

			int money = PlayerPrefs.GetInt ("money");
			Message msg = new Message ();
			
			if (price <= money) {

				//reduce money
				int calc = money - price;
				PlayerPrefs.SetInt ("money", calc);
				PlayerPrefs.Flush ();
				GameObject.Find ("MoneyValue").GetComponent<Text> ().text = calc.ToString ();


				string kengouString = PlayerPrefs.GetString ("kengouItem");
				List<string> kengouList = new List<string> ();
				char[] delimiterChars = {','};
				kengouList = new List<string> (kengouString.Split (delimiterChars));

				int qty = int.Parse (kengouList [kengouId - 1]);
				int newQty = qty + 1;
				kengouList [kengouId - 1] = newQty.ToString ();
				
				string newKengouString = "";
				for (int i=0; i<kengouList.Count; i++) {				
					if (i == 0) {
						newKengouString = kengouList [i];
					} else {
						newKengouString = newKengouString + "," + kengouList [i];
					}
				}
				
				PlayerPrefs.SetString ("kengouItem", newKengouString);
				PlayerPrefs.Flush ();

				msg.makeMessage ("御屋形様、浪人中の剣豪を登用しましたぞ。");
				
				//Close
				GameObject.Find ("MenuRounin").transform.FindChild ("Close").GetComponent<CloseMenu> ().OnClick ();
				
				Color enableImageColor = new Color (35f / 255f, 35f / 255f, 35f / 255f, 155f / 255f);
				Color enableTextColor = new Color (125f / 255f, 125f / 255f, 125f / 255f, 255f / 255f);
				
				
				GameObject btn = GameObject.Find ("SyouninBoard").transform.FindChild ("Youjinbou").gameObject;
				btn.GetComponent<Button> ().enabled = false;
				btn.GetComponent<Image> ().color = enableImageColor;
				btn.transform.FindChild ("Text").GetComponent<Text> ().color = enableTextColor;
			
			} else {
				msg.makeMessage ("御屋形様、金が不足しておりますぞ。");
			
			}


		} else if (name == "DoYasenButton") {

			reduceActionQty ();

			Message msg = new Message ();

			float percent = Random.value;
			percent = percent * 100;
			if (percent > 10) {

				int money = PlayerPrefs.GetInt ("money");
				int newMoney = money + price;
				PlayerPrefs.SetInt ("money", newMoney);
				PlayerPrefs.Flush ();
				GameObject.Find ("MoneyValue").GetComponent<Text> ().text = newMoney.ToString ();

				string yasenTxt = price + "貫の矢銭を供出させましたぞ。";
				msg.makeMessage (yasenTxt);

			} else {
				msg.makeMessage ("なんと町衆共が矢銭を断わりましたぞ。");
			}

			//Close
			GameObject.Find ("MenuYasen").transform.FindChild ("Close").GetComponent<CloseMenu> ().OnClick ();
			
			Color enableImageColor = new Color (35f / 255f, 35f / 255f, 35f / 255f, 155f / 255f);
			Color enableTextColor = new Color (125f / 255f, 125f / 255f, 125f / 255f, 255f / 255f);
			
			
			GameObject btn = GameObject.Find ("SyouninBoard").transform.FindChild ("Yasen").gameObject;
			btn.GetComponent<Button> ().enabled = false;
			btn.GetComponent<Image> ().color = enableImageColor;
			btn.transform.FindChild ("Text").GetComponent<Text> ().color = enableTextColor;


		
		} else if (name == "DoTechButton") {

			reduceActionQty ();
			
			int money = PlayerPrefs.GetInt ("money");
			Message msg = new Message ();

			if (price <= money) {

				//reduce money
				int calc = money - price;
				PlayerPrefs.SetInt ("money", calc);
				GameObject.Find ("MoneyValue").GetComponent<Text> ().text = calc.ToString ();

				//add tech item
				string txt = "";
				if(techId == 1){
					//TP
					int qty = PlayerPrefs.GetInt("transferTP",0);
					int newQty = qty + 1;
					PlayerPrefs.SetInt("transferTP",newQty);
					txt = "御屋形様、鉄砲鋳造技術を導入しましたぞ。\n内政にて鍛冶屋を建造しましょう。";

				}else if(techId == 2){
					int qty = PlayerPrefs.GetInt("transferKB",0);
					int newQty = qty + 1;
					PlayerPrefs.SetInt("transferKB",newQty);
					txt = "御屋形様、馬育成技術を導入しましたぞ。\n内政にて厩建造しましょう。";

				}else if(techId == 3){
					int qty = PlayerPrefs.GetInt("transferSNB",0);
					int newQty = qty  + 1;
					PlayerPrefs.SetInt("transferSNB",newQty);
					txt = "御屋形様、忍育成技術を導入しましたぞ。\n内政にて施設建造しましょう。";

				}
				PlayerPrefs.Flush ();

				msg.makeMessage (txt);

				Color enableImageColor = new Color (35f / 255f, 35f / 255f, 35f / 255f, 155f / 255f);
				Color enableTextColor = new Color (125f / 255f, 125f / 255f, 125f / 255f, 255f / 255f);
				GameObject btn = GameObject.Find ("SyouninBoard").transform.FindChild ("Gijyutsu").gameObject;
				btn.GetComponent<Button> ().enabled = false;
				btn.GetComponent<Image> ().color = enableImageColor;
				btn.transform.FindChild ("Text").GetComponent<Text> ().color = enableTextColor;

			}else{
				msg.makeMessage ("御屋形様、金が不足しておりますぞ。");
			}

			//Close
			GameObject.Find ("MenuTech").transform.FindChild ("Close").GetComponent<CloseMenu> ().OnClick ();
			


		}

	}
Ejemplo n.º 3
0
	public void addKahou(string kahouType, int kahouId){
		string kahouTypeTemp = "";
		Kahou kahou = new Kahou ();

		if(kahouType=="bugu"){
			kahou.registerBugu (kahouId);
		}else if(kahouType=="kabuto"){
			kahou.registerKabuto (kahouId);
		}else if(kahouType=="gusoku"){
			kahou.registerGusoku (kahouId);
		}else if(kahouType=="meiba"){
			kahou.registerMeiba (kahouId);
		}else if(kahouType=="cyadougu"){
			kahou.registerCyadougu (kahouId);
		}else if(kahouType=="heihousyo"){
			kahou.registerHeihousyo (kahouId);
		}else if(kahouType=="chishikisyo"){
			kahou.registerChishikisyo (kahouId);
		}

	}
Ejemplo n.º 4
0
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();

        Color enableImageColor = new Color(35f / 255f, 35f / 255f, 35f / 255f, 155f / 255f);
        Color enableTextColor  = new Color(125f / 255f, 125f / 255f, 125f / 255f, 255f / 255f);

        if (name == "DoKahouButton")
        {
            reduceActionQty();

            int     money      = PlayerPrefs.GetInt("money");
            int     paiedMoney = int.Parse(Money.GetComponent <Text> ().text);
            Message msg        = new Message();
            Kahou   kahou      = new Kahou();

            if (paiedMoney <= money)
            {
                audioSources [3].Play();

                //reduce money
                int calc = money - paiedMoney;
                PlayerPrefs.SetInt("money", calc);
                PlayerPrefs.Flush();
                GameObject.Find("MoneyValue").GetComponent <Text> ().text = calc.ToString();

                if (kahouCd == "bugu")
                {
                    kahou.registerBugu(kahouId);
                }
                else if (kahouCd == "gusoku")
                {
                    kahou.registerGusoku(kahouId);
                }
                else if (kahouCd == "kabuto")
                {
                    kahou.registerKabuto(kahouId);
                }
                else if (kahouCd == "meiba")
                {
                    kahou.registerMeiba(kahouId);
                }
                else if (kahouCd == "cyadougu")
                {
                    kahou.registerCyadougu(kahouId);
                }
                else if (kahouCd == "chishikisyo")
                {
                    kahou.registerChishikisyo(kahouId);
                }
                else if (kahouCd == "heihousyo")
                {
                    kahou.registerHeihousyo(kahouId);
                }

                msg.makeMessage(msg.getMessage(92));

                //Close
                GameObject.Find("MenuKahou").transform.FindChild("Close").GetComponent <CloseMenu> ().OnClick();

                GameObject btn = GameObject.Find("SyouninBoard").transform.FindChild("Kahou").gameObject;
                btn.GetComponent <Button> ().enabled = false;
                btn.GetComponent <Image> ().color    = enableImageColor;
                btn.transform.FindChild("Text").GetComponent <Text> ().color = enableTextColor;
            }
            else
            {
                audioSources [4].Play();
                msg.makeMessage(msg.getMessage(6));
            }
        }
        else if (name == "DoBusshiButton")
        {
            reduceActionQty();

            int     money      = PlayerPrefs.GetInt("money");
            int     paiedMoney = int.Parse(Money.GetComponent <Text> ().text);
            Message msg        = new Message();

            if (paiedMoney <= money)
            {
                audioSources [3].Play();

                //reduce money
                int calc = money - paiedMoney;
                PlayerPrefs.SetInt("money", calc);
                PlayerPrefs.Flush();
                GameObject.Find("MoneyValue").GetComponent <Text> ().text = calc.ToString();
                char[] delimiterChars = { ',' };

                if (busshiCd.Contains("Cyouhei") == true)
                {
                    if (busshiCd.Contains("YR") == true)
                    {
                        string cyouheiYRString = PlayerPrefs.GetString("cyouheiYR");

                        string[] cyouheiYR_list     = cyouheiYRString.Split(delimiterChars);
                        string   newCyouheiYRString = "";

                        if (busshiCd == "CyouheiYR1")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiYR_list [0]) + busshiQty;
                            newCyouheiYRString = newQty.ToString() + "," + cyouheiYR_list [1] + "," + cyouheiYR_list [2];
                        }
                        else if (busshiCd == "CyouheiYR2")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiYR_list [1]) + busshiQty;
                            newCyouheiYRString = cyouheiYR_list [0] + "," + newQty.ToString() + "," + cyouheiYR_list [2];
                        }
                        else if (busshiCd == "CyouheiYR3")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiYR_list [2]) + busshiQty;
                            newCyouheiYRString = cyouheiYR_list [0] + "," + cyouheiYR_list [1] + "," + newQty.ToString();
                        }
                        PlayerPrefs.SetString("cyouheiYR", newCyouheiYRString);
                    }
                    else if (busshiCd.Contains("KB") == true)
                    {
                        string   cyouheiKBString    = PlayerPrefs.GetString("cyouheiKB");
                        string[] cyouheiKB_list     = cyouheiKBString.Split(delimiterChars);
                        string   newCyouheiKBString = "";

                        if (busshiCd == "CyouheiKB1")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiKB_list [0]) + busshiQty;
                            newCyouheiKBString = newQty.ToString() + "," + cyouheiKB_list [1] + "," + cyouheiKB_list [2];
                        }
                        else if (busshiCd == "CyouheiKB2")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiKB_list [1]) + busshiQty;
                            newCyouheiKBString = cyouheiKB_list [0] + "," + newQty.ToString() + "," + cyouheiKB_list [2];
                        }
                        else if (busshiCd == "CyouheiKB3")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiKB_list [2]) + busshiQty;
                            newCyouheiKBString = cyouheiKB_list [0] + "," + cyouheiKB_list [1] + "," + newQty.ToString();
                        }
                        PlayerPrefs.SetString("cyouheiKB", newCyouheiKBString);
                    }
                    else if (busshiCd.Contains("TP") == true)
                    {
                        string   cyouheiTPString    = PlayerPrefs.GetString("cyouheiTP");
                        string[] cyouheiTP_list     = cyouheiTPString.Split(delimiterChars);
                        string   newCyouheiTPString = "";

                        if (busshiCd == "CyouheiTP1")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiTP_list [0]) + busshiQty;
                            newCyouheiTPString = newQty.ToString() + "," + cyouheiTP_list [1] + "," + cyouheiTP_list [2];
                        }
                        else if (busshiCd == "CyouheiTP2")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiTP_list [1]) + busshiQty;
                            newCyouheiTPString = cyouheiTP_list [0] + "," + newQty.ToString() + "," + cyouheiTP_list [2];
                        }
                        else if (busshiCd == "CyouheiTP3")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiTP_list [2]) + busshiQty;
                            newCyouheiTPString = cyouheiTP_list [0] + "," + cyouheiTP_list [1] + "," + newQty.ToString();
                        }
                        PlayerPrefs.SetString("cyouheiTP", newCyouheiTPString);
                    }
                    else if (busshiCd.Contains("YM") == true)
                    {
                        string   cyouheiYMString    = PlayerPrefs.GetString("cyouheiYM");
                        string[] cyouheiYM_list     = cyouheiYMString.Split(delimiterChars);
                        string   newCyouheiYMString = "";

                        if (busshiCd == "CyouheiYM1")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiYM_list [0]) + busshiQty;
                            newCyouheiYMString = newQty.ToString() + "," + cyouheiYM_list [1] + "," + cyouheiYM_list [2];
                        }
                        else if (busshiCd == "CyouheiYM2")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiYM_list [1]) + busshiQty;
                            newCyouheiYMString = cyouheiYM_list [0] + "," + newQty.ToString() + "," + cyouheiYM_list [2];
                        }
                        else if (busshiCd == "CyouheiYM3")
                        {
                            int newQty = 0;
                            newQty             = int.Parse(cyouheiYM_list [2]) + busshiQty;
                            newCyouheiYMString = cyouheiYM_list [0] + "," + cyouheiYM_list [1] + "," + newQty.ToString();
                        }
                        PlayerPrefs.SetString("cyouheiYM", newCyouheiYMString);
                    }
                }
                else if (busshiCd.Contains("Shinobi") == true)
                {
                    if (busshiCd == "Shinobi1")
                    {
                        int newQty     = 0;
                        int shinobiQty = PlayerPrefs.GetInt("shinobiGe");
                        newQty = shinobiQty + busshiQty;
                        PlayerPrefs.SetInt("shinobiGe", newQty);
                    }
                    else if (busshiCd == "Shinobi2")
                    {
                        int newQty     = 0;
                        int shinobiQty = PlayerPrefs.GetInt("shinobiCyu");
                        newQty = shinobiQty + busshiQty;
                        PlayerPrefs.SetInt("shinobiCyu", newQty);
                    }
                    else if (busshiCd == "Shinobi3")
                    {
                        int newQty     = 0;
                        int shinobiQty = PlayerPrefs.GetInt("shinobiJyo");
                        newQty = shinobiQty + busshiQty;
                        PlayerPrefs.SetInt("shinobiJyo", newQty);
                    }
                }
                PlayerPrefs.Flush();



                msg.makeMessage(msg.getMessage(93));

                //Close
                GameObject.Find("MenuBusshi").transform.FindChild("Close").GetComponent <CloseMenu> ().OnClick();

                GameObject btn = GameObject.Find("SyouninBoard").transform.FindChild("Busshi").gameObject;
                btn.GetComponent <Button> ().enabled = false;
                btn.GetComponent <Image> ().color    = enableImageColor;
                btn.transform.FindChild("Text").GetComponent <Text> ().color = enableTextColor;
            }
            else
            {
                audioSources [4].Play();
                msg.makeMessage(msg.getMessage(6));
            }
        }
        else if (name == "DoRouninButton")
        {
            reduceActionQty();

            int     money = PlayerPrefs.GetInt("money");
            Message msg   = new Message();

            if (price <= money)
            {
                audioSources [3].Play();

                //reduce money
                int calc = money - price;
                PlayerPrefs.SetInt("money", calc);
                PlayerPrefs.Flush();
                GameObject.Find("MoneyValue").GetComponent <Text> ().text = calc.ToString();


                string        kengouString   = PlayerPrefs.GetString("kengouItem");
                List <string> kengouList     = new List <string> ();
                char[]        delimiterChars = { ',' };
                kengouList = new List <string> (kengouString.Split(delimiterChars));

                int qty    = int.Parse(kengouList [kengouId - 1]);
                int newQty = qty + 1;
                kengouList [kengouId - 1] = newQty.ToString();

                string newKengouString = "";
                for (int i = 0; i < kengouList.Count; i++)
                {
                    if (i == 0)
                    {
                        newKengouString = kengouList [i];
                    }
                    else
                    {
                        newKengouString = newKengouString + "," + kengouList [i];
                    }
                }

                PlayerPrefs.SetString("kengouItem", newKengouString);
                PlayerPrefs.Flush();

                msg.makeMessage(msg.getMessage(94));

                //Close
                GameObject.Find("MenuRounin").transform.FindChild("Close").GetComponent <CloseMenu> ().OnClick();

                GameObject btn = GameObject.Find("SyouninBoard").transform.FindChild("Youjinbou").gameObject;
                btn.GetComponent <Button> ().enabled = false;
                btn.GetComponent <Image> ().color    = enableImageColor;
                btn.transform.FindChild("Text").GetComponent <Text> ().color = enableTextColor;
            }
            else
            {
                audioSources [4].Play();
                msg.makeMessage(msg.getMessage(6));
            }
        }
        else if (name == "DoYasenButton")
        {
            reduceActionQty();

            Message msg = new Message();

            float percent = Random.value;
            percent = percent * 100;
            if (percent > 10)
            {
                audioSources [3].Play();
                int money    = PlayerPrefs.GetInt("money");
                int newMoney = money + price;
                if (newMoney < 0)
                {
                    newMoney = int.MaxValue;
                }
                PlayerPrefs.SetInt("money", newMoney);
                PlayerPrefs.Flush();
                GameObject.Find("MoneyValue").GetComponent <Text> ().text = newMoney.ToString();
                string yasenTxt = "";
                if (Application.systemLanguage != SystemLanguage.Japanese)
                {
                    yasenTxt = "We levied money " + price + " on merchants.";
                }
                else
                {
                    yasenTxt = price + "貫の矢銭を供出させましたぞ。";
                }
                msg.makeMessage(yasenTxt);
            }
            else
            {
                audioSources [4].Play();
                msg.makeMessage(msg.getMessage(95));
            }

            //Close
            GameObject.Find("MenuYasen").transform.FindChild("Close").GetComponent <CloseMenu> ().OnClick();

            GameObject btn = GameObject.Find("SyouninBoard").transform.FindChild("Yasen").gameObject;
            btn.GetComponent <Button> ().enabled = false;
            btn.GetComponent <Image> ().color    = enableImageColor;
            btn.transform.FindChild("Text").GetComponent <Text> ().color = enableTextColor;
        }
        else if (name == "DoTechButton")
        {
            reduceActionQty();

            int     money = PlayerPrefs.GetInt("money");
            Message msg   = new Message();

            if (price <= money)
            {
                audioSources [3].Play();

                //reduce money
                int calc = money - price;
                PlayerPrefs.SetInt("money", calc);
                GameObject.Find("MoneyValue").GetComponent <Text> ().text = calc.ToString();

                //add tech item
                string txt = "";
                if (techId == 1)
                {
                    //TP
                    int qty    = PlayerPrefs.GetInt("transferTP", 0);
                    int newQty = qty + 1;
                    PlayerPrefs.SetInt("transferTP", newQty);
                    txt = msg.getMessage(96);
                }
                else if (techId == 2)
                {
                    int qty    = PlayerPrefs.GetInt("transferKB", 0);
                    int newQty = qty + 1;
                    PlayerPrefs.SetInt("transferKB", newQty);
                    txt = msg.getMessage(97);
                }
                else if (techId == 3)
                {
                    int qty    = PlayerPrefs.GetInt("transferSNB", 0);
                    int newQty = qty + 1;
                    PlayerPrefs.SetInt("transferSNB", newQty);
                    txt = msg.getMessage(98);
                }
                PlayerPrefs.Flush();

                msg.makeMessage(txt);

                GameObject btn = GameObject.Find("SyouninBoard").transform.FindChild("Gijyutsu").gameObject;
                btn.GetComponent <Button> ().enabled = false;
                btn.GetComponent <Image> ().color    = enableImageColor;
                btn.transform.FindChild("Text").GetComponent <Text> ().color = enableTextColor;
            }
            else
            {
                audioSources [4].Play();
                msg.makeMessage(msg.getMessage(6));
            }

            //Close
            GameObject.Find("MenuTech").transform.FindChild("Close").GetComponent <CloseMenu> ().OnClick();
        }
        else if (name == "DoCyakaiButton")
        {
            reduceActionQty();

            int     money = PlayerPrefs.GetInt("money");
            Message msg   = new Message();

            if (price <= money)
            {
                audioSources [3].Play();
                //reduce money
                int calc = money - price;
                PlayerPrefs.SetInt("money", calc);
                GameObject.Find("MoneyValue").GetComponent <Text> ().text = calc.ToString();

                int meiseiQty = PlayerPrefs.GetInt("meisei");
                meiseiQty = meiseiQty + targetKuniQty;
                PlayerPrefs.SetInt("meisei", meiseiQty);

                string newcyakaiDouguHst = "";
                for (int i = 0; i < cyakaiDouguHstlist.Count; i++)
                {
                    if (i == 0)
                    {
                        newcyakaiDouguHst = cyakaiDouguHstlist[i];
                    }
                    else
                    {
                        newcyakaiDouguHst = newcyakaiDouguHst + "," + cyakaiDouguHstlist[i];
                    }
                }
                PlayerPrefs.SetString("cyakaiDouguHst", newcyakaiDouguHst);

                string finalTxt = "";
                if (!doneCyadouguFlg)
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        finalTxt = "It was good tea party.\n You got " + targetKuniQty + " reputation item. \n Traveller will visit your country.";
                    }
                    else
                    {
                        finalTxt = "茶会は大盛況でした。\n名声を" + targetKuniQty + "個取得しました。\n旅人が来訪いたしますぞ。";
                    }
                }
                else
                {
                    if (Application.systemLanguage != SystemLanguage.Japanese)
                    {
                        finalTxt = "You have already shown your tea item so it didn't get lively. \n You got " + targetKuniQty + " reputation item.";
                    }
                    else
                    {
                        finalTxt = "以前お披露目した茶道具を使用したせいか、盛り上がりは今ひとつでしたな。\n名声を" + targetKuniQty + "個取得しました。";
                    }
                }

                msg.makeMessage(finalTxt);

                GameObject btn = GameObject.Find("SyouninBoard").transform.FindChild("Cyakai").gameObject;
                btn.GetComponent <Button> ().enabled = false;
                btn.GetComponent <Image> ().color    = enableImageColor;
                btn.transform.FindChild("Text").GetComponent <Text> ().color = enableTextColor;
            }
            else
            {
                audioSources [4].Play();
                msg.makeMessage(msg.getMessage(6));
            }

            //Close
            GameObject.Find("MenuCyakai").transform.FindChild("Close").GetComponent <CloseMenu> ().OnClick();
        }
    }
Ejemplo n.º 5
0
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        string        Text         = "";
        Kahou         kahou        = new Kahou();
        Message       msg          = new Message();

        if (!isNanbansenFlg)
        {
            audioSources[3].Play();
            Text = msg.getMessage(122);

            if (itemCd == "money")
            {
                //Money
                int nowMoney = PlayerPrefs.GetInt("money");
                nowMoney = nowMoney + itemQty;
                if (nowMoney < 0)
                {
                    nowMoney = int.MaxValue;
                }
                PlayerPrefs.SetInt("money", nowMoney);


                //Label
                Text nowMoneyLabelText = GameObject.Find("MoneyValue").GetComponent <Text> ();
                int  nowMoneyLabel     = int.Parse(nowMoneyLabelText.text) + itemQty;
                nowMoneyLabelText.text = nowMoneyLabel.ToString();
            }
            else if (itemCd == "hyourou")
            {
                //Hyourou

                //Check
                int maxHyourou = PlayerPrefs.GetInt("hyourouMax");
                int nowHyourou = PlayerPrefs.GetInt("hyourou");
                nowHyourou = nowHyourou + itemQty;

                if (maxHyourou <= nowHyourou)
                {
                    nowHyourou = maxHyourou;
                    PlayerPrefs.SetInt("hyourou", nowHyourou);

                    Text = msg.getMessage(123);

                    //Label
                    Text nowHyourouLabelText = GameObject.Find("HyourouCurrentValue").GetComponent <Text> ();
                    nowHyourouLabelText.text = nowHyourou.ToString();
                }
                else
                {
                    PlayerPrefs.SetInt("hyourou", nowHyourou);

                    //Label
                    Text nowHyourouLabelText = GameObject.Find("HyourouCurrentValue").GetComponent <Text> ();
                    nowHyourouLabelText.text = nowHyourou.ToString();
                }
            }
            else if (itemCd == "kengou")
            {
                string        kengouString   = PlayerPrefs.GetString("kengouItem");
                List <string> kengouList     = new List <string> ();
                char[]        delimiterChars = { ',' };
                kengouList = new List <string> (kengouString.Split(delimiterChars));

                string qty    = kengouList [itemId - 1];
                int    newQty = int.Parse(qty) + itemQty;
                kengouList [itemId - 1] = newQty.ToString();

                string newKengouString = "";
                for (int i = 0; i < kengouList.Count; i++)
                {
                    if (i == 0)
                    {
                        newKengouString = kengouList [i];
                    }
                    else
                    {
                        newKengouString = newKengouString + "," + kengouList [i];
                    }
                }

                PlayerPrefs.SetString("kengouItem", newKengouString);
            }
            else if (itemCd == "gokui")
            {
                string        gokuiString    = PlayerPrefs.GetString("gokuiItem");
                List <string> gokuiList      = new List <string> ();
                char[]        delimiterChars = { ',' };
                gokuiList = new List <string> (gokuiString.Split(delimiterChars));

                string qty    = gokuiList [itemId - 1];
                int    newQty = int.Parse(qty) + itemQty;
                gokuiList [itemId - 1] = newQty.ToString();

                string newGokuiString = "";
                for (int i = 0; i < gokuiList.Count; i++)
                {
                    if (i == 0)
                    {
                        newGokuiString = gokuiList [i];
                    }
                    else
                    {
                        newGokuiString = newGokuiString + "," + gokuiList [i];
                    }
                }

                PlayerPrefs.SetString("gokuiItem", newGokuiString);
            }
            else if (itemCd == "CyouheiTP")
            {
                registerTP();
            }
            else if (itemCd.Contains("nanban"))
            {
                registerNanban();
            }
            else if (itemCd == "bugu")
            {
                kahou.registerBugu(itemId);
            }
            else if (itemCd == "gusoku")
            {
                kahou.registerGusoku(itemId);
            }
            else if (itemCd == "kabuto")
            {
                kahou.registerKabuto(itemId);
            }
            else if (itemCd == "meiba")
            {
                kahou.registerMeiba(itemId);
            }
            else if (itemCd == "cyadougu")
            {
                kahou.registerCyadougu(itemId);
            }
            else if (itemCd == "chishikisyo")
            {
                kahou.registerChishikisyo(itemId);
            }
            else if (itemCd == "heihousyo")
            {
                kahou.registerHeihousyo(itemId);
            }
            else if (itemCd == "cyoutei" || itemCd == "koueki")
            {
                registerKouekiOrCyoutei(itemCd, itemId);
            }

            PlayerPrefs.SetBool("questDailyFlg21", true);
            PlayerPrefs.Flush();
            PlayerPrefs.Flush();

            //Delete Tap Button
            Destroy(popButton);
        }
        else
        {
            //Nanbansen
            if (moneyCheckFlg)
            {
                audioSources[3].Play();
                //Money Handling
                int money = PlayerPrefs.GetInt("money");
                money = money - paiedMoney;
                PlayerPrefs.SetInt("money", money);
                PlayerPrefs.Flush();
                GameObject.Find("MoneyValue").GetComponent <Text>().text = money.ToString();

                //Fadeout & Button false
                shipObj.GetComponent <FadeoutImage>().enabled = true;
                shipObj.GetComponent <Button>().enabled       = false;

                //nanbansen flg change
                GameObject.Find("NaiseiController").GetComponent <NaiseiController>().isNanbansenFlg = false;

                //Register Item
                if (itemCd.Contains("CyouheiTP"))
                {
                    registerTP();
                }
                else if (itemCd.Contains("nanban"))
                {
                    registerNanban();
                }
                else if (itemCd == "bugu")
                {
                    kahou.registerBugu(itemId);
                }
                else if (itemCd == "gusoku")
                {
                    kahou.registerGusoku(itemId);
                }
                else if (itemCd == "kabuto")
                {
                    kahou.registerKabuto(itemId);
                }
                else if (itemCd == "meiba")
                {
                    kahou.registerMeiba(itemId);
                }
                else if (itemCd == "cyadougu")
                {
                    kahou.registerCyadougu(itemId);
                }
                else if (itemCd == "chishikisyo")
                {
                    kahou.registerChishikisyo(itemId);
                }
                else if (itemCd == "heihousyo")
                {
                    kahou.registerHeihousyo(itemId);
                }

                Text = msg.getMessage(124);
            }
            else
            {
                audioSources [4].Play();
                Text = msg.getMessage(125);
            }
        }

        //Message
        msg.makeMessage(Text);

        //Close
        GameObject.Find("close").GetComponent <CloseBoard> ().onClick();
    }
Ejemplo n.º 6
0
    public void receiveKaho()
    {
        Message msgScript = new Message();
        Kahou   kahou     = new Kahou();
        string  kahouMsg  = "";

        for (int i = 0; i < kahoTypList.Count; i++)
        {
            string kahoTyp  = kahoTypList[i];
            int    kahoId   = kahoIdList[i];
            string kahoName = kahoNameList[i];

            if (kahoTyp == "bugu")
            {
                kahou.registerBugu(kahoId);
            }
            else if (kahoTyp == "gusoku")
            {
                kahou.registerGusoku(kahoId);
            }
            else if (kahoTyp == "kabuto")
            {
                kahou.registerKabuto(kahoId);
            }
            else if (kahoTyp == "meiba")
            {
                kahou.registerMeiba(kahoId);
            }
            else if (kahoTyp == "cyadougu")
            {
                kahou.registerCyadougu(kahoId);
            }
            else if (kahoTyp == "chishikisyo")
            {
                kahou.registerChishikisyo(kahoId);
            }
            else if (kahoTyp == "heihousyo")
            {
                kahou.registerHeihousyo(kahoId);
            }

            if (kahouMsg == "")
            {
                kahouMsg = kahoName;
            }
            else
            {
                kahouMsg = kahouMsg + "," + kahoName;
            }
        }

        string msg = "";

        if (Application.systemLanguage != SystemLanguage.Japanese)
        {
            msg = "You got " + kahouMsg + ".";
        }
        else
        {
            msg = kahouMsg + "を受領しましたぞ。良い物を手に入れられましたな。";
        }
        msgScript.makeMessage(msg);
    }
Ejemplo n.º 7
0
    public void OnClick()
    {
        /*Receive Item*/
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource> ();
        audioSources [3].Play();

        //Item1
        string        gameClearDaimyo     = PlayerPrefs.GetString("gameClearDaimyo");
        bool          hardFlg             = PlayerPrefs.GetBool("hardFlg");
        List <string> gameClearDaimyoList = new List <string> ();

        char[] delimiterChars = { ',' };
        if (gameClearDaimyo != null && gameClearDaimyo != "")
        {
            if (gameClearDaimyo.Contains(","))
            {
                gameClearDaimyoList = new List <string> (gameClearDaimyo.Split(delimiterChars));
            }
            else
            {
                gameClearDaimyoList.Add(gameClearDaimyo);
            }
        }
        int myDaimyo = PlayerPrefs.GetInt("myDaimyo");

        if (!gameClearDaimyoList.Contains(myDaimyo.ToString()))
        {
            if (gameClearDaimyo != null && gameClearDaimyo != "")
            {
                gameClearDaimyo = gameClearDaimyo + "," + myDaimyo.ToString();
            }
            else
            {
                gameClearDaimyo = myDaimyo.ToString();
            }
            PlayerPrefs.SetString("gameClearDaimyo", gameClearDaimyo);
        }

        //Hard mode
        if (hardFlg)
        {
            string        gameClearDaimyoHard     = PlayerPrefs.GetString("gameClearDaimyoHard");
            List <string> gameClearDaimyoHardList = new List <string>();
            if (gameClearDaimyoHard != null && gameClearDaimyoHard != "")
            {
                if (gameClearDaimyoHard.Contains(","))
                {
                    gameClearDaimyoHardList = new List <string>(gameClearDaimyoHard.Split(delimiterChars));
                }
                else
                {
                    gameClearDaimyoHardList.Add(gameClearDaimyoHard);
                }
            }
            if (!gameClearDaimyoHardList.Contains(myDaimyo.ToString()))
            {
                if (gameClearDaimyoHard != null && gameClearDaimyoHard != "")
                {
                    gameClearDaimyoHard = gameClearDaimyoHard + "," + myDaimyo.ToString();
                }
                else
                {
                    gameClearDaimyoHard = myDaimyo.ToString();
                }
                PlayerPrefs.SetString("gameClearDaimyoHard", gameClearDaimyoHard);
            }
        }


        PlayerPrefs.SetBool("gameClearItemGetFlg", true);


        //Item2
        PlayerPrefs.DeleteKey("gameClearKahouCd");
        PlayerPrefs.DeleteKey("gameClearKahouId");
        Kahou kahou = new Kahou();

        if (kahouCd == "bugu")
        {
            kahou.registerBugu(int.Parse(kahouId));
        }
        else if (kahouCd == "gusoku")
        {
            kahou.registerGusoku(int.Parse(kahouId));
        }
        else if (kahouCd == "kabuto")
        {
            kahou.registerKabuto(int.Parse(kahouId));
        }
        else if (kahouCd == "meiba")
        {
            kahou.registerMeiba(int.Parse(kahouId));
        }
        else if (kahouCd == "cyadougu")
        {
            kahou.registerCyadougu(int.Parse(kahouId));
        }
        else if (kahouCd == "chishikisyo")
        {
            kahou.registerChishikisyo(int.Parse(kahouId));
        }
        else if (kahouCd == "heihousyo")
        {
            kahou.registerHeihousyo(int.Parse(kahouId));
        }

        //Item3
        int busyoDama    = PlayerPrefs.GetInt("busyoDama");
        int newBusyoDama = busyoDama + 1000;

        PlayerPrefs.SetInt("busyoDama", newBusyoDama);



        //Get Daimyo Busyo
        Daimyo daimyoScript  = new Daimyo();
        int    daimyoId      = PlayerPrefs.GetInt("myDaimyo");
        int    daimyoBusyoId = daimyoScript.getDaimyoBusyoId(daimyoId);

        string        zukanBusyoHst     = PlayerPrefs.GetString("zukanBusyoHst");
        List <string> zukanBusyoHstList = new List <string>();

        if (zukanBusyoHst != null && zukanBusyoHst != "")
        {
            if (zukanBusyoHst.Contains(","))
            {
                zukanBusyoHstList = new List <string>(zukanBusyoHst.Split(delimiterChars));
            }
            else
            {
                zukanBusyoHstList.Add(zukanBusyoHst);
            }
        }
        if (!zukanBusyoHstList.Contains(daimyoBusyoId.ToString()))
        {
            if (zukanBusyoHst != null && zukanBusyoHst != "")
            {
                zukanBusyoHst = zukanBusyoHst + "," + daimyoBusyoId.ToString();
            }
            else
            {
                zukanBusyoHst = daimyoBusyoId.ToString();
            }
            PlayerPrefs.SetString("zukanBusyoHst", zukanBusyoHst);
        }

        if (daimyoScript.daimyoBusyoCheck(daimyoBusyoId))
        {
            string        gacyaDaimyoHst     = PlayerPrefs.GetString("gacyaDaimyoHst");
            List <string> gacyaDaimyoHstList = new List <string>();
            if (gacyaDaimyoHst != null && gacyaDaimyoHst != "")
            {
                if (gacyaDaimyoHst.Contains(","))
                {
                    gacyaDaimyoHstList = new List <string>(gacyaDaimyoHst.Split(delimiterChars));
                }
                else
                {
                    gacyaDaimyoHstList.Add(gacyaDaimyoHst);
                }
            }
            if (!gacyaDaimyoHstList.Contains(daimyoBusyoId.ToString()))
            {
                if (gacyaDaimyoHst != null && gacyaDaimyoHst != "")
                {
                    gacyaDaimyoHst = gacyaDaimyoHst + "," + daimyoBusyoId.ToString();
                }
                else
                {
                    gacyaDaimyoHst = daimyoBusyoId.ToString();
                }
                PlayerPrefs.SetString("gacyaDaimyoHst", gacyaDaimyoHst);
            }
        }

        PlayerPrefs.Flush();



        //Hide Back
        Destroy(backObj.gameObject);
        Destroy(popObj.gameObject);
        Destroy(particleObj.gameObject);
        GameObject kunimap      = GameObject.Find("KuniMap").gameObject;
        GameObject kuniIconView = GameObject.Find("KuniIconView").gameObject;

        Destroy(kunimap.gameObject);
        Destroy(kuniIconView.gameObject);

        FinMaker(panel);
    }