Ejemplo n.º 1
0
 public void AIActorMods(AIActor target)
 {
     if (target && target.aiActor && target.aiActor.EnemyGuid != null)
     {
         string enemyGuid = target?.aiActor?.EnemyGuid;
         if (!string.IsNullOrEmpty(enemyGuid))
         {
             try
             {
                 //ETGModConsole.Log("This enemy's Guid is: " + enemyGuid);
                 if (explosiveKin.Contains(enemyGuid))
                 {
                     target.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null);
                     target.gameObject.AddComponent <KillOnRoomClear>();
                     target.IsHarmlessEnemy    = true;
                     target.IgnoreForRoomClear = true;
                     if (target.gameObject.GetComponent <SpawnEnemyOnDeath>())
                     {
                         Destroy(target.gameObject.GetComponent <SpawnEnemyOnDeath>());
                     }
                     return;
                 }
                 else if (Owner.HasPickupID(Gungeon.Game.Items["nn:shutdown_shells"].PickupObjectId))
                 {
                     if (shotgunEnemies.Contains(enemyGuid))
                     {
                         target.ApplyEffect(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultPermanentCharmEffect, 1f, null);
                         target.gameObject.AddComponent <KillOnRoomClear>();
                         target.IsHarmlessEnemy    = true;
                         target.IgnoreForRoomClear = true;
                         if (target.gameObject.GetComponent <SpawnEnemyOnDeath>())
                         {
                             Destroy(target.gameObject.GetComponent <SpawnEnemyOnDeath>());
                         }
                         return;
                     }
                 }
             }
             catch (Exception e)
             {
                 ETGModConsole.Log(e.Message);
             }
         }
     }
 }
Ejemplo n.º 2
0
        public void Help(string[] args)
        {
            List <string> toLog = new List <string>();

            toLog.Add("Modded Magnet Mod help:");
            toLog.Add("     Commands:");
            toLog.Add("          <color=#ff0000>* modded_magnet help</color> - shows the help you see right now.");
            toLog.Add("          <color=#ff0000>* modded_magnet modgunweight [weight]</color> - changes Modded Gun Magnet's modded gun weight multiplier. If <color=#ff0000>weight</color> argument isn't given, then it will show the current " +
                      "modded gun weight multiplier");
            toLog.Add("          <color=#ff0000>* modded_magnet moditemweight [weight]</color> - changes Modded Item Magnet's modded item weight multiplier. If <color=#ff0000>weight</color> argument isn't given, then it will show the current " +
                      "modded item weight multiplier");
            toLog.Add("     Items:");
            toLog.Add("          <color=#00ffff>* Modded Item Magnet</color> - when picked up, it will increase the weight of modded items by the current modded item weight multiplier. Modded item weight multiplier can be changed using the " +
                      "<color=#ff0000>modded_magnet moditemweight</color>. Give command: <color=#ff0000>give spapi:modded_item_magnet</color>");
            toLog.Add("          <color=#00ffff>* Modded Gun Magnet</color> - when picked up, it will increase the weight of modded guns by the current modded gun weight multiplier. Modded gun weight multiplier can be changed using the " +
                      "<color=#ff0000>modded_magnet modgunweight</color>. Give command: <color=#ff0000>give spapi:modded_gun_magnet</color>");
            ETGModConsole.Log(string.Join("\n", toLog.ToArray()));
        }
        // Token: 0x06000518 RID: 1304 RVA: 0x000301F4 File Offset: 0x0002E3F4
        public override void Init()
        {
            ETGModConsole.Commands.AddGroup("rage_quit", delegate(string[] args)
            {
                ETGModConsole.Log("Goodbye :) ", false);
                Application.Quit();
            });

            ETGModConsole.Commands.AddGroup("zoomout", delegate(string[] args)
            {
                GameManager.Instance.MainCameraController.OverrideZoomScale *= 0.66f;
            });

            ETGModConsole.Commands.AddGroup("zoomin", delegate(string[] args)
            {
                GameManager.Instance.MainCameraController.OverrideZoomScale /= 0.66f;
            });
        }
