Ejemplo n.º 1
0
        //在地图中增加玩家
        public void AddPlayerInMap(List <PMapRole> rolesList)
        {
            uint mapId = MeVo.instance.mapId;

            foreach (PMapRole rolesIn in rolesList)
            {
                var playerVo = new PlayerVo();
                playerVo.mapId = mapId;
                playerVo.Id    = rolesIn.id;
                playerVo.Name  = rolesIn.name;
                playerVo.Level = rolesIn.level;
                playerVo.CurHp = rolesIn.hp;
                playerVo.Hp    = rolesIn.hpFull;
                playerVo.job   = rolesIn.job;
                playerVo.X     = rolesIn.x * GameConst.PositionUnit;
                playerVo.Y     = rolesIn.y * GameConst.PositionUnit;
                playerVo.sex   = rolesIn.sex;
                playerVo.job   = rolesIn.job;
                playerVo.PetId = rolesIn.petId;
                if (playerVo.sex < 1)
                {
                    playerVo.sex = 1;
                }
                PlayerMgr.instance.addPlayer(playerVo);
            }
        }
Ejemplo n.º 2
0
        private void SetRobberPlayerVo(PlayerVo robberPlayerVo, PBaseAttr recRoleBaseAttr)
        {
            robberPlayerVo.Str   = recRoleBaseAttr.str;
            robberPlayerVo.Agi   = recRoleBaseAttr.agi;
            robberPlayerVo.Phy   = recRoleBaseAttr.phy;
            robberPlayerVo.Wit   = recRoleBaseAttr.wit;
            robberPlayerVo.CurHp = recRoleBaseAttr.hpCur;

            robberPlayerVo.Hp    = recRoleBaseAttr.hpFull;
            robberPlayerVo.CurMp = recRoleBaseAttr.mpCur;

            robberPlayerVo.Mp        = recRoleBaseAttr.mpFull;
            robberPlayerVo.AttPMin   = recRoleBaseAttr.attPMin;
            robberPlayerVo.AttPMax   = recRoleBaseAttr.attPMax;
            robberPlayerVo.AttMMin   = recRoleBaseAttr.attMMin;
            robberPlayerVo.AttMMax   = recRoleBaseAttr.attMMax;
            robberPlayerVo.DefP      = recRoleBaseAttr.defP;
            robberPlayerVo.DefM      = recRoleBaseAttr.defM;
            robberPlayerVo.Hit       = recRoleBaseAttr.hit;
            robberPlayerVo.Dodge     = (int)recRoleBaseAttr.dodge;
            robberPlayerVo.Crit      = recRoleBaseAttr.crit;
            robberPlayerVo.CritRatio = recRoleBaseAttr.critRatio;
            robberPlayerVo.Flex      = recRoleBaseAttr.flex;
            robberPlayerVo.HurtRe    = recRoleBaseAttr.hurtRe;
            robberPlayerVo.Speed     = recRoleBaseAttr.speed;
            robberPlayerVo.Luck      = recRoleBaseAttr.luck;
        }
Ejemplo n.º 3
0
        /**添加角色到场景**/

        public void execute()
        {
            if (!isRuning)
            {
                return;
            }
            float time = Time.time;

            if (time - beginTime < delay)
            {
                return;
            }
//			try
//			{
            beginTime = time;
//				String mapId = AppMap.Instance.mapParser.MapId.ToString();
//				IList<PlayerVo> list = playList.ContainsKey(mapId) ? playList[mapId] : null;
            if (waitCreatePlayerList == null || waitCreatePlayerList.Count < 1)
            {
                return;
            }
            PlayerVo item = waitCreatePlayerList[0];

            waitCreatePlayerList.Remove(item);

            //创建角色 增加名字UI
            item.ModelLoadCallBack = LoadPlayerModelBack;
            AppMap.Instance.CreatePlayer(item);
//			}
//			catch (Exception ex)
//			{
//				Log.error(this, "-execute() 添加玩到场景出错,reason:"+ex.StackTrace);
//			}
        }
