Esempio n. 1
0
        /// <summary>
        /// 结束PK
        /// </summary>
        /// <param name="uidTarget">PK目标</param>
        /// <param name="nPKResult">PK结果</param>
        public void EndPK(int uidTarget, int nPKResult, int bForceEnd)
        {
            SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

            if (sc != null)
            {
                sc.doingPKSelection  = false;
                sc.enablePKSelection = true;
            }

            PKResult result = new PKResult();

            result.nResult   = nPKResult;
            result.bForceEnd = bForceEnd == 1? true: false;

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PKINFO_ENDPK, result);
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WAR_FLOATFONT_UNLOAD, null);

            UTopNameManager.Instance.SetPKMode(EntityFactory.MainHeroID, false);
            UTopNameManager.Instance.SetPKMode(uidTarget, false);
            UTopNameManager.PkTargetID = -1;

            UBloodManager.Instance.PkTargetID = -1;
            UBloodManager.Instance.DestroyALL();

            EffectHelper.UnloadPreLight(LightType.ActorSkin, pkTargetSkinID);
            UnLoadPKRelateSkin(pkTargetSkinID);
            UnLoadPKRelateSkin(pkSrcSkinID);
            pkSrcSkinID    = 0;
            pkTargetSkinID = 0;

            m_bIsPK = false;
        }
Esempio n. 2
0
    void  subDamage(SkillCtrl skillctrl)
    {
        foreach (BuffCtrl each in buffs)
        {
            if (each.serverData.sample.getType() == BuffType.damage && each.owner == target)
            {
                int subDamage = (int)(each.serverData.serverDamage * 0.2f);
                for (int i = 0; i < 4; i++)
                {
                    BuffCtrl ctrl = new BuffCtrl();
                    ctrl.owner         = each.owner;
                    ctrl.trigger       = each.trigger;
                    ctrl.DisplayEffect = each.DisplayEffect;

                    ctrl.option                  = each.option;
                    ctrl.parentSkill             = each.parentSkill;
                    ctrl.serverData              = new BuffData(each.serverData.sid, subDamage);
                    ctrl.serverData.damageEffect = "";
                    buffs.Add(ctrl);
                }
                each.serverData.serverDamage = subDamage;
                break;
            }
        }
    }
Esempio n. 3
0
    //其他连击特效
    IEnumerator otherMeleeAttack()
    {
        //BuffCtrl damageBuff = null;
        int damageAll = 0;

        //找到对应的伤害buff,单体目标肯定只有1
        foreach (BuffCtrl each in activeAction.Skill.buffs)           // 先统计所有buff伤害
        {
            if (each.serverData.sample.getType() == BuffType.damage)
            {
                //算出单次伤害
                damageAll += each.serverData.serverDamage;
            }
        }
        activeAction.Skill.applyBuff(activeAction.Skill.buffs);
        SkillCtrl       sc         = activeAction.Skill;          //释放者的
        CharacterData   cd         = sc.targets[0];               //其中一个技能目标
        List <BuffCtrl> damageBuff = cd.characterCtrl.damageBuff; //这个目标中的伤害buff

        if (damageBuff != null && damageBuff.Count > 1)
        {
            for (int i = 0; i < damageBuff.Count; i++)      //细分为多少次伤害
            {
                UiManager.Instance.battleWindow.comboBar.init(damageBuff.Count, damageAll);
                yield return(new WaitForSeconds(0.1f));
            }
        }

        //StartCoroutine (cardCtrl.goBack ());
    }
Esempio n. 4
0
        public void MatchSlotData(int slotType, int slotIndex)
        {
            if (EntityFactory.MainHero == null)
            {
                return;
            }

            SkillCtrl sc    = EntityFactory.MainHero.GetComponent <SkillCtrl>();
            int       index = slotType * m_maxSlotPerType + slotIndex;

            if (!sc || !CurrentSlotMap.ContainsKey(index))
            {
                return;
            }

            sc.SetSlotKeyCode(CurrentSlotMap[index].nSlotType, CurrentSlotMap[index].nSlotIndex, CurrentSlotMap[index].nReleaseCondition, CurrentSlotMap[index].szKeySequence);

            cmd_entity_set_smart_cast data = new cmd_entity_set_smart_cast();

            data.nSlotIndex   = CurrentSlotMap[index].nSlotIndex;
            data.nSlotType    = CurrentSlotMap[index].nSlotType;
            data.nSmartCast   = CurrentSlotMap[index].nAutoCasting;
            slotSmartDatas[0] = data;
            SendSmartDataToLogic();
            slotSmartDatas.Clear();
        }
Esempio n. 5
0
    /// <summary>
    /// 开头动画播放完成回调
    /// </summary>
    public void OnMovieFinished()
    {
        //开启所有已生成
        if (MainHerpEv != null)
        {
            MainHerpObj.SetActive(true);
            MainHerpObj = null;
            MainHerpEv  = null;
        }
        //开启玩家控制输入***
        if (MainSkillCtrl != null)
        {
            MainSkillCtrl.enable = true;
            MainSkillCtrl        = null;
        }
        if (MainMouseCtrl != null)
        {
            MainMouseCtrl.enabled = true;
            MainMouseCtrl         = null;
        }
        if (m_SkinControl != null)
        {
            //m_SkinControl.UnRegsiterSkinChangedEvent(OnSkinChanged);
            m_SkinControl = null;
        }
        LogicDataCenter.onEnterBattleState();

        //UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_BATTLESTATE_ENTER, null);

        //EntityFactory.CreateMainHeroEntityEvent -= OnHeroEntityLoadComplete;
        //MainHerpEv.LightingEffectManager.UnRegisterEffectComplete(333, OnMovieFinished);

        //开启音效
        //开启光效
    }
