示例#1
0
    public void SetProperty(Godirum pGod, bool pIsForm, Vector3 pFinPosi, Vector3 pFinRot, float pLimitMilSec = 2000)
    {
        mGod      = pGod;
        mIsFormer = pIsForm;
        mFinPosi  = pFinPosi;
        mFinRot   = pFinRot;

        switch (mGod)
        {
        case Godirum.PLU:
            mRotValue = new Vector3(0, 0, 0.01f);
            break;

        case Godirum.MUL:
            int ranN = AgUtil.RandomInclude(30, 50);
            if (mIsFormer)
            {
                mRotValue = new Vector3(0, 0, ranN * 0.01f);
            }
            else
            {
                mRotValue = new Vector3(0, 0, -ranN * 0.002f);
            }
            break;
        }

        mLimit = pLimitMilSec;
    }
示例#2
0
    public void SetVarInBot(bool IsKicker, string Grade, int Level)
    {
        isKicker = IsKicker;
        //grade = Grade;
        grade       = (Grade == "S")? "A" : Grade;
        level       = Level;
        limitGameEA = 3;
        cost        = 1;
        condition   = enchant = 0;

        string head = "";
        int    num  = 0;

        if (isKicker)
        {
            num  = AgUtil.RandomInclude(1, 17);
            head = (num < 10) ? "W_N_Kicker00" : "W_N_Kicker0";
        }
        else
        {
            num  = AgUtil.RandomInclude(1, 4);
            head = (num < 10) ? "W_N_Goalie00" : "W_N_Goalie0";
        }
        info       = head + num;
        backNum    = AgUtil.RandomInclude(9, 95);
        playerName = GetName();
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        mGame = GameObject.Find("Ui_camera").gameObject;
        mGame.transform.FindChild("Camera/Ui_loadprefeb/panel_tip" + AgUtil.RandomInclude(10, 21)).gameObject.SetActive(true);

        Application.LoadLevel("StartMenu");
    }
示例#4
0
    public AmCrpt(UInt32 pVal)
    {
        mFactor = AgUtil.RandomInclude(3, 7);
        //Ag.LogDouble ("mFactor is  :: " + mFactor);

        Dlgt_V_Int rNum = () => AgUtil.RandomInclude(3, 500); // Fake List .. Use for Nothing..

        arrCrpt = new List <int>()
        {
            rNum(), rNum(), rNum(), rNum(), rNum(), rNum(), rNum(), rNum(), rNum(), rNum()
        };

        string val     = pVal.ToString();
        int    lengVal = val.Length;

        for (int k = 0; k < (10 - lengVal); k++)
        {
            val = "0" + val;
            //Ag.LogDouble(" val :: " + val);
        }
        strInt = "";

        for (int k = 0; k < 10; k++) // Random 3Character
        {
            int    rdNum  = AgUtil.RandomInclude(3, 50);
            string rndStr = "sdjl23kjas;dlkflasdfsadfsdfewqewroiwequroqweuoiewlkkwlksdflsadlflkasdflkasj,xcm,xzcmv,asd,as,df,slkewlk3io2weiodslfasdl".Substring(rdNum, 3);
            strInt += CriptInt(val.Substring(k, 1));
            strInt += rndStr;
            //Ag.LogDouble( " strInt :: >>" + strInt );
        }
        Ag.LogDouble(" strInt :: >>" + strInt);
    }
