Example #1
0
        void ShowAtkInfo()
        {
            int NewAtk = HeroAttributeScale.GetScaleAttribute(HeroAttributeScaleType.Display_Combat, PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_FIGHTING);

            if (CurrentAtkNumber >= NewAtk)
            {
                CurrentAtkNumber = NewAtk;
                return;
            }
            //TraceUtil.Log("刷新人物信息");
            var addAtkNum = NewAtk - CurrentAtkNumber;
            var heroPos   = PlayerManager.Instance.FindHero().transform.position + new Vector3(CommonDefineManager.Instance.CommonDefine.HitNumber_VectorX, CommonDefineManager.Instance.CommonDefine.HitNumber_VectorY, CommonDefineManager.Instance.CommonDefine.HitNumber_VectorZ);

            PopupTextController.SettleResult(heroPos, addAtkNum.ToString(), FightEffectType.TOWN_EFFECT_ZHANLI, false);

            CurrentAtkNumber   = NewAtk;
            m_isShowZhanLiAnim = false;
        }
Example #2
0
    void ReceiveFightResultHandle(INotifyArgs notifyArgs)
    {
        if (GameManager.Instance.CurrentState != GameManager.GameState.GAME_STATE_BATTLE)
        {
            return;
        }
        SMsgBattleCalculateEffect_SC fightResult = (SMsgBattleCalculateEffect_SC)notifyArgs;
        bool isHero     = fightResult.uidFighter == PlayerManager.Instance.FindHeroDataModel().UID;
        var  entityInfo = m_entityInfos.SingleOrDefault(P => P.Uid == fightResult.uidFighter);

        if (entityInfo != null)
        {
            if (m_typeMapManager.ContainsKey(entityInfo.EntityType))
            {
                var    entityModel = m_typeMapManager [entityInfo.EntityType].GetEntityMode(fightResult.uidFighter);
                TypeID bulletOwnerEntityType;


                if (entityModel != null)
                {
                    string displayContent  = string.Empty;
                    var    fightEffectType = (FightEffectType)fightResult.EffectType;
                    switch (fightEffectType)
                    {
                    case FightEffectType.BATTLE_EFFECT_CRIT:       //暴击
                        //TraceUtil.Log("CritHit");
                        //displayContent = "-" + fightResult.Value.ToString() ;
                        displayContent = fightResult.Value.ToString();
                        if (GameManager.Instance.CurrentGameMode == GameMode.MULTI_PLAYER)
                        {
                            ShowHurtEffect(entityModel, fightResult.BulletTemplateID, fightResult.uidEffectParam);
                            EntityModel bulletOwnerEntityModel = GetEntityModel(fightResult.uidEffectParam, out bulletOwnerEntityType);
                            if (bulletOwnerEntityModel != null)
                            {
                                ShowHurtUiEffect(bulletOwnerEntityModel, fightResult.BulletTemplateID);
                            }
                        }
                        break;

                    case FightEffectType.BATTLE_EFFECT_DODGE:      //闪避 Miss
                        displayContent = LanguageTextManager.GetString("IDS_D2_15");
                        break;

                    case FightEffectType.BATTLE_EFFECT_HIT:      //命中
                        //displayContent = LanguageTextManager.GetString("IDS_D2_16") + " -" + fightResult.Value.ToString() + "HP";
                        displayContent = fightResult.Value.ToString();
                        //命中效果
                        if (GameManager.Instance.CurrentGameMode == GameMode.MULTI_PLAYER)
                        {
                            ShowHurtEffect(entityModel, fightResult.BulletTemplateID, fightResult.uidEffectParam);
                            EntityModel bulletOwnerEntityModel = GetEntityModel(fightResult.uidEffectParam, out bulletOwnerEntityType);
                            if (bulletOwnerEntityModel != null)
                            {
                                ShowHurtUiEffect(bulletOwnerEntityModel, fightResult.BulletTemplateID);
                            }
                        }
                        if (!GameManager.Instance.m_gameSettings.ShowHurtNum)
                        {
                            return;
                        }
                        break;

                    case FightEffectType.BATTLE_EFFECT_HP:      //HP扣血
                        displayContent = "-" + fightResult.Value;
                        return;

                    case FightEffectType.BATTLE_ADDHP:      //加HP
                        displayContent = "+" + fightResult.Value;
                        break;

                    case FightEffectType.BATTLE_ADDMP:      //加MP
                        if (fightResult.Value > 0)
                        {
                            displayContent = "+" + fightResult.Value;
                        }
                        else
                        {
                            displayContent = fightResult.Value.ToString();
                        }
                        break;

                    case FightEffectType.BATTLE_ADDMONEY:      //加铜钱
                        SoundManager.Instance.PlaySoundEffect("Sound_Button_Pay");
                        displayContent = fightResult.Value.ToString();
                        UI.Battle.BattleMessangeManager.Instance.Show(displayContent, LanguageTextManager.GetString("IDS_D2_17"));
                        break;

                    case FightEffectType.BATTLE_EFFECT_ROLLPOINT:       //Roll点
                        //当前还不需要显示Roll点
                        GameManager.Instance.DamageFactory.PlayDiceAnimation();
                        return;

                    case FightEffectType.BATTLE_EFFECT_EXPSHOW:       //怪物死亡经验显示
                        TraceUtil.Log("获得经验显示");
                        //displayContent = string.Format(LanguageTextManager.GetString("IDS_H1_395"), fightResult.Value);
                        displayContent = fightResult.Value.ToString();
                        break;

                    case FightEffectType.BATTLE_EFFECT_GOODSSHOW:       //获得物品显示
                        DamageManager.Instance.AllocationToPlayer(fightResult.uidFighter, fightResult.uidEffectParam, fightResult.Value);
                        //DamageManager.Instance.AllocationEquip(fightResult.uidFighter, fightResult.uidBeFighted, fightResult.Value);
                        return;

                    case FightEffectType.BATTLE_EFFECT_XIUWEI:    //获得修为显示
                        displayContent = fightResult.Value.ToString();
                        TraceUtil.Log("获得修为显示");
                        break;

                    case FightEffectType.BATTLE_EFFECT_SHILIAN_XIUWEI:
                        TraceUtil.Log("获得试炼副本修为显示");
                        //var m_hostPosition = entityModel.GO.transform.position + UnityEngine.Vector3.up * 18;
                        //displayContent = string.Format(LanguageTextManager.GetString("IDS_H1_471"), fightResult.Value);
                        displayContent = fightResult.Value.ToString();
                        PopupTextController.SettleResultForTime(entityModel, displayContent, fightEffectType);
                        return;

                    case FightEffectType.BATTLE_EFFECT_SHILIAN_EXPSHOW:
                        TraceUtil.Log("获得试炼副本经验值显示");
                        //displayContent = string.Format(LanguageTextManager.GetString("IDS_H1_395"), fightResult.Value);
                        displayContent = fightResult.Value.ToString();
                        break;
                    }
                    //var hostPosition = entityModel.GO.transform.position + new Vector3(CommonDefineManager.Instance.CommonDefine.HitNumber_VectorX, CommonDefineManager.Instance.CommonDefine.HitNumber_VectorY, CommonDefineManager.Instance.CommonDefine.HitNumber_VectorZ);
                    var hostPosition = getUIPosition(entityModel);
                    PopupTextController.SettleResult(hostPosition, displayContent, fightEffectType, isHero);
                }
            }
        }
    }