Esempio n. 6
0
        /// <summary>
        /// 重置
        /// </summary>
        public void Restore()
        {
            CacheSkin();
            //要在他们之前清理,因为动态脚本是依赖静态脚本的
            DestroyDynamicCommopnent();
            if (skinControl)
            {
                skinControl.Clear();
                skinControl = null;
            }
            if (m_property)
            {
                m_property.Restore();
                m_property = null;
            }

            if (m_stateMachine)
            {
                m_stateMachine.Clear();
                m_stateMachine.ResetAllMembers();
                m_stateMachine = null;
            }
            if (m_LightEffectManager)
            {
                m_LightEffectManager.Clear();
                m_LightEffectManager.Restore();
                m_LightEffectManager = null;
            }
            m_SkillCtrl = null;
            UBloodManager.Instance.DestroyBlood(ID);
            commands.Clear();
            //commands = null;
        }
Esempio n. 7
0
 public void removeSkill(SkillCtrl _skill)
 {
     if (_skill != null)
     {
         SkillList.Remove(_skill);
         //Debug.LogWarning ("skill Remove:   " + _skill.serverData.sample.getName () + "    " + _skill.serverData.id + "legth:" + SkillList.Count);
     }
 }
Esempio n. 8
0
    private void SendMinimapClickPosToSkillCtrl(Vector3 _vec3Pos)
    {
        SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

        if (sc != null)
        {
            sc.MinimapClickPosInScene = _vec3Pos;
        }
    }
Esempio n. 9
0
        public void ShowEndOfWar(bool bIsWin)
        {
            SetVisible(true);
            StateImage.sprite = USpriteManager.Instance.DefaultSprite;
            if (bIsWin)
            {
                //StateImage.sprite = VictoryImage;

                EndOfWarEffect = new UEffectPrefabParam(_eType: UEffectPrefabType.UEPT_UEndOfWarView_Victory, _tfAttachParent: StateImage.transform);
                UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref EndOfWarEffect);

                UEffectPrefabParam paramPrefab = (UEffectPrefabParam)EndOfWarEffect;
                // paramPrefab.EffectGameObject.transform.localPosition = new Vector3(25, -8, 0);

                // 播放胜利音效
                playWinSound();
            }
            else
            {
                //StateImage.sprite = FailedImage;

                EndOfWarEffect = new UEffectPrefabParam(_eType: UEffectPrefabType.UEPT_UEndOfWarView_Failure, _tfAttachParent: StateImage.transform);
                UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectPrefab, ref EndOfWarEffect);

                UEffectPrefabParam paramPrefab = (UEffectPrefabParam)EndOfWarEffect;
                // paramPrefab.EffectGameObject.transform.localPosition = new Vector3(25, -8, 0);

                // 播放失败音效
                playFailedSound();
            }
            //缩放动画
            Sequence ShowEndOfWarEequence = DOTween.Sequence();

            ShowEndOfWarEequence
            //ShowEndOfWarEequence.Append(StateImage.rectTransform.DOSizeDelta(new Vector2(1218, 651), duration, snapping)
            //                                                    .SetDelay(delay)
            //                                                    .SetEase(Ease.OutFlash, amplitude, period))
            .Append(ContinueImage.DOFade(1.0f, ButtonDuration)
                    .SetDelay(delay))
            .Insert(1, ContinueButton.DOFade(1.0f, ButtonDuration)
                    .SetDelay(delay))
            .Insert(1, ContinueText.DOFade(1.0f, ButtonDuration)
                    .SetDelay(delay));
            ShowEndOfWarEequence.OnKill(() => ShowEndOfWarEequence = null);


            // 进入战绩界面前按键设为false
            if (EntityFactory.MainHero != null)
            {
                SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();
                if (sc != null)
                {
                    sc.enable = false;
                }
            }
            Invoke("onContinueBtnClick", 6f);
        }
Esempio n. 10
0
        public void OnPointerClick(PointerEventData eventData)
        {
            SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

            if (sc != null)
            {
                sc.UIUseSkill(SelectionSpellID, SelectionEntityID);
            }
        }
Esempio n. 11
0
    private void SendTeamRightClickPlayerUID(int _nUID)
    {
        SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

        if (sc != null)
        {
            sc.TeamRightClickPlayerUID = _nUID;
        }
    }
Esempio n. 12
0
 private void OnSkinChangedLoacl()
 {
     //关闭玩家控制输入***
     MainSkillCtrl        = MainHerpObj.GetComponent <SkillCtrl>();
     MainSkillCtrl.enable = false;
     //关闭玩家鼠标输入***
     MainMouseCtrl         = MainHerpObj.GetComponent <MouseCtrl>();
     MainMouseCtrl.enabled = false;
     //想要播放动画
     PlayBattleMovie();
     MainHerpObj.SetActive(false);
 }
Esempio n. 13
0
    public void init(CharacterData _owner, CharacterData _trigger, BuffData _buff, bool _duration, int _id, SkillCtrl _parentSkill)
    {
        owner         = _owner;
        serverData    = _buff;
        serverData.id = _id;
        parentSkill   = _parentSkill;
        trigger       = _trigger;
//	MonoBase.	print(serverData.id);
        if (serverData.id == 0)
        {
            serverData.id = this.GetHashCode();
        }
    }
