예제 #1
0
    private void StartResumeFuncMethod()
    {
        //WindowManager.Instance.HideAllWindow();
        HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());

        FuncMethods.HandleFuncExec(target, WorldSceneDispatchController.Instance.GetParam().m_iExitSceneStep2FuncId, null);
    }
예제 #2
0
    public void TriggerSceneState(GameLogicSceneType sceneType)
    {
        for (int i = 0; i < m_CurrentMissionStepList.Count; ++i)
        {
            MissionStepConfig elemStep = m_CurrentMissionStepList[i];

            if (elemStep.SceneId == (int)(sceneType))
            {
                HandleTarget target = HandleTarget.GetHandleTarget(null);
                if (LimitMethods.HandleLimitExec(target, elemStep.SceneLimitId, null))
                {
                    FuncMethods.HandleFuncExec(target, elemStep.SceneFuncId, null);
                }
            }
            HandleTarget target1 = HandleTarget.GetHandleTarget(null);
            if (LimitMethods.HandleLimitExec(target1, elemStep.CompleteLimitId, null))
            {
                FuncMethods.HandleFuncExec(target1, elemStep.CompleteFuncId, null);
            }
        }

        bool         isMissionComplete = false;
        HandleTarget target2           = HandleTarget.GetHandleTarget(null);

        if (LimitMethods.HandleLimitExec(target2, m_CurrentMission.CompleteLimitId, null))
        {
            isMissionComplete = true;
            FuncMethods.HandleFuncExec(target2, m_CurrentMission.CompleteFuncId, null);
        }

        if (isMissionComplete)
        {
            m_OnMissioinComplete(this);
        }
    }
예제 #3
0
    private void TriggerSceneState(MessageObject obj)
    {
        if (!(obj.msgValue is GameLogicSceneType))
        {
            return;
        }
        var map = ConfigManager.Instance.GetLimitFuncSceneConfig();

        if (null == map)
        {
            Debuger.Log("can't load limit func scene config ");
            return;
        }

        int sceneid = (int)(((GameLogicSceneType)(obj.msgValue)));

        foreach (var elem in map.LimitFuncSceneConfigMap)
        {
            if (elem.Key == sceneid)
            {
                for (int i = 0; i < elem.Value.Count; ++i)
                {
                    HandleTarget target = HandleTarget.GetHandleTarget(null);
                    if (LimitMethods.HandleLimitExec(target, elem.Value[i].LimitId, null))
                    {
                        FuncMethods.HandleFuncExec(target, elem.Value[i].FuncId, null);
                    }
                }
            }
        }
    }
예제 #4
0
    private void StartFuncMethod()
    {
        //WindowManager.Instance.HideAllWindow();
        HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());

        FuncMethods.HandleFuncExec(target, m_CurrentStage.EnterFuncId, null);
    }
예제 #5
0
    private void OnHitLife(MessageObject msg)
    {
        var transform = ((Transform)(msg.msgValue));

        if (transform == m_CharTransformData.GetGameObject().transform)
        {
            // set high light
            //m_CharTransformData.SetSelectedStatus(true);
            //trigger npc hit function
            FuncMethods.HandleFuncExec(HandleTarget.GetHandleTarget(this), m_NpcBaseInfo.ClickFuncId, null);
        }
        else
        {
            //IsPlayerControlled = false;
            m_CharTransformData.SetSelectedStatus(false);
        }
    }
예제 #6
0
 public void ExecuteExitNodeGame()
 {
     if (UIWindowSelectScene.m_iIndex != -1)
     {
         UIWindowSelectScene.OnExitFlightGame();
         return;
     }
     if (m_ProcessData.m_iExitSceneFuncId != 0)
     {
         HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());
         FuncMethods.HandleFuncExec(target, m_ProcessData.m_iExitSceneFuncId, null);
         //m_ProcessData.m_iExitSceneFuncId = 0;
     }
     else
     {
         StageManager.Instance.ChangeState(GameStateType.SelectSceneState);
     }
 }
    private void OnTrigger()
    {
        //try get target
        var param = m_ActionPlayer.GetActionParam();

        if (null != param && null != param.Object && param.Object is FuncContext)
        {
            FuncContext context = param.Object as FuncContext;
            if (!context.ContainsKey(FuncContext.ContextKey.LimitId) ||
                !context.ContainsKey(FuncContext.ContextKey.FunctionId))
            {
                return;
            }

            int          limitId = (int)(context.Get(FuncContext.ContextKey.LimitId));
            int          funcId  = (int)(context.Get(FuncContext.ContextKey.LimitId));
            HandleTarget target  = null;
            Ilife        user    = context.Get(FuncContext.ContextKey.User) as Ilife;
            if (context.ContainsKey(FuncContext.ContextKey.Target))
            {
                //locked skill
                target = HandleTarget.GetHandleTarget(user, context.Get(FuncContext.ContextKey.Target) as Ilife);
            }
            else
            {
                //target is null,unlocked skill
                int targetId = (int)(context.Get(FuncContext.ContextKey.TargetId));
                target = TargetMethods.GetTargetList(user, targetId, null);
            }

            //exec attack
            if (LimitMethods.HandleLimitExec(target, limitId, null))
            {
                FuncMethods.HandleFuncExec(target, funcId, null);
            }
        }
    }