Ejemplo n.º 4
0
        public void ShowFail3_3()
        {
            PlayerVo playerVo = GlobalData.PlayerModel.PlayerVo;
            string   key      = ModuleConfig.MODULE_BATTLE + "__" + playerVo.UserId + "__" + AppConfig.Instance.serverId;

            if (GuideManager.GetStepState(key, "levelup") == GuideStae.Close)
            {
                GuideManager.Hide();
                return;
            }

            gameObject.Show();

            GuideManager.SetStepState(GuideStae.Close, key, "levelup");
            GuideManager.TempState = TempState.Level3_3_Fail;

            GuideManager.SetStatisticsRemoteGuideStep(GuideConst.MainLineStep_3_3_Fail);

            PointerClickListener.Get(gameObject).onClick = go =>
            {
                ModuleManager.Instance.GoBack();
            };

            // Transform view = transform.Find("FinalEstimateFail3_3");
            // view.gameObject.Show();
            //
            // var btn = view.Find("Bg/Buttons/GotoCardCollention");
            // GuideArrow.DoAnimation(btn);


            // PointerClickListener.Get(btn.gameObject).onClick = go =>
            // {
            //     SendMessage(new Message(MessageConst.CMD_BATTLE_FINISH, Message.MessageReciverType.UnvarnishedTransmission, ModuleConfig.MODULE_CARD));
            // };
        }
Ejemplo n.º 5
0
 private void Start()
 {
     _mePlayerVo        = MeController.Me.GetMeVoByType <PlayerVo>();
     _hasAiTask         = false;
     BaseRoleVo         = _mePlayerVo;
     _meTransform       = transform;
     _normalAttackRange = (2 - Mathf.Abs(2 - _mePlayerVo.job)) * 1.5f;
 }
