Пример #1
0
 private void PickStats()
 {
     if (hasPicked)
     {
         return;
     }
     else
     {
         PlayableCharacters characterIdentity = Owner.characterIdentity;
         Effect             effect            = BraveUtility.RandomElement(statEffects);
         statEffects.Remove(effect);
         if (effect.modifyMethod == StatModifier.ModifyMethod.MULTIPLICATIVE)
         {
             AddStat(effect.statToEffect, effect.amount, StatModifier.ModifyMethod.MULTIPLICATIVE);
         }
         else
         {
             if (effect.statToEffect == PlayerStats.StatType.Health && characterIdentity == PlayableCharacters.Robot)
             {
                 LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, Owner);
             }
             AddStat(effect.statToEffect, effect.amount, StatModifier.ModifyMethod.ADDITIVE);
         }
         Owner.stats.RecalculateStats(Owner, true, false);
         hasPicked = true;
     }
 }
Пример #2
0
        private void RandomToadieAirDrop(GameObject lootCratePrefab, RoomHandler currentRoom, IntVector2?Clearence = null)
        {
            if (!Clearence.HasValue)
            {
                Clearence = new IntVector2(2, 2);
            }

            IntVector2?DropLocation = FindRandomDropLocation(currentRoom, Clearence.Value);

            if (DropLocation.HasValue)
            {
                EmergencyCrateController lootCrate = Instantiate(lootCratePrefab, DropLocation.Value.ToVector2().ToVector3ZUp(1f), Quaternion.identity).GetComponent <EmergencyCrateController>();
                if (lootCrate == null)
                {
                    return;
                }

                lootCrate.ChanceToExplode    = 0;
                lootCrate.ChanceToSpawnEnemy = 1;
                lootCrate.EnemyPlaceable     = m_CustomEnemyPlacable(BraveUtility.RandomElement(ToadieGUIDs));

                lootCrate.Trigger(new Vector3(-5f, -5f, -5f), DropLocation.Value.ToVector3() + new Vector3(15f, 15f, 15f), currentRoom, true);
                currentRoom.ExtantEmergencyCrate = lootCrate.gameObject;
            }
            return;
        }
Пример #3
0
        public static DungeonFlow LoadCustomFlow(string target)
        {
            string flowName = target;

            if (flowName.Contains("/"))
            {
                flowName = target.Substring(target.LastIndexOf("/") + 1);
            }
            if (flowName.ToLower() == "secret_doublebeholster_flow")
            {
                string[] glitchflows = new string[] { "custom_glitch_flow", "custom_glitchchest_flow", "Custom_GlitchChestAlt_Flow" };
                flowName = BraveUtility.RandomElement(glitchflows);
            }
            else if (flowName.ToLower() == "secret_doublebeholster_flow_orig")
            {
                flowName = "secret_doublebeholster_flow";
            }
            if (KnownFlows != null && KnownFlows.Length > 0)
            {
                foreach (DungeonFlow flow in KnownFlows)
                {
                    if (flow.name != null && flow.name != string.Empty)
                    {
                        if (flowName.ToLower() == flow.name.ToLower())
                        {
                            return(flow);
                        }
                    }
                }
            }
            // If didn't return match, then try finding it in flow_base_001.
            return(LoadOfficialFlow(flowName));
        }
Пример #4
0
        private void AssignPillPools()
        {
            BlueBluePillEffect = BraveUtility.RandomElement(pillEffectPool);
            pillEffectPool.Remove(BlueBluePillEffect);

            PillPoolsAssigned = true;
        }