Ejemplo n.º 4
0
 public override void Start()
 {
     try
     {
         ETGModConsole.Log("ButcherMod enabled.");
         ETGModConsole.Commands.AddGroup("butcher", this.Butcher);
         ETGModConsole.Commands.GetGroup("butcher").AddGroup("erase", this.ButcherErase);
         ETGModConsole.Commands.GetGroup("butcher").GetGroup("erase").AddUnit("rewards", this.ButcherEraseRewards);
         ETGModConsole.Commands.GetGroup("butcher").AddUnit("damage", this.ButcherDamage);
     }
     catch (Exception ex)
     {
         if (ex != null)
         {
             ETGModConsole.Log(ex.Message);
         }
     }
 }
        private void OnHitEnemy(Projectile proj, SpeculativeRigidbody enemy, bool fatal)
        {
            float chance = 0.1f * chanceScalar;

            ETGModConsole.Log("" + chance);
            if (UnityEngine.Random.value <= chance)
            {
                for (int i = 0; i < 3; i++)
                {
                    this.FireRocket(enemy.aiActor);
                }

                if (this.m_spawnedRockets > 0 && (BossKillCam.BossDeathCamRunning || GameManager.Instance.PreventPausing))
                {
                    this.Cleanup();
                }
            }
        }
Ejemplo n.º 6
0
        public static void Print <T>(T obj, string color = "FFFFFF", bool force = false)
        {
            bool flag = verbose || force;

            if (flag)
            {
                ETGModConsole.Log(string.Concat(new string[] {
                    "<color=#",
                    color,
                    ">",
                    modID,
                    ": ",
                    obj.ToString(),
                    "</color>"
                }), false);
            }
            Log(obj.ToString());
        }
Ejemplo n.º 7
0
		// Token: 0x06000039 RID: 57 RVA: 0x00004470 File Offset: 0x00002670
		public static string[] GetResourceNames()
		{
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			string[] manifestResourceNames = callingAssembly.GetManifestResourceNames();
			bool flag = manifestResourceNames == null;
			bool flag2 = flag;
			string[] result;
			if (flag2)
			{
				ETGModConsole.Log("No manifest resources found.", false);
				result = null;
			}
			else
			{
				result = manifestResourceNames;
			}
			return result;
		}
Ejemplo n.º 8
0
 private void PostProcessSpawnedEnemyProjectiles(Projectile proj)
 {
     if (TintBullets)
     {
         proj.AdjustPlayerProjectileTint(this.TintColor, 1);
     }
     if (enemy != null)
     {
         if (enemy.aiActor != null)
         {
             proj.baseData.damage = baseBulletDamage;
             if (enemyOwner != null)
             {
                 //ETGModConsole.Log("Companionise: enemyOwner is not null");
                 if (scaleDamage)
                 {
                     proj.baseData.damage *= enemyOwner.stats.GetStatValue(PlayerStats.StatType.Damage);
                 }
                 if (scaleSize)
                 {
                     proj.RuntimeUpdateScale(enemyOwner.stats.GetStatValue(PlayerStats.StatType.PlayerBulletScale));
                 }
                 if (scaleSpeed)
                 {
                     proj.baseData.speed *= enemyOwner.stats.GetStatValue(PlayerStats.StatType.ProjectileSpeed);
                     proj.UpdateSpeed();
                 }
                 //ETGModConsole.Log("Damage: " + proj.baseData.damage);
                 if (doPostProcess)
                 {
                     enemyOwner.DoPostProcessProjectile(proj);
                 }
             }
             if (enemy.aiActor.IsBlackPhantom)
             {
                 proj.baseData.damage = baseBulletDamage * jammedDamageMultiplier;
             }
         }
     }
     else
     {
         ETGModConsole.Log("Shooter is NULL");
     }
 }
Ejemplo n.º 9
0
 public static void Init()
 {
     try
     {
         List <OverrideBehavior> obs = new List <OverrideBehavior>();
         foreach (Type type in
                  Assembly.GetAssembly(typeof(OverrideBehavior)).GetTypes()
                  .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(OverrideBehavior))))
         {
             obs.Add((OverrideBehavior)Activator.CreateInstance(type));
         }
         overrideBehaviors = new ReadOnlyCollection <OverrideBehavior>(obs);
         hasInit           = true;
     }
     catch (Exception e)
     {
         ETGModConsole.Log("Failed to init EnemyAPI! Please contact spcreat!\n\n" + e);
     }
 }
        public static Texture2D GetTextureFromFile(string fileName)
        {
            fileName = fileName.Replace(".png", "");
            string    text = Path.Combine(spritesDirectory, fileName + ".png");
            bool      flag = !File.Exists(text);
            Texture2D result;

            if (flag)
            {
                ETGModConsole.Log("<color=#FF0000FF>" + text + " not found. </color>", false);
                result = null;
            }
            else
            {
                Texture2D texture2D = BytesToTexture(File.ReadAllBytes(text), fileName);
                result = texture2D;
            }
            return(result);
        }
