public static GameObject CreatePuftAlpha(string id, string name, string desc, string anim_file, bool is_baby)
    {
        string     symbol_override_prefix = "alp_";
        GameObject prefab = BasePuftConfig.BasePuft(id, name, desc, "PuftAlphaBaseTrait", anim_file, is_baby, symbol_override_prefix, 258.15f, 338.15f);

        EntityTemplates.ExtendEntityToWildCreature(prefab, PuftTuning.PEN_SIZE_PER_CREATURE, 75f);
        Trait trait = Db.Get().CreateTrait("PuftAlphaBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, PuftTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - PuftTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 75f, name, false, false, true));
        List <Diet.Info> list = new List <Diet.Info>();

        list.Add(new Diet.Info(new HashSet <Tag>(new Tag[1]
        {
            SimHashes.ContaminatedOxygen.CreateTag()
        }), SimHashes.SlimeMold.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.BAD_2, "SlimeLung", 1000f, false, false));
        list.Add(new Diet.Info(new HashSet <Tag>(new Tag[1]
        {
            SimHashes.ChlorineGas.CreateTag()
        }), SimHashes.BleachStone.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.BAD_2, "SlimeLung", 1000f, false, false));
        list.Add(new Diet.Info(new HashSet <Tag>(new Tag[1]
        {
            SimHashes.Oxygen.CreateTag()
        }), SimHashes.OxyRock.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.BAD_2, "SlimeLung", 1000f, false, false));
        prefab = BasePuftConfig.SetupDiet(prefab, list.ToArray(), CALORIES_PER_KG_OF_ORE, MIN_POOP_SIZE_IN_KG);
        DiseaseSourceVisualizer diseaseSourceVisualizer = prefab.AddOrGet <DiseaseSourceVisualizer>();

        diseaseSourceVisualizer.alwaysShowDisease = "SlimeLung";
        return(prefab);
    }
Beispiel #2
0
    public GameObject CreatePrefab()
    {
        string         text        = STRINGS.CREATURES.SPECIES.GLOM.NAME;
        string         id          = "Glom";
        string         name        = text;
        string         desc        = STRINGS.CREATURES.SPECIES.GLOM.DESC;
        float          mass        = 25f;
        KAnimFile      anim        = Assets.GetAnim("glom_kanim");
        string         initialAnim = "idle_loop";
        EffectorValues tIER        = DECOR.BONUS.TIER0;
        GameObject     gameObject  = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.Creatures, 1, 1, tIER, default(EffectorValues), SimHashes.Creature, null, 293f);
        Trait          trait       = Db.Get().CreateTrait("GlomBaseTrait", text, text, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, text, false, false, true));
        KPrefabID component = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.Creatures.Walker, false);
        component.prefabInitFn += delegate(GameObject inst)
        {
            inst.GetAttributes().Add(Db.Get().Attributes.MaxUnderwaterTravelCost);
        };
        EntityTemplates.ExtendEntityToBasicCreature(gameObject, FactionManager.FactionID.Pest, "GlomBaseTrait", "WalkerNavGrid1x1", NavType.Floor, 32, 2f, string.Empty, 0, true, true, 293.15f, 393.15f, 273.15f, 423.15f);
        gameObject.AddWeapon(1f, 1f, AttackProperties.DamageType.Standard, AttackProperties.TargetType.Single, 1, 0f);
        gameObject.AddOrGet <Trappable>();
        gameObject.AddOrGetDef <ThreatMonitor.Def>();
        gameObject.AddOrGetDef <CreatureFallMonitor.Def>();
        ElementDropperMonitor.Def def = gameObject.AddOrGetDef <ElementDropperMonitor.Def>();
        def.dirtyEmitElement        = SimHashes.ContaminatedOxygen;
        def.dirtyProbabilityPercent = 25f;
        def.dirtyCellToTargetMass   = 1f;
        def.dirtyMassPerDirty       = 0.2f;
        def.dirtyMassReleaseOnDeath = 3f;
        def.emitDiseaseIdx          = Db.Get().Diseases.GetIndex("SlimeLung");
        def.emitDiseasePerKg        = 1000f;
        OvercrowdingMonitor.Def def2 = gameObject.AddOrGetDef <OvercrowdingMonitor.Def>();
        def2.spaceRequiredPerCreature = 0;
        gameObject.AddOrGet <LoopingSounds>();
        LoopingSounds component2 = gameObject.GetComponent <LoopingSounds>();

        component2.updatePosition = true;
        DiseaseSourceVisualizer diseaseSourceVisualizer = gameObject.AddOrGet <DiseaseSourceVisualizer>();

        diseaseSourceVisualizer.alwaysShowDisease = "SlimeLung";
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_movement_short", NOISE_POLLUTION.CREATURES.TIER2);
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_jump", NOISE_POLLUTION.CREATURES.TIER3);
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_land", NOISE_POLLUTION.CREATURES.TIER3);
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_expel", NOISE_POLLUTION.CREATURES.TIER4);
        EntityTemplates.CreateAndRegisterBaggedCreature(gameObject, true, false, false);
        ChoreTable.Builder chore_table = new ChoreTable.Builder().Add(new DeathStates.Def(), true).Add(new TrappedStates.Def(), true).Add(new BaggedStates.Def(), true)
                                         .Add(new FallStates.Def(), true)
                                         .Add(new StunnedStates.Def(), true)
                                         .Add(new DrowningStates.Def(), true)
                                         .Add(new DebugGoToStates.Def(), true)
                                         .Add(new FleeStates.Def(), true)
                                         .Add(new DropElementStates.Def(), true)
                                         .Add(new IdleStates.Def(), true);
        EntityTemplates.AddCreatureBrain(gameObject, chore_table, GameTags.Creatures.Species.GlomSpecies, null);
        return(gameObject);
    }
Beispiel #3
0
            // обновить визуализатор микробов
            public void UpdateDiseaseSourceVisualizer(string disease)
            {
                DiseaseSourceVisualizer diseaseSourceVisualizer = smi.GetComponent <DiseaseSourceVisualizer>();

                if (diseaseSourceVisualizer != null)
                {
                    diseaseSourceVisualizer.alwaysShowDisease = disease;
                    diseaseSourceVisualizer.UpdateVisibility();
                }
            }
    public static GameObject CreatePuft(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject prefab = BasePuftConfig.BasePuft(id, name, STRINGS.CREATURES.SPECIES.PUFT.DESC, "PuftBaseTrait", anim_file, is_baby, null, 288.15f, 328.15f);

        EntityTemplates.ExtendEntityToWildCreature(prefab, PuftTuning.PEN_SIZE_PER_CREATURE, 75f);
        Trait trait = Db.Get().CreateTrait("PuftBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, PuftTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - PuftTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 75f, name, false, false, true));
        prefab = BasePuftConfig.SetupDiet(prefab, SimHashes.ContaminatedOxygen.CreateTag(), SimHashes.SlimeMold.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.GOOD_2, "SlimeLung", 1000f, MIN_POOP_SIZE_IN_KG);
        DiseaseSourceVisualizer diseaseSourceVisualizer = prefab.AddOrGet <DiseaseSourceVisualizer>();

        diseaseSourceVisualizer.alwaysShowDisease = "SlimeLung";
        return(prefab);
    }