Пример #5
0
        private void ShootRocket(float effectChanceScalar)
        {
            float procChance = 0.05f;

            if (Owner.HasPickupID(106))
            {
                procChance *= 3f;
            }
            procChance *= effectChanceScalar;
            if (UnityEngine.Random.value <= procChance)
            {
                int        selectedRocket = BraveUtility.RandomElement(RocketIDs);
                Projectile projectile     = ((Gun)ETGMod.Databases.Items[selectedRocket]).DefaultModule.projectiles[0];
                GameObject gameObject     = SpawnManager.SpawnProjectile(projectile.gameObject, base.Owner.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (base.Owner.CurrentGun == null) ? 0f : base.Owner.CurrentGun.CurrentAngle), true);
                Projectile component      = gameObject.GetComponent <Projectile>();
                if (component != null)
                {
                    if (Owner.HasPickupID(selectedRocket) && selectedRocket != 739)
                    {
                        component.baseData.damage *= 2f;
                    }
                    else if (Owner.HasPickupID(176) && selectedRocket == 739)
                    {
                        component.baseData.damage *= 2f;
                    }
                    component.Owner   = base.Owner;
                    component.Shooter = base.Owner.specRigidbody;
                }
            }
        }
Пример #6
0
        private IEnumerator KillInventoryCompanion(PlayerController user)
        {
            //ETGModConsole.Log("KillInventoryCompanion Triggered");

            PickupObject item         = BraveUtility.RandomElement(CompanionItems);
            Gun          gunness      = item.gameObject.GetComponent <Gun>();
            DebrisObject debrisObject = SpecialDrop.DropItem(user, item, gunness != null);


            yield return(new WaitForSeconds(1f));

            if (debrisObject != null)
            {
                AkSoundEngine.PostEvent("Play_WPN_smileyrevolver_shot_01", gameObject);
                Instantiate <GameObject>(EasyVFXDatabase.TeleporterPrototypeTelefragVFX, debrisObject.sprite.WorldCenter, Quaternion.identity);
                GameManager.Instance.StartCoroutine(DoReward(user, debrisObject.sprite.WorldCenter, item.PickupObjectId));
                UnityEngine.Object.Destroy(debrisObject.gameObject);
            }
            else
            {
                ETGModConsole.Log("DebrisObject was null in the kill code, this should never happen.");
            }

            yield break;
        }
        private DungeonData.Direction GetFacingDirection(IntVector2 pos1, IntVector2 pos2)
        {
            DungeonData data = GameManager.Instance.Dungeon.data;

            if (data.isWall(pos1 + IntVector2.Down) && data.isWall(pos1 + IntVector2.Up))
            {
                return(DungeonData.Direction.EAST);
            }
            if (data.isWall(pos2 + IntVector2.Down) && data.isWall(pos2 + IntVector2.Up))
            {
                return(DungeonData.Direction.WEST);
            }
            if (data.isWall(pos1 + IntVector2.Down) && data.isWall(pos2 + IntVector2.Down))
            {
                return(DungeonData.Direction.NORTH);
            }
            if (data.isWall(pos1 + IntVector2.Up) && data.isWall(pos2 + IntVector2.Up))
            {
                return(DungeonData.Direction.SOUTH);
            }
            Debug.LogError("Not able to determine the direction of a wall mimic! Using random direction instead!");
            // return DungeonData.Direction.SOUTH;
            return(BraveUtility.RandomElement(new List <DungeonData.Direction>()
            {
                DungeonData.Direction.EAST,
                DungeonData.Direction.WEST,
                DungeonData.Direction.NORTH,
                DungeonData.Direction.SOUTH
            }
                                              ));
        }