Ejemplo n.º 6
0
        private void CreateRobberPlayer()
        {
            PlayerVo challenger = Singleton <GoldSilverIslandMode> .Instance.RobbedPlayer.Vo;

            //初始化对手位置和朝向
            challenger.X = MeVo.instance.X + 10;
            challenger.Y = MeVo.instance.Y;
            PlayerMgr.instance.addPlayer(challenger);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// ServerId UserId CommodityId
        /// </summary>
        /// <param name="product"></param>
        /// <returns></returns>
        public static string GetApplePayLoad(ProductVo product)
        {
            PlayerVo playerVo = GlobalData.PlayerModel.PlayerVo;
            string   str      = AppConfig.Instance.serverId + "@_" + playerVo.UserId + "_" + product.CommodityId;

            if (product.ExtInt != 0)
            {
                str += "&" + product.ExtInt;
            }
            return(str);
        }
Ejemplo n.º 8
0
 public void Start()
 {
     _petVo         = MeController.GetMeVoByType <PetVo>();
     _talentSkillVo = BaseDataMgr.instance.GetSysSkillBaseVo(_petVo.SkillId);
     if (_talentSkillVo != null)
     {
         _talentSkillActionVo = BaseDataMgr.instance.GetSysSkillActionVo(_talentSkillVo.skill_group);
     }
     _masterVo      = _petVo.MasterVo;
     _masterDisplay = _petVo.MasterDisplay;
 }
Ejemplo n.º 9
0
 public void SetData(PlayerVo vo)
 {
     if (vo.ExtInfo.ModCount == 0)
     {
         isFirstText.gameObject.SetActive(true);
     }
     else
     {
         costHint.gameObject.SetActive(true);
     }
 }
Ejemplo n.º 10
0
    // Start is called before the first frame update
    void Awake()
    {
        player = PlayerModel.Instance.Player;
        view   = GetComponent <RoleInfoView>();

        view.Btn_Close.onClick.AddListener(() => gameObject.SetActive(false));
        view.Btn_AddStrength.onClick.AddListener(AddStrength);
        view.Btn_AddAgility.onClick.AddListener(AddAgility);
        GarbageCanController.updatePlayerInfo += UpdateAttribute;
        UpdateAttribute();
    }
Ejemplo n.º 11
0
        /// <summary>
        ///     创建英雄榜敌方玩家
        /// </summary>
        private void CreateChallenger()
        {
            Log.info(this, "创建英雄榜挑战对手");
            PlayerVo challenger = Singleton <ArenaMode> .Instance.vsPlayerAttr;

            //初始化对手位置和朝向
            challenger.X = MeVo.instance.X + 10;
            challenger.Y = MeVo.instance.Y;

            PlayerMgr.instance.addPlayer(challenger);
        }
Ejemplo n.º 12
0
        public void InitData(PlayerVo vo)
        {
            data = vo;

            transform.Find("NameBg/NameTxt").GetComponent <Text>().text = vo.UserName;
            transform.Find("LevelTxt").GetComponent <Text>().text       = "Lv." + vo.Level;

//            PointerClickListener.Get(_headIcon.gameObject).onClick = go => { FlowText.ShowMessage("功能暂未开放,敬请期待"); };

            //SetHeadIcon(vo.BgPicId);
            //todo
//            vo.LogoId
        }
Ejemplo n.º 13
0
    private Dictionary <string, string> GetPayInfo(ProductVo product)
    {
        PlayerVo playerVo = GlobalData.PlayerModel.PlayerVo;

        Dictionary <string, string> payInfo = new Dictionary <string, string>();

        payInfo.Add("productId", product?.ProductId);
        payInfo.Add("dataInfo", Payload.GetApplePayLoad(product));

        Debug.Log("Product======>\n" + product);

        return(payInfo);
    }
Ejemplo n.º 14
0
 protected override void DoStatuTransfered()
 {
     base.DoStatuTransfered();
     if (PreStatuNameHash == Status.NAME_HASH_DEATH_END)
     {
         if (_playerVo == null)
         {
             _playerVo = MeControler.Me.GetVo() as PlayerVo;
         }
         _playerVo.IsUnbeatable = true; //设置玩家复活时3S钟的无敌状态
         Invoke("ResetUnbeatableStatu", 3.0f);
     }
 }
Ejemplo n.º 15
0
        public void OnRegister()
        {
            PlayerVo vo = GlobalData.PlayerModel.PlayerVo;
            Dictionary <string, string> dict = new Dictionary <string, string>();

            dict.Add("roleId", vo.UserId.ToString());
            dict.Add("roleName", vo.UserName);
            dict.Add("zoneId", AppConfig.Instance.serverId);
            dict.Add("zoneName", AppConfig.Instance.serverName);

            GalaSDKBaseFunction.Trace(GalaSDKBaseFunction.GalaTraceSDKType.ALL,
                                      GalaSDKBaseFunction.GalaTraceType.OnRegister, dict);
        }
Ejemplo n.º 16
0
        //更新被挑战者玩家信息
        public void UpdateVserAttr(List <uint> skills, PBaseAttr recRoleBaseAttr)
        {
            Log.info(this, "更新被挑战者玩家基础信息");
            ChallengerVo challengerInfo = Singleton <ArenaMode> .Instance.challengerList [Singleton <ArenaMode> .Instance.selectHeroSub];

            _vsPlayerAttr     = new PlayerVo();                       //需要重新new一个,否则_SysRoleBaseInfoVo不会被置为null,在战斗场景时加载战斗对手时会出问题----add by lixi
            _vsPlayerAttr.job = challengerInfo.job;
//			_vsPlayerAttr.Id = recRoleAttr.id;
            _vsPlayerAttr.Name  = challengerInfo.name;
            _vsPlayerAttr.sex   = challengerInfo.sex;
            _vsPlayerAttr.Level = (int)challengerInfo.level;
//			_vsPlayerAttr.exp = recRoleAttr.exp;
//			_vsPlayerAttr.expFull = recRoleAttr.expFull;
//			_vsPlayerAttr.vip = recRoleAttr.vip;
//			_vsPlayerAttr.nation = recRoleAttr.nation;
//			_vsPlayerAttr.vigour = recRoleAttr.vigour;
//			_vsPlayerAttr.vigourFull = recRoleAttr.vigourFull;
//			_vsPlayerAttr.hasCombine = recRoleAttr.hasCombine;
//			_vsPlayerAttr.customFace = recRoleAttr.customFace;
//			_vsPlayerAttr.titleList = recRoleAttr.titleList;
            _vsPlayerAttr.fightPoint = challengerInfo.fightNum;

//			PBaseAttr recRoleBaseAttr = recRoleAttr.attr;
            _vsPlayerAttr.Str   = recRoleBaseAttr.str;
            _vsPlayerAttr.Agi   = recRoleBaseAttr.agi;
            _vsPlayerAttr.Phy   = recRoleBaseAttr.phy;
            _vsPlayerAttr.Wit   = recRoleBaseAttr.wit;
            _vsPlayerAttr.CurHp = recRoleBaseAttr.hpCur;

            _vsPlayerAttr.Hp    = recRoleBaseAttr.hpFull;
            _vsPlayerAttr.CurMp = recRoleBaseAttr.mpCur;

            _vsPlayerAttr.Mp        = recRoleBaseAttr.mpFull;
            _vsPlayerAttr.AttPMin   = recRoleBaseAttr.attPMin;
            _vsPlayerAttr.AttPMax   = recRoleBaseAttr.attPMax;
            _vsPlayerAttr.AttMMin   = recRoleBaseAttr.attMMin;
            _vsPlayerAttr.AttMMax   = recRoleBaseAttr.attMMax;
            _vsPlayerAttr.DefP      = recRoleBaseAttr.defP;
            _vsPlayerAttr.DefM      = recRoleBaseAttr.defM;
            _vsPlayerAttr.Hit       = recRoleBaseAttr.hit;
            _vsPlayerAttr.Dodge     = (int)recRoleBaseAttr.dodge;
            _vsPlayerAttr.Crit      = recRoleBaseAttr.crit;
            _vsPlayerAttr.CritRatio = recRoleBaseAttr.critRatio;
            _vsPlayerAttr.Flex      = recRoleBaseAttr.flex;
            _vsPlayerAttr.HurtRe    = recRoleBaseAttr.hurtRe;
            _vsPlayerAttr.Speed     = recRoleBaseAttr.speed;
            _vsPlayerAttr.Luck      = recRoleBaseAttr.luck;

            _vsPlayerAttr.skills = skills;
        }
Ejemplo n.º 17
0
    public static void SetSdkData(string type = TYPE_ENTER_SERVER)
    {
        PlayerVo playerVo = GlobalData.PlayerModel.PlayerVo;
        Dictionary <string, string> json = new Dictionary <string, string>();

        Debug.LogWarning("serverName:" + AppConfig.Instance.serverName);
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_TYPE, type);                                   //角色状态
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_ZONEID, AppConfig.Instance.serverId);          //游戏区服ID
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_ZONENAME, AppConfig.Instance.serverName);      //游戏区服名称
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_ROLEID, playerVo.UserId + "");                 //角色ID
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_ROLENAME, playerVo.UserName);                  //角色名
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_ROLELEVEL, playerVo.Level.ToString());         //角色等级
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_POWER, "0");                                   //战力值
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_VIP, playerVo.IsOnVip ? "1" : "0");            //VIP等级
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_BALANCENAME, "CNY");                           //货币名称
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_BALANCENUM, "0");                              //货币数额
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_ROLECTIME, playerVo.CreateTime + "");          //创角时间
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_CHANNEL, AppConfig.Instance.channelInfo + ""); //渠道类型

        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_PARTYID, "0");                                 //帮派ID
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_PARTYNAME, "无");                               //帮派名称
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_PARTYROLEID, "0");                             //帮派职位ID
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_PARTYROLENAME, "无");                           //帮派职业名称
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_PROFESSIONID, "0");                            //玩家职业ID
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_PROFESSION, "无");                              //职业名称
        json.Add(GalaSDKBaseFunction.UserInfoParamKey.PARAMS_GENDER, "无");                                  //玩家姓名

        Debug.Log("SetSdkData--->" + json);

        GalaSDKBaseFunction.UpdateUserInfo(json);

        CustomServiceAgent.OnLogin();

        if ((Application.platform == RuntimePlatform.Android && AppConfig.Instance.isChinese == "true") ||
            AppConfig.Instance.isJailbreak)
        {
            //安卓和越狱iOS
            PayAgent.CheckPayWhenLogin();
        }
        else if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            //PayAgent.InitPay();
            PayAgent.CheckPayWhenLogin();
            Debug.Log("OnGetRechargeRule===>SdkHelper.PayAgent.InitPay()");
        }