Esempio n. 14
0
    /// 选择提示器
    /// </summary>
    /// <param name="skill"></param>
    /// <param name="obj"></param>
    public UnitCtrl TargetSelect(SkillCtrl skill, GameObject skillArrowObj)
    {
        UnitCtrl unitSelect   = null;
        float    _skillRadius = 0.0f;

        //fRadius = skill.m_disRange;//技能的半径
        _skillRadius = outerRadius;
        UnitCtrl _caster    = Caster.GetComponent <UnitCtrl> ();
        Vector3  pos_caster = Caster.transform.position;

        Collider[]      bufCollider = Physics.OverlapSphere(pos_caster, _skillRadius);   //获取周围成员
        List <UnitCtrl> listUnit    = new List <UnitCtrl>();

        foreach (var item in bufCollider)
        {
            UnitCtrl unit = item.GetComponentInParent <UnitCtrl>();
            if (unit != null)
            {
                //if (!MainMgr.self.isWe(unit.m_camp) && unit.isAlive && unit.m_isVisible)//非我方,活着,可见
                if (unit != _caster)
                {
                    listUnit.Add(unit);
                }
            }
        }

        float minDegree = angleSkill / 2;

        //在大圆范围内的再进行筛选  1.满足选择范围夹角,2.离中心射线夹角最小的
        foreach (var unit in listUnit)
        {
            Vector3 unitVec   = unit.transform.position - skillArrowObj.transform.position;
            Vector3 selectVec = skillArrowObj.transform.forward;
            float   degree    = Vector3.Angle(unitVec, selectVec);
            if (degree <= minDegree)
            {
                minDegree  = degree;
                unitSelect = unit;
            }
        }

        if (unitSelect != null)
        {
            HeadLockSet(true, unitSelect);
        }
        else
        {
            HeadLockSet(false, unitSelect);
        }
        return(unitSelect);
    }
Esempio n. 15
0
    public void Update()
    {
        if (InputManager.GetKeyDown(KeyCode.BackQuote) && (InputManager.GetKey(KeyCode.LeftControl) || InputManager.GetKey(KeyCode.RightControl)))
        {
            RotateWithMouse = !RotateWithMouse;
        }

        if (SoldierCamera.MainInstance() != null && SoldierCamera.MainInstance <SoldierCamera>().bRotateWithMouse != RotateWithMouse)
        {
            if (SoldierCamera.MainInstance <SoldierCamera>().bRotateWithMouse)
            {
                setFPSRotate(true, true);
            }
            else
            {
                if (SoldierCamera.MainInstance().cameraMode == CameraMode.FPSMode)
                {
                    setFPSRotate(false, true);
                }
                else if (SoldierCamera.MainInstance().cameraMode != CameraMode.SniperscopeControl)
                {
                    setFPSRotate(false, false);
                }
            }
        }
        fMouseAxisX = InputManager.GetAxis(InputAxisSet.Axis_MouseX);
        fMouseAxisY = InputManager.GetAxis(InputAxisSet.Axis_MouseY);

        if (skillCtrl == null)
        {
            skillCtrl = transform.GetComponent <SkillCtrl>();
        }

        if ((InputManager.GetMouseButton(1) || RotateWithMouse) && canSkillCtrl())
        {
            m_bCameraRotateButton = true;
        }
        else
        {
            m_bCameraRotateButton = false;
        }
        updateMouseMoving();

        //分状态对按键处理
        updateFunction();

        //if (Screen.lockCursor != m_lockCursor)
        //{
        //    Screen.lockCursor = m_lockCursor;
        //}
    }
Esempio n. 16
0
        IEnumerator PkSelect()
        {
            yield return(new WaitForEndOfFrame());

            if (EntityFactory.MainHero)
            {
                SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();
                if (sc != null)
                {
                    //sc.PKTargetSelection();
                    sc.doingPKSelection = true;
                }
            }
        }
Esempio n. 17
0
        public void SendTeamRightClickPlayerUID(int nSlotId)
        {
            if (!LogicDataCenter.teamRightWndDataManager.MyTeamEntityIdTable.ContainsKey(nSlotId))
            {
                return;
            }

            SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

            if (sc != null)
            {
                sc.TeamRightClickPlayerUID = (int)LogicDataCenter.teamRightWndDataManager.MyTeamEntityIdTable[nSlotId];
            }
        }
Esempio n. 18
0
    //击中效果
    void hit()
    {
        if (displayType == bulletDisplayTypeEnum.fixAOE || displayType == bulletDisplayTypeEnum.normal || displayType == bulletDisplayTypeEnum.lightBeam || displayType == bulletDisplayTypeEnum.throughAOE)
        {
            //细分攻击传对应id 对应出伤害
            if (owner.characterCtrl.activeAction.Skill.serverData.sample.getAttackNum() > 1)
            {
                owner.characterCtrl.activeAction.Skill.applyBuff(buffs, GetInstanceID());
            }
            else
            {
                //一下是普通攻击
                if (owner.characterCtrl.activeAction.Skill.targets.Count > 1)
                {
                    //多发子弹
                    owner.characterCtrl.activeAction.Skill.applyBuff(buffs);
                }
                else
                {
                    //单发子弹
                    owner.characterCtrl.activeAction.Skill.applyBuff(owner.characterCtrl.activeAction.Skill.buffs);
                }
            }
        }
        else if (displayType == bulletDisplayTypeEnum.lightBeamInfinite)
        {
            subDamage(owner.characterCtrl.activeAction.Skill);
            owner.characterCtrl.activeAction.Skill.applyBuff(buffs);
        }
        int damageAll = 0;

        //找到对应的伤害buff,单体目标肯定只有1
        foreach (BuffCtrl each in owner.characterCtrl.activeAction.Skill.buffs)           // 先统计所有buff伤害
        {
            if (each.serverData.sample.getType() == BuffType.damage)
            {
                //算出单次伤害
                damageAll += each.serverData.serverDamage;
            }
        }
        SkillCtrl       sc         = owner.characterCtrl.activeAction.Skill; //释放者的
        CharacterData   cd         = sc.targets[0];                          //其中一个技能目标
        List <BuffCtrl> damageBuff = cd.characterCtrl.damageBuff;            //这个目标中的伤害buff

        if (damageBuff != null && damageBuff.Count > 1)
        {
            UiManager.Instance.battleWindow.comboBar.init(damageBuff.Count, damageAll, true);
        }
        owner.characterCtrl.helpBackCheck();
    }
