Beispiel #1
0
    /// <summary>
    /// 检查单个角色条件
    /// </summary>
    public virtual bool checkOneRoleCondition(int[] args, bool needNotice)
    {
        switch (args[0])
        {
        case RoleConditionType.Level:
        {
            if (me.role.getLevel() < args[1])
            {
                if (needNotice)
                {
                    me.showInfoCode(InfoCodeType.Condition_needLevel);
                }

                return(false);
            }
        }
        break;

        case RoleConditionType.FunctionOpen:
        {
            if (!me.func.isFunctionOpen(args[1]))
            {
                if (needNotice)
                {
                    me.showInfoCode(InfoCodeType.Condition_functionNotOpen, FunctionConfig.get(args[1]).showName);
                }

                return(false);
            }
        }
        break;

        case RoleConditionType.NeedUnion:
        {
            if (!me.union.hasUnion())
            {
                if (needNotice)
                {
                    me.showInfoCode(InfoCodeType.Condition_needUnion);
                }

                return(false);
            }
        }
        break;

        case RoleConditionType.QuestComplete:
        {
            if (!me.quest.isQuestComplete(args[1]))
            {
                if (needNotice)
                {
                    me.showInfoCode(InfoCodeType.Condition_needCompleteQuest, QuestConfig.get(args[1]).name);
                }

                return(false);
            }
        }
        break;

        case RoleConditionType.OnStatus:
        {
            if (!me.character.getCurrentCharacterUseLogic().getFightLogic().status.getStatus(args[1]))
            {
                if (needNotice)
                {
                    me.showInfoCode(InfoCodeType.Condition_needOnStatus, StatusConfig.getShowName(args[1]));
                }

                return(false);
            }
        }
        break;

        case RoleConditionType.OffStatus:
        {
            if (me.character.getCurrentCharacterUseLogic().getFightLogic().status.getStatus(args[1]))
            {
                if (needNotice)
                {
                    me.showInfoCode(InfoCodeType.Condition_needOffStatus, StatusConfig.getShowName(args[1]));
                }

                return(false);
            }
        }
        break;
        }

        return(true);
    }