Ejemplo n.º 11
0
 public static void LogSomething(string assetPath)
 {
     foreach (KeyValuePair <string, AssetBundle> bundles in StaticReferences.AssetBundles)
     {
         if (bundles.Value.LoadAsset <DungeonPlaceable>(assetPath))
         {
             ETGModConsole.Log(bundles.Key);
         }
         break;
     }
     foreach (KeyValuePair <string, AssetBundle> bundles in StaticReferences.AssetBundles)
     {
         if (bundles.Value.LoadAsset <GameObject>(assetPath))
         {
             ETGModConsole.Log(bundles.Key);
         }
         break;
     }
 }
Ejemplo n.º 12
0
        private static void SetupBeamPart(tk2dSpriteAnimation beamAnimation, List <string> animSpritePaths, string animationName, int fps, Vector2?colliderDimensions = null, Vector2?colliderOffsets = null, Vector3[] overrideVertices = null)
        {
            tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
            {
                name = animationName, frames = new tk2dSpriteAnimationFrame[0], fps = fps
            };
            List <string> spritePaths = animSpritePaths;

            List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();

            foreach (string path in spritePaths)
            {
                tk2dSpriteCollectionData collection = ETGMod.Databases.Items.ProjectileCollection;
                int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter);
                if (overrideVertices != null)
                {
                    frameDef.colliderVertices = overrideVertices;
                }
                else
                {
                    if (colliderDimensions == null || colliderOffsets == null)
                    {
                        ETGModConsole.Log("<size=100><color=#ff0000ff>BEAM ERROR: colliderDimensions or colliderOffsets was null with no override vertices!</color></size>", false);
                    }
                    else
                    {
                        Vector2 actualDimensions = (Vector2)colliderDimensions;
                        Vector2 actualOffsets    = (Vector2)colliderDimensions;
                        frameDef.colliderVertices = new Vector3[] {
                            new Vector3(actualOffsets.x / 16, actualOffsets.y / 16, 0f),
                            new Vector3(actualDimensions.x / 16, actualDimensions.y / 16, 0f)
                        };
                    }
                }
                frames.Add(new tk2dSpriteAnimationFrame {
                    spriteId = frameSpriteId, spriteCollection = collection
                });
            }
            clip.frames         = frames.ToArray();
            beamAnimation.clips = beamAnimation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
        }
        private void Start()
        {
            SpeculativeRigidbody specRigidbody = base.specRigidbody;

            try {
                if (specRigidbody != null)
                {
                    specRigidbody.OnRigidbodyCollision = (SpeculativeRigidbody.OnRigidbodyCollisionDelegate)Delegate.Combine(specRigidbody.OnRigidbodyCollision, new SpeculativeRigidbody.OnRigidbodyCollisionDelegate(OnPlayerCollision));
                }
            } catch (Exception ex) {
                if (ChaosConsole.DebugExceptions)
                {
                    ETGModConsole.Log("Exception Caught at [GetDistanceToPoint] in ChaosKickableObject class.", false);
                    ETGModConsole.Log(ex.Message + ex.Source, false);
                    ETGModConsole.Log(ex.StackTrace, false);
                }
                return;
            }
        }
Ejemplo n.º 14
0
        // Token: 0x06000034 RID: 52 RVA: 0x00003673 File Offset: 0x00001873
        public override void OnPostFired(PlayerController player, Gun gun)
        {
            int    roulette      = UnityEngine.Random.Range(1, 7);
            string rouletteValue = "shot number " + roulette;

            ETGModConsole.Log(rouletteValue, false);
            switch (roulette)
            {
            case 6:
                AkSoundEngine.PostEvent("Play_WPN_magnum_shot_01", base.gameObject);
                player.healthHaver.ApplyDamage(10000f, Vector2.zero, "RNG", CoreDamageTypes.None, DamageCategory.Unstoppable, true, null, false);
                break;

            default:
                gun.PreventNormalFireAudio = true;
                AkSoundEngine.PostEvent("Play_WPN_magnum_shot_01", base.gameObject);
                break;
            }
        }