Esempio n. 19
0
 // 获得主英雄的技能控制键
 private SkillCtrl GetMyHeroCtrl()
 {
     if (MyHeroSkillCtrl == null)
     {
         GameObject MyHeroGO = EntityFactory.getEntityGameObjectByID(EntityFactory.MainHeroID);
         if (MyHeroGO == null)
         {
             Trace.LogError("get Hero GameObject failed");
             return(null);
         }
         MyHeroSkillCtrl = MyHeroGO.GetComponent <SkillCtrl>();
     }
     return(MyHeroSkillCtrl);
 }
Esempio n. 20
0
        /// <summary>
        /// 修改槽位方法
        /// </summary>
        /// <param name="nIndex">槽位索引 槽位类型(slotType) * 每类槽位最大数量(1000)+当前槽位索引(slotIndex)</param>
        /// <param name="nAuto">智能施法状态(0:默认;1:快捷 ;2:常规;3:推荐)</param>
        /// <param name="szKeyCode">槽位键值</param>
        public void ChangeSlotData(int nIndex, int nAuto, string szKeyCode)
        {
            if (CurrentSlotMap.ContainsKey(nIndex))
            {
                int index = CurrentSlotMap[nIndex].nSlotIndex;
                int type  = CurrentSlotMap[nIndex].nSlotType;

                if (szKeyCode != CurrentSlotMap[nIndex].szKeySequence)
                {
                    CurrentSlotMap[nIndex].szKeySequence = szKeyCode;

                    if (type == (int)SlotType.Function)
                    {
                        FuntionShortCutCtrl.GetInstance().ChangeKeyCodeToDic(index, szKeyCode, 0);
                    }
                    else
                    {
                        if (!EntityFactory.MainHero)
                        {
                            return;
                        }
                        SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();
                        if (sc != null)
                        {
                            sc.SetSlotKeyCode(type, index, CurrentSlotMap[nIndex].nReleaseCondition, szKeyCode);
                            UIMsgCmdData uiPlayerProgress = new UIMsgCmdData((int)WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, type, szKeyCode.ToUpper(), IntPtr.Zero, index);
                            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, uiPlayerProgress);
                        }
                    }
                }

                if (nAuto != CurrentSlotMap[nIndex].nAutoCasting)
                {
                    if (type == (int)SlotType.Function)
                    {
                        return;
                    }

                    CurrentSlotMap[nIndex].nAutoCasting = nAuto;
                    cmd_entity_set_smart_cast data = new cmd_entity_set_smart_cast();
                    data.nSlotIndex   = index;
                    data.nSlotType    = type;
                    data.nSmartCast   = nAuto;
                    slotSmartDatas[0] = data;
                    SendSmartDataToLogic();
                    slotSmartDatas.Clear();
                }
            }
        }
Esempio n. 21
0
        /// <summary>
        /// 开始PK
        /// </summary>
        /// <param name="uidTarget">PK目标</param>
        /// <param name="pkLoc">PK点坐标</param>
        public void StartPK(int uidTarget, float[] pkLoc)
        {
            SkillCtrl sc = EntityFactory.MainHeroView.SkillCtrl;

            if (sc != null)
            {
                sc.doingPKSelection  = false;
                sc.enablePKSelection = false;
            }

            PKPosInfo posInfo = new PKPosInfo();

            posInfo.pos = pkLoc;
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PKINFO_STARTPK, posInfo);
            UISystem.Instance.ShowWnd(WndID.WND_ID_WAR_FLOATFONTFRAME, true);

            UTopNameManager.Instance.SetPKMode(EntityFactory.MainHeroID, true);
            UTopNameManager.Instance.SetPKMode(uidTarget, true);
            UTopNameManager.PkTargetID = uidTarget;

            U3D_Render.EntityView targetEV = EntityFactory.getEntityViewByID(uidTarget);

            if (targetEV == null || targetEV.Property == null)
            {
                Trace.LogError("pk target ev or pk target ev property null!");
                return;
            }

            UBloodManager.Instance.PkTargetID = uidTarget;
            UBloodManager.Instance.CreatBlood(EntityFactory.MainHeroView, (int)GFxCampTpye.CT_Self);
            UBloodManager.Instance.CreatBlood(targetEV, (int)GFxCampTpye.CT_Enemy);

            pkTargetSkinID = 0;
            pkTargetSkinID = targetEV.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_SKIN);

            pkSrcSkinID = 0;
            pkSrcSkinID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_SKIN);
            EffectHelper.LoadPreLight(LightType.ActorSkin, pkTargetSkinID, CachePriority.PRIORITY_MEDIUM);

            LoadPKRelateSkin(pkTargetSkinID);
            LoadPKRelateSkin(pkSrcSkinID);
            m_bIsPK = true;
        }
