コード例 #1
0
ファイル: Quest.cs プロジェクト: StephenGault/SeriousGames
        public void DoAction(QuestStatusAction action, bool forceActions = false)
        {
            switch (action)
            {
            case QuestStatusAction.Activate:
                Activate(forceActions);
                break;

            case QuestStatusAction.Complete:
                CompleteAndGiveRewards(forceActions);
                break;

            case QuestStatusAction.Cancel:
                Cancel();
                break;

            default:
                throw new ArgumentOutOfRangeException("action", action, null);
            }
        }
コード例 #2
0
        private ConditionInfo HasAffinity(QuestStatusAction currentAction)
        {
            if (currentAction != status)
            {
                // Not the status we're testing, this condition doesn't apply, always accept.
                return(ConditionInfo.success);
            }

            var currentAffinity = QuestSystemLoveHateBridgeManager.factionManager.GetAffinity(judgeFactionName, subjectFactionName);

            switch (filterType)
            {
            case FilterType.HigherThanOrEqual:
            {
                if (currentAffinity >= affinity)
                {
                    return(ConditionInfo.success);
                }

                return(new ConditionInfo(false, new MultiLangString("", string.Format(affinityToLowString.message, currentAffinity, affinity))));
            }

            case FilterType.LowerThanOrEqual:
            {
                if (currentAffinity <= affinity)
                {
                    return(ConditionInfo.success);
                }

                return(new ConditionInfo(false, new MultiLangString("", string.Format(affinityToHighString.message, currentAffinity, affinity))));
            }

            default:
            {
                DevdogLogger.LogWarning("Filter type of " + filterType + " not found, please report this error + Stack trace.");
                return(new ConditionInfo(false));
            }
            }
        }