Ejemplo n.º 15
0
 protected override void Start()
 {
     try
     {
         base.Start();
         tk2dBaseSprite baseSprite = BraveUtility.RandomElement(ImprovedCandies.candySpritesProcessed);
         if (baseSprite)
         {
             sprite.SetSprite(baseSprite.spriteId);
         }
         else
         {
             ETGModConsole.Log("dumbass bro");
         }
     } catch (Exception error)
     {
         error.ToString().Log();
     }
 }
Ejemplo n.º 16
0
 public static void SetFields(this Component comp, Component other, bool includeFields = true, bool includeProperties = true)
 {
     if (comp != null && other != null)
     {
         Type type = comp.GetType();
         if (type != other.GetType())
         {
             ETGModConsole.Log(" type mis-match");
             return;
         } // type mis-match
         if (includeProperties)
         {
             PropertyInfo[] pinfos = type.GetProperties();
             foreach (var pinfo in pinfos)
             {
                 if (pinfo.CanWrite)
                 {
                     try
                     {
                         pinfo.SetValue(comp, pinfo.GetValue(other, null), null);
                     }
                     catch { } // In case of NotImplementedException being thrown. For some reason specifying that exception didn't seem to catch it, so I didn't catch anything specific.
                 }
                 else
                 {
                 }
             }
         }
         if (includeFields)
         {
             FieldInfo[] finfos = type.GetFields();
             foreach (var finfo in finfos)
             {
                 try
                 {
                     finfo.SetValue(comp, finfo.GetValue(other));
                 }
                 catch { }
             }
         }
     }
 }
        public IEnumerator Start()
        {
            while (Dungeon.IsGenerating | GameManager.Instance.IsLoadingLevel)
            {
                yield return(null);
            }

            if (!ManuallyAssigned)
            {
                TryFindOtherDoor();
            }

            yield return(null);

            if (!m_DestinationDoor | !m_Destination.HasValue)
            {
                ETGModConsole.Log("[ExpandTheGungeon] [" + gameObject.name + "] ERROR: Destination Door was not found!", true);
                m_Disabled = true;
                yield break;
            }

            if (!specRigidbody)
            {
                m_Disabled = true; yield break;
            }

            if (!m_spawnUnlocked && Lock)
            {
                m_parentRoom.RegisterInteractable(Lock);
                Lock.OnUnlocked = MakeReadyForPlayer;
            }

            if (MinimapIcon)
            {
                Minimap.Instance.RegisterRoomIcon(m_parentRoom, MinimapIcon, false);
            }
            else if (m_spawnUnlocked)
            {
                Minimap.Instance.RegisterRoomIcon(m_parentRoom, ExpandPrefabs.exit_room_basic.associatedMinimapIcon, false);
            }
            yield break;
        }
Ejemplo n.º 18
0
            void FixedUpdate()
            {
                PlayerController player = this.GetComponent <PlayerController>();

                if (player == null || !player.passiveItems.Contains(parent))
                {
                    Destroy(this);
                    return;
                }

                if (player.activeItems == null)
                {
                    return;
                }

                foreach (PlayerItem item in player.activeItems)
                {
                    if (item == null)
                    {
                        continue;
                    }
                    float maxTime   = item.timeCooldown;
                    float maxDamage = item.damageCooldown;
                    try
                    {
                        var curRemTime = (float)remainingTimeCooldown.GetValue(item);
                        var curRemDmg  = (float)remainingDamageCooldown.GetValue(item);

                        if (curRemDmg <= 0 || curRemDmg <= 0)
                        {
                            continue;
                        }

                        remainingTimeCooldown.SetValue(item, curRemTime - (maxTime * .01f * Time.deltaTime));
                        remainingDamageCooldown.SetValue(item, curRemDmg - (maxDamage * .01f * Time.deltaTime));
                    }
                    catch (Exception e)
                    {
                        ETGModConsole.Log(e.Message + ": " + e.StackTrace);
                    }
                }
            }