示例#5
0
    public static int GetRandomChant(this System.Random rand, int pGrade, int pMax)
    {
        if (pMax == 0)
        {
            return(0);
        }

        if (pGrade == 1)
        {
            return(1);
        }

        float numm = AgUtil.RandomInclude(1, 1000);           //rand.Next (1, 1000);

        // more (Lower Chant value) .. less (high value)
        int mult = 100, divN = 50 + (10 - pGrade) * 4, divX = mult + (10 - pGrade) * 4;

        for (int k = 0; k < 3; k++)
        {
            numm *= rand.Next(50, mult);
            numm /= rand.Next(divN, divX);
        }

        int rlt = (int)(numm * pMax / 1000) + 1;

        if (rlt > pMax)
        {
            return(pMax);
        }

        //numm.ToString ().HtLog ();
        return(rlt);
    }
    public void AiSetEnchantGrade(int pGrade)  // Grade : 1 ~ 10
    {
        // Enchant Setting..
        //System.Random rObj = new System.Random();

        int min = pGrade - 2, max = pGrade + 2;

        if (min < 0)
        {
            min = 0;
        }
        mEnchant = AgUtil.RandomInclude(min, max);

        // Grade..
        int sum = 0;

        for (int k = 0; k < 4; k++)
        {
            //arr4Grade [k] = rObj.GetRandomChant(pGrade, pMax: 3);
            arr4Grade [k] = AgUtil.RandomInclude(0, mEnchant + 2);
            sum          += arr4Grade[k];
        }
        ("Amplayer :: Ai Set Enchant Grade  >>>   mEnchant : " + mEnchant + " ,  arr4Grade :  " +
         arr4Grade[0] + ", " + arr4Grade[1] + ", " + arr4Grade[2] + ", " + arr4Grade[3] +
         "  Total :: " + (mEnchant + sum)).HtLog();
    }
    void PopupAfterCombi()
    {
        // show image
        InitPopupList();
        int ranN = AgUtil.RandomInclude(1, 999);

        if (ranN % 5 == 1)
        {
            if (ranN % 2 == 0)
            {
                Productid     = "com.appsgraphy.kvsskakao.popupstore04";
                mProductCode  = "1000007367";
                mPaymentPrice = 20000;
                GetTranjectionkey();
                popupCode = "DiscCombi";
                #if UNITY_ANDROID
                GoogleIAB.consumeProduct(Productid);
                GoogleIABManager.purchaseSucceededEvent += PurchaseSuccessed;
                #endif
                MenuCommonOpen("Ui_popupstore", "PopupCardMixLuckTicket", true);

                /*
                 * ShowSalePrice (dicMenuList["PopupCardMixLuckTicket"].transform.FindChild ("btn_item/Label_cost_before1").GetComponent<UILabel>(),
                 *             (ItemPrice("CardCombiAdvtHigh")*AfterEa ("DiscCombi")).ToString(),
                 *             dicMenuList["PopupCardMixLuckTicket"].transform.FindChild ("btn_item/Label_cost1").GetComponent<UILabel>(),
                 *             AfterPrice ("DiscCombi").ToString());
                 *
                 * dicMenuList["PopupCardMixLuckTicket"].transform.FindChild ("btn_item/Label_gold").GetComponent<UILabel>().text = "X "+ AfterEa ("DiscCombi").ToString();
                 */

                // General Show ...
            }
            else
            {
                Productid = "com.appsgraphy.kvsskakao.popupstore05";
                GetTranjectionkey();
                mProductCode  = "1000007368";
                mPaymentPrice = 20000;
                popupCode     = "DiscSave";


                #if UNITY_ANDROID
                GoogleIAB.consumeProduct(Productid);
                GoogleIABManager.purchaseSucceededEvent += PurchaseSuccessed;
                #endif
                MenuCommonOpen("Ui_popupstore", "PopupCardMixGradeReserveTicket", true);

                /*
                 * ShowSalePrice (dicMenuList["PopupCardMixGradeReserveTicket"].transform.FindChild ("btn_item/Label_cost_before1").GetComponent<UILabel>(),
                 *             (ItemPrice("CardCombiGrade")* AfterEa ("DiscSave")).ToString(),
                 *             dicMenuList["PopupCardMixGradeReserveTicket"].transform.FindChild ("btn_item/Label_cost1").GetComponent<UILabel>(),
                 *             AfterPrice ("DiscSave").ToString());
                 * dicMenuList["PopupCardMixGradeReserveTicket"].transform.FindChild ("btn_item/Label_safe").GetComponent<UILabel>().text = "X "+ AfterEa ("DiscSave").ToString();
                 */
            }
            // Show --- Grade retain ...
        }
        // button Action ...
    }
示例#8
0
    void PreGameVoicePlay()
    {
        int rannum = AgUtil.RandomInclude(1, 100);

        if (Ag.mgIsKick)
        {
            if (rannum % 6 == 1)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals01");
            }
            if (rannum % 6 == 2)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals03");
            }
            if (rannum % 6 == 3)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals04");
            }
            if (rannum % 6 == 4)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals01");
            }
            if (rannum % 6 == 5)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals03");
            }
            if (rannum % 6 == 0)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals04");
            }
        }
        else
        {
            if (rannum % 6 == 1)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperSaves01");
            }
            if (rannum % 6 == 2)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperSaves04");
            }
            if (rannum % 6 == 3)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperSaves07");
            }
            if (rannum % 6 == 4)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperMisses01");
            }
            if (rannum % 6 == 5)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperMisses03");
            }
            if (rannum % 6 == 0)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperMisses05");
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        //Debug.Log (AgUtil.RandomInclude(0,9));
        mUICamera = GameObject.Find("Ui_camera");
        mUICamera.transform.FindChild("Camera/Ui_loadprefeb/panel_tip" + AgUtil.RandomInclude(0, 9)).gameObject.SetActive(true);

        Application.LoadLevel("GameScene");
    }
    /// <summary>
    /// Kickoff_ready
    /// </summary>

    void Btn_Fun_MatchRequire()  // 준비하기
    {
        Ag.LogIntenseWord("   Btn_Fun_MatchRequire  >>>>  ...     >>   Flag :: ");

        //MatchingFlag = false;


        SortBtnInitSet();

        Ag.NodeObj.UserModify("ONLINE", statusOnly: true);

        string TimeNow = PreviewLabs.PlayerPrefs.GetString("ReviewStampTime");

        mBackDepthFlag = true;

        if (AgStt.mgGameTutorial)
        {
            Application.LoadLevel("GameScene");
            return;
        }
        if (TimeNow == null || TimeNow.Length < 5)
        {
            TimeNow = "1390441587486";
        }
        int ranNum = AgUtil.RandomInclude(1, 5);

        if (Ag.mySelf.WAS.reviewEvent == 0 && Ag.mySelf.myRank.WAS.winNum > 3 && ranNum == 1 && Ag.UnixTimeStampToDateTimeAddmili(double.Parse(TimeNow)).AddDays(1) < System.DateTime.Now && Ag.CurStorePlfm == StorePlfm.GooglePlay)
        {
            MenuCommonOpen("popup_review", "Ui_popup", true);
        }

        SendWasCardupdate();
        mMenuName = "Btn_Fun_MatchRequire";
        if (Ag.Uniform)
        {
            Ag.Uniform = false;
            if (!PutonNotbuyUniform())
            {
                return;
            }
        }
        dicMenuList ["MainCamera"].SetActive(false);
        dicMenuList ["Ui_team"].SetActive(false);
        dicMenuList ["Ui_lobby"].SetActive(false);
        dicMenuList ["Ui_kickoff"].SetActive(true);
        Btn_Fun_DrinkItem();
        Ag.mySelf.arrUniform [0].SetColorInfoString();
        Ag.mySelf.arrUniform [1].SetColorInfoString();

        if (Ag.mGuest)   // 게스트 모드일때는 친구리스트 안불러옴
        {
            dicMenuList ["kakao_sync_kickoff"].SetActive(true);
        }
        else
        {
            StartCoroutine(CoruMatchRequire());
        }
    }
    /// <summary>
    /// Sub Methods ...  Add direction [idx] with Random [wide] width..
    /// </summary>
    /// <param name="pDir">P dir.</param>
    void AddSmlDirect(int pDir)
    {
        int idx = (pDir - 1) * 2 + 1; // 1, 3, 5, 7  Width

        do
        {
            direction [idx] = AgUtil.RandomInclude(50, 650);
        } while (!CheckSmalArea());
    }
