Exemple #1
0
        // Token: 0x060003BB RID: 955 RVA: 0x00026BB0 File Offset: 0x00024DB0
        public static void Init()
        {
            Hook hook = new Hook(typeof(DungeonDatabase).GetMethod("GetOrLoadByName", BindingFlags.Static | BindingFlags.Public), typeof(SpecialDungeon).GetMethod("GetOrLoadByNameHook"));

            foreach (Type type in from myType in Assembly.GetAssembly(typeof(SpecialDungeon)).GetTypes()
                     where myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(SpecialDungeon))
                     select myType)
            {
                SpecialDungeon dungeon = (SpecialDungeon)Activator.CreateInstance(type);
                SpecialDungeon.RegisterCustomDungeon(new Func <Dungeon, Dungeon>(dungeon.BuildDungeon), dungeon.PrefabPath);
                GameLevelDefinition def = new GameLevelDefinition
                {
                    bossDpsCap                 = dungeon.BossDPSCap,
                    dungeonPrefabPath          = dungeon.PrefabPath,
                    damageCap                  = dungeon.DamageCap,
                    dungeonSceneName           = dungeon.SceneName,
                    enemyHealthMultiplier      = dungeon.EnemyHealthMultiplier,
                    flowEntries                = dungeon.FlowEntries,
                    priceMultiplier            = dungeon.PriceMultiplier,
                    secretDoorHealthMultiplier = dungeon.SecretDoorHealthMultiplier
                };
                GameManager.Instance.customFloors.Add(def);
                SpecialDungeon.addedLevelDefs.Add(def);
            }
            ETGModMainBehaviour.Instance.gameObject.AddComponent <DetectMissingDefinitions>();
        }
Exemple #2
0
 private int CalculatePrice(ConsumableType consumable)
 {
     if (consumableIDDictionary.ContainsKey(consumable))
     {
         PickupObject databaseObject = PickupObjectDatabase.GetById(consumableIDDictionary[consumable]);
         if (databaseObject != null)
         {
             int price = databaseObject.PurchasePrice;
             GameLevelDefinition lastLoadedLevelDefinition = GameManager.Instance.GetLastLoadedLevelDefinition();
             float num4        = (lastLoadedLevelDefinition == null) ? 1f : lastLoadedLevelDefinition.priceMultiplier;
             float moddedPrice = price * num4;
             if (LastOwner)
             {
                 moddedPrice = price * LastOwner.stats.GetStatValue(PlayerStats.StatType.GlobalPriceMultiplier);
                 return(Mathf.RoundToInt(moddedPrice));
             }
             else
             {
                 return(Mathf.RoundToInt(moddedPrice));
             }
         }
         else
         {
             return(420);
         }
     }
     else
     {
         return(69);
     }
 }
Exemple #3
0
        public static void GetSceneNames(string[] notused)
        {
            GameLevelDefinition gameLevelDefinition = GameManager.Instance.GetLastLoadedLevelDefinition();


            //GameLevelDefinition gameLevelDefinition = new GameLevelDefinition();
            //gameLevelDefinition.dungeonSceneName = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;

            ETGModConsole.Log("SceneName " + gameLevelDefinition.dungeonSceneName);
        }