Ejemplo n.º 19
0
 public static void OnActiveReloadPressedHook(Action <Gun, PlayerController, Gun, bool> orig, Gun self, PlayerController p, Gun g, bool actualPress)
 {
     orig(self, p, g, actualPress);
     if (self.IsReloading || self.reloadTime < 0f)
     {
         PlayerController playerController = self.CurrentOwner as PlayerController;
         if (playerController && (actualPress || true))
         {
             MultiActiveReloadController controller = self.GetComponent <MultiActiveReloadController>();
             if (controller != null && controller.activeReloadEnabled && controller.canAttemptActiveReload && !GameUIRoot.Instance.GetReloadBarForPlayer(self.CurrentOwner as PlayerController).IsActiveReloadGracePeriod())
             {
                 bool flag2 = GameUIRoot.Instance.AttemptActiveReloadOnlyMultireload(self.CurrentOwner as PlayerController);
                 MultiActiveReload reload = GameUIRoot.Instance.GetReloadBarForPlayer(self.CurrentOwner as PlayerController).GetMultiActiveReloadForController();
                 if (flag2)
                 {
                     controller.OnActiveReloadSuccess(reload);
                     GunFormeSynergyProcessor component = self.GetComponent <GunFormeSynergyProcessor>();
                     if (component)
                     {
                         component.JustActiveReloaded = true;
                     }
                     ChamberGunProcessor component2 = self.GetComponent <ChamberGunProcessor>();
                     if (component2)
                     {
                         component2.JustActiveReloaded = true;
                     }
                 }
                 else
                 {
                     controller.OnActiveReloadFailure(reload);
                 }
                 if (reload == null || !reload.canAttemptActiveReloadAfterwards)
                 {
                     ETGModConsole.Log("yes");
                     controller.canAttemptActiveReload = false;
                     Action <PlayerController, Gun, bool> act = (Action <PlayerController, Gun, bool>)info2.CreateDelegate <Action <PlayerController, Gun, bool> >();
                     self.OnReloadPressed -= act;
                 }
             }
         }
     }
 }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
0
 public static void doEffect(Action <DebrisObject> orig, DebrisObject spawnedItem)
 {
     try
     {
         orig(spawnedItem);
         PickupObject itemness = spawnedItem.gameObject.GetComponent <PickupObject>();
         if (itemness != null)
         {
             if (itemness.PickupObjectId == 73 || itemness.PickupObjectId == 85)
             {
                 AttemptReroll(itemness);
             }
         }
     }
     catch (Exception e)
     {
         ETGModConsole.Log(e.Message);
         ETGModConsole.Log(e.StackTrace);
     }
 }
Ejemplo n.º 22
0
        private void KillGroundCompanion(PlayerController user, GameObject companion)
        {
            //Result is a Debris Object
            if (companion != null)
            {
                PickupObject itemness = companion.gameObject.GetComponent <PickupObject>();

                if (itemness != null)
                {
                    AkSoundEngine.PostEvent("Play_WPN_smileyrevolver_shot_01", gameObject);
                    Instantiate <GameObject>(EasyVFXDatabase.TeleporterPrototypeTelefragVFX, itemness.sprite.WorldCenter, Quaternion.identity);
                    GameManager.Instance.StartCoroutine(DoReward(user, itemness.sprite.WorldCenter, itemness.PickupObjectId));
                    Destroy(companion.gameObject);
                }
            }
            else
            {
                ETGModConsole.Log("Companion was Null in the Debris Object handler, this should never happen.");
            }
        }
 private void RestoreAmmo(Projectile arg1, SpeculativeRigidbody arg2, bool arg3)
 {
     if (arg3)
     {
         float restorePercent = 0.10f;
         if ((arg1.Owner as PlayerController).PlayerHasActiveSynergy("Ammo Economy Inflation"))
         {
             restorePercent = 0.20f;
         }
         Gun gun = arg1.GetComponentInChildren <Gun>();
         if (gun)
         {
             gun.GainAmmo(Mathf.FloorToInt(gun.AdjustedMaxAmmo * restorePercent));
         }
         else
         {
             ETGModConsole.Log("Could not find gun component.");
         }
     }
 }
 public float GetDistanceToPoint(Vector2 point)
 {
     // Table Tech Rockets used on tables converted to kickableObjects can cause a softlock of player input not working
     // When this occurs, return a default value and destroy the object.
     try {
         Bounds bounds = sprite.GetBounds();
         bounds.SetMinMax(bounds.min + sprite.transform.position, bounds.max + sprite.transform.position);
         float num  = Mathf.Max(Mathf.Min(point.x, bounds.max.x), bounds.min.x);
         float num2 = Mathf.Max(Mathf.Min(point.y, bounds.max.y), bounds.min.y);
         return(Mathf.Sqrt((point.x - num) * (point.x - num) + (point.y - num2) * (point.y - num2)));
     } catch (Exception ex) {
         if (ChaosConsole.DebugExceptions)
         {
             ETGModConsole.Log("Exception Caught at [GetDistanceToPoint] in ChaosKickableObject class." + ex.Message + ex.Source + ex.InnerException + ex.StackTrace + ex.TargetSite, false);
         }
         float defaultFloat = 0f;
         Destroy(this);
         return(defaultFloat);
     }
 }