示例#12
0
    public void SetBotPlayerInfo()
    {
        int botCNum = WAS.isKicker ? Tbl.arrKickBotCard.Count : Tbl.arrKeepBotCard.Count;

        Ag.LogString(" Bot Player Info  ::   arr Num ? >>   " + botCNum);
        WasCard curCrd = WAS.isKicker ? Tbl.arrKickBotCard [AgUtil.RandomInclude(0, botCNum - 1)] : Tbl.arrKeepBotCard [AgUtil.RandomInclude(0, botCNum - 1)];

        WAS.country = curCrd.country;
        WAS.look    = curCrd.look;
        //  JKLeeMustFinishThis
    }
示例#13
0
    public AmCard xxGetFakeCard(string grade, bool isKicker)
    {
        AmCard rObj = new AmCard();

        rObj.WAS.grade    = grade;
        rObj.WAS.level    = AgUtil.RandomInclude(0, 9);
        rObj.WAS.isKicker = isKicker;
        rObj.WAS.InitDirectionAndSkill();
        rObj.WAS.ShowMySelf();
        return(rObj);
    }
    public static bool GetRandomTrue(this System.Random rand, int pTruePercent) // 0 ~ 100
    {
        int numm = AgUtil.RandomInclude(0, 99);                                 //  rand.Next (0, 100);

        //("Get Random True ::  " + numm).HtLog ();
        if (numm < pTruePercent)
        {
            return(true);
        }
        return(false);
    }
示例#15
0
    //  _////////////////////////////////////////////////_    _____  Actions  _____    Host Decision   _____
    public void FlipCoin()  // 선공 정하기
    {
        int rand = AgUtil.RandomInclude(11, 112);

        if (rand % 2 == 0)
        {
            return;
        }
        AmHost = !AmHost;
        NodeGamePreReverseHostVstr gamePre = new NodeGamePreReverseHostVstr();

        MySocket.ActionGameObj(gamePre);
    }
示例#16
0
    /// <summary>
    /// 어떤 팝업을 띄울지 리턴.
    /// </summary>
    /// <returns>팝업의 종류 </returns>
    public PopupStore KindOfPopup(string pCase, int pScore = 0)
    {
        Debug.Log("KindOfpopup Test    " + "AgMgdidwin   " + Ag.mgDidWin + " Pscore " + pScore);

        int ranNum = AgUtil.RandomInclude(1, 100);

        switch (pCase)
        {
        case "GameEnd":
            if (Ag.mySelf.ShowHeartPopup)
            {
                Ag.mySelf.CheckPopupHeartToday();

                if (Ag.mySelf.GameNumberOfToday == 10 && !Ag.mySelf.IsFreeCouponRemain)
                {
                    return(PopupStore.DiscHeartWeek);
                }
                if (Ag.mySelf.GameNumberOfToday == 15 && !Ag.mySelf.IsFreeCouponRemain)
                {
                    return(PopupStore.DiscHeartMonth);
                }
            }
            //if (Ag.mgDidWin == false && ranNum % 4 == 1) { // 25%
            if (!Ag.mgDidWin && ranNum % 10 == 1)   // 10%
            {
                return(PopupStore.DiscCardPurchase);
            }
            if (Ag.mgDidWin && pScore < 1000)   // 테스트 용도로 50000점 이하일때 100% 적용
            {
                int ranN = AgUtil.RandomInclude(1, 999);
                if (ranN % 50 == 4)  // 2 %
                {
                    return(PopupStore.DiscGloves);
                }
                if (ranN % 50 == 3)  // 2 %
                {
                    return(PopupStore.DiscShoes);
                }
            }
            return(PopupStore.None);

        case "AfterCashUse":
            if (ranNum % 5 == 1)
            {
                return(PopupStore.DiscCash);
            }
            return(PopupStore.None);
        }
        return(PopupStore.None);
    }
示例#17
0
    //  ////////////////////////////////////////////////     Starting Init Job
    public override void Start()
    {
        base.Start();
        mSeldomActionNum = 5;

        int ranN = AgUtil.RandomInclude(10, 100);

        if (ranN % 2 == 0)
        {
            ranN *= -1;
        }

        //mRotValue = new Vector3 (0, 0, ranN * 0.001f);

        mRotValue = new Vector3(0f, 0f, 0.5f);
    }