#if UNITY_EDITOR
        PayAgent.CheckPayWhenLogin();
#endif
    }
Ejemplo n.º 18
0
    public void SetMainLive2d(PlayerVo vo)
    {
        if (vo.Apparel[0] <= 0 || !L2DModel.HasResource(vo.Apparel[0].ToString()))
        {
            _isShowLive2d = false;
            _live2dGraphic.Hide();
            return;
        }

        ChangeRole(vo.Apparel[0]);
        if (GuideManager.CurStage() != GuideStage.MainLine1_1Level_1_3Level_Stage)
        {
            Live2dTigger(EXPRESSIONTRIGERTYPE.LOGIN, -1, false);
        }
    }
Ejemplo n.º 19
0
    public void SetData(PlayerVo vo)
    {
        _uiv.InitData(vo);

        _goldTxt.text = vo.Gold + "";
        _gemTxt.text  = vo.Gem + "";

        _visitPowerTxt.text = vo.EncourageEnergy + "/" + vo.MaxEncourageEnergy;

        _powerTxt.text = vo.Energy + "/" + vo.MaxEnergy;

        _recolletionBar.GetText("Text").text = vo.RecollectionEnergy + "/" +
                                               GlobalData.ConfigModel.GetConfigByKey(GameConfigKey
                                                                                     .RESTORE_MEMORIES_POWER_MAX_SIZE); //90;
    }
