Exemple #1
0
        private bool JobCalled(TriggerReader reader)
        {
            double jobNumber = 0;

            if (reader.PeekVariable())
            {
                jobNumber = reader.ReadVariable().Value.AsDouble();
            }
            else if (reader.PeekNumber())
            {
                jobNumber = reader.ReadNumber();
            }

            double requiredJobNumber = reader.GetParameter <double>(0);

            if (reader.TryReadVariableTable(out VariableTable table, true))
            {
                object[] args = reader.Parameters.Skip(1).ToArray();
                for (int i = 0; i <= args.Length - 1; i++)
                {
                    table.Add(i.ToString(), args[i]);
                }
            }

            bool result = false;

            if (jobNumber > 0 && jobNumber == requiredJobNumber)
            {
                result = reader.CurrentBlock.IndexOfTrigger(TriggerCategory.Effect, 115, reader.CurrentBlockIndex) == -1;
            }
            return(result);
        }
Exemple #2
0
 private bool WhenTimerGoesOff(TriggerReader reader)
 {
     if (TryGetTimerFrom(reader, out TimerTask timerTask))
     {
         return(timerTask.Id == reader.GetParameter <double>());
     }
     return(false);
 }
Exemple #3
0
 private bool GetCurrentTimerIntoVar(TriggerReader reader)
 {
     if (reader.Parameters.Length > 0)
     {
         var var = reader.ReadVariable(true);
         var.Value = reader.GetParameter <double>(0);
         return(true);
     }
     return(false);
 }