示例#18
0
 private void SetBotGrade()
 {
     arrBotGrade = new List <string> ();
     for (int k = 0; k < 6; k++)
     {
         string curGrd = GetCardOrderOf(k).WAS.grade;
         if (k < 1)
         {
             arrBotGrade.Add(curGrd);
         }
         else
         {
             arrBotGrade.Insert(AgUtil.RandomInclude(0, k - 1), curGrd);
         }
     }
     Ag.LogStartWithStr(2, " AmUser :: SetBotGrade  ...   " + arrBotGrade [0] + arrBotGrade [1] + arrBotGrade [2] + arrBotGrade [3]);
 }
示例#19
0
    public static List <int> CombiSelect(int pAmong, int pSel)  // 4 C 2  // include 0, 1, 2 ...
    {
        Ag.LogString("  AgUtil :: CombiSelect " + pAmong + "   select " + pSel);
        List <int> among = new List <int> ();
        List <int> rVal  = new List <int> ();

        for (int k = 0; k < pAmong; k++)
        {
            among.Add(k);
        }

        for (int k = 0; k < pSel; k++)
        {
            int val = among [AgUtil.RandomInclude(0, among.Count - 1)];
            among.Remove(val);
            rVal.Add(val);
        }
        return(rVal);
    }
示例#20
0
    public void SetBotScouter()
    {
        if (!WAS.isKicker)
        {
            ScoutObj = new Scouter("3_4_11_13_14_22_15_16_11_12_18_21");
            return;
        }

        ScoutObj = new Scouter();
        for (int k = 1; k <= 4; k++)
        {
            int wid = WAS.GetWidthOfDirection(k);
            int s   = wid * 5 / AgUtil.RandomInclude(50, 98);
            int f   = wid * 4 / AgUtil.RandomInclude(40, 78);
            s = s.GetSmaller(AgUtil.RandomInclude(3, 15));
            f = f.GetSmaller(AgUtil.RandomInclude(3, 15));
            //(k + "    wid " + wid + "   s / f " + s + ", " + f).HtLog ();
            ScoutObj.SetValue(k, s, f);
        }
        ScoutObj.GetString().HtLog();
    }
示例#21
0
    public void SetAsBot(int league, Rank myRank)  // league = 1, 2, .. 5
    {
        int initScore = (5 - league) * 20000;

        //전적 : 내 전적 +7  //승수 : 내 승수 +4
        WAS.winNum = myRank.WAS.winNum + 11 * (6 - league);
        //패수 : 내 패수 +3
        WAS.lossNum = myRank.WAS.lossNum + 7 * (6 - league);
        //승점 : 각 리그 기본점수 + (봇 승수 × 157 × 리그)
        WAS.weekScore = WAS.totalScore = initScore + WAS.winNum * 157 * league;
        // 등 수.
        WAS.thisWeekRank = (int)(myRank.WAS.thisWeekRank * 0.9f - AgUtil.RandomInclude(5, 15));

        if (myRank.WAS.thisWeekRank < 100)
        {
            WAS.winNum       = (int)(myRank.WAS.winNum * 0.79 - AgUtil.RandomInclude(2, 12));
            WAS.lossNum      = (int)(myRank.WAS.lossNum * 0.81 + AgUtil.RandomInclude(3, 10));
            WAS.weekScore    = (int)(myRank.WAS.weekScore * 0.81 - AgUtil.RandomInclude(4000, 12000));
            WAS.thisWeekRank = (int)(myRank.WAS.thisWeekRank * 1.25) + AgUtil.RandomInclude(10, 40);
        }
    }
示例#22
0
    // 유니폼 랜덤하게 입을 것 (편집된 상태)
    // 상대 유저와 같은 리그로 표시
    // 상대 선수와 동일한 등급 카드로 라인업을 구성하되 킥커 순서와 레벨은 랜덤
    public AmUniform SetUniform(int step, AmUniform pUnif = null)
    {
        AmUniform theUnif;

        if (pUnif == null)
        {
            theUnif = new AmUniform();
        }
        else
        {
            theUnif = pUnif;
        }

        int sMai = AgUtil.RandomInclude(5, 12), sSub = AgUtil.RandomInclude(5, 12);

        if (sSub == sMai)
        {
            sSub = (sSub > 8) ? sSub - 1 : sSub + 1;
        }
        // Kicker ..
        int txtr  = (step > 2) ? AgUtil.RandomInclude(2, 5) : 1;
        int txtrL = (step > 2) ? AgUtil.RandomInclude(2, 5) : 1;

        theUnif.Kick.SetValue(txtr, sMai, sSub,
                              txtrL, AgUtil.RandomInclude(1, 3), AgUtil.RandomInclude(1, 3),
                              1, sMai, sSub);
        sMai = AgUtil.RandomInclude(5, 12);
        sSub = AgUtil.RandomInclude(5, 12);
        if (sSub == sMai)
        {
            sSub = (sSub > 8) ? sSub - 1 : sSub + 1;
        }
        // Keeper
        txtr  = (step > 2) ? AgUtil.RandomInclude(2, 5) : 1;
        txtrL = (step > 2) ? AgUtil.RandomInclude(2, 5) : 1;
        theUnif.Keep.SetValue(txtr, sMai, sSub,
                              txtrL, AgUtil.RandomInclude(1, 3), AgUtil.RandomInclude(1, 3),
                              1, sMai, sSub);
        return(theUnif);
    }
