Beispiel #1
0
            public Reactable GetReactable()
            {
                GameObject         gameObject         = base.master.gameObject;
                HashedString       id                 = "PeriodicEmoteSickness";
                ChoreType          emote              = Db.Get().ChoreTypes.Emote;
                HashedString       animset            = "anim_sneeze_kanim";
                float              cooldown           = periodicEmoteSickness.cooldown;
                SelfEmoteReactable selfEmoteReactable = new SelfEmoteReactable(gameObject, id, emote, animset, 0f, cooldown, float.PositiveInfinity);

                HashedString[] anims = periodicEmoteSickness.anims;
                foreach (HashedString anim in anims)
                {
                    selfEmoteReactable.AddStep(new EmoteReactable.EmoteStep
                    {
                        anim = anim
                    });
                }
                return(selfEmoteReactable);
            }
 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);
         }
     }
 }
Beispiel #3
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);
     }
 }