Пример #8
0
        // This function doesn't null check orLoadByGuid. If non fake prefab custom enemies are spawned (like the special rats on Hollow), then this would cause exception.
        // Added fall back GUIDs and use one of those for AIActor instead if this happens.
        public void AddSpecificEnemyToRoomProcedurallyFixed(RoomHandler room, string enemyGuid, bool reinforcementSpawn = false, Vector2?goalPosition = null)
        {
            AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid(enemyGuid);

            if (!orLoadByGuid)
            {
                List <string> FallbackGUIDs = new List <string>()
                {
                    ExpandCustomEnemyDatabase.BootlegBullatGUID,
                    ExpandCustomEnemyDatabase.BootlegBulletManGUID,
                    ExpandCustomEnemyDatabase.BootlegBulletManBandanaGUID,
                    ExpandCustomEnemyDatabase.BootlegShotgunManBlueGUID,
                    ExpandCustomEnemyDatabase.BootlegShotgunManRedGUID
                };
                FallbackGUIDs = FallbackGUIDs.Shuffle();
                orLoadByGuid  = EnemyDatabase.GetOrLoadByGuid(BraveUtility.RandomElement(FallbackGUIDs));
            }
            IntVector2    clearance     = orLoadByGuid.specRigidbody.UnitDimensions.ToIntVector2(VectorConversions.Ceil);
            CellValidator cellValidator = delegate(IntVector2 c) {
                for (int i = 0; i < clearance.x; i++)
                {
                    int x = c.x + i;
                    for (int j = 0; j < clearance.y; j++)
                    {
                        int y = c.y + j;
                        if (GameManager.Instance.Dungeon.data.isTopWall(x, y))
                        {
                            return(false);
                        }
                    }
                }
                return(true);
            };
            IntVector2?intVector;

            if (goalPosition != null)
            {
                intVector = room.GetNearestAvailableCell(goalPosition.Value, new IntVector2?(clearance), new CellTypes?(CellTypes.FLOOR), false, cellValidator);
            }
            else
            {
                intVector = room.GetRandomAvailableCell(new IntVector2?(clearance), new CellTypes?(CellTypes.FLOOR), false, cellValidator);
            }
            if (intVector != null)
            {
                AIActor aiactor = AIActor.Spawn(orLoadByGuid, intVector.Value, room, true, AIActor.AwakenAnimationType.Spawn, false);
                if (aiactor && reinforcementSpawn)
                {
                    if (aiactor.specRigidbody)
                    {
                        aiactor.specRigidbody.CollideWithOthers = false;
                    }
                    aiactor.HandleReinforcementFallIntoRoom(0f);
                }
            }
            else
            {
                Debug.LogError("failed placement");
            }
        }
        public override DebrisObject Drop(PlayerController player)
        {
            DebrisObject droppedSelf = base.Drop(player);

            TextBubble.DoAmbientTalk(droppedSelf.transform, new Vector3(0.5f, 2, 0), BraveUtility.RandomElement(DropDialogue), 2f);
            return(droppedSelf);
        }
 private void OnPreSpawn(AIActor actor)
 {
     if (Owner && actor && (actor.EnemyGuid == "699cd24270af4cd183d671090d8323a1" || actor.EnemyGuid == "a446c626b56d4166915a4e29869737fd"))
     {
         actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(BraveUtility.RandomElement(lootIDlist)));
     }
 }
Пример #11
0
 protected override void OnTrigger(Vector2 damageDirection)
 {
     if (m_hasTriggered)
     {
         return;
     }
     m_hasTriggered = true;
     if (chanceToSpawn < 1f && UnityEngine.Random.value > chanceToSpawn)
     {
         return;
     }
     if (spawnRatKey)
     {
         SpawnRatKey(); return;
     }
     GameObject[] array = null;
     if (objectSelection == ObjectSelection.All)
     {
         array = objectsToSpawn;
     }
     else if (objectSelection == ObjectSelection.Random)
     {
         array = new GameObject[UnityEngine.Random.Range(minSpawnCount, maxSpawnCount)];
         for (int i = 0; i < array.Length; i++)
         {
             array[i] = BraveUtility.RandomElement(objectsToSpawn);
         }
     }
     if (parentEnemyWasRat)
     {
         PickupObject.RatBeatenAtPunchout = true;
     }
     SpawnObjects(array);
 }