示例#23
0
    public static bool?LinearPercentVari(int spot0, int spot1, int pSpot)
    {
        if ((spot0 < pSpot && spot1 < pSpot) || (spot0 > pSpot && spot1 > pSpot))
        {
            return(null);
        }

        if (pSpot == spot1)
        {
            return(true);
        }
        if (pSpot == spot0)
        {
            return(false);
        }

        int ratio = Math.Abs((int)(Math.Abs(pSpot - spot0) * 1000 / Math.Abs(
                                       (double)(spot1 - spot0)))); // in %% 1000

        int rand = AgUtil.RandomInclude(0, 1000);

        Ag.LogString("   Is it ?  ;: " + rand + "  <  " + ratio + "  => " + (rand < ratio));
        return(rand < ratio);
    }
示例#24
0
    public void SetUniform()
    {
        int sMai = AgUtil.RandomInclude(5, 12), sSub = AgUtil.RandomInclude(5, 12);

        if (sSub == sMai)
        {
            sSub = (sSub > 8) ? sSub - 1 : sSub + 1;
        }


        Uniform.Kick.SetValue(1, sMai, sSub,
                              1, AgUtil.RandomInclude(1, 3), AgUtil.RandomInclude(1, 3),
                              1, sMai, sSub);
        sMai = AgUtil.RandomInclude(5, 12);
        sSub = AgUtil.RandomInclude(5, 12);
        if (sSub == sMai)
        {
            sSub = (sSub > 8) ? sSub - 1 : sSub + 1;
        }

        Uniform.Keep.SetValue(1, sMai, sSub,
                              1, AgUtil.RandomInclude(1, 3), AgUtil.RandomInclude(1, 3),
                              1, sMai, sSub);
    }
    /// <summary>
    /// 최초 값 세팅
    /// </summary>
    public void InitDirectionAndSkill()
    {
        mustUpdate = true;
        SetSkillValue();

        if (!isKicker)   // keeper setting.
        {
            direction [0] = direction [1] = 100;
            direction [2] = direction [3] = direction [4] = 0;
            direction [AgUtil.RandomInclude(10, 500) % 2] = CalculateBalance(level);   // 0 , 1 ..
            return;
        }

        Ag.LogStartWithStr(1, " WasCard :: ...   SetDirection   ....   isKicker ::  " + isKicker + " Start      .... ID :  " + ID);

        kickOrder = -1;
        int wideN = 1;

        switch (grade)
        {
        case "S":
        case "A":
            wideN = 3;
            break;

        case "B":
            wideN = 2;
            break;

        case "C":
            wideN = 2;
            break;

        case "D":
            break;
        }
        //Ag.LogString (" Is Grade S ?? " + tempS + "   Current Grade :: " + grade);
        int width = GetDirectionWidthOfSmallArea(level);  // 34 .. 38 ..

        // 방향바 0, 2, 4, 6 을 좁은 영역으로 세팅
        for (int j = 0; j < 4; j++)
        {
            direction [j * 2] = width;
        }
        // SetWideDirection 조합으로 넓은 방향 선택.
        List <int> wideDirArr = AgUtil.CombiSelect(4, wideN); // (0, 2, 3)

        // in Case of B (different 2 dir), C (same 2 dir)
        if (grade == "C")
        {
            int dir = wideDirArr [0], dir2;
            if (dir < 2)
            {
                dir2 = dir + 2;
            }
            else
            {
                dir2 = dir - 2;
            }
            wideDirArr.Clear();
            wideDirArr.Add(dir);
            wideDirArr.Add(dir2);
        }
        if (grade == "B")
        {
            int dir = wideDirArr [0], dir2, ran = AgUtil.RandomInclude(0, 100) % 2; // ran = 0 or 1
            if (dir % 2 == 0)                                                       // 0, 2
            {
                dir2 = ran * 2 + 1;                                                 // 1, 3
            }
            else // 1, 3
            {
                dir2 = ran * 2; // 0, 2
            }
            wideDirArr.Clear();
            wideDirArr.Add(dir);
            wideDirArr.Add(dir2);
        }
        for (int j = 0; j < wideN; j++)
        {
            int dir = wideDirArr [j] + 1;
            if (wideN == 1)
            {
                AddWideDirect(pWid: 1000, pDir: dir, pLast: false);
                break;
            }
            //if (j == 0) {
            int max = wideN > 2 ? 400 : 500;
            max = wideN == 4 ? 300 : max;
            //("wideN  :  " + wideN + "    max  " + max).HtLog ();
            AddWideDirect(pWid: AgUtil.RandomInclude(152, max), pDir: dir, pLast: j == wideN - 1);
            //continue;
            //}
            //int wid = 1000 / wideN;
            //AddWideDirect (pWid: AgUtil.RandomInclude (wid - 100, wid + 100), pDir: dir, pLast: j == wideN - 1);
        }

        // Set Small Direction Position
        List <int> smlDirArr = new List <int> ();

        smlDirArr.Add(0);
        smlDirArr.Add(1);
        smlDirArr.Add(2);
        smlDirArr.Add(3);
        foreach (int k in wideDirArr)
        {
            //Ag.LogString ("  Small Direct is " + k);
            smlDirArr.Remove(k);
        }
        foreach (int sV in smlDirArr)
        {
            AddSmlDirect(sV + 1);
        }
    }
