Exemple #1
0
 static void Postfix(CreatureEgg __instance)
 {
     if (Main.config.dbgCfg.showWaterParkCreatures)
     {
         $"progress: {__instance.progress}".onScreen("waterpark " + __instance.name + " " + __instance.GetHashCode());
     }
 }
Exemple #2
0
 static void CreatureEgg_UpdateProgress_Postfix(CreatureEgg __instance)
 {
     if (Main.config.dbgCfg.showWaterParkCreatures)
     {
         $"progress: {__instance.progress}".onScreen($"waterpark {__instance.name} {__instance.GetHashCode()}");
     }
 }
 public static void Postfix(CreatureEgg __instance)
 {
     UnityEngine.Object.Destroy(__instance.gameObject);
 }
Exemple #4
0
    // Token: 0x0600000B RID: 11 RVA: 0x000029E8 File Offset: 0x00000BE8
    public override Object LoadResource()
    {
        bool flag = this.Resource == null;

        if (flag)
        {
            GameObject          gameObject          = Resources.Load <GameObject>("WorldEntities/Eggs/BonesharkEgg");
            GameObject          gameObject2         = AssetBundleLoader.LoadedBundle.LoadAsset("Capsule 1") as GameObject;
            SkinnedMeshRenderer componentInChildren = gameObject.GetComponentInChildren <SkinnedMeshRenderer>();
            gameObject2.name = "GhostRayRedEgg";
            PrefabIdentifier prefabIdentifier = gameObject2.AddComponent <PrefabIdentifier>();
            gameObject2.AddComponent <LargeWorldEntity>().cellLevel = LargeWorldEntity.CellLevel.Near;
            prefabIdentifier.ClassId = this.Key;
            Rigidbody component = gameObject2.GetComponent <Rigidbody>();
            component.isKinematic = true;
            Pickupable  pickupable  = gameObject2.AddComponent <Pickupable>();
            CreatureEgg creatureEgg = gameObject2.AddComponent <CreatureEgg>();
            creatureEgg.daysBeforeHatching = 1.5f;
            gameObject2.AddComponent <EntityTag>().slotType = EntitySlot.Type.Small;
            WorldForces worldForces = gameObject2.AddComponent <WorldForces>();
            worldForces.handleGravity     = true;
            worldForces.underwaterGravity = 2f;
            worldForces.useRigidbody      = component;
            worldForces.aboveWaterGravity = 9.81f;
            worldForces.underwaterDrag    = 1f;
            worldForces.aboveWaterDrag    = 0.1f;
            worldForces.handleDrag        = true;
            SkyApplier   skyApplier = gameObject2.AddComponent <SkyApplier>();
            MeshRenderer component2 = gameObject2.GetComponent <MeshRenderer>();
            skyApplier.renderers = new Renderer[]
            {
                component2
            };
            skyApplier.anchorSky = Skies.Auto;
            Texture mainTexture  = component2.sharedMaterial.mainTexture;
            Texture mainTexture2 = component2.material.mainTexture;
            component2.material.shader       = componentInChildren.material.shader;
            component2.material.color        = new Color(0.75f, 0f, 0f);
            component2.sharedMaterial.shader = componentInChildren.sharedMaterial.shader;
            component2.material.SetFloat("_SpecInt", 16f);
            component2.material.SetFloat("_Shininess", 7.5f);
            component2.material.SetTexture("_SpecText", mainTexture2);
            LiveMixin liveMixin = gameObject2.AddComponent <LiveMixin>();
            liveMixin.data = ScriptableObject.CreateInstance <LiveMixinData>();
            LiveMixinData data = liveMixin.data;
            liveMixin.health      = 25f;
            data.maxHealth        = 25f;
            data.knifeable        = true;
            data.destroyOnDeath   = true;
            data.explodeOnDestroy = true;
            ResourceTracker resourceTracker = gameObject2.AddComponent <ResourceTracker>();
            resourceTracker.overrideTechType = TechType.GenericEgg;
            resourceTracker.prefabIdentifier = prefabIdentifier;
            resourceTracker.rb          = component;
            resourceTracker.pickupable  = pickupable;
            creatureEgg.overrideEggType = (TechType)6968;
            Animator animator = gameObject2.AddComponent <Animator>();
            creatureEgg.animator         = animator;
            creatureEgg.hatchingCreature = TechType.GhostRayRed;
            gameObject2.AddComponent <ScaleFixer>().scale = new Vector3(0.5f, 0.5f, 0.5f);
            this.Resource = gameObject2;
        }
        return(this.Resource);
    }