Пример #1
0
        /// <summary>
        /// Adds the additional Moo chores required for growth. Growing up and giving birth
        /// chores are required.
        /// </summary>
        /// <param name="prefab">The prefab to add chores.</param>
        internal static void UpdateMooChores(GameObject prefab)
        {
            var cc            = prefab.GetComponent <ChoreConsumer>();
            var newChoreTable = new ChoreTable.Builder().
                                Add(new DeathStates.Def()).
                                Add(new AnimInterruptStates.Def()).
                                Add(new BaggedStates.Def()).
                                Add(new StunnedStates.Def()).
                                Add(new DebugGoToStates.Def()).
                                Add(new DrowningStates.Def()).
                                Add(new MooGrowUpStates.Def()).
                                PushInterruptGroup().
                                Add(new CreatureSleepStates.Def()).
                                Add(new FixedCaptureStates.Def()).
                                Add(new RanchedStates.Def()).
                                Add(new GiveBirthStates.Def()).
                                Add(new EatStates.Def()).
                                Add(new PlayAnimsStates.Def(GameTags.Creatures.Poop, false, "poop", STRINGS.CREATURES.STATUSITEMS.EXPELLING_GAS.NAME, STRINGS.CREATURES.STATUSITEMS.EXPELLING_GAS.TOOLTIP)).
                                Add(new MoveToLureStates.Def()).
                                PopInterruptGroup().
                                Add(new IdleStates.Def {
                customIdleAnim = MOO_IDLE_ANIM
            });

            if (cc != null)
            {
                cc.choreTable = newChoreTable.CreateTable();
            }
        }
Пример #2
0
    public static void AddCreatureBrain(GameObject prefab, ChoreTable.Builder chore_table, Tag species, string symbol_prefix)
    {
        CreatureBrain creatureBrain = prefab.AddOrGet <CreatureBrain>();

        creatureBrain.species      = species;
        creatureBrain.symbolPrefix = symbol_prefix;
        ChoreConsumer chore_consumer = prefab.AddOrGet <ChoreConsumer>();

        chore_consumer.choreTable = chore_table.CreateTable();
        KPrefabID kPrefabID = prefab.AddOrGet <KPrefabID>();

        kPrefabID.AddTag(GameTags.CreatureBrain, false);
        kPrefabID.instantiateFn += delegate(GameObject go)
        {
            go.GetComponent <ChoreConsumer>().choreTable = chore_consumer.choreTable;
        };
    }