示例#26
0
    /// <summary>
    /// I am Enemy ..  에너미를 봇으로 세팅
    /// Bots the uniform card rank item setting.
    /// </summary>

    public void BotUniformCardRankItemSetting()
    {
        // Uniform Setting.
        //Ag.mVirServer.BotIDSetting ();

        arrUniform = new List <AmUniform> ();
        arrUniform.Add(Ag.mVirServer.SetUniform(Ag.mVirServer.maiGradeOfBot));   //, arrUniform [0]); // 봇은 유니폼 1개만 필요.

        Ag.LogIntenseWord(" BotUniformCardRankItemSetting  " + arrUniform.Count);

        arrUniform [0].ShowMySelf();

        // Card Setting
        arrCard = new List <AmCard> ();
        //  _____  Set Keeper
        AmCard aCard = new AmCard();

        aCard.WAS.SetVarInBot(false, Ag.mySelf.GetBotGrade(), AgUtil.RandomInclude(0, 4));
        aCard.WAS.isKicker  = false;
        aCard.WAS.kickOrder = 0;
        aCard.WAS.InitDirectionAndSkill();
        aCard.SetBotScouter();
        aCard.SetBotPlayerInfo();
        aCard.WAS.ShowMySelf();
        arrCard.Add(aCard);
        //  _____  Set Kicker
        for (int k = 0; k < 5; k++)
        {
            aCard = new AmCard();
            //aCard.WAS.SetVarInBot (true, "C", AgUtil.RandomInclude (0, 4));
            aCard.WAS.SetVarInBot(true, Ag.mySelf.GetBotGrade(), AgUtil.RandomInclude(0, 4));
            aCard.WAS.InitDirectionAndSkill();
            aCard.SetBotScouter();
            aCard.SetBotPlayerInfo();
            aCard.WAS.isKicker  = true;
            aCard.WAS.kickOrder = k + 1;
            aCard.WAS.ShowMySelf();
            arrCard.Add(aCard);
        }

        myRank.SetAsBot(Ag.mySelf.LeagueAsInt, Ag.mySelf.myRank);
        Ag.NodeObj.EnemyUser = Ag.myEnem;
        Ag.LogString("WeekWinNum" + Ag.NodeObj.EnemyUser.myRank.WAS.winNumWeek);

        // Item Setting
        arrItem = new List <AmItem> ();
        // Message
        AmItem aItm = new AmItem();

        aItm.WAS.itemTypeID = "StartMessage";
        aItm.SetVarInBot();
        arrItem.Add(aItm);
        aItm = new AmItem();
        aItm.WAS.itemTypeID = "EndMessage";
        aItm.SetVarInBot();
        arrItem.Add(aItm);
        aItm = new AmItem();
        aItm.WAS.itemTypeID = "CeremonyDefault";
        aItm.SetVarInBot();
        arrItem.Add(aItm);
    }
    //  _////////////////////////////////////////////////_    _///////////////////////_    _____  Set Frames   _____  2 * Single Row  _____
    void SetDoubleHor1Row()
    {
        //  _////////////////////////////////////////////////_    _____  General Option 양 프레임에 공통 적용  _____
        //optObj = new CuUiOption (HoldLimit: 30, SelDist: 0.5f, FlyingSpdMin: 0.05f, SpdLimit: 3f);
        optObj = new CuUiOption(HoldLimit: 5, SelDist: 1.2f, FlyingSpdMin: 0.05f, SpdLimit: 3f);
        mTouch = new CuTouch(optObj);

        mLiaison = new CuLiaison();


        // Frame Setting ..  Upper Frame
        int eaX = 5, eaY = 1; // 셀의 갯수. 삽입될 것 고려해서 충분히 잡을 것.

        //  _////////////////////////////////////////////////_    _____  Frame Option  _____
        optFrame = new CuFrameOption(optObj, Vert: false, MoveAniSpd: 200, SizeAniSpd: 100, SelectSize: 1.2f, SwitchSize: 0.9f,
                                     SwitchInFrame: false);

        // Set Touch Manager
        float   dimX, dimY;     // 셀의 크기.
        Vector3 vecOri, vecMax; // 스크린 좌하/우상 좌표 가져오기. (월드 좌표계로 변환)

        muiCam.GetComponent <UICam> ().GetWorldPointsOfCurScreen(out vecOri, out vecMax);
        dimX = (vecMax.x - vecOri.x) / 5; //7; // 스크린 크기를 기준으로 셀의 크기를 정한다.
        dimY = (vecMax.y - vecOri.y) / 3; //8;

        Ag.LogDouble(" TileUITest ::     Screen World Points .. " + vecOri.LogWith("world 1") +
                     vecMax.LogWith("world 2") + Ag.mgScrX.LogWith("ScrX") + Ag.mgScrY.LogWith("ScrY"));

        AgUiManDoubleRow theMan = new AgUiManDoubleRow("UPFR", mTouch, optFrame, muiCam);

        theMan.SetFrame(eaX: eaX, eaY: eaY, reverse: false, xyTchFrame: new float[] {
            0.1f,  // Xmin
            0.55f, // Ymin
            0.9f,  // Xmax
            0.9f,  // Ymax
            0.1f,
            0.55f,
            0.9f, // Xmax
            0.9f
        });

        Ag.LogDouble(" TileUI Test :: Setting  >>>   Vects " + vecOri + ", " + vecMax + " >> dimX/Y : " + dimX + " / " + dimY);

        // Set Wagu, Container ...  TIle Manager ...
        Vector3 boxScale        = new Vector3(dimX * 0.8f, dimY * 0.8f, 0.5f); // 크기 조절.
        int     serialN         = 0;

        /*for (int ii=0; ii < eaY; ii++) {
         *  for (int k=0; k < eaX; k++) {
         *      GameObject curObj = mRscrcMan.GetPrefabAt (Folder: "_TestMoon", pName: "ATile");
         *      curObj.name = "UP_BOX_" + serialN++; //k.ToString() + ii;
         *      curObj.transform.renderer.material.mainTexture = mRscrcMan.GetTextureIn ("Download", "Item" + (serialN % 10 + 1));
         *      curObj.transform.localScale = boxScale;
         *      curObj.CellCs ().InitPstnSize (optFrame);
         *
         *      AmCard playerCard = new AmCard (pGrade: AgUtil.RandomInclude (0, 20), pType: 5, pWthr: "CLOUD");  // Type, Grade, Weather .. setting ...
         *      curObj.CellCs ().PlCard = playerCard;
         *
         *      string kind = "TEST"; // serialN < 3 ? "ATTK" : "DPNC" ;
         *      theMan.AddACell (curObj, k, ii, kind);
         *
         *      Ag.LogString (" Add a Cell  " + curObj.name + "   " + k.LogWith ("X") + ii.LogWith ("Y"));
         *  }
         * } */

        mTouch.evntTouchDown += theMan.CheckInside; // 필수.

        //mTouch.evntDrag += theMan.Scroll; // 스크롤 가능하게
        //theMan.dodgeScroll += theMan.DidSelected;
        //theMan.dodgeScrollArea += theMan.OutOfMyTouchArea;

        mTouch.evntHold += theMan.SelectNearest;

        mTouch.evntHoldMove     += theMan.SwitchCombination; // Empty Cell   스위치 가능하게..  #####
        theMan.dodgeSwitchCombi += theMan.IsFrameOffLimit;

        //mTouch.evntHoldMove += theMan.AutoScroll;

        theMan.dodgeSelectNear        += theMan.DidSelected;
        theMan.dodgeSelectNear        += theMan.IsFrameOffLimit;
        theMan.dodgeSelectNearestArea += theMan.OutOfMyTouchArea;

        mTouch.evntTouchUp += mLiaison.InsertRemove;



        //mTouch.evntInitFly = theMan.InitiateFly;
        //theMan.evntFlyBack = theMan.FlyBack;

        //theMan.dodgeAutoScrlArea += theMan.OutOfMyTouchArea;
        //theMan.dodgeAutoScrl += theMan.SelectObjIsNull;

        theMan.evntAlienCame = theMan.AlienCame_SetSwitchObj;
        mTouch.evntTouchUp  += theMan.RelaseProcess; // Put @ Last ...

        theMan.mLiaison = mLiaison;

        arrMan.Add(theMan);



        // Frame Setting ..  Lower Frame
        eaX = 15;
        eaY = 1; // 셀의 갯수. 삽입될 것 고려해서 충분히 잡을 것.

        //  _////////////////////////////////////////////////_    _____  Frame Option  _____
        optFrame = new CuFrameOption(optObj, Vert: false, MoveAniSpd: 100, SizeAniSpd: 100, SelectSize: 1.2f, SwitchSize: 0.9f,
                                     SwitchInFrame: false);

        // Set Touch Manager
        muiCam.GetComponent <UICam> ().GetWorldPointsOfCurScreen(out vecOri, out vecMax);
        dimX = (vecMax.x - vecOri.x) / 6; //7; // 스크린 크기를 기준으로 셀의 크기를 정한다.
        dimY = (vecMax.y - vecOri.y) / 3; //8;

        Ag.LogDouble(" TileUITest ::     Screen World Points .. " + vecOri.LogWith("world 1") +
                     vecMax.LogWith("world 2") + Ag.mgScrX.LogWith("ScrX") + Ag.mgScrY.LogWith("ScrY"));

        theMan = new AgUiManDoubleRow("LOWR", mTouch, optFrame, muiCam); //, new float[] { vecOri.x * 0.9f, vecMax.x*0.9f, vecOri.y*0.9f, vecMax.y*0.9f } );
        theMan.SetFrame(eaX: eaX, eaY: eaY, reverse: false, xyTchFrame: new float[] {
            0.1f,                                                        // Xmin
            0.05f,                                                       // Ymin
            0.9f,                                                        // Xmax
            0.45f,                                                       // Ymax
            0.1f,
            0.05f,
            2.5f,
            0.45f
        });

        Ag.LogDouble(" TileUI Test :: Setting  >>>   Vects " + vecOri + ", " + vecMax + " >> dimX/Y : " + dimX + " / " + dimY);
        Ag.LogString(" Option " + optFrame.optMoveAniSpd.LogWith("AniSpd"));

        // Set Wagu, Container ...  TIle Manager ...

        //new float[] { vecOri.x, vecMax.x, vecOri.y, vecMax.y } );
        boxScale = new Vector3(dimX * 0.8f, dimY * 0.8f, 0.5f);   // 크기 조절.
        serialN  = 0;
        //        for (int k=0; k< eaX - 6; k++) { // 12를 기본으로 넣고.. 6개까지 추가 가능.
        //            for (int ii=0; ii< 1; ii++) {
        for (int ii = 0; ii < eaY; ii++)
        {
            for (int k = 0; k < eaX; k++)
            {
                GameObject curObj = mRscrcMan.GetPrefabAt(Folder: "_TestMoon", pName: "ATile");
                curObj.name = "LW_BOX_" + serialN++; //k.ToString() + ii;
                curObj.transform.renderer.material.mainTexture = mRscrcMan.GetTextureIn("Download", "Item" + (serialN % 10 + 1));
                curObj.transform.localScale = boxScale;
                curObj.CellCs().InitPstnSize(optFrame);

                AmCard playerCard      = new AmCard(pGrade: AgUtil.RandomInclude(0, 20), pType: 5, pWthr: "CLOUD"); // Type, Grade, Weather .. setting ...
                curObj.CellCs().PlCard = playerCard;

                string kind = "TEST"; // serialN < 3 ? "ATTK" : "DPNC" ;
                theMan.AddACell(curObj, k, ii, kind);

                Ag.LogString(" Add a Cell  " + curObj.name + "   " + k.LogWith("X") + ii.LogWith("Y"));
            }
        }

        mTouch.evntTouchDown += theMan.CheckInside;

        mTouch.evntDrag        += theMan.Scroll;
        theMan.dodgeScroll     += theMan.DidSelected;
        theMan.dodgeScrollArea += theMan.OutOfMyTouchArea;

        mTouch.evntHold += theMan.SelectNearest;

        // Normal Switch
        //mTouch.evntHoldMove += theMan.Switch;
        mTouch.evntHoldMove     += theMan.SwitchCombination; // Empty Cell   스위치 가능하게..  #####
        theMan.dodgeSwitchCombi += theMan.IsFrameOffLimit;

        theMan.dodgeSelectNear        += theMan.DidSelected;
        theMan.dodgeSelectNear        += theMan.IsFrameOffLimit;
        theMan.dodgeSelectNearestArea += theMan.OutOfMyTouchArea;

        mTouch.evntTouchUp += theMan.RelaseProcess;
        mTouch.evntInitFly += theMan.InitiateFly;
        theMan.evntFlyBack += theMan.FlyBack;

        //touchObj.evntAutoScrl += theMan.AutoScroll;
        theMan.dodgeAutoScrlVec += theMan.OutOfMyTouchArea;
        theMan.dodgeAutoScrl    += () => {
            return(true);
        };

        // Liaison Related ..
        theMan.evntAlienCame = theMan.AlienCame_SetSwitchObj;

        theMan.mLiaison = mLiaison;

        arrMan.Add(theMan);
    }