Пример #12
0
        private void Awake()
        {
            m_hasAwoken = true;
            if (!m_gun)
            {
                m_gun = GetComponent <Gun>();
            }
            if (m_gun)
            {
                m_gun.OnInitializedWithOwner = (Action <GameActor>)Delegate.Combine(m_gun.OnInitializedWithOwner, new Action <GameActor>(OnGunInitialized));
                m_gun.OnDropped = (Action)Delegate.Combine(m_gun.OnDropped, new Action(OnGunDroppedOrDestroyed));
                if (m_gun.CurrentOwner != null)
                {
                    OnGunInitialized(m_gun.CurrentOwner);
                }

                if (TransfmorgifyTargetGUIDs != null && TransfmorgifyTargetGUIDs.Count <= 0 && IsBootlegShotgun)
                {
                    List <string> m_GUIDlist = new List <string>()
                    {
                        ExpandCustomEnemyDatabase.BootlegShotgunManBlueGUID,
                        ExpandCustomEnemyDatabase.BootlegShotgunManRedGUID
                    };
                    m_GUIDlist = m_GUIDlist.Shuffle();
                    TransfmorgifyTargetGUIDs.Add(BraveUtility.RandomElement(m_GUIDlist));
                }
            }
        }
Пример #13
0
 private void PickStats()
 {
     if (hasPicked)
     {
         return;
     }
     else
     {
         for (int i = 0; i < 2; i++)
         {
             Effect effect = BraveUtility.RandomElement(statEffects);
             statEffects.Remove(effect);
             if (effect.modifyMethod == StatModifier.ModifyMethod.MULTIPLICATIVE)
             {
                 AddStat(effect.statToEffect, effect.amount, StatModifier.ModifyMethod.MULTIPLICATIVE);
             }
             else
             {
                 AddStat(effect.statToEffect, effect.amount, StatModifier.ModifyMethod.ADDITIVE);
             }
         }
         Owner.stats.RecalculateStats(Owner, true, false);
         hasPicked = true;
     }
 }
        public static void ChestPreOpen(Chest self, PlayerController opener)
        {
            JammedChestBehav jamness = self.gameObject.GetComponent <JammedChestBehav>();

            if (jamness != null)
            {
                self.PredictContents(opener);
                if (UnityEngine.Random.value <= 0.5f)
                {
                    List <PickupObject> items = GenerateContents(self.lootTable, self.breakertronLootTable, opener, 0, new System.Random());
                    self.contents.AddRange(items);
                }
                else
                {
                    int          lootID = BraveUtility.RandomElement(LootIDs);
                    PickupObject obj    = PickupObjectDatabase.GetById(lootID);
                    self.contents.Add(obj);
                }
            }
            if (jamness != null)
            {
                SaveAPIManager.RegisterStatChange(CustomTrackedStats.JAMMED_CHESTS_OPENED, 1);
                LootEngine.SpawnCurrency(self.sprite.WorldCenter, UnityEngine.Random.Range(10, 21), false);
                if (UnityEngine.Random.value <= 0.25f && opener.name != "PlayerShade(Clone)")
                {
                    opener.healthHaver.ApplyDamage(1f, Vector2.zero, "Jammed Chest");
                }
            }
        }