Esempio n. 22
0
        public override void OnPointerClick(PointerEventData eventData)
        {
            if (emoticonSkillID < 0)
            {
                return;
            }

            base.OnPointerClick(eventData);

            if (U3D_Render.EntityView.isNullOrEmpty(EntityFactory.MainHeroView))
            {
                return;
            }

            SkillCtrl sc = EntityFactory.MainHeroView.SkillCtrl;

            if (sc != null)
            {
                sc.UseEmoticonSkill(emoticonSkillID);
            }
        }
Esempio n. 23
0
    public void     cameraLookAt(Vector3 pos, float time, SkillCtrl skill)
    {
        if (isCameraScaleNow == true)
        {
            return;
        }

        isCameraScaleNow = true;
        float returnTime = time * 0.2f;
        float delay      = time - returnTime;

        Vector3 oldPos = BattleCamera.transform.position;

        pos = new Vector3(pos.x, BattleCamera.transform.position.y, pos.z);         //忽略传入位置的y轴

        iTween.MoveTo(BattleCamera.gameObject, iTween.Hash("position", pos, "time", returnTime));
        iTween.ValueTo(BattleManager.Instance.gameObject, iTween.Hash("from", 1, "to", 0.6f, "onupdate", "cameraSacle", "time", returnTime));
        UiManager.Instance.removeAllEffect();
        EffectManager.Instance.CreateSkillBanner(skill.serverData.sample.getName());

        iTween.MoveTo(BattleCamera.gameObject, iTween.Hash("delay", delay, "position", oldPos, "time", returnTime));
        iTween.ValueTo(BattleManager.Instance.gameObject, iTween.Hash("delay", delay, "from", 0.6f, "to", 1, "onupdate", "cameraSacle", "oncomplete", "cameraLookatOver", "time", returnTime));
    }
Esempio n. 24
0
    public void changeBuff(SkillCtrl skill)
    {
        foreach (BuffAttrChange each in  skill.changes)
        {
            bool foundBuff = false;
            //在已有buff中找到对应buff
            foreach (CharacterData man in  BattleManager.Instance.getAllBattleCharacterData())
            {
                foreach (BuffCtrl eachBuff in  man.characterCtrl.GetBuffList())
                {
                    if (each.skillID == eachBuff.serverData.id)
                    {
//						MonoBase.print (man.role.getName () + ":" + eachBuff.serverData.sample.getName () + " " + eachBuff.serverData.id+",operationType="+each.operationType);
                        foundBuff = true;
                        //如果buff操作类型是移除
                        if (each.operationType == BattleReportService.BUFFER_REMOVE)
                        {
                            man.characterCtrl.RemoveBuff(eachBuff);
                        }
                        else if (each.operationType == BattleReportService.BUFFER_ABILITY)
                        {
                            eachBuff.option = buff_option.active;
                            eachBuff.serverData.serverDamage = each.changes [0].damage;
                            eachBuff.activeOtherBuff();
                        }
                        break;
                    }
                }
                if (foundBuff)
                {
                    man.characterCtrl.BeHit();
                    break;
                }
            }
        }
    }
Esempio n. 25
0
        /// <summary>
        /// 绑定主角组件
        /// </summary>
        /// <returns></returns>
        private bool BindHeroComponent()
        {
            Trace.Log("BindHeroComponent() -> Hero, id=" + ID.ToString());

            CreatureProperty property = this.Property;
            BaseStateMachine fsm      = this.StateMachine;

            if (property == null || fsm == null)
            {
                Trace.Log("BindHeroComponent failed. CreatureProperty==null or BaseStateMachine == null !!!");
                return(false);
            }

            m_gameObject.layer = LayerMask.NameToLayer(Config.LayerHero);
            fsm.baseLayer      = LayerMask.NameToLayer(Config.LayerHero);
            fsm.pickableCount  = 1;
            fsm.isNotAttack    = false;
            MouseCtrl mousectrl = m_gameObject.GetComponent <MouseCtrl>();

            if (mousectrl == null)
            {
                mousectrl = m_gameObject.AddComponent <MouseCtrl>();
            }
            m_DynamicCommopnent.AddLast(mousectrl);
            SkillCtrl skillctrl = m_gameObject.GetComponent <SkillCtrl>();

            if (skillctrl == null)
            {
                skillctrl = m_gameObject.AddComponent <SkillCtrl>();
                skillctrl.resetOrderset(0);//property.SkillOrderSetName);
            }
            m_DynamicCommopnent.AddLast(skillctrl);
            ScreenRaycast raycast = m_gameObject.GetComponent <ScreenRaycast>();

            if (raycast == null)
            {
                raycast = m_gameObject.AddComponent <ScreenRaycast>();
            }
            m_DynamicCommopnent.AddLast(raycast);

            fsm.isHero     = true;
            fsm.canControl = true;

            SoldierController soliderController = m_gameObject.GetComponent <SoldierController>();

            if (soliderController == null)
            {
                soliderController = m_gameObject.AddComponent <SoldierController>();
            }
            m_DynamicCommopnent.AddLast(soliderController);

            if (StageManager.Instance.CurPermissionState == EStage_PermissionState.ESPS_OB)
            {
                OBController obController = m_gameObject.GetComponent <OBController>();
                if (obController == null)
                {
                    obController = m_gameObject.AddComponent <OBController>();
                }

                m_DynamicCommopnent.AddLast(obController);
            }

            fsm.maxRunForwardSpeed  = property.runSpeed_Forward;
            fsm.maxRunBackwardSpeed = property.runSpeed_Back;
            fsm.maxRunSidewaySpeed  = property.runSpeed_LeftRight;

            //ScreenCastLayer screenCastLayer = m_gameObject.GetComponent<ScreenCastLayer>();
            //if (screenCastLayer != null)
            //{
            //    screenCastLayer.setHero(true);
            //    GameObject.ResNode.DestroyRes(ref screenCastLayer);
            //}

            return(true);
        }
