示例#1
0
    // Update is called once per frame
    void Update()
    {
        foreach (SkillInfoDate pd in skillDic.Values)
        {
            pd.Update(Time.deltaTime);
        }

        if (startTime == 0 || curSlot == -1)
        {
            return;
        }

        Iplayer player = UIViewerPersonInfo.Instance.SetCurrClickPlayer;

        if (!skillDic.ContainsKey(player))
        {
            return;
        }

        if (Time.time - startTime >= timeLimit)
        {
            EventCenter.Broadcast <bool, int, Iplayer>(EGameEvent.eGameEvent_SkillDescribleId, true, skillDic[player].GetSkillId(curSlot), player);

            startTime = 0f;
            curSlot   = -1;
        }
    }
示例#2
0
    void SetAbsVis(Iplayer player, int skillID, int slot)
    {
        if (skillID == 0)
        {
            skillDic[player].RemoveSkillInofDate(slot);

            if (UIViewerPersonInfo.Instance.SetCurrClickPlayer == player)
            {
                InfoPlayerSkill(player);
            }
            return;
        }
        NpcConfigInfo npcCfg = ConfigReader.GetNpcInfo(skillID);

        if (npcCfg == null)
        {
            return;
        }
        SkillManagerConfig skillCfg = ConfigReader.GetSkillManagerCfg(npcCfg.NpcSkillType2);

        if (skillCfg == null)
        {
            return;
        }
        skillDic[player].AddSkillInfoDate(skillCfg.id, slot, npcCfg.HeadPhoto.ToString(), skillCfg.coolDown / 1000, 0, true);
    }
示例#3
0
    //change fury state
    public void  ChangeFuryState(Iplayer player)
    {
        EFuryState state = PlayerSkillData.Instance.FuryState;

        if (skillDic.ContainsKey(player))
        {
            if (state == EFuryState.eFuryRunState)
            {
                skillDic[player].ChangeVisable(0, false);
                skillDic[player].ChangeVisable(1, false);
                skillDic[player].ChangeVisable(2, true);
                skillDic[player].ChangeVisable(3, true);
            }
            else
            {
                skillDic[player].ChangeVisable(0, true);
                skillDic[player].ChangeVisable(1, true);
                skillDic[player].ChangeVisable(2, false);
                skillDic[player].ChangeVisable(3, false);
            }
        }

        if (UIViewerPersonInfo.Instance.SetCurrClickPlayer == player)
        {
            InfoPlayerSkill(player);
        }
    }
示例#4
0
 public void SetPlayerAbsSkillInfo(Iplayer player, int slot, int skillId, int slot1, int skillId1)
 {
     Player   = player;
     Slot     = slot;
     SkillId  = skillId;
     Slot1    = slot1;
     SkillId1 = skillId1;
 }
示例#5
0
 void ShowGold(int index, Iplayer player)
 {
     if (index > 5)
     {
         return;
     }
     mMoneyList.ElementAt(index).text = player.AccountGold.ToString();
 }
示例#6
0
        //显示技能描述面板
        void ShowDes()
        {
            if (statePress != DateTime.Now)
            {
                if (desObj == null)
                {
                    //根据英雄获取被动技能信息
                    Iplayer player = PlayerManager.Instance.LocalPlayer;
                    if (player == null)
                    {
                        return;
                    }

                    int skillId = GetPassSkill(0, player);
                    SkillPassiveConfigInfo skillInfo = ConfigReader.GetSkillPassiveConfig((uint)skillId);
                    if (skillInfo == null)
                    {
                        Debug.LogError("skillPassive is null");
                        return;
                    }
                    //面板的生成与设置
                    ResourceItem desObjUnit = ResourcesManager.Instance.loadImmediate(GameDefine.GameConstDefine.SkillDestribe, ResourceType.PREFAB);
                    desObj = GameObject.Instantiate(desObjUnit.Asset) as GameObject;
                    desObj.transform.parent        = mPassiveSkill.transform;
                    desObj.transform.localScale    = Vector3.one;
                    desObj.transform.localPosition = new Vector3(550, -450, 0);
                    UnityEngine.GameObject.DestroyImmediate(desObj.GetComponent <UIAnchor>());
                    //技能信息的获取与显示
                    UILabel skillCd     = desObj.transform.Find("Skill_Cooldown").GetComponent <UILabel>();
                    UILabel skillDes    = desObj.transform.Find("Skill_Describe").GetComponent <UILabel>();
                    UILabel skillLv     = desObj.transform.Find("Skill_Level").GetComponent <UILabel>();
                    UILabel skillName   = desObj.transform.Find("Skill_Name").GetComponent <UILabel>();
                    UILabel skillMpCost = desObj.transform.Find("Skill_HP").GetComponent <UILabel>();

                    if (skillInfo.isShowCoolTime)
                    {
                        skillCd.text = (skillInfo.coolTime / 1000f).ToString();
                    }
                    else
                    {
                        skillCd.text = "0";
                    }
                    skillDes.text = DestribeWithAttribue(skillInfo.info, player);
                    int bet = (int)skillInfo.id % 10;
                    if (bet == 0)
                    {
                        bet = 1;
                    }
                    skillLv.text   = bet.ToString();
                    skillName.text = skillInfo.name;
                    if (skillInfo.Mp != 0)
                    {
                        skillMpCost.text = skillInfo.Mp.ToString();
                    }
                    skillMpCost.transform.Find("Label").GetComponent <UILabel>().gameObject.SetActive(skillInfo.Mp != 0);
                }
            }
        }
