예제 #1
0
    private void CreateRuntimeParam()
    {
        m_RuntimeParam = new ActionParam();
        FuncContext context = FuncContext.Create();

        m_RuntimeParam.Object = context;
        Npc target = null;

        if (m_CreatedNpcList != null && m_CreatedNpcList.Count > 0)
        {
            target = m_CreatedNpcList.ToArray()[0];
        }

        context.Put(FuncContext.ContextKey.User, m_PlayerChar);
        context.Put(FuncContext.ContextKey.Target, target);

        PlayerManager.Instance.SetPlayerInstance(m_PlayerChar);
    }
예제 #2
0
    private void TriggerExecSkill(Ilife user, SkillConfig config)
    {
        bool isLockedTarget = m_LockedTargetList.ContainsKey(config.Id) && m_LockedTargetList[config.Id] != null;

        //add to playing list
        m_PlayingSkill.Add(config.Id, config);

        // play animation
        FuncContext context = FuncContext.Create();

        if (!isLockedTarget)
        {
            context.Put(FuncContext.ContextKey.TargetId, config.TargeteId);
        }
        else
        {
            context.Put(FuncContext.ContextKey.Target, m_LockedTargetList[config.Id]);
        }

        context.Put(FuncContext.ContextKey.User, user);
        context.Put(FuncContext.ContextKey.LimitId, config.LimitId);
        context.Put(FuncContext.ContextKey.FunctionId, config.FuncId);

        ActionParam param = new ActionParam();

        param.Id     = config.Id;
        param.Object = context;

        ActionManager.Instance.PlayAction(config.ActionId, param);

        if (m_CdStore.ContainsKey(config.Id))
        {
            m_CdStore.Add(config.Id, new SkillCd(config.InitCd));
        }
        else
        {
            m_CdStore[config.Id] = new SkillCd(config.InitCd);
        }
    }