public ExpandExplodeOnDeath() { immuneToIBombApp = false; deathType = DeathType.PreDeath; preDeathDelay = 0.1f; useDefaultExplosion = false; spawnItemsOnExplosion = false; isCorruptedObject = false; ExplosionNotGuranteed = false; isCorruptedNPC = false; spawnShardsOnDeath = false; numberOfDefaultItemsToSpawn = 1; ExplosionOdds = 0.3f; ExplosionDamage = 120f; breakStyle = MinorBreakable.BreakStyle.BURST; direction = Vector2.zero; minAngle = 0; maxAngle = 0; verticalSpeed = 0.4f; minMagnitude = 0.25f; maxMagnitude = 0.5f; heightOffGround = 0.1f; m_hasTriggered = false; // m_GrenadeGuyPrefab = EnemyDatabase.GetOrLoadByGuid("4d37ce3d666b4ddda8039929225b7ede").gameObject; // ExpandExplosionData = m_GrenadeGuyPrefab.gameObject.GetComponent<ExplodeOnDeath>().explosionData; // This uses Explosion Data settings from Grenade Kin by default ExpandExplosionData = ExpandUtility.GenerateExplosionData(); }
public static void Init(AssetBundle expandSharedAssets1) { PowBlockObject = expandSharedAssets1.LoadAsset <GameObject>("Pow Block"); tk2dSprite m_PowBlockSprite = SpriteSerializer.AddSpriteToObject(PowBlockObject, ExpandPrefabs.EXItemCollection, "PowBlock"); ExpandUtility.GenerateSpriteAnimator(PowBlockObject, playAutomatically: true); tk2dSpriteAnimator m_PowBlockAnimator = PowBlockObject.GetComponent <tk2dSpriteAnimator>(); ExpandUtility.AddAnimation(m_PowBlockAnimator, m_PowBlockSprite.Collection, PowBlockIdleSprites, "Idle", tk2dSpriteAnimationClip.WrapMode.Loop, 8); ExpandUtility.AddAnimation(m_PowBlockAnimator, m_PowBlockSprite.Collection, PowBlockUsedSprites, "POW", tk2dSpriteAnimationClip.WrapMode.Loop, 2); PowBlock powBlock = PowBlockObject.AddComponent <PowBlock>(); string shortDesc = "Shaken not stirred..."; string longDesc = "A special block that when stomped on causes a violent shaking.\n\nEnemies shall lose their footing."; ItemBuilder.SetupItem(powBlock, shortDesc, longDesc, "ex"); ItemBuilder.SetCooldownType(powBlock, ItemBuilder.CooldownType.Damage, 380f); powBlock.quality = ItemQuality.C; if (!ExpandSettings.EnableEXItems) { powBlock.quality = ItemQuality.EXCLUDED; } PowBlockPickupID = powBlock.PickupObjectId; }
private static void BuildWestBrosHatPrefab(AssetBundle assetBundle, out GameObject outObject, WestBros whichBro, tk2dSpriteCollectionData spriteCollection, DebrisObject broDebris) { outObject = assetBundle.LoadAsset <GameObject>($"WestBrosHat_{whichBro}"); string hatSpriteName = null; switch (whichBro) { case WestBros.Angel: hatSpriteName = "hat_angel"; break; case WestBros.Nome: hatSpriteName = "hat_nome"; break; case WestBros.Tuc: hatSpriteName = "hat_tuco"; break; } tk2dSprite hatSprite = outObject.AddComponent <tk2dSprite>(); hatSprite.SetSprite(spriteCollection, hatSpriteName); hatSprite.SortingOrder = 0; ExpandUtility.GenerateSpriteAnimator(outObject); DebrisObject debrisObject = outObject.AddComponent <DebrisObject>(); // this is set seperately because we use DeclaredOnly for the reflection field copying and Priority is inherited from EphemeralObject debrisObject.Priority = broDebris.Priority; ExpandUtility.ReflectionShallowCopyFields(debrisObject, broDebris, (BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)); }
private IEnumerator DelayedDoorOpen(GameObject targetObject) { yield return(new WaitForSeconds(0.5f)); targetObject.GetComponent <tk2dSpriteAnimator>().Play("Sarco_Door_Open"); AkSoundEngine.PostEvent("Play_OBJ_hugedoor_open_01", targetObject); while (targetObject.GetComponent <tk2dSpriteAnimator>().IsPlaying("Sarco_Door_Open")) { yield return(null); } if (targetObject.GetComponent <SpeculativeRigidbody>().PixelColliders.Count > 2) { targetObject.GetComponent <SpeculativeRigidbody>().PixelColliders[0].Enabled = false; targetObject.GetComponent <SpeculativeRigidbody>().PixelColliders[1].Enabled = false; } GameObject m_NewWarpWing = new GameObject("Belly Warp Wing Thing") { layer = 0 }; m_NewWarpWing.transform.position = m_TargetDoor.transform.position; ExpandUtility.GenerateOrAddToRigidBody(m_NewWarpWing, CollisionLayer.Trap, PixelCollider.PixelColliderGeneration.Manual, IsTrigger: true, UsesPixelsAsUnitSize: true, offset: new IntVector2(7, 12), dimensions: new IntVector2(38, 16)); ExpandWarpManager WarpWingDoor = m_NewWarpWing.AddComponent <ExpandWarpManager>(); WarpWingDoor.TargetRoom = m_TargetRoom; WarpWingDoor.IsOpenForTeleport = true; yield return(null); Destroy(this); yield break; }
private void OnBrokenInSadness() { string CustomText = "{wb}Never gonna give you up!{w}\r\nYou did give up a real rainbow chest this time though.\r\n{wb}-Apache Thunder{w}"; ExpandUtility.SpawnCustomBowlerNote(GameManager.Instance.RewardManager.BowlerNoteOtherSource, CachedSpawnLocation, ParentRoom, CustomText, true); return; }
private static IEnumerator WaitForFoyerLoad() { while (Foyer.DoIntroSequence && Foyer.DoMainMenu) { yield return(null); } if (!m_ListsCleared) { // This should fix issus with Pasts trying to spawn inactive versions of custom enemies // (and any other mod that has created a custom AIActor or object that has a HealthHaver component) // Moved to WaitForForyerLoad so this can clean up fakeprefabs from other mods regardless of mods.txt load order StaticReferenceManager.AllHealthHavers.Clear(); // Remove any custom instances that use BroController StaticReferenceManager.AllBros.Clear(); // Clear any fakeprefab AIActors from lists. StaticReferenceManager.AllEnemies.Clear(); m_ListsCleared = true; } if (ExpandSettings.EnableLanguageFix) { GameManager.Options.CurrentLanguage = ExpandUtility.IntToLanguage(ExpandSettings.GameLanguage); StringTableManager.CurrentLanguage = ExpandUtility.IntToLanguage(ExpandSettings.GameLanguage); } if (ExpandSettings.EnableTestDungeonFlow) { GameManager.Instance.InjectedFlowPath = ExpandSettings.TestFlow; GameManager.Instance.InjectedLevelName = ExpandSettings.TestFloor; } yield break; }
private void TakeItem(PlayerController player) { if (PickupObjectDatabase.GetById(ItemID) && (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite) != null && player.HasPassiveItem(ItemID)) { m_Interacted = true; } else { return; } GameObject m_SubSpriteObject = new GameObject("Item Display Object", new Type[] { typeof(tk2dSprite) }) { layer = 0 }; m_SubSpriteObject.transform.position = (transform.position + new Vector3(0.35f, 1.3f)); ExpandUtility.DuplicateSprite(m_SubSpriteObject.GetComponent <tk2dSprite>(), (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite)); if (m_ParentRoom != null) { m_SubSpriteObject.transform.parent = m_ParentRoom.hierarchyParent; } m_SubSpriteObject.GetComponent <tk2dSprite>().HeightOffGround = 3f; m_SubSpriteObject.GetComponent <tk2dSprite>().UpdateZDepth(); player.RemovePassiveItem(ItemID); if (m_TargetDoor && m_TargetDoor.GetComponent <tk2dSpriteAnimator>() && m_TargetDoor.GetComponent <SpeculativeRigidbody>()) { AkSoundEngine.PostEvent("Play_OBJ_plate_press_01", gameObject); StartCoroutine(DelayedDoorOpen(m_TargetDoor)); } SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false); }
public static void Init(AssetBundle expandSharedAssets1) { m_BlinkPassive = PickupObjectDatabase.GetById(436).GetComponent <BlinkPassiveItem>(); if (!m_BlinkPassive) { return; } EXRedScarfObject = expandSharedAssets1.LoadAsset <GameObject>("Bloodied Scarf"); EXRedScarfObject.AddComponent <ExpandRedScarf>(); EXRedScarfObject.AddComponent <tk2dSprite>(); ExpandUtility.DuplicateSprite(EXRedScarfObject.GetComponent <tk2dSprite>(), m_BlinkPassive.GetComponent <tk2dSprite>()); ExpandRedScarf redScarf = EXRedScarfObject.GetComponent <ExpandRedScarf>(); ItemBuilder.SetupItem(redScarf, "Blink Away", "Dodge roll is augmented with a blink\n\nThis simple scarf was once worn by a skilled assassin. Betrayed by his brothers and assumed dead...", "ex"); ItemBuilder.AddPassiveStatModifier(redScarf, PlayerStats.StatType.ReloadSpeed, 1.3f, StatModifier.ModifyMethod.MULTIPLICATIVE); // redScarf.PickupObjectId = m_BlinkPassive.PickupObjectId; redScarf.itemName = "Red Bandana"; redScarf.PickupObjectId = 436; redScarf.quality = m_BlinkPassive.quality; if (!ExpandSettings.EnableEXItems) { redScarf.quality = ItemQuality.EXCLUDED; } redScarf.additionalMagnificenceModifier = m_BlinkPassive.additionalMagnificenceModifier; redScarf.ItemSpansBaseQualityTiers = m_BlinkPassive.ItemSpansBaseQualityTiers; redScarf.ItemRespectsHeartMagnificence = m_BlinkPassive.ItemRespectsHeartMagnificence; redScarf.associatedItemChanceMods = m_BlinkPassive.associatedItemChanceMods; redScarf.contentSource = m_BlinkPassive.contentSource; redScarf.ShouldBeExcludedFromShops = m_BlinkPassive.ShouldBeExcludedFromShops; redScarf.CanBeDropped = m_BlinkPassive.CanBeDropped; redScarf.PreventStartingOwnerFromDropping = m_BlinkPassive.PreventStartingOwnerFromDropping; redScarf.PersistsOnDeath = m_BlinkPassive.PersistsOnDeath; redScarf.RespawnsIfPitfall = m_BlinkPassive.RespawnsIfPitfall; redScarf.PreventStartingOwnerFromDropping = m_BlinkPassive.PreventStartingOwnerFromDropping; redScarf.IgnoredByRat = m_BlinkPassive.IgnoredByRat; redScarf.SaveFlagToSetOnAcquisition = m_BlinkPassive.SaveFlagToSetOnAcquisition; redScarf.ForcedPositionInAmmonomicon = m_BlinkPassive.ForcedPositionInAmmonomicon; redScarf.UsesCustomCost = m_BlinkPassive.UsesCustomCost; redScarf.CustomCost = m_BlinkPassive.CustomCost; redScarf.PersistsOnPurchase = m_BlinkPassive.PersistsOnPurchase; redScarf.CanBeSold = m_BlinkPassive.CanBeSold; redScarf.passiveStatModifiers = m_BlinkPassive.passiveStatModifiers; redScarf.ArmorToGainOnInitialPickup = m_BlinkPassive.ArmorToGainOnInitialPickup; redScarf.minimapIcon = m_BlinkPassive.minimapIcon; redScarf.DodgeRollTimeMultiplier = m_BlinkPassive.DodgeRollTimeMultiplier; redScarf.DodgeRollDistanceMultiplier = m_BlinkPassive.DodgeRollDistanceMultiplier; redScarf.AdditionalInvulnerabilityFrames = m_BlinkPassive.AdditionalInvulnerabilityFrames; redScarf.ScarfPrefab = m_BlinkPassive.ScarfPrefab; redScarf.BlinkpoofVfx = m_BlinkPassive.BlinkpoofVfx; // Try to prevent original item from showing up. (can still be accessed via MTG console's give command however) if (ExpandSettings.EnableEXItems) { m_BlinkPassive.quality = ItemQuality.EXCLUDED; } }
public static tk2dSpriteCollectionData ENV_Tileset_Belly(GameObject TargetObject, Texture2D tileSetTexture, AssetBundle sharedAssets, AssetBundle expandSharedAssets1) { tk2dSpriteCollectionData m_NewDungeonCollection = TargetObject.AddComponent <tk2dSpriteCollectionData>(); Material m_LitCutout = new Material(sharedAssets.LoadAsset <Shader>("BraveLitTk2dCustomFalloffCutout")); m_LitCutout.mainTexture = tileSetTexture; m_LitCutout.SetFloat("_Cutoff", 0.5f); m_LitCutout.SetFloat("_MaxValue", 1); m_LitCutout.SetFloat("_Perpendicular", 1); Material m_LitBlend = new Material(sharedAssets.LoadAsset <Shader>("BraveLitTK2dCustomFalloff")); m_LitBlend.mainTexture = tileSetTexture; m_LitBlend.SetFloat("_Cutoff", 0.5f); m_LitBlend.SetFloat("_Perpendicular", 1); Material m_UnlitCutout = new Material(sharedAssets.LoadAsset <Shader>("BraveUnlitCutout")); m_UnlitCutout.mainTexture = tileSetTexture; m_UnlitCutout.SetFloat("_Cutoff", 0.5f); m_UnlitCutout.SetFloat("_Perpendicular", 1); JsonUtility.FromJsonOverwrite(ExpandUtility.DeserializeJSONDataFromAssetBundle(expandSharedAssets1, "TilesetData/Belly/ENV_Tileset_Belly"), m_NewDungeonCollection); string[] m_BellyMaterialTable = ExpandUtility.GetLinesFromAssetBundle(expandSharedAssets1, "ExpandSerializedData/TilesetData/Belly/ENV_Tileset_Belly_MaterialTable"); for (int i = 0; i < m_NewDungeonCollection.spriteDefinitions.Length; i++) { if (m_BellyMaterialTable[i].Contains("lit cutout")) { m_NewDungeonCollection.spriteDefinitions[i].material = m_LitCutout; } else if (m_BellyMaterialTable[i].Contains("lit blend")) { m_NewDungeonCollection.spriteDefinitions[i].material = m_LitBlend; } else if (m_BellyMaterialTable[i].Contains("unlit cutout")) { m_NewDungeonCollection.spriteDefinitions[i].material = m_UnlitCutout; } else { Debug.Log("[ExpandTheGungeon] ERROR: sprite id " + i + " did not have a matching material name in lookup table!"); m_NewDungeonCollection.spriteDefinitions[i].material = m_LitCutout; } } m_NewDungeonCollection.materials = new Material[] { m_LitCutout, m_LitBlend, m_UnlitCutout }; m_NewDungeonCollection.textures = new Texture[] { tileSetTexture }; sharedAssets = null; return(m_NewDungeonCollection); }
public void TeleportToRoom(PlayerController targetPlayer, RoomHandler targetRoom, bool isSecondaryPlayer = false, bool isCorruptedRoomCopy = false, Vector2?overridePosition = null) { m_IsTeleporting = true; bool m_NeedsNewPosition = false; Vector2 OldPosition = (targetPlayer.transform.position - targetPlayer.CurrentRoom.area.basePosition.ToVector3()); IntVector2 OldPositionIntVec2 = (targetPlayer.CenterPosition.ToIntVector2() - targetPlayer.CurrentRoom.area.basePosition); Vector2 NewPosition = (OldPosition + targetRoom.area.basePosition.ToVector2()); if (overridePosition.HasValue) { NewPosition = (overridePosition.Value + targetRoom.area.basePosition.ToVector2()); } else { if (isCorruptedRoomCopy && !GameManager.Instance.Dungeon.data.isPlainEmptyCell(OldPositionIntVec2.x + targetRoom.area.basePosition.x, OldPositionIntVec2.y + targetRoom.area.basePosition.y)) { m_NeedsNewPosition = true; } else if (!isCorruptedRoomCopy) { m_NeedsNewPosition = true; } if (m_NeedsNewPosition) { IntVector2?randomAvailableCell = ExpandUtility.GetRandomAvailableCellForPlayer(GameManager.Instance.Dungeon, targetRoom); if (randomAvailableCell.HasValue) { NewPosition = randomAvailableCell.Value.ToVector3(); } else { randomAvailableCell = ExpandUtility.GetRandomAvailableCellSmart(targetRoom, new IntVector2(2, 3)); } if (!randomAvailableCell.HasValue) { m_IsTeleporting = false; return; } } } if (GameManager.Instance.CurrentGameType == GameManager.GameType.COOP_2_PLAYER && !isSecondaryPlayer) { PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(targetPlayer); if (otherPlayer) { TeleportToRoom(otherPlayer, targetRoom, true, true); } } targetPlayer.DoVibration(Vibration.Time.Normal, Vibration.Strength.Medium); GameManager.Instance.StartCoroutine(HandleTeleportToRoom(targetPlayer, NewPosition)); targetPlayer.specRigidbody.Velocity = Vector2.zero; targetPlayer.knockbackDoer.TriggerTemporaryKnockbackInvulnerability(1f); targetRoom.EnsureUpstreamLocksUnlocked(); }
private IEnumerator SpwanEnemyAirDrop(float delay = 0.4f) { Vector3 RoomOffset = m_room.area.basePosition.ToVector3(); string EnemyGUID1 = "88b6b6a93d4b4234a67844ef4728382c"; // bandana_bullet_kin string EnemyGUID2 = "4d37ce3d666b4ddda8039929225b7ede"; // grenade_kin string EnemyGUID3 = "01972dee89fc4404a5c408d50007dad5"; // bullet_kin string EnemyGUID4 = "128db2f0781141bcb505d8f00f9e4d47"; // red_shotgun_kin if (UnityEngine.Random.value <= 0.5f) { EnemyGUID1 = ExpandCustomEnemyDatabase.BootlegBulletManBandanaGUID; } if (UnityEngine.Random.value <= 0.1f) { EnemyGUID2 = ExpandCustomEnemyDatabase.BootlegShotgunManBlueGUID; } if (UnityEngine.Random.value <= 0.5f) { EnemyGUID3 = ExpandCustomEnemyDatabase.BootlegBulletManGUID; } if (UnityEngine.Random.value <= 0.5f) { EnemyGUID4 = ExpandCustomEnemyDatabase.BootlegShotgunManRedGUID; } yield return(new WaitForSeconds(delay)); GameObject eCrateInstance1 = ExpandUtility.SpawnAirDrop(m_room, (RoomOffset + new Vector3(4, 3, 0)), null, ExpandUtility.GenerateDungeonPlacable(null, true, EnemyGUID: EnemyGUID1)); GameObject eCrateInstance2 = ExpandUtility.SpawnAirDrop(m_room, (RoomOffset + new Vector3(4, 9, 0)), null, ExpandUtility.GenerateDungeonPlacable(null, true, EnemyGUID: EnemyGUID2), 0.2f); GameObject eCrateInstance3 = ExpandUtility.SpawnAirDrop(m_room, (RoomOffset + new Vector3(13, 3, 0)), null, ExpandUtility.GenerateDungeonPlacable(null, true, EnemyGUID: EnemyGUID3)); GameObject eCrateInstance4 = ExpandUtility.SpawnAirDrop(m_room, (RoomOffset + new Vector3(13, 9, 0)), null, ExpandUtility.GenerateDungeonPlacable(null, true, EnemyGUID: EnemyGUID4), 0.2f); /*List<GameObject> eCrateList = new List<GameObject>(); * * if (eCrateInstance1) { eCrateList.Add(eCrateInstance1); } * if (eCrateInstance2) { eCrateList.Add(eCrateInstance1); } * if (eCrateInstance3) { eCrateList.Add(eCrateInstance1); } * if (eCrateInstance4) { eCrateList.Add(eCrateInstance1); } * * GameObject SelectedCrate = null; * * if (eCrateList.Count > 0) { SelectedCrate = BraveUtility.RandomElement(eCrateList); } * * if (SelectedCrate && SelectedCrate.GetComponent<EmergencyCrateController>()) { * yield return new WaitForSeconds(2.25f); * while (ReflectionHelpers.ReflectGetField<bool?>(typeof(EmergencyCrateController), "m_hasBeenTriggered", SelectedCrate.GetComponent<EmergencyCrateController>()).HasValue && ReflectionHelpers.ReflectGetField<bool?>(typeof(EmergencyCrateController), "m_hasBeenTriggered", SelectedCrate.GetComponent<EmergencyCrateController>()).Value) { * if (!SelectedCrate | !SelectedCrate.GetComponent<EmergencyCrateController>()) { break; } * yield return null; * } * yield return new WaitForSeconds(1f); * m_room.npcSealState = RoomHandler.NPCSealState.SealNone; * }*/ yield break; }
private void HandleBuildFakeWall() { Vector3 SecretKeyPosition = (new Vector3(14, 21) + m_ParentRoom.area.basePosition.ToVector3()); GameObject SecretKeyPedestal = Instantiate(ExpandPrefabs.RatKeyRewardPedestal, SecretKeyPosition, Quaternion.identity); SecretKeyPedestal.transform.SetParent(m_ParentRoom.hierarchyParent, true); IntVector2 wallPosition = new IntVector2(14, 20); SecretKeyPedestal.transform.localScale -= new Vector3(0.7f, 0.7f); ExpandUtility.GenerateFakeWall(DungeonData.Direction.SOUTH, new IntVector2(14, 20), m_ParentRoom, markAsSecret: true); }
public static tk2dSpriteCollectionData ENV_Tileset_West(GameObject TargetObject, Texture2D tileSetTexture, AssetBundle sharedAssets, AssetBundle expandSharedAssets1) { tk2dSpriteCollectionData m_NewDungeonCollection = TargetObject.AddComponent <tk2dSpriteCollectionData>(); JsonUtility.FromJsonOverwrite(ExpandUtility.DeserializeJSONDataFromAssetBundle(expandSharedAssets1, "TilesetData/West/ENV_Tileset_West"), m_NewDungeonCollection); Material m_LitCutout = new Material(sharedAssets.LoadAsset <Material>("lit cutout")); m_LitCutout.mainTexture = tileSetTexture; Material m_LitBlend = new Material(sharedAssets.LoadAsset <Material>("lit blend")); m_LitBlend.mainTexture = tileSetTexture; Material m_UnlitTransparent = new Material(sharedAssets.LoadAsset <Material>("unlit transparent")); m_UnlitTransparent.mainTexture = tileSetTexture; string[] m_WestMaterialTable = ExpandUtility.GetLinesFromAssetBundle(expandSharedAssets1, "ExpandSerializedData/TilesetData/West/ENV_Tileset_West_MaterialTable"); for (int i = 0; i < m_NewDungeonCollection.spriteDefinitions.Length; i++) { if (m_WestMaterialTable[i].Contains("lit cutout")) { m_NewDungeonCollection.spriteDefinitions[i].material = m_LitCutout; } else if (m_WestMaterialTable[i].Contains("lit blend")) { m_NewDungeonCollection.spriteDefinitions[i].material = m_LitBlend; } else if (m_WestMaterialTable[i].Contains("unlit transparent")) { m_NewDungeonCollection.spriteDefinitions[i].material = m_UnlitTransparent; } else { Debug.Log("[ExpandTheGungeon] ERROR: sprite id " + i + " did not have a matching material name in lookup table!"); m_NewDungeonCollection.spriteDefinitions[i].material = m_LitCutout; } } m_NewDungeonCollection.materials = new Material[] { m_LitCutout, m_LitBlend, m_UnlitTransparent }; m_NewDungeonCollection.textures = new Texture[] { tileSetTexture }; sharedAssets = null; return(m_NewDungeonCollection); }
public static void Init(AssetBundle expandSharedAssets1) { TableTechAssassinHook.TableExplosionData = ExpandUtility.GenerateExplosionData(damage: 60); TableTechAssasinObject = expandSharedAssets1.LoadAsset <GameObject>("Table Tech Assassin"); TableTechAssassin tableTechAssassin = TableTechAssasinObject.AddComponent <TableTechAssassin>(); ItemBuilder.AddSpriteToObject(TableTechAssasinObject, expandSharedAssets1.LoadAsset <Texture2D>("tabletech_assassin"), false, false); string shortDesc = "Betray the Flipper"; string longDesc = "A forbidden technique thought lost was recoverd in the Gungeon.\n\nAll that was written was this: \n\n 'Do upon the flipper that which the flipper had done to you'"; ItemBuilder.SetupItem(tableTechAssassin, shortDesc, longDesc, "ex"); tableTechAssassin.quality = ItemQuality.D; }
public static PrototypeDungeonRoom BuildFromAssetBundle(AssetBundle[] Bundles, string assetPath, bool setRoomCategory = false, bool autoAssignToFloor = false, bool assignDecorationSettings = false) { TextAsset m_Asset = ExpandAssets.LoadAsset <TextAsset>(assetPath); if (m_Asset) { Texture2D texture = ExpandUtility.BytesToTexture(m_Asset.bytes, m_Asset.name); RoomData roomData = ExtractRoomDataFromTextAssetBytes(m_Asset); return(Build(Bundles, texture, roomData, setRoomCategory, autoAssignToFloor, assignDecorationSettings, roomData.weight)); } else { ETGModConsole.Log("[ExpandTheGungeon] ERROR: RoomFactory asset: " + assetPath + " was not found!"); return(null); } }
private void OnBrokenInSadness() { Chest chest = gameObject.GetComponent <Chest>(); bool chestWasOpened = false; if (chest) { chestWasOpened = chest.pickedUp; } if (!chestWasOpened) { string CustomText = "{wb}Never gonna give you up!{w}\r\nYou did give up a real rainbow chest this time though.\r\n{wb}-Apache Thunder{w}"; ExpandUtility.SpawnCustomBowlerNote(GameManager.Instance.RewardManager.BowlerNoteOtherSource, CachedSpawnLocation, ParentRoom, CustomText, true); } return; }
public void Interact(PlayerController player) { if (IsValidForUse()) { if (IsSecretGlitchFloorPit) { ExpandUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat"); ExpandUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE; ExpandPrefabs.InitCanyonTileSet(ExpandUtility.RatDungeon, GlobalDungeonData.ValidTilesets.PHOBOSGEON); GameManager.Instance.StartCoroutine(ExpandUtility.DelayedGlitchLevelLoad(1f, "SecretGlitchFloor_Flow", true)); } else { GameManager.Instance.LoadCustomLevel(targetLevelName); } } }
private void CompanionOnDamaged(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection) { m_healthRemaining = resultValue; m_maxHealthRemaining = maxValue; if (m_canSpawnRings && RingDropChance > UnityEngine.Random.value) { if (m_extantCompanion) { m_extantCompanion.GetComponent <AIActor>().behaviorSpeculator.Stun(1); m_extantCompanion.GetComponent <AIAnimator>().PlayUntilFinished(HitAnimation); int RingCount = UnityEngine.Random.Range(3, 10); ExpandUtility.SpawnCustomCurrency(m_extantCompanion.GetComponent <SpeculativeRigidbody>().GetUnitCenter(ColliderType.HitBox), RingCount, SonicRing.RingID); AkSoundEngine.PostEvent("Play_EX_SonicLoseRings_01", m_extantCompanion); } } m_canSpawnRings = false; }
private void ExpandToggleLanguageFix(string[] consoleText) { if (ExpandSettings.EnableLanguageFix) { ExpandSettings.EnableLanguageFix = false; GameManager.Options.CurrentLanguage = StringTableManager.GungeonSupportedLanguages.ENGLISH; StringTableManager.CurrentLanguage = StringTableManager.GungeonSupportedLanguages.ENGLISH; ETGModConsole.Log("[ExpandTheGungeon] Language override disabled!"); ETGModConsole.Log("[ExpandTheGungeon] Game Language set back to English!\n\nSet game language back to your desired language before re-enabling this feature!"); } else { ExpandSettings.EnableLanguageFix = true; ETGModConsole.Log("[ExpandTheGungeon] Language override enabled!"); } ExpandSettings.GameLanguage = ExpandUtility.LanguageToInt(GameManager.Options.CurrentLanguage); ExpandExportSettings(consoleText); }
private Texture2D PortalTextureRender() { m_ScreenCapInProgress = true; Texture2D m_Texture = null; if (Pixelator.Instance.slavedCameras != null && Pixelator.Instance.slavedCameras.Count > 0) { m_Texture = ExpandUtility.GenerateTexture2DFromRenderTexture(Pixelator.Instance.slavedCameras[0].activeTexture); } if (m_Texture) { m_ScreenCapInProgress = false; return(m_Texture); } else { m_ScreenCapInProgress = false; return(ExpandAssets.LoadAsset <Texture2D>("EX_GlitchPortalDefaultTexture")); } }
public static void Init(AssetBundle expandSharedAssets1) { TableTechAssassinHook.TableExplosionData = ExpandUtility.GenerateExplosionData(damage: 60); TableTechAssasinObject = expandSharedAssets1.LoadAsset <GameObject>("Table Tech Assassin"); SpriteSerializer.AddSpriteToObject(TableTechAssasinObject, ExpandPrefabs.EXItemCollection, "tabletech_assassin"); TableTechAssassin tableTechAssassin = TableTechAssasinObject.AddComponent <TableTechAssassin>(); string shortDesc = "Betray the Flipper"; string longDesc = "A forbidden technique thought lost was recovered in the Gungeon.\n\nAll that was written was this: \n\n 'Do upon the flipper that which the flipper had done to you'"; ItemBuilder.SetupItem(tableTechAssassin, shortDesc, longDesc, "ex"); tableTechAssassin.quality = ItemQuality.D; if (!ExpandSettings.EnableEXItems) { tableTechAssassin.quality = ItemQuality.EXCLUDED; } TableTechAssasinID = tableTechAssassin.PickupObjectId; }
private void HandleHideKeyOnTable() { ExpandObjectDatabase objectDatabase = new ExpandObjectDatabase(); IntVector2 GlitchedTable1Position = new IntVector2(9, 10); IntVector2 GlitchedTable2Position = new IntVector2(9, 8); GameObject GlitchedVerticalTable1 = ExpandUtility.GenerateDungeonPlacable(objectDatabase.TableVertical, false, true).InstantiateObject(m_ParentRoom, GlitchedTable1Position); GameObject GlitchedVerticalTable2 = ExpandUtility.GenerateDungeonPlacable(objectDatabase.TableVertical, false, true).InstantiateObject(m_ParentRoom, GlitchedTable2Position); GlitchedVerticalTable1.transform.SetParent(m_ParentRoom.hierarchyParent, true); GlitchedVerticalTable2.transform.SetParent(m_ParentRoom.hierarchyParent, true); GlitchedVerticalTable1.AddComponent <ExpandKickableObject>(); GlitchedVerticalTable2.AddComponent <ExpandKickableObject>(); float RandomIntervalFloat = UnityEngine.Random.Range(0.02f, 0.06f); float RandomDispFloat = UnityEngine.Random.Range(0.1f, 0.16f); float RandomDispIntensityFloat = UnityEngine.Random.Range(0.1f, 0.2f); float RandomColorProbFloat = UnityEngine.Random.Range(0.05f, 0.2f); float RandomColorIntensityFloat = UnityEngine.Random.Range(0.1f, 0.22f); if (BraveUtility.RandomBool()) { ExpandKickableObject GlitchedTable1Component = GlitchedVerticalTable1.GetComponent <ExpandKickableObject>(); GlitchedTable1Component.SpawnedObject = PickupObjectDatabase.GetById(727).gameObject; GlitchedTable1Component.willDefinitelyExplode = true; GlitchedTable1Component.spawnObjectOnSelfDestruct = true; ExpandShaders.Instance.ApplyGlitchShader(GlitchedTable1Component.GetComponentInChildren <tk2dBaseSprite>(), true, RandomIntervalFloat, RandomDispFloat, RandomDispIntensityFloat, RandomColorProbFloat, RandomColorIntensityFloat); } else { ExpandKickableObject GlitchedTable1Component = GlitchedVerticalTable2.GetComponent <ExpandKickableObject>(); GlitchedTable1Component.SpawnedObject = PickupObjectDatabase.GetById(727).gameObject; GlitchedTable1Component.willDefinitelyExplode = true; GlitchedTable1Component.spawnObjectOnSelfDestruct = true; ExpandShaders.Instance.ApplyGlitchShader(GlitchedTable1Component.GetComponentInChildren <tk2dBaseSprite>(), true, RandomIntervalFloat, RandomDispFloat, RandomDispIntensityFloat, RandomColorProbFloat, RandomColorIntensityFloat); } m_ParentRoom.RegisterInteractable(GlitchedVerticalTable1.GetComponentInChildren <FlippableCover>()); m_ParentRoom.RegisterInteractable(GlitchedVerticalTable2.GetComponentInChildren <FlippableCover>()); m_ParentRoom.RegisterInteractable(GlitchedVerticalTable1.GetComponent <ExpandKickableObject>()); m_ParentRoom.RegisterInteractable(GlitchedVerticalTable2.GetComponent <ExpandKickableObject>()); }
private void OnFireStarted() { IntVector2 baseCellPosition = (transform.position.IntXY(VectorConversions.Floor) + new IntVector2(4, 2)); for (int X = -1; X < 2; X++) { for (int Y = -1; Y < 2; Y++) { IntVector2 PositionOffset = baseCellPosition + new IntVector2(X, Y); CellData cellData = GameManager.Instance.Dungeon.data[PositionOffset]; if (cellData != null) { cellData.OnCellGooped = (Action <CellData>)Delegate.Remove(cellData.OnCellGooped, new Action <CellData>(HandleGooped)); } } } specRigidbody.OnRigidbodyCollision = (SpeculativeRigidbody.OnRigidbodyCollisionDelegate)Delegate.Remove(specRigidbody.OnRigidbodyCollision, new SpeculativeRigidbody.OnRigidbodyCollisionDelegate(HandleCollision)); // specRigidbody.OnHitByBeam = (Action<BasicBeamController>)Delegate.Remove(specRigidbody.OnHitByBeam, new Action<BasicBeamController>(HandleBeamCollision)); GameObject PitManager = new GameObject("Jungle Pit Manager") { layer = 0 }; PitManager.transform.position = (transform.position + new Vector3(5, 2)); tk2dSprite PitDummySprite = PitManager.AddComponent <tk2dSprite>(); ExpandUtility.DuplicateSprite(PitDummySprite, ExpandSecretDoorPrefabs.EXSecretDoorMinimapIcon.GetComponent <tk2dSprite>()); tk2dSprite pitSprite = PitManager.GetComponent <tk2dSprite>(); pitSprite.renderer.enabled = false; ExpandUtility.GenerateOrAddToRigidBody(PitManager, CollisionLayer.Trap, PixelCollider.PixelColliderGeneration.Manual, IsTrigger: true, dimensions: new IntVector2(2, 2)); JungleTreePitController junglePitManager = PitManager.AddComponent <JungleTreePitController>(); junglePitManager.targetLevelName = targetLevelName; StartCoroutine(HandleDelayedFireDamage()); }
public void ConfigureOnPlacement(RoomHandler room) { m_ParentRoom = room; m_EntranceTriggerObject = new GameObject("BellyMonsterAwakenTrigger") { layer = 0 }; m_EntranceTriggerObject.transform.position = transform.position - new Vector3(14, 0); // m_EntranceTriggerObject.transform.parent = m_ParentRoom.hierarchyParent; ExpandUtility.GenerateOrAddToRigidBody(m_EntranceTriggerObject, CollisionLayer.Trap, PixelCollider.PixelColliderGeneration.Manual, IsTrigger: true, UsesPixelsAsUnitSize: true, offset: new IntVector2(0, -2), dimensions: new IntVector2(256, (m_ParentRoom.area.dimensions.y + 4 * 16))); ExpandBellyMonsterTriggerHandler EntranceTrigger = m_EntranceTriggerObject.AddComponent <ExpandBellyMonsterTriggerHandler>(); EntranceTrigger.ParentRoom = m_ParentRoom; EntranceTrigger.MonsterController = this; if (EntranceTrigger.specRigidbody) { EntranceTrigger.specRigidbody.OnTriggerCollision = (SpeculativeRigidbody.OnTriggerDelegate)Delegate.Combine(EntranceTrigger.specRigidbody.OnTriggerCollision, new SpeculativeRigidbody.OnTriggerDelegate(EntranceTrigger.HandleTriggerCollision)); } }
public ExpandKickableObject() { rollSpeed = 6f; rollAnimations = null; goopFrequency = 0.05f; goopRadius = 1f; breakTimerLength = 3f; RollingDestroysSafely = false; triggersBreakTimer = false; AllowTopWallTraversal = true; explodesOnKick = true; willDefinitelyExplode = false; spawnObjectOnSelfDestruct = false; useDefaultExplosion = false; hasRollingAnimations = false; RollingBreakAnim = "red_barrel_break"; m_lastOutlineDirection = (DungeonData.Direction)(-1); m_objectSpawned = false; TableExplosionData = ExpandUtility.GenerateExplosionData(); m_WasKicked = false; }
private IEnumerator SpwanEnemyAirDrop(float delay = 0.05f) { Vector3 RoomOffset = m_room.area.basePosition.ToVector3(); string EnemyGUID1 = "88b6b6a93d4b4234a67844ef4728382c"; // bandana_bullet_kin string EnemyGUID2 = "4d37ce3d666b4ddda8039929225b7ede"; // grenade_kin string EnemyGUID3 = "01972dee89fc4404a5c408d50007dad5"; // bullet_kin string EnemyGUID4 = "128db2f0781141bcb505d8f00f9e4d47"; // red_shotgun_kin if (UnityEngine.Random.value <= 0.5f) { EnemyGUID1 = ExpandCustomEnemyDatabase.BootlegBulletManBandanaGUID; } if (UnityEngine.Random.value <= 0.1f) { EnemyGUID2 = ExpandCustomEnemyDatabase.BootlegShotgunManBlueGUID; } if (UnityEngine.Random.value <= 0.5f) { EnemyGUID3 = ExpandCustomEnemyDatabase.BootlegBulletManGUID; } if (UnityEngine.Random.value <= 0.5f) { EnemyGUID4 = ExpandCustomEnemyDatabase.BootlegShotgunManRedGUID; } ExpandUtility.SpawnParaDrop(m_room, (RoomOffset + new Vector3(4, 3, 0)), null, EnemyGUID1); ExpandUtility.SpawnParaDrop(m_room, (RoomOffset + new Vector3(4, 9, 0)), null, EnemyGUID2); ExpandUtility.SpawnParaDrop(m_room, (RoomOffset + new Vector3(13, 3, 0)), null, EnemyGUID3); ExpandUtility.SpawnParaDrop(m_room, (RoomOffset + new Vector3(13, 9, 0)), null, EnemyGUID4); yield return(new WaitForSeconds(delay)); if (!m_room.IsSealed) { m_room.SealRoom(); } yield break; }
public void ConfigureOnPlacement(RoomHandler room) { m_ParentRoom = room; if (PickupObjectDatabase.GetById(ItemID) && (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite) != null) { m_SubSpriteObject = new GameObject("Item Display Object", new Type[] { typeof(tk2dSprite) }) { layer = 0 }; m_SubSpriteObject.transform.position = (transform.position + new Vector3(0.95f, 1)); m_ItemSprite = m_SubSpriteObject.GetComponent <tk2dSprite>(); ExpandUtility.DuplicateSprite(m_ItemSprite, (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite)); if (m_ParentRoom != null) { m_SubSpriteObject.transform.parent = m_ParentRoom.hierarchyParent; } if (AddOutline) { SpriteOutlineManager.AddOutlineToSprite(m_ItemSprite, BaseOutlineColor, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); } } sprite.HeightOffGround = -2; if (m_ItemSprite) { sprite.AttachRenderer(m_ItemSprite); if (AddOutline) { SpriteOutlineManager.AddOutlineToSprite(m_ItemSprite, BaseOutlineColor, 0.1f, 0f, SpriteOutlineManager.OutlineType.NORMAL); } m_ItemSprite.HeightOffGround = 0.5f; m_ItemSprite.depthUsesTrimmedBounds = true; m_ItemSprite.UpdateZDepth(); } sprite.UpdateZDepth(); }
public static void Init(AssetBundle expandSharedAssets1) { SonicBoxObject = expandSharedAssets1.LoadAsset <GameObject>("EXSonicBox"); SpriteSerializer.AddSpriteToObject(SonicBoxObject, ExpandPrefabs.EXItemCollection, "SonicBox_Idle_02"); ExpandUtility.GenerateSpriteAnimator(SonicBoxObject, playAutomatically: true); ExpandUtility.AddAnimation(SonicBoxObject.GetComponent <tk2dSpriteAnimator>(), ExpandPrefabs.EXItemCollection.GetComponent <tk2dSpriteCollectionData>(), m_IdleFrames, "Idle", tk2dSpriteAnimationClip.WrapMode.Loop, 16); SonicBox sonicBoxItem = SonicBoxObject.AddComponent <SonicBox>(); string name = "Sonic Box"; string shortDesc = "Gotta Go Fast!"; string longDesc = "Sonic the Hedgehog has found his way to the Gungeon and loves to spin dash into the Gundead!"; ItemBuilder.SetupEXItem(sonicBoxItem, name, shortDesc, longDesc); sonicBoxItem.quality = ItemQuality.A; if (!ExpandSettings.EnableEXItems) { sonicBoxItem.quality = ItemQuality.EXCLUDED; } ; }
public static void Init(AssetBundle expandSharedAssets1) { CorruptedJunkObject = expandSharedAssets1.LoadAsset <GameObject>("Corrupted Junk"); CorruptedJunk poopSack = CorruptedJunkObject.AddComponent <CorruptedJunk>(); ItemBuilder.AddSpriteToObject(CorruptedJunkObject, expandSharedAssets1.LoadAsset <Texture2D>("corrupted_poopsack_09"), false, false); string shortDesc = "Next Time... What even is this!?"; string longDesc = "Just some corrupted junk.\n\nCarrying this around makes you question your sanity..."; ItemBuilder.SetupItem(poopSack, shortDesc, longDesc, "ex"); poopSack.quality = ItemQuality.A; poopSack.CanBeDropped = false; m_SpriteNames = new List <string> { "corrupted_poopsack_01", "corrupted_poopsack_02", "corrupted_poopsack_03", "corrupted_poopsack_04", "corrupted_poopsack_05", "corrupted_poopsack_06", "corrupted_poopsack_07", "corrupted_poopsack_08", "corrupted_poopsack_09", "corrupted_poopsack_10" }; foreach (string spritePath in m_SpriteNames) { if (spritePath != "corrupted_poopsack_09") { SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>(spritePath), CorruptedJunkObject.GetComponent <tk2dSprite>().Collection); } } ExpandUtility.GenerateSpriteAnimator(CorruptedJunkObject, playAutomatically: true); ExpandUtility.AddAnimation(CorruptedJunkObject.GetComponent <tk2dSpriteAnimator>(), CorruptedJunkObject.GetComponent <tk2dSprite>().Collection, m_SpriteNames, "idle", tk2dSpriteAnimationClip.WrapMode.RandomLoop, 20); }
public static void Init(AssetBundle expandSharedAssets1) { RockslideObject = expandSharedAssets1.LoadAsset <GameObject>("Rock Slide"); ItemBuilder.AddSpriteToObject(RockslideObject, expandSharedAssets1.LoadAsset <Texture2D>("rockslide"), false, false); RockSlide rockslide = RockslideObject.AddComponent <RockSlide>(); string shortDesc = "Crushing Defeat"; string longDesc = "Falling rocks are a well known threat to everyone, especially within the Gungeon.\n\nIt does not help that a long gone Gungeoneer accidentally popularized the idea of using falling debris as a weapon among the Gundead.\n\nHowever, they quickly grew tired of it, seeming too easy or effortless to eliminate Gungeoneers compared to the exhilarating experience of the combat they were forged for."; ItemBuilder.SetupItem(rockslide, shortDesc, longDesc, "ex"); ItemBuilder.SetCooldownType(rockslide, ItemBuilder.CooldownType.Damage, 275f); rockslide.quality = ItemQuality.B; List <string> spritePaths = new List <string>() { "plunger_fire_001", "plunger_fire_002", "plunger_fire_003", "plunger_fire_004", "plunger_fire_005", "plunger_fire_006" }; tk2dSprite rockslidesprite = RockslideObject.GetComponent <tk2dSprite>(); foreach (string sprite in spritePaths) { SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>(sprite), rockslidesprite.Collection); } ExpandUtility.GenerateSpriteAnimator(RockslideObject); tk2dSpriteAnimator rockslideAnimator = RockslideObject.GetComponent <tk2dSpriteAnimator>(); ExpandUtility.AddAnimation(rockslideAnimator, rockslidesprite.Collection, spritePaths, "Activate", frameRate: 8); RockSlidePickupID = rockslide.PickupObjectId; }