示例#28
0
    void EndingCer()
    {
        EnemyCeremony = Ag.NodeObj.EnemyUser.GetApplyIDofItem("CeremonyDefault");
        MyCeremony    = Ag.mySelf.GetApplyIDofItem("CeremonyDefault");


        if (Ag.mSingleMode)
        {
            EnemyCeremony = 0;
            switch (Ag.mVirServer.maiGradeOfBot)
            {
            case 2:
                if (AgUtil.RandomInclude(1, 50) % 5 == 2)
                {
                    EnemyCeremony = AgUtil.RandomInclude(3, 5);
                }
                break;

            case 3:
            case 4:
                EnemyCeremony = AgUtil.RandomInclude(3, 5);
                break;

            case 0:
                if (AgUtil.RandomInclude(1, 50) % 3 == 1)
                {
                    EnemyCeremony = AgUtil.RandomInclude(3, 5);
                }
                break;
            }
        }

        ranNumStr      = "1";
        ranKeeperStr   = "1";
        mSkillCeremony = true;
        if (!AgStt.mgGameTutorial)
        {
            if (MyCeremony > 0 && Ag.mgDidWin == true || EnemyCeremony > 0 && Ag.mgDidWin == false)
            {
                StartCoroutine(WaitSkillAction());
                mSkillCeremony = false;
            }
        }
        LastCerLogic();

        int rannum = AgUtil.RandomInclude(1, 100);

        if (Ag.mgDidWin)
        {
            if (rannum % 3 == 0)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/Winthegame1");
            }
            if (rannum % 3 == 1)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/Winthegame2");
            }
            if (rannum % 3 == 2)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/Winthegame3-2");
            }
        }
        else
        {
            if (rannum % 3 == 0)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/Losethegame02");
            }
            if (rannum % 3 == 1)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/Losethegame04");
            }
            if (rannum % 3 == 2)
            {
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/Losethegame07");
            }
        }
    }
