Ejemplo n.º 1
0
 protected override void InternalEnd()
 {
     if (emote != null && (Object)emote.driver != (Object)null)
     {
         emote.PairReactable(null);
         emote.Cancel("Reactable ended");
         emote = null;
     }
     base.InternalEnd();
 }
Ejemplo n.º 2
0
        protected override void OnCompleteWork(Worker worker)
        {
            Status       scientist_skill = Status.Ugly;
            MinionResume component       = worker.GetComponent <MinionResume>();

            if (component != null)
            {
                if (component.HasPerk(Db.Get().SkillPerks.AllowInterstellarResearch.Id))
                {
                    scientist_skill = Status.Great;
                }
                else if (component.HasPerk(Db.Get().SkillPerks.CanStudyWorldObjects.Id))
                {
                    scientist_skill = Status.Okay;
                }
            }

            List <Stage> potential_stages = new List <Stage>();

            potential_stages = stages.FindAll(s => s.statusItem.Equals(scientist_skill));
            potential_stages.Shuffle();
            SetStage(potential_stages[0].id, false);

            if (potential_stages[0].cheerOnComplete)
            {
                EmoteChore emoteChore1 = new EmoteChore(worker.GetComponent <ChoreProvider>(), Db.Get().ChoreTypes.EmoteHighPriority, "anim_cheer_kanim", new HashedString[3]
                {
                    "cheer_pre",
                    "cheer_loop",
                    "cheer_pst"
                }, null);
            }
            else
            {
                EmoteChore emoteChore2 = new EmoteChore(worker.GetComponent <ChoreProvider>(), Db.Get().ChoreTypes.EmoteHighPriority, "anim_disappointed_kanim", new HashedString[3]
                {
                    "disappointed_pre",
                    "disappointed_loop",
                    "disappointed_pst"
                }, null);
            }

            shouldShowSkillPerkStatusItem = false;
            UpdateStatusItem(null);
            Prioritizable.RemoveRef(gameObject);
        }
 private void RegisterReactEmotePair(string reactable_id, string kanim_file_name, float max_trigger_time)
 {
     if (!((Object)base.gameObject == (Object)null))
     {
         ReactionMonitor.Instance sMI = base.gameObject.GetSMI <ReactionMonitor.Instance>();
         if (sMI != null)
         {
             EmoteChore emoteChore = new EmoteChore(base.gameObject.GetComponent <ChoreProvider>(), Db.Get().ChoreTypes.EmoteIdle, kanim_file_name, new HashedString[1]
             {
                 "react"
             }, null);
             SelfEmoteReactable selfEmoteReactable = new SelfEmoteReactable(base.gameObject, reactable_id, Db.Get().ChoreTypes.Cough, kanim_file_name, max_trigger_time, 20f, float.PositiveInfinity);
             emoteChore.PairReactable(selfEmoteReactable);
             selfEmoteReactable.AddStep(new EmoteReactable.EmoteStep
             {
                 anim = (HashedString)"react"
             });
             selfEmoteReactable.PairEmote(emoteChore);
             sMI.AddOneshotReactable(selfEmoteReactable);
         }
     }
 }
Ejemplo n.º 4
0
 public void RegisterHitReaction()
 {
     ReactionMonitor.Instance sMI = base.gameObject.GetSMI <ReactionMonitor.Instance>();
     if (sMI != null)
     {
         SelfEmoteReactable selfEmoteReactable = new SelfEmoteReactable(base.gameObject, "Hit", Db.Get().ChoreTypes.Cough, "anim_hits_kanim", 0f, 1f, 1f);
         selfEmoteReactable.AddStep(new EmoteReactable.EmoteStep
         {
             anim = (HashedString)"hit"
         });
         if (!base.gameObject.GetComponent <Navigator>().IsMoving())
         {
             EmoteChore emoteChore = new EmoteChore(base.gameObject.GetComponent <ChoreProvider>(), Db.Get().ChoreTypes.EmoteIdle, "anim_hits_kanim", new HashedString[1]
             {
                 "hit"
             }, null);
             emoteChore.PairReactable(selfEmoteReactable);
             selfEmoteReactable.PairEmote(emoteChore);
         }
         sMI.AddOneshotReactable(selfEmoteReactable);
     }
 }
Ejemplo n.º 5
0
 public void PairEmote(EmoteChore emote)
 {
     this.emote = emote;
 }