Exemplo n.º 1
0
    /// <summary>
    /// 当前玩家移动完成
    /// </summary>
    public void CurRoleMoveEnd()
    {
        //没有可以执行的东西了
        if (_diceCallbackInfoNew == null || _diceCallbackInfoNew.Info == null || _diceCallbackInfoNew.Info.Count <= 0)
        {
            Debug.Log("CurRoleMoveEnd 当前玩家移动完成 通知色子可以继续!!!");
            _isShowDice = true;
            _middleTra.gameObject.SetActive(true);
            //体力不足最小骰子消耗
            if (!ZillionairePlayerManager._instance.CurrentPlayer.IsMinPower())
            {
                Debug.Log("体力不足不可以投掷骰子!!!");
                StaticData.OpenBuyPower(ConfirmBuyItems, CancelBuyPower);
            }

            return;
        }

        //获取移动终点格子
        var grid = ZillionaireGameMapManager._instance.GetGridDataByID(ZillionairePlayerManager._instance.CurrentPlayer.CurGridID);

        Debug.Log("当前移动到的格子id:" + ZillionairePlayerManager._instance.CurrentPlayer.CurGridID);
        Debug.Log("当前移动到的格子的数据的id:" + grid.GridInfo.ID);

        //激活事件 随机事件 //激活普通事件
        if (grid.IsActiveEvent || grid.GridInfo.IsEvent)
        {
            ZillionaireGameMapManager._instance.CurZillionaireMapControl.CurMapEventManager.ActiveEvent(_diceCallbackInfoNew.Info[0], grid, ActionEvenCallback);
            return;
        }

        //领取奖励
        if (grid.GridInfo.BasicReward != null && grid.GridInfo.BasicReward.ID != 0)
        {
            Debug.Log("CurRoleMoveEnd 只有奖励");
            //
            int baseNum = (int)grid.GridInfo.BasicReward.Count;
            //金币进行等级计算
            if (grid.GridInfo.BasicReward.ID == StaticData.configExcel.GetVertical().GoldGoodsId)
            {
                baseNum = ZillionaireToolManager.GetGridBaseReward(baseNum);
            }
            //暂存玩家获得的奖励
            ZillionairePlayerManager._instance.CurrentPlayer.AddPlayerRewards(grid.GridInfo.BasicReward.ID, baseNum);
            //发放体力奖励 + 播放角色获得动画
            ZillionairePlayerManager._instance.CurrentPlayer.IssueCurrentRewards();
            //CurDiceActionEnd();
        }

        CurDiceActionEnd();
    }
Exemplo n.º 2
0
    /// <summary>
    /// 奖励翻倍事件
    /// </summary>
    private void RewardDoubledEvent(ZillionaireEventDefine curEvent, ZillionaireGameMapGridDefInfo gridInfo)
    {
        //1.播放动画效果 翻倍数量在动效中表现
        //2.获得奖励效果
        int baseNum = (int)gridInfo.GridInfo.BasicReward.Count;

        //金币进行等级计算
        if (gridInfo.GridInfo.BasicReward.ID == StaticData.configExcel.GetVertical().GoldGoodsId)
        {
            baseNum = ZillionaireToolManager.GetGridBaseReward(baseNum);
        }

        baseNum *= curEvent.Effect;
        //暂存玩家获得的奖励
        ZillionairePlayerManager._instance.CurrentPlayer.AddPlayerRewards(gridInfo.GridInfo.BasicReward.ID, baseNum);
        //发放体力奖励 + 播放角色获得动画
        ZillionairePlayerManager._instance.CurrentPlayer.IssueCurrentRewards();
        //通知格子播放获得奖励效果
        gridInfo.PlayPickupItemEffect(true);
        //完成
        EventEnd();
    }
Exemplo n.º 3
0
    /// <summary>
    /// 大满贯事件
    /// </summary>
    private async void GrandSlamEvent(ZillionaireEventDefine curEvent)
    {
        //1.播放动画效果
        List <ZillionaireGameMapGridDefInfo> needPlayAnimList = new List <ZillionaireGameMapGridDefInfo>();

        //2.有大满贯触发格子播放获得道具效果
        foreach (var item in ZillionaireGameMapManager._instance.CurZillionaireMapControl.MapGridDic)
        {
            if (!item.Value.GridInfo.IsTrigger)
            {
                continue;
            }

            needPlayAnimList.Add(item.Value);

            //添加奖励
            int baseNum = (int)item.Value.GridInfo.BasicReward.Count;
            //金币进行等级计算
            if (item.Value.GridInfo.BasicReward.ID == StaticData.configExcel.GetVertical().GoldGoodsId)
            {
                baseNum = ZillionaireToolManager.GetGridBaseReward(baseNum);
            }
            //暂存玩家获得的奖励
            ZillionairePlayerManager._instance.CurrentPlayer.AddPlayerRewards(item.Value.GridInfo.BasicReward.ID, baseNum);
        }
        while (needPlayAnimList.Count > 0)
        {
            Debug.Log("通知格子播放获得奖励效果!");
            //通知格子播放获得奖励效果
            needPlayAnimList[0].PlayPickupItemEffect(true);
            await UniTask.Delay(200);

            needPlayAnimList.RemoveAt(0);
        }

        Debug.Log("大满贯事件 end");
        //完成
        EventEnd();
    }