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); } }
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)); } } }