Пример #15
0
 protected override void OnTrigger(Vector2 damageDirection)
 {
     if (m_hasTriggered)
     {
         return;
     }
     m_hasTriggered = true;
     if (guaranteedSpawnGenerations <= 0f && chanceToSpawn < 1f && UnityEngine.Random.value > chanceToSpawn)
     {
         return;
     }
     if (!string.IsNullOrEmpty(spawnVfx))
     {
         aiAnimator.PlayVfx(spawnVfx, null, null, null);
     }
     string[] array = null;
     if (enemySelection == EnemySelection.All)
     {
         array = enemyGuidsToSpawn;
     }
     else if (enemySelection == EnemySelection.Random)
     {
         array = new string[UnityEngine.Random.Range(minSpawnCount, maxSpawnCount)];
         for (int i = 0; i < array.Length; i++)
         {
             array[i] = BraveUtility.RandomElement(enemyGuidsToSpawn);
         }
     }
     SpawnEnemies(array);
 }
 protected override void DoEffect(PlayerController user)
 {
     if (user.carriedConsumables.KeyBullets == 1)
     {
         Vector2      yourPosition   = user.sprite.WorldCenter + new Vector2(-0.5f, 0f);
         List <Chest> possibleChests = new List <Chest>
         {
             GameManager.Instance.RewardManager.D_Chest,
             GameManager.Instance.RewardManager.C_Chest,
             GameManager.Instance.RewardManager.B_Chest,
         };
         Chest chest = Chest.Spawn(BraveUtility.RandomElement(possibleChests), yourPosition, yourPosition.GetAbsoluteRoom());
         chest.IsLocked = false;
         user.carriedConsumables.KeyBullets -= 1;
     }
     else if (user.carriedConsumables.KeyBullets > 1 && user.carriedConsumables.KeyBullets < 7)
     {
         Vector2      yourPosition   = user.sprite.WorldCenter + new Vector2(-0.5f, 0f);
         List <Chest> possibleChests = new List <Chest>
         {
             GameManager.Instance.RewardManager.A_Chest,
             GameManager.Instance.RewardManager.S_Chest,
         };
         Chest chest = Chest.Spawn(BraveUtility.RandomElement(possibleChests), yourPosition, yourPosition.GetAbsoluteRoom());
         chest.IsLocked = false;
         user.carriedConsumables.KeyBullets -= 2;
     }
     else
     {
         Vector2 yourPosition = user.sprite.WorldCenter + new Vector2(-0.5f, 0f);
         Chest   chest        = Chest.Spawn(GameManager.Instance.RewardManager.Rainbow_Chest, yourPosition, yourPosition.GetAbsoluteRoom());
         chest.IsLocked = false;
         user.carriedConsumables.KeyBullets -= 7;
     }
 }
Пример #17
0
        private void DoSpawn()
        {
            DisplacedEnemy enemy = BraveUtility.RandomElement(listOfDisplacedEnemies.DisplacedEnemies);

            var        Enemy = EnemyDatabase.GetOrLoadByGuid(enemy.GUID);
            IntVector2?bestRewardLocation = m_player.CurrentRoom.GetRandomVisibleClearSpot(2, 2);
            AIActor    TargetActor        = AIActor.Spawn(Enemy.aiActor, bestRewardLocation.Value, GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(bestRewardLocation.Value), true, AIActor.AwakenAnimationType.Default, true);

            PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(TargetActor.specRigidbody, null, false);
            if (TargetActor.IsBlackPhantom && !enemy.ISJAMMED)
            {
                TargetActor.UnbecomeBlackPhantom();
            }
            else if (!TargetActor.IsBlackPhantom && enemy.ISJAMMED)
            {
                TargetActor.BecomeBlackPhantom();
            }
            TargetActor.healthHaver.ForceSetCurrentHealth(enemy.HEALTH);


            listOfDisplacedEnemies.DisplacedEnemies.Remove(enemy);

            AkSoundEngine.PostEvent("Play_OBJ_chestwarp_use_01", gameObject);
            var tpvfx = (PickupObjectDatabase.GetById(573) as ChestTeleporterItem).TeleportVFX;

            SpawnManager.SpawnVFX(tpvfx, TargetActor.sprite.WorldCenter, Quaternion.identity, true);
        }
Пример #18
0
        private void Start()
        {
            //base.aiActor.HasBeenEngaged = true;
            base.aiActor.healthHaver.OnPreDeath += (obj) =>
            {
                //AkSoundEngine.PostEvent("Play_ENM_beholster_death_01", base.aiActor.gameObject);
                //Chest chest2 = GameManager.Instance.RewardManager.SpawnTotallyRandomChest(spawnspot)rg;
                //chest2.IsLocked = false;
            };
            base.healthHaver.healthHaver.OnDeath += (obj) =>
            {
                float itemsToSpawn = UnityEngine.Random.Range(3, 6);
                float spewItemDir  = 360 / itemsToSpawn;
                // new Vector2(spewItemDir * itemsToSpawn, 0);

                for (int i = 0; i < itemsToSpawn; i++)
                {
                    int id = BraveUtility.RandomElement <int>(TheStranger.Lootdrops);
                    LootEngine.SpawnItem(PickupObjectDatabase.GetById(id).gameObject, base.aiActor.sprite.WorldCenter, new Vector2(spewItemDir * itemsToSpawn, spewItemDir * itemsToSpawn), 2.2f, false, true, false);
                }

                Chest chest2 = GameManager.Instance.RewardManager.SpawnTotallyRandomChest(GameManager.Instance.PrimaryPlayer.CurrentRoom.GetRandomVisibleClearSpot(1, 1));
                chest2.IsLocked = false;
            };;
            this.aiActor.knockbackDoer.SetImmobile(true, "nope.");
        }