示例#7
0
        private void BtnOnPressStore()
        {
            Iplayer player = PlayerManager.Instance.LocalPlayer;

            if (player != null)
            {
                GamePlayCtrl.Instance.OpenShop();
            }
        }
示例#8
0
 public void SetPackageData(Iplayer player, int seat, int id, int num, float totalTime, float lastTime)
 {
     Player    = player;
     Seat      = seat;
     Id        = id;
     Num       = num;
     TotalTime = totalTime;
     LastTime  = lastTime;
 }
示例#9
0
        public void SetSkillDestribe(int skillId, Iplayer player)
        {
            SkillManagerConfig skillconfig = ConfigReader.GetSkillManagerCfg(skillId);

            if (skillconfig == null)
            {
                return;
            }
            UpdateDestribe(skillId, player);
        }
示例#10
0
    public void OnUpdateHeroMp(Iplayer player)
    {
        PersonHead hd;

        if (!PlayerInfoDict.TryGetValue(player, out hd))
        {
            return;
        }
        hd.OnUpdateMp();
    }
示例#11
0
    public override void SetXueTiaoInfo()
    {
        base.SetXueTiaoInfo();
        UpdateMp();
        UpdateLevel();
        Iplayer player = (Iplayer)base.xueTiaoOwner;

        labelName.text = player.GameUserNick;
        ShowGuideXueTiaoInfo();
    }
示例#12
0
        void ShowNickName(int index, Iplayer player)
        {
            mNameList[index].text = player.GameUserNick;

            if (player.isGameLookViewer())
            {
                mNameList[index].gameObject.SetActive(true);
                mTipList[index].gameObject.SetActive(false);
                return;
            }
        }
示例#13
0
 public void ShowDescribleById(bool show, int skillId, Iplayer player)
 {
     if (show)
     {
         Show();
         SetSkillDestribe(skillId, player);
     }
     else
     {
         Hide();
         currentSkill = SkillType.SKILL_NULL;
     }
 }
示例#14
0
 void ShowMasterPressEffect()
 {
     foreach (var item in PlayerManager.Instance.AccountDic)
     {
         Iplayer player = (Iplayer)item.Value;
         if (!player.IsReady())
         {
             return;
         }
     }
     mStartObj.SetActive(true);
     mReadyObj.SetActive(true);
 }
示例#15
0
 private void ShowDescribleByType(bool show, SkillType skillType, Iplayer player)
 {
     if (show)
     {
         Show();
         SetSkillDestribe(skillType, (Iselfplayer)player);
         currentSkill = skillType;
     }
     else
     {
         Hide();
         currentSkill = SkillType.SKILL_NULL;
     }
 }
示例#16
0
        void OnEvent(FEvent eve)
        {
            Iplayer entity = (Iplayer)eve.GetParam("Target");
            bool    add    = (bool)eve.GetParam("Add");

            if (add)
            {
                AddPlayerEnemy(entity);//更新英雄头像
            }
            else
            {
                RemovePlayerEnemy(entity);
            }
        }
示例#17
0
    /// <summary>
    /// 初始化角色信息
    /// </summary>
    /// <param name="sGUID"></param>
    public void InitViewPersonInfo(Iplayer player)
    {
        int        campID = PlayerPersonData.Instance.CampID;
        PersonHead head   = PersonList[campID - 1];

        if (head.Player != null)
        {
            return;
        }
        head.Player = player;
        //head.SGUID = sGUID;
        head.CampID = campID;
        PlayerInfoDict.Add(player, head);
    }