Ejemplo n.º 20
0
        public void OnLogin()
        {
            Dictionary <string, string> userdata = new Dictionary <string, string>();
            PlayerVo playerVo = GlobalData.PlayerModel.PlayerVo;

            userdata.Add("userAccount", playerVo.AccountId);        //string用户账号
            userdata.Add("serverId", AppConfig.Instance.serverId);  //string服务器ID
            userdata.Add("userCode", playerVo.UserId + "");         //string识别码
            userdata.Add("teamName", playerVo.UserName);            //string球队名
            userdata.Add("vipLevel", playerVo.IsOnVip ? "1" : "0"); //string vip等级
            userdata.Add("totalRecharge", "0");                     //string累计充值
            userdata.Add("teamLevel", playerVo.Level + "");         //string
            userdata.Add("regisTime", playerVo.CreateTime + "");    //long时间戳
//            userdata.Add("teamOtherInfo", "jsonString");//string额外信息:json字符串
            GalaCSCManager.Instance.LoadUserInfo(userdata);         //设置用户信息(登陆成功后)
        }
Ejemplo n.º 21
0
        /**创建角色**/

        public PlayerDisplay CreatePlayer(PlayerVo vo)
        {
            if (vo == null)
            {
                return(null);
            }
            vo.Type = DisplayType.ROLE;
            var display = new PlayerDisplay();

            objectList.Add(display);
            _playerList.Add(display);
            vo.ClothUrl = "Model/Role/" + vo.SysRoleBaseInfo.Model + "/Model/" + vo.SysRoleBaseInfo.Model +
                          ".assetbundle";
            display.SetVo(vo);
            return(display);
        }
Ejemplo n.º 22
0
    public void SetData(PlayerVo vo)
    {
        data = vo;

        _name.text  = vo.UserName;
        _id.text    = vo.UserId.ToString();
        _level.text = I18NManager.Get("Common_Level", vo.Level);

        _exp.text             = I18NManager.Get("Common_LevelProportion", vo.CurrentLevelExp, vo.NeedExp);
        _progressBar.Progress = (int)((float)vo.CurrentLevelExp / vo.NeedExp * 100);

        SetStarPos();

        _headModel = new HeadModel();
        SetHeadImg();
        SetHeadRedDot();
    }
Ejemplo n.º 23
0
        protected void Awake()
        {
            MeControler = GetComponent <ActionControler>();
            _playerVo   = MeControler.Me.GetVo() as PlayerVo;
            switch (_playerVo.job)
            {
            case 1:
            case 3:
                MaxComb = 4;
                break;

            case 2:
                MaxComb = 3;
                break;

            default:
                MaxComb = 3;
                break;
            }
        }