Esempio n. 26
0
        /// <summary>
        /// 设置槽位信息
        /// </summary>
        public void SetSlotData(bool isForceDefault = false)
        {
            if (!EntityFactory.MainHero)
            {
                return;
            }
            SkillCtrl sc = EntityFactory.MainHero.GetComponent <SkillCtrl>();

            if (!sc)
            {
                return;
            }
            int vocationID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION);

            foreach (KeyValuePair <int, SlotKeyCodeData> kv in CurrentSlotMap)
            {
                switch (kv.Value.nSlotType)
                {
                case (int)SlotType.Equip:
                case (int)SlotType.Skill:
                {
                    sc.SetSlotKeyCode(kv.Value.nSlotType, kv.Value.nSlotIndex, kv.Value.nReleaseCondition, kv.Value.szKeySequence);
                    UIMsgCmdData uiPlayerProgress = new UIMsgCmdData((int)WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, kv.Value.nSlotType, kv.Value.szKeySequence.ToUpper(), IntPtr.Zero, kv.Value.nSlotIndex);
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_WARBUTTOMCENTER_SETSHORTCUT, uiPlayerProgress);
                    cmd_entity_set_smart_cast data     = new cmd_entity_set_smart_cast();
                    List <PlayerSlotItem>     slotList = null;
                    int       maxSlotIndexForEachType  = 1000;  //一类slot最多有多少个index,用于将index和type合并编码
                    int       nSlotID       = kv.Value.nSlotType * maxSlotIndexForEachType + kv.Value.nSlotIndex;
                    SpellMode useType       = SpellMode.ST_Normal;
                    bool      hasUserConfig = PlayerSlotSettingConfig.Instance.GetLocalData(EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION), out slotList);
                    if (hasUserConfig && !isForceDefault)         //如果用户配置了就使用用户的配置
                    {
                        for (int i = 0; i < slotList.Count; i++)
                        {
                            if (nSlotID == slotList[i].slotID)
                            {
                                useType = (SpellMode)Enum.Parse(typeof(SpellMode), slotList[i].useType.ToString());
                            }
                        }
                    }
                    else           //默认施法:使用策划在技能编辑器的配置
                    {
                        if (sc != null)
                        {
                            OrderData odata = sc.GetCurOrderData(nSlotID);
                            if (odata == null)
                            {
                                useType = SpellMode.ST_Normal;
                            }
                            else
                            {
                                useType = (SpellMode)Enum.Parse(typeof(SpellMode), (odata.nAdvanceUseType).ToString());
                            }
                        }
                    }
                    kv.Value.nAutoCasting = (int)useType;
                    data.nSlotIndex       = kv.Value.nSlotIndex;
                    data.nSlotType        = kv.Value.nSlotType;
                    data.nSmartCast       = kv.Value.nAutoCasting;
                    slotSmartDatas[0]     = data;
                    SendSmartDataToLogic();
                    slotSmartDatas.Clear();
                }
                break;

                case (int)SlotType.Function:
                    FuntionShortCutCtrl.GetInstance().SaveKeyCodeToDic(kv.Value.nSlotIndex, kv.Value.szKeySequence);
                    break;

                default:
                    break;
                }
            }
        }
Esempio n. 27
0
 public CharacterAction(enum_character_Action _action, SkillCtrl _Skill)
 {
     action = _action;
     Skill  = _Skill;
 }