示例#18
0
        //设置玩家座位
        void SetPlayerSeat(Iplayer playerU)
        {
            if (playerU.GameUserSeat <= 0)
            {
                return;
            }

            int seat = (int)playerU.GameUserSeat - 1;

            ShowSeat(seat, true, playerU.GameHeadId);
            ShowNickName(seat, playerU);
            ShowMasterIcon(seat, playerU);
            ShowGold(seat, playerU);
        }
示例#19
0
    /// <summary>
    /// 更新信息
    /// </summary>
    /// <param name="sGUID"></param>
    void OnUpdateHeroInfo(Iplayer player)
    {
        PersonHead head;

        if (!PlayerInfoDict.TryGetValue(player, out head))
        {
            return;
        }
        head.SetIsVib(true);
        head.OnUpdateHp();
        head.OnUpdateMp();
        head.OnUpdateLevel();
        head.OnUpdateHeadPt();
    }
示例#20
0
 void SetPlayerInfo(int index, Iplayer player)
 {
     SetCurrClickPlayer = PersonList[index].Player;
     if (UIViewerPlayerPackage.Instance != null)
     {
         UIViewerPlayerPackage.Instance.InfoPlayerPackage(SetCurrClickPlayer, index);
     }
     if (UIViewerSkillInfo.Instance != null)
     {
         UIViewerSkillInfo.Instance.InfoPlayerSkill(SetCurrClickPlayer);
     }
     GameDefine.GameMethod.GetMainCamera.transform.GetComponent <SmoothFollow>().enabled = true;
     GameDefine.GameMethod.GetMainCamera.target = player.realObject.transform;
 }
示例#21
0
        void SetAssist()
        {
            Iplayer palyer = PlayerManager.Instance.LocalPlayer;

            if (palyer == null)
            {
                return;
            }
            Dictionary <UInt64, HeroBattleInfo> AssistDic = BattleingData.Instance.GetCamp(palyer.EntityCamp);

            if (AssistDic.ContainsKey(palyer.GameObjGUID))
            {
                AssistLabel.text = AssistDic[palyer.GameObjGUID].Assist.ToString();
            }
        }
示例#22
0
        void SetKill()
        {
            Iplayer player = PlayerManager.Instance.LocalPlayer;

            if (player == null)
            {
                return;
            }
            Dictionary <UInt64, HeroBattleInfo> KillsDic = BattleingData.Instance.GetCamp(player.EntityCamp);

            if (KillsDic.ContainsKey(player.GameObjGUID))
            {
                KillLabel.text = KillsDic[player.GameObjGUID].Kills.ToString();
            }
        }
示例#23
0
        public void OpenInfo(Iplayer pl)
        {
            Player = pl;

            HeroSelectConfigInfo heroinfo = ConfigReader.GetHeroSelectInfo(Player.NpcGUIDType);

            TweenPosition.Begin(teamPress.gameObject, 0.2f, new Vector3(orignalPos.x, orignalPos.y, orignalPos.z));
            ShowSprite.spriteName = heroinfo.HeroSelectHead.ToString();
            teamPress.gameObject.SetActive(true);

            if (uit != null)
            {
                EventDelegate.Remove(uit.onFinished, Finished);
            }
        }
示例#24
0
        void SetPassSkill(int skillId)
        {
            Iplayer player = PlayerManager.Instance.LocalPlayer;

            if (player == null)
            {
                return;
            }
            int id = GetPassSkill(skillId, player);

            if (!ShowPassSkill(id))
            {
                return;
            }
        }
    void OnPress(int ie, bool isPress)
    {
        if (isPress)
        {
            startTime = Time.time;
            curSlot   = ie;
            return;
        }
        Iplayer player = UIViewerPersonInfo.Instance.SetCurrClickPlayer;

        curSlot   = -1;
        startTime = 0f;

        EventCenter.Broadcast <bool, SkillType, Iplayer>(EGameEvent.eGameEvent_SkillDescribleType, false, SkillType.SKILL_NULL, player);
    }
示例#26
0
 bool HasPlayerHead(Iplayer pl)
 {
     if (pl == null)
     {
         return(true);
     }
     foreach (EnemyHeadInfo team in mEnemyTeamList)
     {
         if (team.Player == pl)
         {
             return(true);
         }
     }
     return(false);
 }
示例#27
0
 private void RemovePlayerEnemy(Iplayer pl)
 {
     if (pl == null)
     {
         return;
     }
     for (int i = mEnemyTeamList.Count - 1; i >= 0; i--)
     {
         if (mEnemyTeamList.ElementAt(i).Player == pl)
         {
             mEnemyTeamList.ElementAt(i).CloseInfo();
             break;
         }
     }
 }