Exemple #4
0
        public static void InitCustomDungeon()
        {
            getOrLoadByName_Hook = new Hook(
                typeof(DungeonDatabase).GetMethod("GetOrLoadByName", BindingFlags.Static | BindingFlags.Public),
                typeof(DoodleDungeon).GetMethod("GetOrLoadByNameHook", BindingFlags.Static | BindingFlags.Public)
                );


            AssetBundle braveResources = ResourceManager.LoadAssetBundle("brave_resources_001");

            GameManagerObject = braveResources.LoadAsset <GameObject>("_GameManager");

            FloorNameDefinition = new GameLevelDefinition()
            {
                dungeonSceneName           = "tt_testflow",    //this is the name we will use whenever we want to load our dungeons scene
                dungeonPrefabPath          = "Base_FloorName", //this is what we will use when we want to acess our dungeon prefab
                priceMultiplier            = 1.5f,             //multiplies how much things cost in the shop
                secretDoorHealthMultiplier = 1,                //multiplies how much health secret room doors have, aka how many shots you will need to expose them
                enemyHealthMultiplier      = 2,                //multiplies how much health enemies have
                damageCap       = 300,                         // damage cap for regular enemies
                bossDpsCap      = 78,                          // damage cap for bosses
                flowEntries     = new List <DungeonFlowLevelEntry>(0),
                predefinedSeeds = new List <int>(0)
            };

            // sets the level definition of the GameLevelDefinition in GameManager.Instance.customFloors if it exists
            foreach (GameLevelDefinition levelDefinition in GameManager.Instance.customFloors)
            {
                if (levelDefinition.dungeonSceneName == "tt_testflow")
                {
                    FloorNameDefinition = levelDefinition;
                }
            }

            GameManager.Instance.customFloors.Add(FloorNameDefinition);
            GameManagerObject.GetComponent <GameManager>().customFloors.Add(FloorNameDefinition);
        }
        private IEnumerator HandleConversation(PlayerController interactor)
        {
            SpriteOutlineManager.AddOutlineToSprite(base.sprite, Color.black);
            base.spriteAnimator.PlayForDuration("talk_start", 1, "talk");
            interactor.SetInputOverride("npcConversation");
            Pixelator.Instance.LerpToLetterbox(0.35f, 0.25f);
            yield return(null);

            //Determine Dialogue
            var conversationToUse = new List <string>()
            {
                "Null"
            };

            //Price Mult
            GameLevelDefinition lastLoadedLevelDefinition = GameManager.Instance.GetLastLoadedLevelDefinition();
            float PriceMult = (lastLoadedLevelDefinition == null) ? 1f : lastLoadedLevelDefinition.priceMultiplier;

            //Check for if ever met before and then else
            if (hasDeclinedAlreadyThisRun)
            {
                conversationToUse = new List <string>()
                {
                    "You're back? Did you change your mind?",
                    "Did you get hopelessly lost?",
                    "Please tell me you got hopelessly lost!",
                };
            }
            else
            {
                conversationToUse = new List <string>()
                {
                    "Well hello again, young adventurer!",
                    "You look lost... mayhaps you are in need of a finely crafted... map?",
                    "Only " + (20 * PriceMult) + " of those little janglies, you know the deal."
                };
            }


            int conversationIndex = 0;

            while (conversationIndex < conversationToUse.Count - 1)
            {
                TextBoxManager.ClearTextBox(this.talkPoint);
                TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, -1f, conversationToUse[conversationIndex], interactor.characterAudioSpeechTag, instant: false, showContinueText: true);
                float timer = 0;
                while (!BraveInput.GetInstanceForPlayer(interactor.PlayerIDX).ActiveActions.GetActionFromType(GungeonActions.GungeonActionType.Interact).WasPressed || timer < 0.4f)
                {
                    timer += BraveTime.DeltaTime;
                    yield return(null);
                }
                conversationIndex++;
            }
            TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, -1f, conversationToUse[conversationToUse.Count - 1], interactor.characterAudioSpeechTag, instant: false, showContinueText: true);


            var acceptanceTextToUse = "Null";
            var declineTextToUse    = "Null";

            if (hasDeclinedAlreadyThisRun)
            {
                acceptanceTextToUse = "...Just give me the map. <Lose " + (20 * PriceMult) + " Money>";
                declineTextToUse    = "Not lost, I know EXACTLY where I am!";
            }
            else
            {
                acceptanceTextToUse = "Yeah, a map would be nice <Lose " + (20 * PriceMult) + " Money>";
                declineTextToUse    = "No thanks, I can find my way around juuust fine.";
            }

            GameUIRoot.Instance.DisplayPlayerConversationOptions(interactor, null, acceptanceTextToUse, declineTextToUse);
            int selectedResponse = -1;

            while (!GameUIRoot.Instance.GetPlayerConversationResponse(out selectedResponse))
            {
                yield return(null);
            }

            if (selectedResponse == 0)
            {
                TextBoxManager.ClearTextBox(this.talkPoint);
                base.spriteAnimator.PlayForDuration("do_effect", -1, "talk");
                base.spriteAnimator.Play("talk");
                if (interactor.carriedConsumables.Currency >= (20 * PriceMult))
                {
                    TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 1f, "Enjoy the fruits of my knowledge!", interactor.characterAudioSpeechTag, instant: false);
                    OnAccept?.Invoke(interactor, this.gameObject);
                    hasBeenUsedThisRun = true;
                }
                else
                {
                    TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 1f, "Oh... looks like you don't have the cash. Welp, research ain't free.", interactor.characterAudioSpeechTag, instant: false);
                }
                yield return(new WaitForSeconds(1f));
            }
            else
            {
                OnDecline?.Invoke(interactor, this.gameObject);
                TextBoxManager.ShowTextBox(this.talkPoint.position, this.talkPoint, 1f, "Harumph, enjoy being lost...", interactor.characterAudioSpeechTag, instant: false);
                hasDeclinedAlreadyThisRun = true;
                TextBoxManager.ClearTextBox(this.talkPoint);
            }

            interactor.ClearInputOverride("npcConversation");
            Pixelator.Instance.LerpToLetterbox(1, 0.25f);
            base.spriteAnimator.Play("idle");
        }