Ejemplo n.º 25
0
 public static void doEffect(Action <DebrisObject> orig, DebrisObject spawnedItem)
 {
     try
     {
         orig(spawnedItem);
         if (GameManager.Instance.AnyPlayerHasPickupID(AmmoTrapID))
         {
             AmmoPickup itemness = spawnedItem.gameObject.GetComponent <AmmoPickup>();
             if (itemness != null)
             {
                 itemness.IgnoredByRat = true;
             }
         }
     }
     catch (Exception e)
     {
         ETGModConsole.Log(e.Message);
         ETGModConsole.Log(e.StackTrace);
     }
 }
Ejemplo n.º 26
0
 public static void SetProjectileSpriteRight(this Projectile proj, string name, int pixelWidth, int pixelHeight, bool lightened = true, tk2dBaseSprite.Anchor anchor = tk2dBaseSprite.Anchor.LowerLeft, bool anchorChangesCollider = true,
                                             bool fixesScale = false, int?overrideColliderPixelWidth = null, int?overrideColliderPixelHeight = null, int?overrideColliderOffsetX = null, int?overrideColliderOffsetY = null, Projectile overrideProjectileToCopyFrom = null)
 {
     try
     {
         proj.GetAnySprite().spriteId = ETGMod.Databases.Items.ProjectileCollection.inst.GetSpriteIdByName(name);
         tk2dSpriteDefinition def     = SetupDefinitionForProjectileSprite(name, proj.GetAnySprite().spriteId, pixelWidth, pixelHeight, lightened, overrideColliderPixelWidth, overrideColliderPixelHeight, overrideColliderOffsetX,
                                                                           overrideColliderOffsetY, overrideProjectileToCopyFrom);
         def.ConstructOffsetsFromAnchor(anchor, def.position3, fixesScale, anchorChangesCollider);
         proj.GetAnySprite().scale = new Vector3(1f, 1f, 1f);
         proj.transform.localScale = new Vector3(1f, 1f, 1f);
         proj.GetAnySprite().transform.localScale = new Vector3(1f, 1f, 1f);
         proj.AdditionalScaleMultiplier = 1f;
     }
     catch (Exception ex)
     {
         ETGModConsole.Log("Ooops! Seems like something got very, Very, VERY wrong. Here's the exception:");
         ETGModConsole.Log(ex.ToString());
     }
 }
Ejemplo n.º 27
0
        public static void ListDungeonComponents(string[] notused)
        {
            MetalGearRatRoomController[] rooms            = UnityEngine.Resources.FindObjectsOfTypeAll <MetalGearRatRoomController>();
            MetalGearRatRoomController   metalgearratroom = UnityEngine.Object.FindObjectOfType <MetalGearRatRoomController>();
            GameObject gameobject = metalgearratroom.gameObject;

            if (gameobject)
            {
                string name = gameobject.name;
                ETGModConsole.Log("MetalGearRatRoomControllerAttachedTo: " + name);
            }

            else
            {
                ETGModConsole.Log("No RatRoomObject Found");
            }


            //MetalGearRatRoomPlaceable
        }