Esempio n. 28
0
    ///// <summary>
    ///// 死亡前的碰撞层
    ///// </summary>
    //private int nOldCollisionLayer = -1;
    // 进入状态
    public bool OnEnter(IntPtr lParam)
    {
        //退出假死状态
        if (m_pFSM != null && m_pFSM.animatorCtrl != null)
        {
            m_pFSM.animatorCtrl.Dying = false;
        }

        Debug.Log("on OnEnter CreaturePosture_Dead " + this.m_pFSM.name);
        if (m_pFSM.showLog)
        {
            Trace.Log(m_pFSM.name + "=======OnEnter CreaturePosture_Dead======");
        }

        cmd_creature_die context = IntPtrHelper.toData <cmd_creature_die>(lParam);

        if (m_pFSM.showLog)
        {
            Trace.Log("DeadInterval:" + context.nDeadInterval);
            Trace.Log("reborn second:" + context.nInterval);
        }



        m_pFSM.rebornTick = context.nInterval - context.nDeadInterval;
        if (m_pFSM.rebornTick <= 0)
        {
            Trace.Log("rebornTick <= 0!");
            //return false;                   吃鸡地图,这个时差是0,所以先不要返回
        }
        m_nDeadInterval = context.nDeadInterval;

        //暂时让角色死亡不让射线检测该层
        //if (!m_pFSM.isHero)
        //{
        //    nOldLayer = m_pFSM.gameObject.layer;
        //    if (m_pFSM.gameObject.layer != LayerMask.NameToLayer(Config.LayerTransparentFX))
        //    {
        //        GameUtil.SetLayer(LayerMask.NameToLayer(Config.LayerNeutrality), m_pFSM.gameObject, true);
        //    }

        //    //m_pFSM.gameObject.layer = LayerMask.NameToLayer(Config.LayerPlayerFriend);
        //    //if (m_pFSM.SkinConfig.ScreenCastObject != null)
        //    //{
        //    //    m_pFSM.SkinConfig.ScreenCastObject.layer = LayerMask.NameToLayer(Config.LayerPlayerFriend);
        //    //}
        //}

        SkillCtrl sk = m_pFSM.GetComponent <SkillCtrl>();

        if (sk)
        {
            sk.enabled = false;
        }

        SoldierController sco = m_pFSM.GetComponent <SoldierController>();

        if (sco)
        {
            sco.dead = true;
        }

        if (m_pFSM.animator)
        {
            m_pFSM.animator.SetTrigger("Dead");

            m_pFSM.animator.ResetTrigger("Reborn");
        }

        //关闭死亡时要求关闭的光效
        LightingEffectManager light = m_pFSM.GetComponent <LightingEffectManager>();

        if (light)
        {
            light.CloseLightingWhenDead();
        }

        startTick = GameLogicAPI.getSyncTickCount(); // GameLogicAPI.getTickCount();
        endTick   = startTick + (uint)m_pFSM.rebornTick;
        tick_cameraSwitchAfterDead = startTick + m_pFSM.cameraSwitchAfterDead;

        if (m_pFSM.isHero)
        {
            //GFxGameHud hud = SFGFxMovieManager.GetWindow<GFxGameHud>();
            //if (SFGFxMovieManager.CheckTheMovieCanUse(hud))
            //{
            //    hud.ShowReliveTime(((float)m_pFSM.rebornTick));
            //}
            ScreenREC.GetInstance().SwitchRECState(ScreenREC.EMRECState.EMREC_STOP);

            //ImageEffects.ImageEffectManager.API_EnableImageEffect<ImageEffects.FullScreenGray>();
            if (ImageSetting.GetData().currImageQuality == ImageQuality.Fastest)
            {
                LightingEffectFactory.EnableDeadEffect();
                ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.FullScreenSaturation>();
                ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.DepthOfFieldScatter>();
            }
            else
            {
                LightingEffectFactory.DisableDeadEffect();
                ImageEffects.ImageEffectManager.API_EnableImageEffect <ImageEffects.FullScreenSaturation>();
                ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.DepthOfFieldScatter>();
            }
        }

        //死亡不碰撞
        if (m_pFSM.controller)
        {
            //nOldCollisionLayer = m_pFSM.gameObject.layer;
            //m_pFSM.gameObject.layer = LayerMask.NameToLayer(Config.LayerIngoreRayCast);
            m_pFSM.pickableCount = 0;
        }

        int nEntityID = m_pFSM.entityID;

        U3D_Render.EntityView ev = EntityFactory.getPlayerViewByID(nEntityID);

        //添加金币掉落光效
        if (GameLogicAPI.isInWarScene() > 0)
        {
            addMoneyEffect(ev, context.uMurderID);
        }

        USpeedUI.Blood.UBloodManager.Instance.OnEntityDead(m_pFSM.entityID, ENTITY_TYPE.TYPE_PLAYER_ROLE);
        // 小地图隐藏
//         U3D_Render.EntityView objev = EntityFactory.getEntityViewByID(m_pFSM.entityID);
//         if (objev != null && GFxMinimapManager.Instance != null)
//         {
//             GFxMinimapManager.Instance.SetObjectVisible(m_pFSM.entityID, objev.createinfo.nMinimapIcon, 0);
//         }
        return(true);
    }
Esempio n. 29
0
        public void SettingKeyCodeInfo(EntityView view, bool isForceDefault = false)
        {
            nSpellTypeState = (int)SlotKeyCodeConfig.Instance.CurrentSpellMode;
            if (this.gameObject.activeInHierarchy && nSpellTypeState >= 1)
            {
                spellState.NotifyToggleOn(spellStateToggleGroup[nSpellTypeState - 1]);
            }
            if (EntityFactory.MainHero == null)
            {
                return;
            }
            SkillCtrl skillCtrl = EntityFactory.MainHero.GetComponent <SkillCtrl>();

            foreach (KeyValuePair <int, SlotKeyCodeData> kv in SlotKeyCodeConfig.Instance.CurrentSlotMap)
            {
                foreach (var temp in m_KeyCodeMap)
                {
                    if (kv.Key == temp.keyIndex && temp.keyCodeText != null)
                    {
                        temp.keyCodeText.text = kv.Value.szKeySequence.ToUpper();
                    }
                    if (kv.Key == temp.keyIndex && temp.keyCodeToggleBtn != null && temp.toggleText != null)
                    {
                        int maxSlotIndexForEachType = 1000; //一类slot最多有多少个index,用于将index和type合并编码
                        int nSlotID = kv.Value.nSlotType * maxSlotIndexForEachType + kv.Value.nSlotIndex;

                        SpellMode useType = SpellMode.ST_Normal;

                        List <PlayerSlotItem> slotList = null;
                        bool hasUserConfig             = PlayerSlotSettingConfig.Instance.GetLocalData(EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION), out slotList);
                        if (hasUserConfig && !isForceDefault) //如果用户配置了就使用用户的配置
                        {
                            for (int i = 0; i < slotList.Count; i++)
                            {
                                if (nSlotID == slotList[i].slotID)
                                {
                                    useType = (SpellMode)Enum.Parse(typeof(SpellMode), slotList[i].useType.ToString());
                                }
                            }
                        }
                        else   //默认施法:使用策划在技能编辑器的配置
                        {
                            if (skillCtrl != null)
                            {
                                OrderData odata = skillCtrl.GetCurOrderData(nSlotID);
                                if (odata == null || odata.nAdvanceUseType == 0)
                                {
                                    useType = SpellMode.ST_Normal;
                                }
                                else
                                {
                                    useType = (SpellMode)Enum.Parse(typeof(SpellMode), (odata.nAdvanceUseType).ToString());
                                }
                            }
                        }
                        temp.useType = (int)useType;
                        switch (useType)
                        {
                        case SpellMode.ST_Normal:          //常规施法
                            temp.toggleText.text = SKILL_USE_TYPE_TEXT[temp.useType];
                            break;

                        case SpellMode.ST_Speed:          //快捷施法
                            temp.toggleText.text = SKILL_USE_TYPE_TEXT[temp.useType];
                            break;

                        case SpellMode.ST_Smart:           //推荐施法
                            temp.toggleText.text = SKILL_USE_TYPE_TEXT[temp.useType];
                            break;

                        default:          //默认施法(不会是这个)
                            temp.toggleText.text = "";
                            break;
                        }
                    }
                }
            }
            bFirstLoad = false;
        }
