示例#1
0
        internal void ChangeStatus(StatusType statusType)
        {
            Logger.Debug(String.Format("Server attempting to transition from initial state: {0} to {1}", _currentStatus.StatusType, statusType));

            _currentStatus.Dispose();
            _currentStatus = _statusFactory.Create(statusType, this);
            _currentStatus.EnterState();

            Logger.Debug(String.Format("Server transitioned to state {0}", statusType));
        }
        public void UpdateStatus_NewClaimIdAndStatusId_UpdatedClaimHasNewStatusId()
        {
            // Arrange
            var          interactor    = UpdateClaimInteractorFactory.Create();
            ClaimEntity  claimToUpdate = ClaimFactory.Create();
            StatusEntity newStatus     = StatusFactory.Create("Closed");

            // Run
            var result = interactor.UpdateStatus(claimToUpdate, newStatus);

            // Assert
            result.StatusId.ShouldBe(newStatus.Id);
        }
示例#3
0
    /// <summary>
    /// 确认能否添加状态。(状态放打断机制)
    /// </summary>
    /// <returns>true :该状态会打断技能 false : 该状态不打断技能</returns>
    public bool CheckCanAddStatus(int ResalseSceneID, int SkillID, AttackType SkillType, SkillStatusInfo Info)
    {
        StatusInterrupt interrputtype = StatusInterrupt.Phy;

        if (SkillType == AttackType.Physical)
        {
            interrputtype = StatusInterrupt.Phy;
        }
        else if (SkillType == AttackType.Magic)
        {
            interrputtype = StatusInterrupt.Magic;
        }
        else
        {
            return(true);
        }

        StatusM Data = StatusFactory.Create(m_SceneID, ResalseSceneID, SkillID, Info);

        //打断的技能
        if (Data != null /*&& Data.InterruptSkill() == true*/)
        {
            for (int i = 0; i < m_RoleStatus.Count; i++)
            {
                StatusM status = m_RoleStatus[i];
                if (status == null)
                {
                    continue;
                }
                if (status.CheckInterruptStatus(interrputtype) == true)
                {
                    return(false);
                }
            }
        }
        return(true);
    }
示例#4
0
    /// <summary>
    /// 添加状态,SceneID 释放技能对象的SceneID
    /// </summary>
    /// <returns>true :该状态会打断技能 false : 该状态不打断技能</returns>
    public bool AddStatus(int ResalseSceneID, int SkillID, SkillStatusInfo Info)
    {
        StatusType s = (StatusType)Info.m_type;

        SetAttrChange();

        //状态叠加规则
        if (Info.m_RelpaceInfo.m_type == 1)
        {
        }
        else if (Info.m_RelpaceInfo.m_type == 2)         //控制类状态
        {
            if (Info.m_RelpaceInfo.m_compatible == 0)
            {
                foreach (StatusM status  in m_RoleStatus)
                {
                    if (status.CheckHaveStatus() && status.ReplaceInfo.m_type == 2)
                    {
                        if (status.ReplaceInfo.m_compatible == 0)
                        {
                            if (status.ReplaceInfo.m_reppriority > Info.m_RelpaceInfo.m_reppriority)
                            {
                                return(false);
                            }
                        }
                    }
                }
                foreach (StatusM status  in m_RoleStatus)
                {
                    if (status.CheckHaveStatus() && status.ReplaceInfo.m_type == 2)
                    {
                        status.ClearStatus();
                    }
                }
            }
            else
            {
                foreach (StatusM status  in m_RoleStatus)
                {
                    if (status.ReplaceInfo.m_type == 2)
                    {
                        if (status.CheckHaveStatus() && status.ReplaceInfo.m_compatible == 0)
                        {
                            return(false);
                        }
                    }
                }
            }
        }
        else
        {
        }
        //
        StatusM Data = FindStatusM(s);

        if (Data != null)
        {
            if (Data.AddStatus(ResalseSceneID, SkillID, Info))
            {
                Data.AddStatusEffect(Info, SkillID, CheckCreateAction(Info));
                return(Data.InterruptSkill());
            }
        }
        else
        {
            Data = StatusFactory.Create(m_SceneID, ResalseSceneID, SkillID, Info);
            if (Data != null)
            {
                Data.Init(m_SceneID, ResalseSceneID, SkillID, Info);
                m_RoleStatus.Add(Data);
                Info.m_releasesceneid = ResalseSceneID;
                Data.AddStatusEffect(Info, SkillID, CheckCreateAction(Info));

                Life life = CM.GetAllLifeM(m_SceneID, LifeMType.ALL);
                if (life != null)
                {
                    if (Info.m_bufftype == 1)
                    {
                        life.ShowBuff(Info.m_name);
                    }
                    else
                    {
                        life.ShowDebuff(Info.m_name);
                    }
                }

                return(Data.InterruptSkill());
            }
        }
        return(false);
    }