Пример #1
0
 public override void InitializeStates(out BaseState default_state)
 {
     default_state = root;
     Target(emoter);
     root.ToggleThought((StatesInstance smi) => reactable.Get(smi).thought).ToggleExpression((StatesInstance smi) => reactable.Get(smi).expression).ToggleAnims((StatesInstance smi) => smi.emoteKAnim)
     .ToggleThought(Db.Get().Thoughts.Unhappy, null)
     .PlayAnims((StatesInstance smi) => smi.emoteAnims, (StatesInstance smi) => smi.mode)
     .OnAnimQueueComplete(null)
     .Enter(delegate(StatesInstance smi)
     {
         smi.master.GetComponent <Facing>().Face(Grid.CellToPos(reactable.Get(smi).sourceCell));
     });
 }
Пример #2
0
 public override void InitializeStates(out BaseState default_state)
 {
     default_state     = idle;
     base.serializable = false;
     idle.Enter("ClearReactable", delegate(Instance smi)
     {
         reactable.Set(null, smi);
     }).TagTransition(GameTags.Dead, dead, false);
     reacting.Enter("Reactable.Begin", delegate(Instance smi)
     {
         reactable.Get(smi).Begin(smi.gameObject);
     }).Update("Reactable.Update", delegate(Instance smi, float dt)
     {
         reactable.Get(smi).Update(dt);
     }, UpdateRate.SIM_200ms, false).Exit("Reactable.End", delegate(Instance smi)
     {
         reactable.Get(smi).End();
     })
     .EventTransition(GameHashes.NavigationFailed, idle, null)
     .Enter("Reactable.AddChorePreventionTag", delegate(Instance smi)
     {
         if (reactable.Get(smi).preventChoreInterruption)
         {
             smi.GetComponent <KPrefabID>().AddTag(GameTags.PreventChoreInterruption, false);
         }
     })
     .Exit("Reactable.RemoveChorePreventionTag", delegate(Instance smi)
     {
         if (reactable.Get(smi).preventChoreInterruption)
         {
             smi.GetComponent <KPrefabID>().RemoveTag(GameTags.PreventChoreInterruption);
         }
     })
     .TagTransition(GameTags.Dying, dead, false)
     .TagTransition(GameTags.Dead, dead, false);
     dead.DoNothing();
 }
 public override void InitializeStates(out BaseState default_state)
 {
     default_state = nochore;
     saveHistory   = true;
     nochore.Update(delegate(StatesInstance smi, float dt)
     {
         if (smi.master.HasTag(GameTags.Minion) && !smi.master.HasTag(GameTags.Dead))
         {
             ReportManager.Instance.ReportValue(ReportManager.ReportType.WorkTime, dt, string.Format(UI.ENDOFDAYREPORT.NOTES.TIME_SPENT, DUPLICANTS.CHORES.THINKING.NAME), smi.master.GetProperName());
         }
     }, UpdateRate.SIM_200ms, false).ParamTransition(nextChore, haschore, (StatesInstance smi, Chore next_chore) => next_chore != null);
     haschore.Enter("BeginChore", delegate(StatesInstance smi)
     {
         smi.BeginChore();
     }).Update(delegate(StatesInstance smi, float dt)
     {
         if (smi.master.HasTag(GameTags.Minion) && !smi.master.HasTag(GameTags.Dead))
         {
             Chore chore = currentChore.Get(smi);
             if (chore != null)
             {
                 if (smi.master.GetComponent <Navigator>().IsMoving())
                 {
                     ReportManager.Instance.ReportValue(ReportManager.ReportType.TravelTime, dt, GameUtil.GetChoreName(chore, null), smi.master.GetProperName());
                 }
                 else
                 {
                     ReportManager.ReportType reportType = chore.GetReportType();
                     Workable workable = smi.master.GetComponent <Worker>().workable;
                     if ((UnityEngine.Object)workable != (UnityEngine.Object)null)
                     {
                         ReportManager.ReportType reportType2 = workable.GetReportType();
                         if (reportType != reportType2)
                         {
                             reportType = reportType2;
                         }
                     }
                     ReportManager.Instance.ReportValue(reportType, dt, string.Format(UI.ENDOFDAYREPORT.NOTES.WORK_TIME, GameUtil.GetChoreName(chore, null)), smi.master.GetProperName());
                 }
             }
         }
     }, UpdateRate.SIM_200ms, false).Exit("EndChore", delegate(StatesInstance smi)
     {
         smi.EndChore("ChoreDriver.SignalStop");
     })
     .OnSignal(stop, nochore);
 }