// Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
        public static void Add()
        {
            ShrineFactory ShrineFactory = new ShrineFactory
            {
                name                  = "Shrine Of The Whisper",
                modID                 = "BunnyMod",
                spritePath            = "BunnyMod/Resources/ShrineOfWhisper/ancientwhisper_idle_001.png",
                shadowSpritePath      = "BunnyMod/Resources/ShrineOfWhisper/ancientwhispershadow_001",
                acceptText            = "I challenge the Shrine Of The Whisper. (Lag Warning)",
                declineText           = "I don't challenge the Shrine Of The Whisper.",
                OnAccept              = new Action <PlayerController, GameObject>(WhisperShrine.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(WhisperShrine.CanUse),
                offset                = new Vector3(103.9375f, 15.5f, 16f),
                talkPointOffset       = new Vector3(3f, 3f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(WhisperShrineInteractible)
            };
            GameObject gameObject = ShrineFactory.Build();

            gameObject.AddAnimation("idle", "BunnyMod/Resources/ShrineOfWhisper/", 2, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "BunnyMod/Resources/ShrineOfWhisper/", 6, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "BunnyMod/Resources/ShrineOfWhisper/", 6, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "BunnyMod/Resources/ShrineOfWhisper/", 5, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            WhisperShrineInteractible component = gameObject.GetComponent <WhisperShrineInteractible>();

            component.conversation = new List <string>
            {
                "Challenge the Shrine Of The Whisper?"
            };
            gameObject.SetActive(false);
        }
Example #2
0
        // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
        public static void Add()
        {
            ShrineFactory ShrineFactory = new ShrineFactory
            {
                name                  = "Deicide Shrine",
                modID                 = "BunnyMod",
                spritePath            = "BunnyMod/Resources/DeicideShrine/dcdshrine_idle_001.png",
                shadowSpritePath      = "BunnyMod/Resources/DeicideShrine/dcdshrine_shadow.png",
                acceptText            = "I challenge fate. (Gives all artifacts)",
                declineText           = "I don't challenge fate.",
                OnAccept              = new Action <PlayerController, GameObject>(DeicideShrine.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(DeicideShrine.CanUse),
                offset                = new Vector3(12.6875f, 21.9375f, 22.4375f),
                talkPointOffset       = new Vector3(3f, 3f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(DeicideShrineInteractible)
            };
            GameObject gameObject = ShrineFactory.Build();

            gameObject.AddAnimation("idle", "BunnyMod/Resources/DeicideShrine/", 2, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "BunnyMod/Resources/DeicideShrine/", 3, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "BunnyMod/Resources/DeicideShrine/", 4, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "BunnyMod/Resources/DeicideShrine/", 5, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            DeicideShrineInteractible component = gameObject.GetComponent <DeicideShrineInteractible>();

            component.conversation = new List <string>
            {
                "Put yourself to the ultimate test?"
            };
            gameObject.SetActive(false);
        }
Example #3
0
 // Token: 0x06000089 RID: 137 RVA: 0x000059ED File Offset: 0x00003BED
 public static void Init()
 {
     Tools.Init();
     StaticReferences.Init();
     ShrineFakePrefabHooks.Init();
     ShrineFactory.Init();
 }
Example #4
0
        public static void Init()
        {
            VFXScapegoat = new GameObject("ShrineVFXScapegoat");
            VFXScapegoat.gameObject.SetActive(false);
            UnityEngine.Object.DontDestroyOnLoad(VFXScapegoat);
            ShrineIconCollection = SpriteBuilder.ConstructCollection(VFXScapegoat, "ShrineIcon_Collection");
            UnityEngine.Object.DontDestroyOnLoad(ShrineIconCollection);

            bool initialized = ShrineFactory.m_initialized;
            bool flag        = !initialized;
            bool flag2       = flag;

            if (flag2)
            {
                DungeonHooks.OnFoyerAwake           += ShrineFactory.PlaceBreachShrines;
                DungeonHooks.OnPreDungeonGeneration += delegate(LoopDungeonGenerator generator, Dungeon dungeon, DungeonFlow flow, int dungeonSeed)
                {
                    bool flag3 = flow.name != "Foyer Flow" && !GameManager.IsReturningToFoyerWithPlayer;
                    bool flag4 = flag3;
                    bool flag5 = flag4;
                    if (flag5)
                    {
                        ShrineFactory.CleanupBreachShrines();
                    }
                };
                ShrineFactory.m_initialized = true;
            }
        }
Example #5
0
 public void Copy(CustomShrineController other)
 {
     this.ID             = other.ID;
     this.roomStyles     = other.roomStyles;
     this.isBreachShrine = other.isBreachShrine;
     this.offset         = other.offset;
     this.pixelColliders = other.pixelColliders;
     this.factory        = other.factory;
     this.OnAccept       = other.OnAccept;
     this.OnDecline      = other.OnDecline;
     this.CanUse         = other.CanUse;
 }
        public static void ReloadBreachShrinesHook(Action <Foyer> orig, Foyer self1)
        {
            orig(self1);
            bool flag = ReloadBreachShrineHooks.hasInitialized;

            if (!flag)
            {
                {
                    ShrineFactory.PlaceBreachShrines();
                }
                ReloadBreachShrineHooks.hasInitialized = true;
            }
            ShrineFactory.PlaceBreachShrines();
        }
        // Token: 0x06000058 RID: 88 RVA: 0x00004D94 File Offset: 0x00002F94
        public static void Init()
        {
            bool initialized = ShrineFactory.m_initialized;

            if (!initialized)
            {
                DungeonHooks.OnFoyerAwake           += ShrineFactory.PlaceBreachShrines;
                DungeonHooks.OnPreDungeonGeneration += delegate(LoopDungeonGenerator generator, Dungeon dungeon, DungeonFlow flow, int dungeonSeed)
                {
                    bool flag = flow.name != "Foyer Flow" && !GameManager.IsReturningToFoyerWithPlayer;
                    if (flag)
                    {
                        ShrineFactory.CleanupBreachShrines();
                    }
                };
                ShrineFactory.m_initialized = true;
            }
        }
Example #8
0
 // Token: 0x0600009C RID: 156 RVA: 0x000084D0 File Offset: 0x000066D0
 public static void PlaceBreachShrines()
 {
     ShrineFactory.CleanupBreachShrines();
     foreach (GameObject gameObject in ShrineFactory.registeredShrines.Values)
     {
         try
         {
             ShrineFactory.CustomShrineController component = gameObject.GetComponent <ShrineFactory.CustomShrineController>();
             bool flag  = !component.isBreachShrine;
             bool flag2 = !flag;
             bool flag3 = flag2;
             if (flag3)
             {
                 ShrineFactory.CustomShrineController component2 = UnityEngine.Object.Instantiate <GameObject>(gameObject).GetComponent <ShrineFactory.CustomShrineController>();
                 component2.Copy(component);
                 component2.gameObject.SetActive(true);
                 component2.sprite.PlaceAtPositionByAnchor(component2.offset, tk2dBaseSprite.Anchor.LowerCenter);
                 SpriteOutlineManager.AddOutlineToSprite(component2.sprite, Color.black);
                 IPlayerInteractable component3 = component2.GetComponent <IPlayerInteractable>();
                 bool flag4 = component3 is SimpleInteractable;
                 bool flag5 = flag4;
                 bool flag6 = flag5;
                 if (flag6)
                 {
                     ((SimpleInteractable)component3).OnAccept  = component2.OnAccept;
                     ((SimpleInteractable)component3).OnDecline = component2.OnDecline;
                     ((SimpleInteractable)component3).CanUse    = component2.CanUse;
                 }
                 bool flag7 = !RoomHandler.unassignedInteractableObjects.Contains(component3);
                 bool flag8 = flag7;
                 bool flag9 = flag8;
                 if (flag9)
                 {
                     RoomHandler.unassignedInteractableObjects.Add(component3);
                 }
             }
         }
         catch (Exception e)
         {
             Tools.PrintException(e, "FF0000");
         }
     }
 }
 // Token: 0x060001C2 RID: 450 RVA: 0x000128FC File Offset: 0x00010AFC
 public static void Add()
 {
     ShrineFactory shrineFactory = new ShrineFactory();
     {
         shrineFactory.name            = "MountainBny Shrine";
         shrineFactory.modID           = "bny";
         shrineFactory.text            = "A shrine to the Gungeon Master. Voices of the Jammed whisper promises of power.";
         shrineFactory.spritePath      = "BunnyMod/Resources/shrines/shrineoftheleadlord.png";
         shrineFactory.room            = RoomFactory.BuildFromResource("BunnyMod/Resources/rooms/shrineofleadlordroom.room").room;
         shrineFactory.acceptText      = "Accept their promises.";
         shrineFactory.declineText     = "Leave them be.";
         shrineFactory.OnAccept        = new Action <PlayerController, GameObject>(ShrineOfTheLeadLord.Accept);
         shrineFactory.OnDecline       = null;
         shrineFactory.CanUse          = new Func <PlayerController, GameObject, bool>(ShrineOfTheLeadLord.CanUse);
         shrineFactory.offset          = new Vector3(-1f, -1f, 0f);
         shrineFactory.talkPointOffset = new Vector3(0f, 3f, 0f);
         shrineFactory.isToggle        = false;
         shrineFactory.isBreachShrine  = false;
     }
     GameObject gameObject = shrineFactory.Build();
 }
 // Token: 0x060001C2 RID: 450 RVA: 0x000128FC File Offset: 0x00010AFC
 public static void Add()
 {
     ShrineFactory shrineFactorya = new ShrineFactory();
     {
         shrineFactorya.name            = "ChaosCorruptionShrine";
         shrineFactorya.modID           = "bny";
         shrineFactorya.text            = "Whatever this shrine may have been, it has been eaten away by chaotic corruption.";
         shrineFactorya.spritePath      = "BunnyMod/Resources/shrines/chaoscorruptionshrine.png";
         shrineFactorya.room            = RoomFactory.BuildFromResource("BunnyMod/Resources/rooms/chaosshrine1.room").room;
         shrineFactorya.acceptText      = "Poke at it like the curious idiot that you are.";
         shrineFactorya.declineText     = "Leave it alone.";
         shrineFactorya.OnAccept        = new Action <PlayerController, GameObject>(ChaosCorruptionShrine.Accept);
         shrineFactorya.OnDecline       = null;
         shrineFactorya.CanUse          = new Func <PlayerController, GameObject, bool>(ChaosCorruptionShrine.CanUse);
         shrineFactorya.offset          = new Vector3(-1f, -1f, 0f);
         shrineFactorya.talkPointOffset = new Vector3(0f, 1f, 0f);
         shrineFactorya.isToggle        = false;
         shrineFactorya.isBreachShrine  = false;
     }
     GameObject gameObject = shrineFactorya.Build();
 }
 // Token: 0x060001C2 RID: 450 RVA: 0x000128FC File Offset: 0x00010AFC
 public static void Add()
 {
     ShrineFactory shrineFactory = new ShrineFactory();
     {
         shrineFactory.name            = "why";
         shrineFactory.modID           = "bny";
         shrineFactory.text            = "....";
         shrineFactory.spritePath      = "BunnyMod/Resources/shrines/imsorryneighborino.png";
         shrineFactory.room            = RoomFactory.BuildFromResource("BunnyMod/Resources/rooms/StrangerBossRoom.room").room;
         shrineFactory.acceptText      = "...";
         shrineFactory.declineText     = "Youre a monster Bunny.";
         shrineFactory.OnAccept        = null;
         shrineFactory.OnDecline       = null;
         shrineFactory.CanUse          = new Func <PlayerController, GameObject, bool>(PleaseForgiveMe.CanUse);
         shrineFactory.offset          = new Vector3(-19f, -19f, 0f);
         shrineFactory.talkPointOffset = new Vector3(0f, 3f, 0f);
         shrineFactory.isToggle        = false;
         shrineFactory.isBreachShrine  = false;
     }
     GameObject gameObject = shrineFactory.Build();
 }
Example #12
0
        // Token: 0x06000059 RID: 89 RVA: 0x0000480C File Offset: 0x00002A0C
        public static void Add()
        {
            ShrineFactory ShrineFactory = new ShrineFactory
            {
                name                  = "Artifact Monger",
                modID                 = "BunnyMod",
                spritePath            = "BunnyMod/Resources/Artifacts/ArtifactNPC/Idle/artifactmonger_idle_001.png",
                shadowSpritePath      = "BunnyMod/Resources/Artifacts/ArtifactNPC/artifactmongerplaceshadow_001.png",
                acceptText            = "...Sure?",
                declineText           = "No thanks.",
                OnAccept              = new Action <PlayerController, GameObject>(ArtifactMonger.Accept),
                OnDecline             = null,
                CanUse                = new Func <PlayerController, GameObject, bool>(ArtifactMonger.CanUse),
                offset                = new Vector3(38.125f, 27f, 26.5f),
                talkPointOffset       = new Vector3(3f, 3f, 0f),
                isToggle              = false,
                isBreachShrine        = true,
                interactableComponent = typeof(ArtifactMongerInteractible)
            };
            GameObject gameObject = ShrineFactory.Build();

            gameObject.AddAnimation("idle", "BunnyMod/Resources/Artifacts/ArtifactNPC/Idle/", 2, NPCBuilder.AnimationType.Idle, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk", "BunnyMod/Resources/Artifacts/ArtifactNPC/Talk/", 6, NPCBuilder.AnimationType.Talk, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("talk_start", "BunnyMod/Resources/Artifacts/ArtifactNPC/TalkStart/", 6, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            gameObject.AddAnimation("do_effect", "BunnyMod/Resources/Artifacts/ArtifactNPC/DoEffect/", 5, NPCBuilder.AnimationType.Other, DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType.None);
            ArtifactMongerInteractible component = gameObject.GetComponent <ArtifactMongerInteractible>();

            component.conversation = new List <string>
            {
                "helo!",
                "i com from favaway pwanet!",
                "soooooo fav awayyyyy!!",
                "and breng pwetty wocks!",
                "but te wocks hurt...",
                "...",
                "...do u want one? tu help me?"
            };
            gameObject.SetActive(false);
        }
Example #13
0
        public static void Add()
        {
            ShrineFactory sf = new ShrineFactory()
            {
                name            = "Key Shrine",
                modID           = "kts",
                text            = "A shrine representing the key to happiness.",
                spritePath      = "GungeonAPI/resource/shrine_heart_key.png",
                room            = RoomFactory.BuildFromResource("GungeonAPI/resource/rooms/KeyShrine.room").room,
                acceptText      = "Offer a heart to unlock your potential",
                declineText     = "Walk away",
                OnAccept        = Accept,
                OnDecline       = null,
                CanUse          = CanUse,
                offset          = new Vector3(10, 0, 0),
                talkPointOffset = new Vector3(0, 3, 0),
                isToggle        = false,
                isBreachShrine  = false
            };

            //register shrine
            sf.Build();
        }
Example #14
0
        // Token: 0x0600009A RID: 154 RVA: 0x00008084 File Offset: 0x00006284
        public GameObject Build()
        {
            GameObject result;

            try
            {
                Texture2D  textureFromResource = ResourceExtractor.GetTextureFromResource(this.spritePath);
                GameObject gameObject          = SpriteBuilder.SpriteFromResource(this.spritePath, null);
                string     text = (this.modID + ":" + this.name).ToLower().Replace(" ", "_");
                gameObject.name = text;
                tk2dSprite component = gameObject.GetComponent <tk2dSprite>();
                component.IsPerpendicular = true;
                component.PlaceAtPositionByAnchor(this.offset, tk2dBaseSprite.Anchor.LowerCenter);
                Transform transform = new GameObject("talkpoint").transform;
                transform.position = gameObject.transform.position + this.talkPointOffset;
                transform.SetParent(gameObject.transform);
                bool flag  = !this.usesCustomColliderOffsetAndSize;
                bool flag2 = flag;
                bool flag3 = flag2;
                if (flag3)
                {
                    IntVector2 intVector = new IntVector2(textureFromResource.width, textureFromResource.height);
                    this.colliderOffset = new IntVector2(0, 0);
                    this.colliderSize   = new IntVector2(intVector.x, intVector.y / 2);
                }
                SpeculativeRigidbody speculativeRigidbody = component.SetUpSpeculativeRigidbody(this.colliderOffset, this.colliderSize);
                ShrineFactory.CustomShrineController customShrineController = gameObject.AddComponent <ShrineFactory.CustomShrineController>();
                customShrineController.ID             = text;
                customShrineController.roomStyles     = this.roomStyles;
                customShrineController.isBreachShrine = true;
                customShrineController.offset         = this.offset;
                customShrineController.pixelColliders = speculativeRigidbody.specRigidbody.PixelColliders;
                customShrineController.factory        = this;
                customShrineController.OnAccept       = this.OnAccept;
                customShrineController.OnDecline      = this.OnDecline;
                customShrineController.CanUse         = this.CanUse;
                customShrineController.text           = this.text;
                customShrineController.acceptText     = this.acceptText;
                customShrineController.declineText    = this.declineText;
                bool flag4 = this.interactableComponent == null;
                bool flag5 = flag4;
                bool flag6 = flag5;
                if (flag6)
                {
                    SimpleShrine simpleShrine = gameObject.AddComponent <SimpleShrine>();
                    simpleShrine.isToggle    = this.isToggle;
                    simpleShrine.OnAccept    = this.OnAccept;
                    simpleShrine.OnDecline   = this.OnDecline;
                    simpleShrine.CanUse      = this.CanUse;
                    simpleShrine.text        = this.text;
                    simpleShrine.acceptText  = this.acceptText;
                    simpleShrine.declineText = this.declineText;
                    simpleShrine.talkPoint   = transform;
                }
                else
                {
                    gameObject.AddComponent(this.interactableComponent);
                }
                gameObject.name = text;
                bool flag7 = !this.isBreachShrine;
                bool flag8 = flag7;
                bool flag9 = flag8;
                if (flag9)
                {
                    bool flag10 = !this.room;
                    bool flag11 = flag10;
                    bool flag12 = flag11;
                    if (flag12)
                    {
                        this.room = RoomFactory.CreateEmptyRoom(12, 12);
                    }
                    ShrineFactory.RegisterShrineRoom(gameObject, this.room, text, this.offset, this.RoomWeight);
                }
                ShrineFactory.registeredShrines.Add(text, gameObject);
                FakePrefab.MarkAsFakePrefab(gameObject);
                result = gameObject;
            }
            catch (Exception e)
            {
                Tools.PrintException(e, "FF0000");
                result = null;
            }
            return(result);
        }