Ejemplo n.º 24
0
        /**放入队列**/

        internal void addPlayer(PlayerVo playerVo)
        {
            if (playerVo == null)
            {
                return;
            }
//			if (StringUtils.isEmpty(mapId)) return;
//			IList<PlayerVo> list =null;
//			if(playList.ContainsKey(mapId))
//			{
//				list = playList[mapId];
//			}
//			else
//			{
//				list = new List<PlayerVo>();
//				playList.Add(mapId, list);
//			}
            foreach (PlayerVo item in playerList)
            {
                if (item.Id.Equals(playerVo.Id))
                {
                    removePlayer(item.Id); //避免因多次断线重连导致的重复创建问题.如果已有该玩家信息,先删除,再添加
//					playerList.Remove(item);
                    break;
                }
            }

            //上一个步骤已包含该次循环判断
//			foreach (PlayerVo item in waitCreatePlayerList)
//			{
//				if (item.Id.Equals(playerVo.Id))
//				{
//					waitCreatePlayerList.Remove(item);
//					break;
//				}
//			}

            playerList.Add(playerVo);
            waitCreatePlayerList.Add(playerVo);
        }
Ejemplo n.º 25
0
        public MapPointDisplay MapPointDisplay; //当前场景传送点

        /**创建本角色**/

        public void CreateMe(PlayerVo vo)
        {
            if (vo == null)
            {
                return;
            }
            if (_me != null)
            {
                return;
            }
            vo.Type = DisplayType.ROLE;
            _me     = new MeDisplay();
            //vo.ClothUrl = "Model/Role/" + vo.SysRoleBaseInfo.Model + "/Model/" + vo.SysRoleBaseInfo.Model +
            //              ".assetbundle";
            vo.ClothUrl = "Model/Role/" + "100001/Model/" + "100001" +
                          ".assetbundle";
            _me.SetVo(vo);
            if (_playerList.IndexOf(_me) == -1)
            {
                _playerList.Add(_me);
            }
            Object.DontDestroyOnLoad(_me.GoBase);
            Object.DontDestroyOnLoad(_me.GoCloth);
        }
