Example #1
0
 /// <summary>
 /// Clear
 /// </summary>
 void Clear()
 {
     mapId = 0;
     eventId = 0;
     isWaitingMessage = false;
     isWaitingMoveRoute = false;
     buttonInputVariableId = 0;
     waitCount = 0;
     childInterpreter = null;
     branch = new Branch[GeexEdit.MaxNumberfOfBranch];
 }
Example #2
0
 /// <summary>
 /// Frame Update
 /// </summary>
 public void Update()
 {
     // Initialize loop count
     loopCount = 0;
     // Loop
     do
     {
         // Add 1 to loop count
         loopCount += 1;
         // If 100 event commands ran
         if (loopCount > 100)
         {
             loopCount = 0;
             break;
         }
         // If map is different than event startup time
         if (InGame.Map.MapId != mapId)
         {
             // Change event ID to 0
             eventId = 0;
         }
         // If a child interpreter exists
         if (childInterpreter != null)
         {
             // Update child interpreter
             childInterpreter.Update();
             // If child interpreter is finished running
             if (!childInterpreter.IsRunning)
             {
                 // Delete child interpreter
                 childInterpreter = null;
             }
             // If child interpreter still exists
             if (childInterpreter != null) return;
         }
         // If waiting for message to end
         if (isWaitingMessage) return;
         // If waiting for move to end
         if (isWaitingMoveRoute)
         {
             // If player is forcing move route
             if (InGame.Player.MoveRouteForcing) return;
             // Loop (map events)
             foreach (GameEvent ev in InGame.Map.Events)
             {
                 // If this event is forcing move route
                 if (ev!=null && ev.MoveRouteForcing) 
                     return;
             }
             // Clear move end waiting flag
             isWaitingMoveRoute = false;
         }
         // If waiting for button input
         if (buttonInputVariableId > 0)
         {
             // Run button input processing
             InputButton();
             return;
         }
         // If waiting
         if (waitCount > 0)
         {
             waitCount -= 1;
             return;
         }
         // If an action forcing Battler exists
         if (InGame.Temp.ForcingBattler != null) return;
         // If a call flag is set for each type of screen
         if (InGame.Temp.IsCallingBattle ||
             InGame.Temp.IsCallingShop ||
             InGame.Temp.IsCallingName ||
             InGame.Temp.IsCallingSave ||
             InGame.Temp.IsCallingName ||
             InGame.Temp.IsGameover) return;
         // If list of event commands is empty
         if (list == null)
         {
             // If main map event
             if (main)
             {
                 SetupStartingEvent();
             }
             // If nothing was set up
             if (list==null) return;
         }
         // If return value is false when trying to execute event command
         if (!ExecuteCommand()) return;
         // Advance index
         index += 1;
     } while (true);
 }