示例#28
0
        public int Play(Iplayer player1, Iplayer player2, IBackgamonUi ui)
        {
            int doneMovesNo;

            int[] playerTurnDiceValues;
            Setup();
            Iplayer player = player1;

            ui.AfterGameBoardChange(_board);
            while (_gameOver == IsGameVictory.noneWins)
            {
                ui.StartNewPlayerTurn(_isPlayer_1turn);
                int[] diceValues = _dice.Roll();
                ui.AfterDiceRoll(diceValues[0], diceValues[1]);
                doneMovesNo          = 0;
                playerTurnDiceValues = PlayerTurnDiceValues(diceValues[0], diceValues[1]);
                do
                {
                    List <PlayPieceMovement> nextLegalMoves = NextGameMoveSuggest(playerTurnDiceValues[doneMovesNo]);
                    var nextMove = player.NextGameMoveChose(nextLegalMoves, _isPlayer_1turn);
                    if (nextMove == null)
                    {
                        Console.WriteLine(" there is no legal move to do ");
                        doneMovesNo++;
                        continue;
                    }
                    _gameOver = MakeMove(nextMove);
                    ui.AfterGameBoardChange(_board);
                    doneMovesNo++;
                    if (_gameOver != IsGameVictory.noneWins)
                    {
                        ui.AfterGameBoardChange(_board);
                        if ((_isPlayer_1turn && _board.Player_2_FinalDestination.Count == 0) || (!_isPlayer_1turn && _board.Player_1_FinalDestination.Count == 0))
                        {
                            _wasMars = true;
                        }
                        _gameOver = (_isPlayer_1turn) ? IsGameVictory.player1wins : IsGameVictory.player2wins;
                        ui.AfterGameVictory(_isPlayer_1turn, _wasMars);
                        break;
                    }
                }while (playerTurnDiceValues.Count() > doneMovesNo);
                _isPlayer_1turn = !_isPlayer_1turn;
                player          = (_isPlayer_1turn) ?player1:player2;
            }
            bool isPlayer1_victory = (_gameOver == IsGameVictory.player1wins);

            return(GameScore(isPlayer1_victory, _wasMars));
        }
示例#29
0
 void ShowButtonEffect()
 {
     foreach (var item in PlayerManager.Instance.AccountDic)
     {
         Iplayer player = (Iplayer)item.Value;
         if (!player.IsReady() || (PlayerManager.Instance.AccountDic.Count == 1))
         {
             mStartObj.SetActive(false);
             return;
         }
     }
     if (PlayerManager.Instance.LocalAccount != null && PlayerManager.Instance.LocalAccount.IsMaster())
     {
         mStartObj.SetActive(true);
     }
 }
    public void ChangeSkillCd(Iplayer player)
    {
        int   skillID  = PlayerSkillData.Instance.SkillId;
        float lastTime = PlayerSkillData.Instance.TotalTime;

        if (!skillDic.ContainsKey(player))
        {
            return;
        }

        skillDic[player].ChangeColDownTime(skillID, lastTime);

        if (UIViewerPersonInfo.Instance.SetCurrClickPlayer == player)
        {
            InfoPlayerSkill(player);
        }
    }
示例#31
0
文件: Program.cs 项目: jdianala/Day3
        public Iplayer Fight(Iplayer activePlayer1, Iplayer activePlayer2)
        {
            Iplayer winner;

            if (activePlayer1.Act() == "Rock" && activePlayer2.Act() == "Paper")
            {
                winner = activePlayer2;
                activePlayer2.NumOfWins += 1;
            }

            else if (activePlayer1.Act() == "Rock" && activePlayer2.Act() == "Scissor")
            {
                winner = activePlayer1;
                activePlayer1.NumOfWins += 1;
            }

            else if (activePlayer1.Act() == "Scissor" && activePlayer2.Act() == "Rock")
            {
                winner = activePlayer2;
                activePlayer2.NumOfWins += 1;
            }

            else if (activePlayer1.Act() == "Scissor" && activePlayer2.Act() == "Paper")
            {
                winner = activePlayer1;
                activePlayer1.NumOfWins += 1;
            }

            else if (activePlayer1.Act() == "Paper" && activePlayer2.Act() == "Scissor")
            {
                winner = activePlayer2;
                activePlayer2.NumOfWins += 1;

            }

            else
            {
                winner = activePlayer1;
                activePlayer1.NumOfWins += 1;
            }

            return winner;
        }