Ejemplo n.º 26
0
        /// <summary>
        ///     主角伤害检测
        /// </summary>
        /// <param name="atker">攻击者</param>
        /// <param name="skillVo">技能Vo</param>
        /// <param name="playerVo"></param>
        /// <param name="skillType">技能类型</param>
        /// <param name="effectPos">技能特效位置</param>
        /// <param name="ownerPos">技能施放者位置</param>
        /// <param name="dir">技能施放方向</param>
        /// <param name="enemyDisplays">敌人列表</param>
        /// <param name="isBullet">是否是子弹技能</param>
        /// <param name="checkedTime"></param>
        /// <param name="index">索引</param>
        /// <param name="needSyn">是否需要同步伤害</param>
        /// <returns></returns>
        public bool CheckPlayerInjured2D(BaseControler atker, SysSkillBaseVo skillVo, PlayerVo playerVo, Vector3 effectPos,
                                         Vector3 ownerPos, int dir,
                                         IList <ActionDisplay> enemyDisplays, bool isBullet, int checkedTime, int index = 0, bool needSyn = false)
        {
            bool result = false;

            if (playerVo.CurHp == 0)
            {
                return(false);
            }
            foreach (ActionDisplay enemyDisplay in enemyDisplays)
            {
                var enemyVo = enemyDisplay.GetMeVoByType <BaseRoleVo>(); //怪物vo
                if (enemyDisplay.Controller == null || enemyVo.CurHp == 0)
                {
                    continue;
                }
                Vector3       target             = enemyDisplay.Controller.transform.position; //敌方位置
                BoxCollider2D myBoxCollider2D    = (meControler.Me as ActionDisplay).BoxCollider2D;
                BoxCollider2D enemyBoxCollider2D = enemyDisplay.BoxCollider2D;
                if (IsSkillCovered(skillVo, effectPos, ownerPos, target, dir, myBoxCollider2D, enemyBoxCollider2D))
                {
                    result = true;
                    ActionVo attackVo = GetSkillActionVo(skillVo, effectPos, dir, enemyDisplay, index, checkedTime,
                                                         enemyVo.MoveRatio);
                    //attackVo.HurtEffectIndex = index;
                    attackVo.HurtType = Actions.HurtNormal;
                    enemyDisplay.Controller.BeAttackedController.BeAttacked(attackVo);
                    meControler.AttackController.ForceFeedBack(attackVo);
                    if (!needSyn)
                    {
                        int  damageVal;
                        uint damageType;
                        uint stateType;
                        //攻击伤害计算
                        GameFormula.CalcDamage(playerVo, enemyVo, skillVo, out damageVal, out damageType, out stateType);
                        var        cutHp   = (uint)damageVal; //伤害值
                        bool       isDodge = false;           //是否闪避
                        bool       isCrit  = false;           //是否暴击
                        const bool isParry = false;           //是否格挡
                        switch (damageType)
                        {
                        case GameConst.DAMAGE_TYPE_MISS:
                            isDodge = true;
                            break;

                        case GameConst.DAMAGE_TYPE_CRIT:
                            isCrit = true;
                            break;
                        }
                        if (enemyVo.CurHp <= cutHp)
                        {
                            attackVo.HurtType = Actions.HurtFly;
                            enemyDisplay.Controller.BeAttackedController.BeAttacked(attackVo);
                            if (!needSyn)
                            {
                                enemyVo.CurHp = 0;
                                enemyDisplay.Controller.DisposeHudView();
                                attackVo            = new ActionVo();
                                attackVo.ActionType = Actions.DEATH;
                                enemyDisplay.Controller.AttackController.AddAttackList(attackVo, true);
                            }
                        }
                        else //Miss也播放受击效果,所以这里是>=0
                        {
                            enemyVo.lastHp = enemyVo.CurHp;
                            if (AppMap.Instance.mapParser.MapId != MapTypeConst.WORLD_BOSS)
                            {
                                enemyVo.CurHp -= cutHp;
                            }
                        }
                        enemyDisplay.Controller.AiController.AddHudView(isDodge, isCrit, isParry, (int)cutHp,
                                                                        (int)enemyVo.CurHp, ColorConst.Blood);
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 27
0
 private void UpDataUserName(PlayerVo vo)
 {
     view.SetData(vo);
 }
Ejemplo n.º 28
0
        public static bool IsCurrentUser(string payload)
        {
            PlayerVo playerVo = GlobalData.PlayerModel.PlayerVo;

            return(payload.StartsWith(AppConfig.Instance.serverId + "&" + playerVo.UserId));
        }
Ejemplo n.º 29
0
        //场景角色信息修改
        private void Fun_4_10(INetData data)
        {
            var mapRoleUpdateMsg = new MapRoleUpdateMsg_4_10();

            mapRoleUpdateMsg.read(data.GetMemoryStream());
            Log.info(this, "-Fun_4_10()收到场景中角色信息修改:" + mapRoleUpdateMsg.id);

            PlayerVo changeVo = (mapRoleUpdateMsg.id == MeVo.instance.Id)
                ? MeVo.instance
                : PlayerMgr.instance.getPlayer(mapRoleUpdateMsg.id);

            Log.info(this, "-Fun_4_10()Meid: " + MeVo.instance.Id);
            Log.info(this, "-Fun_4_10()mapRoleUpdateMsg.id: " + mapRoleUpdateMsg.id);
            Log.info(this, "-Fun_4_10()changeVO: " + changeVo);
            if (changeVo == null)
            {
                return;
            }
            foreach (PItem item in mapRoleUpdateMsg.changeList)
            {
                if (item.key == MapTypeConst.ROLE_HP_CHANGE_KEY)
                {
                    changeVo.CurHp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_HP_FULL_CHANGE_KEY)
                {
                    changeVo.Hp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_MP_CHANGE_KEY)
                {
                    changeVo.CurMp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_MP_FULL_CHANGE_KEY)
                {
                    changeVo.Mp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_LV_CHANGE_KEY)
                {
                    changeVo.Level = (byte)item.value[0];
                }
                else if (item.key == MapTypeConst.Role_BUFF_LIST_CHANGE_KEY)
                {
                    //注:与后端约定buff的list<uint>的uint=id*100+lvl;
                    //对buff列表进行判断增删;
                    List <PBuff> tmpPbList = new List <PBuff>();
                    PBuff        tmpPb     = null;
                    uint         tmpBid    = 0;
                    uint         tmpBlv    = 0;
                    foreach (uint tmpValue in item.value)
                    {
                        tmpBlv    = tmpValue % 100;
                        tmpBid    = (tmpValue - tmpBlv) / 100;
                        tmpPb     = new PBuff();
                        tmpPb.id  = tmpBid;
                        tmpPb.lvl = (byte)tmpBlv;
                        tmpPbList.Add(tmpPb);
                    }
                    BuffManager.Instance.AddBuff(changeVo.Id.ToString(), tmpPbList, true);
                }
                else if (item.key == MapTypeConst.RolePetChange)
                {
                    changeVo.PetId = item.value[0];
                }
            }
            if (mapRoleUpdateMsg.id == MeVo.instance.Id)
            {
                MeVo.instance.DataUpdate(MeVo.DataHpMpUpdate);
            }
        }
    public void SetData(VisitBattleResultData data, PlayerModel playerModel)
    {
        transform.Find("StarAndGrade/Star").GetComponent <VisitStarComponent>().ShowStar(data.Star);
        // transform.Find("StarAndGrade/Text").GetComponent<Text>().text = "应援热度:<b> " + data.Cap + "</b>";
        transform.Find("StarAndGrade/Text/Text").GetComponent <Text>().text = data.Cap.ToString();
        var propContainer = transform.Find("Reward/Props");
        var cardContainer = transform.Find("Cards");

        for (int i = 0; i < data.RewardList.Count; i++)
        {
            GameObject item = InstantiatePrefab("VisitBattle/FinalEstimate/VisitBattleRewardItem");
            item.transform.SetParent(propContainer, false);

            DrawActivityDropItemVo extReward;
            data.DrawActivityDropItemDict.TryGetValue(i, out extReward);

            item.transform.gameObject.AddComponent <VisitBattleRewardItem>().SetData(data.RewardList[i], extReward);
            item.GetComponent <ItemShowEffect>().OnShowEffect(0.3f + i * 0.2f);
        }

        PlayerVo player = playerModel.PlayerVo;

        _levelText.text  = "Lv." + player.Level;
        _expAddText.text = "+" + data.Exp + " exp";

        var isOnVip = GlobalData.PlayerModel.PlayerVo.IsOnVip;

        _vip.gameObject.SetActive(isOnVip);

        _userNameText.text = I18NManager.Get("Battle_Name", player.UserName);

        int lastNeedExp = player.NeedExp;

        _expText.text = player.CurrentLevelExp + "/" + player.NeedExp;

        progressBar.DeltaX   = 0;
        progressBar.Progress = (int)((float)player.CurrentLevelExp / player.NeedExp * 100);

        bool isLevelup = playerModel.AddExp(data.Exp);

        int rate = (int)((float)player.CurrentLevelExp / player.NeedExp * 100);

        if (isLevelup)
        {
            if (player.Level >= 100)
            {
                _expText.text = "MAX";
            }
            else
            {
                DOTween.To(() => progressBar.Progress, x => progressBar.Progress = x, 100, 0.3f).SetDelay(0.9f)
                .onComplete =
                    () =>
                {
                    _expText.text        = player.CurrentLevelExp + "/" + player.NeedExp;
                    progressBar.DeltaX   = 0;
                    progressBar.Progress = 0;
                    DOTween.To(() => progressBar.Progress, x => progressBar.Progress = x, rate, 0.3f)
                    .SetDelay(1.3f);
                    Util.TweenTextNum(_expText, 0.3f, player.CurrentLevelExp, "", "/" + player.NeedExp);
                    _levelText.text = "Lv." + player.Level;
                };

                Util.TweenTextNum(_expText, 0.3f, lastNeedExp, "", "/" + lastNeedExp);
            }
        }
        else
        {
            if (player.Level >= 100)
            {
                _expText.text = "MAX";
            }
            else
            {
                DOTween.To(() => progressBar.Progress, x => progressBar.Progress = x, rate, 0.3f).SetDelay(0.9f);
                Util.TweenTextNum(_expText, 0.3f, player.CurrentLevelExp, "", "/" + player.NeedExp);
            }
        }

        for (int i = 0; i < data.UserCards.Count; i++)
        {
            GameObject item = InstantiatePrefab("Battle/FinalEstimate/RewardHeroCard");
            item.transform.SetParent(cardContainer, false);
            item.AddComponent <ItemShowEffect>().OnShowEffect(1 + i * 0.2f);

            var cardData = GlobalData.CardModel.GetUserCardById(data.UserCards[i].CardId);
            item.transform.GetComponent <RewardHeroCard>().SetData(cardData, data.CardExp);
        }

        StartCoroutine(StarRotation());
    }