예제 #8
0
    protected void OnSceneLose()
    {
        HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());

        FuncMethods.HandleFuncExec(target, m_CurrentStage.LoseFuncId, null);
    }
예제 #9
0
    public virtual bool ExecNode()
    {
        HandleTarget target = TargetMethods.GetTargetList(this, m_NodeData.TargetMethodId, null);

        if (target.GetTarget(EFuncTarget.EFT_Target).Count == 0)
        {
            if (m_CurrentTargetList.Count == 0)
            {
                // no target ,not trigger
                return(true);
            }
            else
            {
                foreach (Ilife elem in m_CurrentTargetList)
                {
                    //离开
                    Debuger.Log("trigger exit " + elem.GetInstanceId());
                    HandleTarget tmpTarget = HandleTarget.GetHandleTarget(this, elem);
                    if (LimitMethods.HandleLimitExec(tmpTarget, m_NodeData.ExitLimitMethodId, null))
                    {
                        FuncMethods.HandleFuncExec(tmpTarget, m_NodeData.ExitFuncMethodId, null);
                    }
                }
                m_CurrentTargetList.Clear();
            }
            return(true);
        }

        List <Ilife> targetList = target.GetTarget(EFuncTarget.EFT_Target);

        for (int i = 0; i < targetList.Count; ++i)
        {
            if (m_NodeData.IsTick)
            {
                //进入
                Debuger.Log("trigger enter " + targetList[i].GetInstanceId());
                HandleTarget tmpTarget = HandleTarget.GetHandleTarget(this, targetList[i]);
                if (LimitMethods.HandleLimitExec(tmpTarget, m_NodeData.EnterLimitMethodId, null))
                {
                    FuncMethods.HandleFuncExec(tmpTarget, m_NodeData.EnterFuncMethodId, null);
                }
            }

            if (!m_CurrentTargetList.Contains(targetList[i]))
            {
                if (!m_NodeData.IsTick)
                {
                    //进入
                    Debuger.Log("trigger enter " + targetList[i].GetInstanceId());
                    HandleTarget tmpTarget = HandleTarget.GetHandleTarget(this, targetList[i]);
                    if (LimitMethods.HandleLimitExec(tmpTarget, m_NodeData.EnterLimitMethodId, null))
                    {
                        FuncMethods.HandleFuncExec(tmpTarget, m_NodeData.EnterFuncMethodId, null);
                    }
                }
            }
            else
            {
                m_CurrentTargetList.Remove(targetList[i]);
            }
        }

        foreach (Ilife elem in m_CurrentTargetList)
        {
            HandleTarget tmpTarget = HandleTarget.GetHandleTarget(this, elem);
            if (LimitMethods.HandleLimitExec(tmpTarget, m_NodeData.ExitLimitMethodId, null))
            {
                //离开
                Debuger.Log("trigger exit " + elem.GetInstanceId());
                FuncMethods.HandleFuncExec(tmpTarget, m_NodeData.ExitFuncMethodId, null);
            }
        }
        ResetCurrentTargetList(targetList);

        //collection target instance

        return(true);
    }
예제 #10
0
    protected override void Execute()
    {
        HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());

        FuncMethods.HandleFuncExec(target, m_Config.FuncID, null);
    }
예제 #11
0
    public void TryPlaySkill(int id, Ilife user, Ilife lockedTarget = null)
    {
        SkillConfig config = ConfigManager.Instance.GetSkillConfig(id);

        if (null == config)
        {
            Debuger.Log("can't load skill id: " + id);
            return;
        }

        //check cd
        SkillCd cd = null;

        if (m_CdStore.TryGetValue(id, out cd))
        {
            if (cd.cd > 0)
            {
                // can't play skill
                return;
            }
        }

        if (m_BeginCdStore.TryGetValue(id, out cd))
        {
            if (cd.cd > 0)
            {
                // can't play skill
                return;
            }
        }

        if (m_PlayingSkill.ContainsKey(id))
        {
            //can't play
            return;
        }

        //per handle
        HandleTarget target = HandleTarget.GetHandleTarget(user);

        if (LimitMethods.HandleLimitExec(target, config.PerLimitId, null))
        {
            FuncMethods.HandleFuncExec(target, config.PerFuncId, null);

            m_LockedTargetList.Add(id, lockedTarget);

            if (config.BeginCd <= 0)
            {
                TriggerExecSkill(user, config);
            }
            else
            {
                if (m_BeginCdStore.ContainsKey(config.Id))
                {
                    m_BeginCdStore.Add(config.Id, new SkillCd(config.InitCd, config, user));
                }
                else
                {
                    m_BeginCdStore[config.Id] = new SkillCd(config.InitCd, config, user);
                }
            }
        }
    }
예제 #12
0
    private void OnSceneWin()
    {
        HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());

        FuncMethods.HandleFuncExec(target, m_CurrentStage.WinLimitId, null);
    }
예제 #13
0
    private void DoEnterScene()
    {
        HandleTarget target = HandleTarget.GetHandleTarget(PlayerManager.Instance.GetPlayerInstance());

        FuncMethods.HandleFuncExec(target, m_CurrentStage.EnterFuncId, null);
    }