Пример #19
0
        protected override void DoEffect(PlayerController player)
        {
            BraveUtility.RandomElement(ImprovedCandies.PositiveCandyEffects).Invoke(player);
            player.BloopItemAboveHead(base.sprite);

            ETGModConsole.Log("GJ idiot ...");
        }
Пример #20
0
        public static void AddRandomCurse(bool doPopup = false)
        {
            List <CurseData> refinedData = new List <CurseData>();

            refinedData.AddRange(CursePrefabs);
            if (CurrentActiveCurses.Count > 0)
            {
                for (int i = (refinedData.Count - 1); i >= 0; i--)
                {
                    if (CurseManager.CurseIsActive(refinedData[i].curseName))
                    {
                        refinedData.RemoveAt(i);
                    }
                    else if (cursesLastFloor != null && cursesLastFloor.Contains(refinedData[i].curseName))
                    {
                        refinedData.RemoveAt(i);
                    }
                    else if (bannedCursesThisRun != null && bannedCursesThisRun.Contains(refinedData[i].curseName))
                    {
                        refinedData.RemoveAt(i);
                    }
                }
            }
            if (refinedData.Count > 0)
            {
                CurseData pickedCurse = BraveUtility.RandomElement(refinedData);
                AddCurse(pickedCurse.curseName, doPopup);
            }
        }
            private void OnDamaged(PlayerController player)
            {
                float procChance;

                if (Owner.PlayerHasActiveSynergy("Good Lads"))
                {
                    procChance = 0.6f;
                }
                else
                {
                    procChance = 0.4f;
                }
                if (UnityEngine.Random.value < procChance)
                {
                    int amountOfStuffToSpawn = 1;
                    if (Owner.PlayerHasActiveSynergy("Worship"))
                    {
                        amountOfStuffToSpawn += 1;
                    }
                    for (int i = 0; i < amountOfStuffToSpawn; i++)
                    {
                        int lootID = BraveUtility.RandomElement(lootIDlist);
                        LootEngine.SpawnItem(PickupObjectDatabase.GetById(lootID).gameObject, base.aiActor.sprite.WorldCenter, Vector2.zero, 1f, false, true, false);
                    }
                }
            }
Пример #22
0
 private void EndEffect(PlayerController player)
 {
     if (UnityEngine.Random.value < this.m_exhaustionChance)
     {
         player.StartCoroutine(this.EndEffectCR(player));
     }
     if (UnityEngine.Random.value < this.m_exhaustionChance)
     {
         List <RoomHandler> rooms = new List <RoomHandler>();
         foreach (RoomHandler room in GameManager.Instance.Dungeon.data.rooms)
         {
             if (!room.hasEverBeenVisited)
             {
                 rooms.Add(room);
             }
         }
         if (rooms.Count > 0)
         {
             RoomHandler randomRoom          = BraveUtility.RandomElement(rooms);
             IntVector2? randomAvailableCell = randomRoom.GetRandomAvailableCell(new IntVector2?(GreenChamberEyeController.hallucinationEyePrefab.GetComponent <GreenChamberEyeController>().specRigidbody.UnitDimensions.ToIntVector2(VectorConversions.Ceil)),
                                                                                 new CellTypes?(CellTypes.FLOOR | CellTypes.PIT), false, null);
             if (randomAvailableCell.HasValue)
             {
                 Instantiate(GreenChamberEyeController.hallucinationEyePrefab, randomAvailableCell.Value.ToVector3(0), Quaternion.identity).GetComponent <GreenChamberEyeController>().BindWithRoom(randomRoom);
             }
         }
     }
     this.m_exhaustionChance = Mathf.Min(this.m_exhaustionChance += 0.01f, 0.05f);
     AkSoundEngine.PostEvent("Play_ENM_lighten_world_01", player.gameObject);
     this.spriteAnimator.Play("unmelt");
 }
 private void SpawnMundaneLoot()
 {
     if (base.aiActor && base.aiActor.healthHaver && base.aiActor.healthHaver.IsAlive)
     {
         int lootID = BraveUtility.RandomElement(lootIDlist);
         LootEngine.SpawnItem(PickupObjectDatabase.GetById(lootID).gameObject, base.aiActor.sprite.WorldCenter, Vector2.zero, 1f, false, true, false);
     }
 }