Ejemplo n.º 28
0
        private void ChangeToTileset(int t)
        {
            if (hyperDebugMode)
            {
                ETGModConsole.Log($"Attempting to Change to Tileset {t}. FloorFormeDatas is at a count of {floorFormeDatas.Count}.");
            }

            int targetID = -1;

            foreach (ChamberGunData data in floorFormeDatas)
            {
                if (hyperDebugMode)
                {
                    ETGModConsole.Log($"Checking ChamberGunData with tileset id {data.floorTilesetID}.");
                }
                if (data.floorTilesetID == t)
                {
                    if (hyperDebugMode)
                    {
                        ETGModConsole.Log($"ChamberGunData with tileset id {data.floorTilesetID} MATCHES {t}, and targetID has been set to it.");
                    }
                    targetID = data.correspondingFormeID;
                    break;
                }
                else
                {
                    if (hyperDebugMode)
                    {
                        ETGModConsole.Log($"ChamberGunData with tileset id {data.floorTilesetID} does NOT match with {t}.");
                    }
                }
            }
            if (targetID != -1)
            {
                ChangeForme(targetID); currentTileset = t;
            }
            else
            {
                Debug.LogWarning($"ChamberGunAPI ({primeHandlerModName}): Attempted to change form to a tileset that wasn't valid ({t}).");
            }
        }
Ejemplo n.º 29
0
        // Token: 0x0600034F RID: 847 RVA: 0x00020258 File Offset: 0x0001E458
        private void OnHitEnemy(Projectile bullet, SpeculativeRigidbody enemy, bool fatal)
        {
            bool flag = enemy && enemy.gameActor && enemy.healthHaver;

            if (flag)
            {
                bool flag2 = UnityEngine.Random.value <= (float)this.procChance;
                if (flag2)
                {
                    GameActorHealthEffect healthModifierEffect  = Game.Items["irradiated_lead"].GetComponent <BulletStatusEffectItem>().HealthModifierEffect;
                    GameActorHealthEffect gameActorHealthEffect = new GameActorHealthEffect
                    {
                        duration = healthModifierEffect.duration,
                        DamagePerSecondToEnemies = healthModifierEffect.DamagePerSecondToEnemies,
                        TintColor          = this.tintColour,
                        DeathTintColor     = this.tintColour,
                        effectIdentifier   = healthModifierEffect.effectIdentifier,
                        AppliesTint        = true,
                        AppliesDeathTint   = true,
                        resistanceType     = EffectResistanceType.Poison,
                        OverheadVFX        = healthModifierEffect.OverheadVFX,
                        AffectsEnemies     = true,
                        AffectsPlayers     = false,
                        AppliesOutlineTint = false,
                        ignitesGoops       = false,
                        OutlineTintColor   = this.tintColour,
                        PlaysVFXOnActor    = false
                    };
                    bool flag3 = this.duration > 0;
                    if (flag3)
                    {
                        gameActorHealthEffect.duration = (float)this.duration;
                    }
                    enemy.gameActor.ApplyEffect(gameActorHealthEffect, 1f, null);
                }
            }
            else
            {
                ETGModConsole.Log("Target could not be poisoned", false);
            }
        }
        private IEnumerator HandleFreeFiringBeam(BeamController beam, SpeculativeRigidbody otherShooter, float duration)
        {
            float elapsed = 0f;

            yield return(null);

            while (elapsed < duration)
            {
                Vector2 sourcePos;
                if (otherShooter == null)
                {
                    break;
                }
                if (!otherShooter.GetComponentInParent <FlippableCover>())
                {
                    break;
                }
                if (otherShooter.GetComponentInParent <FlippableCover>().IsBroken)
                {
                    break;
                }
                else
                {
                    sourcePos = otherShooter.UnitCenter;
                }

                elapsed += BraveTime.DeltaTime;
                if (sourcePos != null)
                {
                    beam.Origin = sourcePos;
                    beam.LateUpdatePosition(sourcePos);
                }
                else
                {
                    ETGModConsole.Log("SOURCEPOS WAS NULL IN BEAM FIRING HANDLER");
                }
                yield return(null);
            }
            beam.CeaseAttack();
            yield break;
        }