Exemple #1
0
    //내보내기 진행
    public void OutYes()
    {
        int outPay = int.Parse(priceTable[buildN].ToString());

        if (theStat.myAllMoney >= outPay)
        {
            theNotice.NotificationAppear(theSellBuy.stockSc[(int)stockTable[buildN]].stockNameT.text + "을 건물에서 퇴출시켰습니다.");
            theStat.myAllMoney -= outPay;

            theSellBuy.stockSc[(int)stockTable[buildN]].stockGetin = false;
            theHandler.Buildings[buildN].stockIn = false;
            BackGroundBuildingName[buildN].SetActive(false);

            if (stockTable.ContainsKey(buildN))
            {
                stockTable.Remove(buildN);
            }
            if (priceTable.ContainsKey(buildN))
            {
                priceTable.Remove(buildN);
            }

            populationMax -= 1;
            OutCompanyChoiceP.SetActive(false);
            checkInOut();
        }
        else
        {
            theNotice.NotificationAppear("퇴출을 위한 보증금 반납 비용이 부족합니다.");
            OutCompanyChoiceP.SetActive(false);
        }
    }
Exemple #2
0
 /* 성공하고 스탑 버튼을 누를 때 실행되는 함수 */
 public void StopButtonOnClick()
 {
     gamePanel.SetActive(false);       //모든 패널을 닫는다.
     theNotice.NotificationAppear("미니게임에 성공하여 돈을 획득했습니다 : " + inputMoney + "$");
     theStat.myAllMoney += inputMoney; //돈을 획득
     theStat.playerCash += inputMoney;
     theMiniGame.ProfileSetting();     //text 설정
     /*레포트 미니게임 번 돈*/
     theReport.nMonthEarnMiniMoney += inputMoney;
 }
    /*신용등급 조정위원회*/
    public void PlayerCreditUp()
    {
        /*신용등급 오르면 거래횟수 초기화*/
        stockTradeCountNum = 0;

        /*신용등급 올림*/
        if (playerCredit > 1)
        {
            playerCredit--;
        }
        else
        {
            playerCredit = 1;
        }

        /*신용등급에 따른 차등 주식보유 증가량*/
        //9~6
        if (playerCredit > 5)
        {
            stockLimitCount += 0.5f;
        }
        //5~3
        else if (playerCredit > 2)
        {
            stockLimitCount += 1;
        }
        //1~2
        else
        {
            stockLimitCount = 8;
        }

        playerLevelText.text = "벼리 신용등급: " + playerCredit + "등급";

        /*플레이어레벨이 높아질수록 다음 기준선이 지수승으로 올라간다*/
        playerLevelUpIndex   = playerLevelUpIndex * (int)Math.Pow(2, 10 - playerCredit);
        playerLevelDownIndex = playerLevelDownIndex * (int)Math.Pow(2, 10 - playerCredit);

        playerLevelUpIndexText.text   = "신용등급 상승갱신 기준 :" + playerLevelUpIndex.ToString();
        playerLevelDownIndexText.text = "신용등급 하락갱신 기준 :" + playerLevelDownIndex.ToString();

        theNotice.NotificationAppear("신용등급 상승  " + (playerCredit + 1).ToString() + "->" + playerCredit.ToString() + "  확인 요망");

        theBuilding.UpdateAllConditions(0);
        theMiniGame.InitMoneyChange();
    }
 public void BuyChooseBuildingOK()
 {
     if (theStat.myAllMoney >= Buildings[selectedPanel].buildingPrice)
     {
         theStat.myAllMoney          -= Buildings[selectedPanel].buildingPrice;
         Buildings[selectedPanel].has = true;
         chooseBuildingPanel.SetActive(false);
         detailPanel.SetActive(false);
         theNotice.NotificationAppear("건물 구매 완료!");
         var clone = Instantiate(congratEffect, Buildings[selectedPanel].transform);
     }
     else
     {
         theNotice.NotificationAppear("건물을 사기위한 돈이 부족합니다.");
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (theDate.day == 4)
        {
            reportButton.SetActive(false);
        }

        if (theDate.month == checkMonth % 12 + 1 && theDate.day == 1 && theDate.hour == 1)
        {
            reportButton.SetActive(true);

            theNotice.NotificationAppear("월간 수익률 보고서가 발행되었습니다");
            checkMonth += 1;

            if (theDate.month != 1)
            {
                reprotTitleT.text = "<" + theStat.playerNameText.text + ">의 " + (theDate.month - 1).ToString() + "월 자산 수익동향 레포트";
            }
            else
            {
                reprotTitleT.text = "<" + theStat.playerNameText.text + ">의 " + "12월 자산 수익동향 레포트";
            }

            /*주식*/
            CheckStock();

            /*빌딩*/
            CheckEstate();

            /*미니*/
            CheckMini();

            /*전부*/
            CheckAll();

            /* 전달*/
            StartCoroutine(BeforMonthCoroutine());
        }
    }
Exemple #6
0
    /* 구매 확인 버튼을 클릭할 때 실행되는 함수 */
    public void BuyYesButtonOnClick()
    {
        if (allBuildings[selectedPanel].buildingPrice <= theStat.myAllMoney) /* 충분한 돈이 있을 경우 */
        {
            if (allBuildings[selectedPanel].CheckAllConditionsComplete())    /* 모든 조건을 만족한 경우 */
            {
                allBuildings[selectedPanel].Sold();
                theStat.myAllMoney -= allBuildings[selectedPanel].buildingPrice;
                /*레포트용 건물 월 거래비용 계산*/
                theReport.nMonthUseEstateMoney += allBuildings[selectedPanel].buildingPrice;
                theNotice.NotificationAppear("건물 구매 완료! 건물 관리 탭에서 내 건물을 확인할 수 있어요.");

                /* 내 건물 탭에 들어갈 내용들을 초기화 시킨다 */
                myBuildings[selectedPanel].gameObject.SetActive(true);

                myBuildings[selectedPanel].buildingSold   = true;
                myBuildings[selectedPanel].buildingNum    = allBuildings[selectedPanel].buildingNum;
                myBuildings[selectedPanel].buildingName   = allBuildings[selectedPanel].buildingName;
                myBuildings[selectedPanel].buildingDetail = allBuildings[selectedPanel].buildingDetail;
                myBuildings[selectedPanel].buildingPrice  = allBuildings[selectedPanel].buildingPrice;
                myBuildings[selectedPanel].monthlyRent    = allBuildings[selectedPanel].monthlyRent;

                myBuildings[selectedPanel].buildingNameText.text      = allBuildings[selectedPanel].buildingNameText.text;
                myBuildings[selectedPanel].buildingDetailText.text    = allBuildings[selectedPanel].buildingDetail;
                myBuildings[selectedPanel].buildingRentText.text      = "월세 : $" + string.Format("{0}", allBuildings[selectedPanel].monthlyRent.ToString("n0"));
                myBuildings[selectedPanel].buildingDateText.text      = "구매 날짜 : " + theDate.year + "년 " + theDate.month + "월 " + theDate.day + "일";
                myBuildings[selectedPanel].buildingCondition          = 1.0f;
                myBuildings[selectedPanel].buildingConditionText.text = "건물 상태 : " + (int)(myBuildings[selectedPanel].buildingCondition * 100) + "/100";
                /* 여기까지 초기화 할 내용이 들어간다 */
            }
            else /* 조건을 다 만족시키지 못하는 경우 */
            {
                theNotice.NotificationAppear("건물을 사기 위한 조건을 만족시키세요.");
                buyPanel.SetActive(false);
            }
        }
        else /* 충분한 돈이 없는 경우 */
        {
            theNotice.NotificationAppear("건물을 사기 위한 돈이 부족합니다.");
            buyPanel.SetActive(false);
        }
    }
Exemple #7
0
 public void ShowResultItem()
 {
     if (result[closetIndex] == "하트")
     {
         if (theStat.numberOfHarts < 5)
         {
             theNotice.NotificationAppear("하트당첨");
             renderer               = theStat.harts[theStat.numberOfHarts].GetComponent <SpriteRenderer>();
             renderer.color         = new Color(1f, 1f, 1f);
             theStat.numberOfHarts += 1;
         }
         else
         {
             theNotice.NotificationAppear("하트당첨");
         }
     }
     else if (result[closetIndex] == "본전X2")
     {
         theStat.myAllMoney += theMini.inputMoney * 2;
         theNotice.NotificationAppear((theMini.inputMoney * 2).ToString() + "$ 본전 두배당첨");
         /*레포트 미니게임 번 돈*/
         theReport.nMonthEarnEstateMoney += theMini.inputMoney * 2;
     }
     else if (result[closetIndex] == "본전X5")
     {
         theStat.myAllMoney += theMini.inputMoney * 5;
         theNotice.NotificationAppear((theMini.inputMoney * 5).ToString() + "$ 본전 다섯배당첨");
         /*레포트 미니게임 번 돈*/
         theReport.nMonthEarnEstateMoney += theMini.inputMoney * 5;
     }
     else if (result[closetIndex] == "꽝")
     {
         theNotice.NotificationAppear("꽝");
     }
     else if (result[closetIndex] == "다시하기")
     {
         theNotice.NotificationAppear("한번 더~!");
         activeFalse.SetActive(false);
         goFalse.SetActive(false);
         init();
     }
 }
Exemple #8
0
    // Update is called once per frame
    void Update()
    {
        if (DateManager.activated)
        {
            if (theDate.hour == 6 && !newsArrive) //새로운 뉴스를 하나 받는다.
            {
                newsArrive = true;
                StartCoroutine(DelayCoroutine()); /* TO DO */

                /* Database 안에 있는 뉴스 데이터에서 랜덤으로 뽑아서 newsList에 추가한다. */
                int  n        = DatabaseManager.newsDataList.Count;
                News new_news = new News(DatabaseManager.newsDataList[Random.Range(0, n)]);

                int who = Random.Range(0, 10);
                /*발행지 랜덤으로 정함*/
                new_news.SetfromWhom(fromWhom[who]);
                /*발행지의 정확도에 대한 계산*/
                if (Random.Range(0, 100) < fromWhomAccu[who])
                {
                    rightEffect = true;
                }
                else
                {
                    rightEffect = false;
                }

                new_news.SetDate(theDate.year, theDate.month, theDate.day);
                newsList.Add(new_news);

                SetAlert();

                theNotice.NotificationAppear("새로운 메일이 도착했습니다. 확인해보세요");

                /* 메일이 발행된 후에 약간의 딜레이를 주고 효력을 발생시킨다 */
                newsEffectDelay       = true;
                newsEffectCurrentTime = 15f;
                newsEffectIndex       = new_news.whichStock;
                newsEffectOffset      = new_news.offset;
                newsAccuracy          = new_news.accuracy;
            }
            else if (theDate.hour == 8) /* 더 깔끔하게 수정 예정 */
            {
                newsArrive = false;
            }

            /* 메일이 발행된 후에 약간의 딜레이를 준다 */
            if (newsEffectDelay)
            {
                newsEffectCurrentTime -= Time.deltaTime;

                /* 딜레이가 끝나면 효력을 발생시킨다 */
                if (newsEffectCurrentTime < 0)
                {
                    newsEffectDelay       = false;
                    newsEffectActivate    = true;
                    newsEffectCurrentTime = 50f;

                    //if (false/*onlyThisType*/)
                    //{
                    //    for (int i = 0; i < theStock.stockType.Length; i++)
                    //    {
                    //        if (theStock.stockType[i/*특정 업종 대상*/] == 0/*특정 업종대상*/)
                    //        {
                    //            theStock.stockSc[i].NewsEffectActivate(newsEffectOffset, newsAccuracy, rightEffect);
                    //        }
                    //    }
                    //}
                    //else
                    theStock.stockSc[newsEffectIndex].NewsEffectActivate(newsEffectOffset, newsAccuracy, rightEffect);

                    Debug.Log("뉴스 효과 시작" + newsEffectIndex + "번 주식에 " + newsEffectOffset + "만큼의 오프셋 적용");
                }
            }
            /* 뉴스 효력 발생 */
            if (newsEffectActivate)
            {
                newsEffectCurrentTime -= Time.deltaTime;

                /* 일정 시간이 끝나면 뉴스 효력 끝 */
                if (newsEffectCurrentTime < 0)
                {
                    newsEffectActivate = false;
                    theStock.stockSc[newsEffectIndex].NewsEffectNotActivate();
                    Debug.Log("뉴스 효과 끝");
                }
            }
        }
    }
    void Update()
    {
        //false 일 경우 진행
        // 유저가 내려가면 더이상 실행 x, 유저가 아직 안내려가면 계속 체크
        if (playerEnd)
        {
            return;
        }

        if (!PlayerCs[playerNum].isEnd)
        {
            //isEnd 아니면 playerEnd 아님
            playerEnd = false;
        }
        else
        {
            //isEnd 이면 playerEnd 임
            playerEnd = true;
        }

        //유저가 종료했으면 실행
        if (playerEnd)
        {
            ResultPanel.SetActive(true);
            for (int i = 0; i < 6; i++)
            {
                playerCheck[i].SetActive(false);
            }
            playerCheck[playerNum].SetActive(true);

            for (int i = 0; i < peopleNumber; i++)
            {
                if (i != playerNum)
                {
                    ResultText[i].text = result[i];
                }
                else
                {
                    ResultText[playerNum].text = result[PlayerCs[playerNum].finishNum - 1];

                    if (ResultText[playerNum].text == "하트")
                    {
                        if (theStat.numberOfHarts < 5)
                        {
                            theNotice.NotificationAppear("하트당첨");
                            renderer               = theStat.harts[theStat.numberOfHarts].GetComponent <SpriteRenderer>();
                            renderer.color         = new Color(1f, 1f, 1f);
                            theStat.numberOfHarts += 1;
                        }
                        else
                        {
                            theNotice.NotificationAppear("하트당첨");
                        }
                    }
                    else if (ResultText[playerNum].text == "본전")
                    {
                        theStat.myAllMoney += theMini.inputMoney;
                        theNotice.NotificationAppear(theMini.inputMoney.ToString() + "$ 본전당첨");
                        /*레포트 미니게임 번 돈*/
                        theReport.nMonthEarnEstateMoney += theMini.inputMoney;
                    }
                    else if (ResultText[playerNum].text == "잭팟X6")
                    {
                        theStat.myAllMoney += theMini.inputMoney * 6;
                        theNotice.NotificationAppear((theMini.inputMoney * 6).ToString() + "$ 당첨");
                        /*레포트 미니게임 번 돈*/
                        theReport.nMonthEarnEstateMoney += theMini.inputMoney * 6;
                    }
                    else if (ResultText[playerNum].text == "잭팟X3")
                    {
                        theStat.myAllMoney += theMini.inputMoney * 3;
                        theNotice.NotificationAppear((theMini.inputMoney * 3).ToString() + "$ 당첨");
                        /*레포트 미니게임 번 돈*/
                        theReport.nMonthEarnEstateMoney += theMini.inputMoney * 3;
                    }
                    else if (ResultText[playerNum].text == "주식하나")
                    {
                        int stockN = 0;

                        for (int n = 0; n < theStat.myStockCountArray.Length; n++)
                        {
                            if (theStat.myStockCountArray[n] > 0)
                            {
                                stockN = n;
                            }
                        }

                        if (theStat.myStockCountArray[stockN] >= 1)
                        {
                            theStat.myStockCountArray[stockN] += 1;
                            theNotice.NotificationAppear(theStock.stockSc[stockN].stockNamePrice[stockN, 0] + " 주식 당첨");
                            /*레포트 미니게임 번 돈*/
                            theReport.nMonthEarnMiniMoney += theStock.stockSc[stockN].thisStockPrice;
                        }
                        else
                        {
                            theNotice.NotificationAppear("주식 미보유로인한 수령불가");
                        }
                    }

                    else
                    {
                        theNotice.NotificationAppear(ResultText[playerNum].text);
                    }
                }
            }

            //게임 종료
            BlindPanel.SetActive(false);
            StartCoroutine(ExitCoroutine());
            theMiniGame.ProfileSetting();
        }
    }
Exemple #10
0
 /* 홀짝 게임 버튼을 누르면 게임 시작 */
 public void OddEvenStart()
 {
     theOddEven.inputMoney = inputMoney;
     if (theStat.myAllMoney >= inputMoney) /* 500 이상 있을 경우 */
     {
         if (theStat.numberOfHarts > 0)    /* 하트가 있을 경우 게임 시작 */
         {
             theStat.HartOff();
             theStat.myAllMoney -= inputMoney;
             theNotice.NotificationAppear(inputMoney.ToString() + "$ 입장료");
             OEGamePanel.SetActive(true);
             theOddEven.init();
             playCount++;                                  //게임 실행 횟수 증가
             ProfileSetting();
             theBuilding.UpdateAllConditions(3);           //건물 조건 만족 확인하기
             theReport.nMonthTradeMiniCount += 1;          /*미니게임 플레이횟수 증가*/
             theReport.nMonthUseMiniMoney   += inputMoney; /*미니게임 게임비 쓴 돈*/
         }
         else //없을 경우, 시작 못함
         {
             theNotice.NotificationAppear("하트가 부족합니다.");
         }
     }
     else //돈이 부족할 경우, 시작 못함
     {
         theNotice.NotificationAppear("돈이 부족합니다.");
     }
 }