Пример #24
0
 // Token: 0x06004B93 RID: 19347 RVA: 0x00191F90 File Offset: 0x00190190
 public override BehaviorResult Update()
 {
     this.m_startingAngle = BraveMathCollege.ClampAngle360(BraveUtility.RandomElement <float>(this.startingAngles));
     this.m_aiActor.BehaviorOverridesVelocity = true;
     this.m_aiActor.BehaviorVelocity          = BraveMathCollege.DegreesToVector(this.m_startingAngle, this.m_aiActor.MovementSpeed);
     this.m_isBouncing = true;
     return(BehaviorResult.RunContinuousInClass);
 }
Пример #25
0
 private void DoRandomRoomSpawns(RoomHandler room)
 {
     for (int i = 0; i < 2; i++)
     {
         Vector3 positionToSpawn3 = room.GetRandomVisibleClearSpot(2, 2).ToVector3();
         SpawnObjectManager.SpawnObject(BraveUtility.RandomElement(PossibleObjects), positionToSpawn3, EasyVFXDatabase.BloodiedScarfPoofVFX);
     }
 }
Пример #26
0
        public static Dungeon SewerDungeonMods(Dungeon dungeon)
        {
            // Here is where you'll do your mods to existing Dungeon prefab
            var finalMasteryRewardOub = BraveUtility.RandomElement(oubMasteryRewards);

            dungeon.BossMasteryTokenItemId = finalMasteryRewardOub; // Item ID for Third Floor Master Round. Replace with Item ID of your choosing.
            return(dungeon);
        }
