Example #1
0
    /// <summary>
    /// 开始竞猜
    /// </summary>
    public override void StartGame()
    {
        base.StartGame();
        GambleTrickySizeItem cup = gambleBuilder.GetCup();

        cup.SetCallBack(this);
        cup.SetStatus(GambleTrickySizeItem.CupStatusEnum.Choosing);
    }
Example #2
0
    /// <summary>
    /// 协程-开始改变杯子
    /// </summary>
    public IEnumerator CoroutineForStartChangeSize()
    {
        GambleTrickySizeItem cup = gambleBuilder.GetCup();

        cup.SetStatus(GambleTrickySizeItem.CupStatusEnum.Changing);
        yield return(new WaitForSeconds(2.6f));

        StartGame();
    }
Example #3
0
    /// <summary>
    /// 开始结算
    /// </summary>
    public override void StartSettlement()
    {
        base.StartSettlement();
        //展示结果
        GambleTrickySizeItem cup = gambleBuilder.GetCup();

        cup.SetStatus(GambleTrickySizeItem.CupStatusEnum.Result);
        StartCoroutine(CoroutineForSettlement());
    }
Example #4
0
    public void SizeChoose(int size)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        GambleTrickySizeItem cup = gambleBuilder.GetCup();
        float        winRate     = Random.Range(0f, 1f);
        GameDataBean gameData    = GameDataHandler.Instance.manager.GetGameData();

        //幸运加成
        gameData.userCharacter.GetAttributes(out CharacterAttributesBean characterAttributes);
        float addWinRate = 0.0025f * characterAttributes.lucky;

        if (winRate <= (gambleData.winRate + addWinRate))
        {
            gambleData.SetIsWin(true);
            if (size == 0)
            {
                int number = Random.Range(1, 4);
                cup.SetResult(number);
            }
            else
            {
                int number = Random.Range(4, 7);
                cup.SetResult(number);
            }
        }
        else
        {
            gambleData.SetIsWin(false);
            if (size == 0)
            {
                int number = Random.Range(4, 7);
                cup.SetResult(number);
            }
            else
            {
                int number = Random.Range(1, 4);
                cup.SetResult(number);
            }
        }
        StartSettlement();
    }
 public void SetCup(GambleTrickySizeItem gambleCup)
 {
     this.gambleCup = gambleCup;
 }
Example #6
0
 /// <summary>
 /// 设置杯子
 /// </summary>
 /// <param name="gambleTrickySizeItem"></param>
 public void SetCup(GambleTrickySizeItem gambleTrickySizeItem)
 {
     gambleBuilder.SetCup(gambleTrickySizeItem);
 }