Esempio n. 30
0
    // 离开状态
    public void OnLeave()
    {
        if (!m_pFSM)
        {
            return;
        }

        Trace.Log(m_pFSM.name + "=======OnLeave CreaturePosture_Dead======");

        //死亡动作在攻击层调用,这里结束掉死亡动作
        m_pFSM.BreakAttackAnim();

        SkillCtrl sk = m_pFSM.GetComponent <SkillCtrl>();

        if (sk)
        {
            sk.enabled = true;
        }

        if (m_pFSM.isHero) //复活时切回主角镜头
        {
            SoldierCamera.MainInstance <SoldierCamera>().EnableMode(CameraMode.DeadControl, false);
        }

        SoldierController sco = m_pFSM.GetComponent <SoldierController>();

        if (sco)
        {
            sco.dead        = false;
            sco.desireAngle = m_pFSM.transform.localEulerAngles;
            //sco.bindSoldierCamera.Reset(); 2016-09-22,策划需求,复活后摄像机位置保持原来跟角色的位置,不重置,改为仅取消effect
            CameraEffectUtil.MainInstance.stopEffect();
        }
        if (m_pFSM.isHero)
        {
            //ImageEffects.ImageEffectManager.API_DisableImageEffect<ImageEffects.FullScreenGray>();
            LightingEffectFactory.DisableDeadEffect();
            ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.FullScreenSaturation>();
            ImageEffects.ImageEffectManager.API_EnableImageEffect <ImageEffects.DepthOfFieldScatter>();
        }


        //恢复死亡不碰撞
        if (m_pFSM.controller)
        {
            m_pFSM.pickableCount++;
            //if (true==m_pFSM.GetVisible())
            //{
            //    m_pFSM.gameObject.layer = m_pFSM.baseLayer;
            //}
        }

        ////实体复活不是重新发下来的,在这里改回原来的层
        //if (!m_pFSM.isHero)
        //{
        //    GameUtil.SetLayer(nOldLayer, m_pFSM.gameObject, true);
        //    //m_pFSM.gameObject.layer = nOldLayer;
        //    //if (m_pFSM.SkinConfig.ScreenCastObject != null)
        //    //{
        //    //    m_pFSM.SkinConfig.ScreenCastObject.layer = nOldLayer;
        //    //}
        //}

        if (m_pFSM.animator)
        {
            Trace.Log("SetTrigger(Reborn)");
            m_pFSM.animator.SetTrigger("Reborn");
            m_pFSM.animator.ResetTrigger("Dead");
            m_pFSM.animator.speed = 1;
        }

        //GfxBloodManager.OnEntityRelive(m_pFSM.entityID, ENTITY_TYPE.TYPE_PLAYER_ROLE);
        USpeedUI.Blood.UBloodManager.Instance.OnEntityRelive(m_pFSM.entityID, ENTITY_TYPE.TYPE_PLAYER_ROLE);
        //TopNameManager.OnEntityRelive(m_pFSM.entityID, ENTITY_TYPE.TYPE_PLAYER_ROLE);

        //某些特效,在模型死亡时,会将模型隐藏起来,复活的时候设置为可见
        m_pFSM.SetVisible(m_pFSM.m_OnViewVisible);

        //         // 小地图显示
        //         U3D_Render.EntityView objev = EntityFactory.getEntityViewByID(m_pFSM.entityID);
        //         if (objev != null)
        //         {
        //             GFxMinimapManager.Instance.SetObjectVisible(m_pFSM.entityID, objev.createinfo.nMinimapIcon, 1);
        //         }
        U3D_Render.EntityView objev = EntityFactory.getPlayerViewByID(m_pFSM.entityID);
        if (objev != null && objev.gameObject != null && objev.Property != null)
        {
            int nHeroID = objev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_VOCATION);
            SoundPlayHandler.PlayHeroRandomSound(nHeroID, m_pFSM.entityID, objev.gameObject, ASpeedGame.Data.Scheme.EMHeroSoundType.EHeroSound_Relive);
        }
    }