Пример #27
0
        public static DungeonFlow GetRandomFlowFromNextDungeonPrefabForGlitchFloor()
        {
            int     NextLevelIndex = ReflectionHelpers.ReflectGetField <int>(typeof(GameManager), "nextLevelIndex", GameManager.Instance);
            Dungeon dungeon        = null;
            bool    useFallBack    = true;

            switch (NextLevelIndex)
            {
            case 2:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Castle");
                break;

            case 3:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Gungeon");
                break;

            case 4:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                break;

            case 5:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Catacombs");
                break;

            case 6:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Forge");
                break;

            case 7:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Bullethell");
                break;

            default:
                dungeon = DungeonDatabase.GetOrLoadByName("Base_Mines");
                break;
            }
            DungeonFlow m_AssignedFallBackFlow = FlowDatabase.GetOrLoadByName(BraveUtility.RandomElement(GlitchChestFlows));
            DungeonFlow m_AssignedFlow         = FlowHelpers.DuplicateDungeonFlow(BraveUtility.RandomElement(dungeon.PatternSettings.flows));

            dungeon = null;
            foreach (DungeonFlowNode node in m_AssignedFlow.AllNodes)
            {
                if (node.roomCategory == PrototypeDungeonRoom.RoomCategory.BOSS)
                {
                    node.overrideExactRoom = ExpandPrefabs.doublebeholsterroom01;
                    useFallBack            = false;
                    break;
                }
            }
            if (useFallBack)
            {
                return(m_AssignedFallBackFlow);
            }
            else
            {
                return(m_AssignedFlow);
            }
        }
 private void DoReroll()
 {
     foreach (DebrisObject debris in pickupsInRoom)
     {
         Vector2 pos = debris.transform.position;
         LootEngine.SpawnItem(PickupObjectDatabase.GetById(BraveUtility.RandomElement(validIDs)).gameObject, pos, Vector2.zero, 1f, false, true, false);
         Destroy(debris.gameObject);
     }
 }
        private IEnumerator DoTalk(Vector3 dialogBoxOffset)
        {
            GetComponent <GenericIntroDoer>().SuppressSkipping = true;
            TextBoxManager.TIME_INVARIANT = true;

            List <int> RandomStrings = new List <int>()
            {
                1, 2, 3, 4
            };

            int RandomString = BraveUtility.RandomElement(RandomStrings);

            string DialogOption1 = "This Gungeon ain't big enough for both of us!";

            string DialogOption2       = "I will kill you twice!";
            string DialogOption2_Line2 = "First I will kill you here.";
            string DialogOption2_Line3 = "Then I will get the bullet and kill your past!";

            string DialogOption3       = "I shall become the ultimate clone!";
            string DialogOption3_Line2 = "I will kill you here so that I can take your place.";
            string DialogOption3_Line3 = "Your fellow Gungeoneers will suspect nothing!";

            string DialogOption4 = "You can kill your past, but how about your present?";

            if (RandomString == 1)
            {
                yield return(StartCoroutine(TalkRaw(DialogOption1, dialogBoxOffset)));
            }
            else if (RandomString == 2)
            {
                yield return(StartCoroutine(TalkRaw(DialogOption2, dialogBoxOffset)));

                yield return(StartCoroutine(TalkRaw(DialogOption2_Line2, dialogBoxOffset)));

                yield return(StartCoroutine(TalkRaw(DialogOption2_Line3, dialogBoxOffset)));
            }
            else if (RandomString == 3)
            {
                yield return(StartCoroutine(TalkRaw(DialogOption3, dialogBoxOffset)));

                yield return(StartCoroutine(TalkRaw(DialogOption3_Line2, dialogBoxOffset)));

                yield return(StartCoroutine(TalkRaw(DialogOption3_Line3, dialogBoxOffset)));
            }
            else if (RandomString == 4)
            {
                yield return(StartCoroutine(TalkRaw(DialogOption4, dialogBoxOffset)));
            }

            yield return(null);

            TextBoxManager.TIME_INVARIANT = false;
            GetComponent <GenericIntroDoer>().SuppressSkipping = false;
            yield break;
        }
Пример #30
0
        protected override void DoEffect(PlayerController user)
        {
            //ETGModConsole.Log("Item was used");

            ClearItemLists();
            GetCompanionItemsOnUser(user);
            GetCompanionItemsOnGround();
            int totalItemsFound = CompanionItems.Count + DebrisCompanionItems.Count + DebrisGuns.Count;

            //ETGModConsole.Log("Total items found: " + totalItemsFound);
            if (totalItemsFound > 0)
            {
                int randomValue = UnityEngine.Random.Range(1, (totalItemsFound + 1));

                if (randomValue > (CompanionItems.Count + DebrisCompanionItems.Count))
                {
                    //GunDebris
                    if (DebrisGuns.Count > 0)
                    {
                        KillGroundCompanion(user, BraveUtility.RandomElement(DebrisGuns).gameObject);
                    }
                    else
                    {
                        ETGModConsole.Log("DebrisGuns had nothing in it? This should never happen.");
                    }
                }
                else
                {
                    if (randomValue > CompanionItems.Count)
                    {
                        //Debris
                        if (DebrisCompanionItems.Count > 0)
                        {
                            KillGroundCompanion(user, BraveUtility.RandomElement(DebrisCompanionItems).gameObject);
                        }
                        else
                        {
                            ETGModConsole.Log("DebrisCompanionItems had nothing in it? This should never happen.");
                        }
                    }
                    else
                    {
                        //Companion
                        if (CompanionItems.Count > 0)
                        {
                            GameManager.Instance.StartCoroutine(this.KillInventoryCompanion(user));
                        }
                        else
                        {
                            ETGModConsole.Log("CompanionItems had nothing in it? This should never happen.");
                        }
                    }
                }
            }
        }