Example #1
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");
    }
    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();
    }
Example #3
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();
    }
Example #4
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);
    }
Example #5
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;
    }
Example #6
0
//    public IEnumerator Awake ()
//    {
//        return 0;
//        //base.Awake ();
//        //DontDestroyOnLoad (this.gameObject);
//    }
    // Use this for initialization



    public override void Start()
    {
        //Ag.GameStt.TitleSceneBegan ();

        base.Start();
        //CheckWasServerVision ();
        //Debug.Log ("Getbool" + PreviewLabs.PlayerPrefs.GetBool ("BgmSoundOff"));
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        #if UNITY_IPHONE
        NotificationServices.RegisterForRemoteNotificationTypes(RemoteNotificationType.Alert | RemoteNotificationType.Badge | RemoteNotificationType.Sound);
        Ag.LogIntenseWord("NotificationServices.  Register For Remote NotificationTypes  ");
        #endif

        ("  Title :: Start    ").HtLog();
        //Ag.mFBOrder = "ConNet";
        GameInit();
        StartCoroutine(WaitAndPrint());
        JCE.JceUrgentNoticePT(Ag.mySelf);
        JCE.JceTextNoticePT(Ag.mySelf);


        if (AgUtil.IsLGeVuModel())
        {
            Screen.SetResolution((Screen.height / 2) * 3, Screen.height, true);
        }
    }
Example #7
0
    //  _////////////////////////////////////////////////_    _____  Joyple  _____    JCE   _____
    public static void JceUrgentNoticePT(AmUser User)
    {
        Ag.LogStartWithStr(2, "   JceUrgentNoticePT  >>      Started   .........  . . . . . . ");
        WebClient webClient = new WebClient();

        webClient.QueryString.Add("game_code", "113");
        webClient.QueryString.Add("client_secret", "5423b620768434b2a928e2cc62af2785");

        string result;

        if (!JCE.WebDownloadString(webClient, JCE.NoticeUrl + "urgent-notice/info", out result))
        {
            return;
        }
        JSONNode jnObj = JSON.Parse(result);

        ("   JceUrgentNoticePT  >>  Received :::   " + result).HtLog();

        if (AgUtil.IsNullJson(jnObj ["result"] ["info"]))
        {
            return;
        }

        JSONNode imgNtc = jnObj ["result"] ["info"];

        Ag.LogString(" JceUrgentNoticePT ::  Count  " + imgNtc.Count);
        JceTextNotice img = new JceTextNotice(jnObj ["timestamp"]);

        img.ParseFrom(imgNtc);
        if (img.platform == 0 || img.platform == AgStt.JoyplePlatformID)
        {
            Joycity.UrgentNotice = img;
        }
    }
Example #8
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);
    }
Example #9
0
    public static Texture2D GetTexture2D(string pName)
    {
        string fullName = pName + AgUtil.GetLanguage();

        AgUtil.GetTextureInArr(fullName, arrSomeTexture);
        return(null);
    }
    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 ...
    }
Example #11
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());
    }
    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);
    }
Example #16
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);
    }
Example #17
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
    }
    //  _////////////////////////////////////////////////_    _____  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);
    }
Example #19
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);
    }
Example #20
0
    public Scouter(JSONNode pJson)
    {
        if (AgUtil.IsNullJson(pJson))
        {
            SetVoidCount();
            return;
        }
        StackOfInt stObj = new StackOfInt(pJson);

        for (int k = 0; k < 6; k++)
        {
            arrCount.Add(new SctCounter(stObj.PopHeadInt(), stObj.PopHeadInt()));
        }
    }
Example #21
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);
    }
Example #22
0
    public static string xxRemoveDot(string pTarget)
    {
        string rStr    = "";
        string pattern = "^[a-zA-Z0-9]{1}$";

        int j, num = pTarget.Length;

        for (j = 0; j < num; j++)
        {
            string cur = pTarget.Substring(j, 1);
            if (AgUtil.CheckNickValidWithPattern(cur, pattern))
            {
                rStr += cur;
            }
        }
        return(rStr);
    }
Example #23
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]);
 }
Example #24
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);
    }
Example #25
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);
        }
    }
Example #26
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();
    }
Example #27
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);
    }
Example #28
0
    public string ToJsonStr()
    {
        string SendStr = "";

        SendStr  = SendStr.AddKeyValue("isKicker", isKicker);
        SendStr += AgUtil.IntArrToJson("direction", direction);
        SendStr += AgUtil.IntArrToJson("skill", skill);
        SendStr  = SendStr.AddKV3("limitGameEA", limitGameEA, "cost", cost, "level", level);
        SendStr  = SendStr.AddKV3("enchant", enchant, "condition", condition, "backNum", backNum);
        SendStr  = SendStr.AddKV3("kickOrder", kickOrder, "price4trade", price4trade, "ID", ID);                           // int
        SendStr  = SendStr.AddKV3("info", info, "grade", grade, "playerName", playerName);                                 // string
        SendStr  = SendStr.AddKV3("leagueType", leagueType, "tradeState", tradeState, "dirSuccessRatio", dirSuccessRatio); // string
        SendStr  = SendStr.AddKeyValue("scouter", scouter);

        //public string country, position;        public int playerID, look;
        SendStr = SendStr.AddKV2("country", country, "position", position);
        SendStr = SendStr.AddKV2("playerID", playerID, "look", look);

        SendStr = SendStr.AddKeyValue("tradeTs", tradeTs, false);
        SendStr = SendStr.AddParen();
        return(SendStr);
    }
    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);
    }
Example #30
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);
    }