/// <summary>
 /// Проверить учёт выбранной статистики
 /// </summary>
 static bool CompareStatistics(StoryCondition _condition, StoryEventArgs e)
 {
     if ((e.ID == _condition.id1))
     {
         return(SpecialFunctions.ComprFunctionality(e.Argument, _condition.id2, _condition.argument));
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
    protected void HandleStatisticCountEvent(object other, StoryEventArgs e)
    {
        List <string> questLines = new List <string>();

        foreach (Quest _quest in activeQuests)
        {
            string s = _quest.questLine[_quest.stage];
            if (_quest.hasStatistic && s.Contains("/"))
            {
                string s1 = s.Substring(0, s.LastIndexOf("/"));
                string s2 = s.Substring(s.LastIndexOf("/") + 1);
                if (_quest.statisticName == e.ID && _quest.questLine[_quest.stage].Contains("/"))
                {
                    _quest.statisticCount = e.Argument;
                }
                questLines.Add(s1 + _quest.statisticCount.ToString() + "/" + s2);
            }
            else
            {
                questLines.Add(s);
            }
        }
        SpecialFunctions.gameUI.ConsiderQuests(questLines);
    }
예제 #3
0
    public List <Story> nonConsequences = new List <Story>(); //Какие события становятся невозможными, если приведётся в исполнение данный журнальный скрипт?

    #endregion                                                //fields

    /// <summary>
    /// Обработать событие "Причинно-следственная связь"
    /// </summary>
    public void HandleStoryEvent(object sender, StoryEventArgs e)
    {
        History history = SpecialFunctions.history;

        if (!storyCondition.storyCondition(storyCondition, e))
        {
            return;
        }

        foreach (StoryAction _action in storyActions)
        {
            _action.storyAction.Invoke(_action);
        }

        history.RemoveCompletedStory(this);
        foreach (Story _script in consequences)
        {
            history.AddStory(_script);
        }
        foreach (Story _script in nonConsequences)
        {
            history.RemoveStory(_script);
        }
    }
예제 #4
0
 /// <summary>
 /// Проверить учёт выбранной статистики
 /// </summary>
 static bool CompareStatistics(StoryCondition _condition, StoryEventArgs e)
 {
     return(e.ID == _condition.id && e.Argument == _condition.argument);
 }
예제 #5
0
 /// <summary>
 /// Проверить, была ли сказана персонажем нужна нам реплика
 /// </summary>
 static bool CompareSpeech(StoryCondition _condition, StoryEventArgs e)
 {
     return(e.ID == _condition.id);
 }
예제 #6
0
 /// <summary>
 /// Сравнить 2 числа
 /// </summary>
 static bool Compare(StoryCondition _condition, StoryEventArgs e)
 {
     return(SpecialFunctions.ComprFunctionality(e.Argument, _condition.id, _condition.argument));
 }
예제 #7
0
 /// <summary>
 /// Пустая функция на тот случай, если не окажется подходящих функций проверки условия
 /// </summary>
 static bool Empty(StoryCondition _condition, StoryEventArgs e)
 {
     return(true);
 }
예제 #8
0
 /// <summary>
 /// Запустить событие, связанное с сюжетом игры
 /// </summary>
 public static void StartStoryEvent(object sender, EventHandler <StoryEventArgs> handler, StoryEventArgs e)
 {
     if (handler != null)
     {
         handler(sender, e);
     }
 }