示例#29
0
    void KickerVoice()
    {
        int rannum = AgUtil.RandomInclude(1, 10);


        if (Ag.mgIsKick)
        {
            if (Ag.mgDidWin)
            {
                if (Ag.mgSkill == 1)
                {
                    if (rannum % 2 == 1)
                    {
                        VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals05");
                    }
                    else
                    {
                        VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals09");
                    }
                }
                if (Ag.mgSkill == 2)
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals07");
                }
                if (Ag.mgSkill == 3)
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerGoals07");
                }
            }
            else
            {
                if (IsKickerDdong())
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerNoGoals04");
                    return;
                }
                if (IsSameDirection())
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerNoGoals07");
                    return;
                }
                if (IsSameDirection() && Ag.mgEnemSkill == 2)
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KickerNoGoals09");
                    return;
                }
            }
        }
        else
        {
            if (Ag.mgDidWin)
            {
                if (IsSameDirection() && Ag.mgEnemSkill == 2)
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperSaves03");
                    return;
                }
                if (IsSameDirection())
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperSaves06");
                    return;
                }

                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperSaves08");
            }
            else
            {
                if (!IsSameDirection())
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperMisses04");
                    return;
                }
                if (IsSameDirection())
                {
                    VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperMisses05");
                    return;
                }
                VoiceSoundManager.Instance.Play_Effect_Sound("voice/KeeperMisses02");
            }
        }
    }
示例#30
0
 void CeremonyAnimation(bool isKicker, bool didWin)
 {
     int randNum = AgUtil.RandomInclude(1, 8);
 }