Example #1
0
 private void SendMessageOnFungusDrop(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
 {
     if (EngineerInGame &&
         RoR2.PickupCatalog.GetPickupDef(pickupIndex).itemIndex == ItemIndex.Mushroom)
     {
         Message.SendToAll($"It's a motherfucking fungus!!", Colours.Green);
     }
     orig(pickupIndex, position, velocity);
 }
Example #2
0
        private void PickupDropletController_CreatePickupDroplet(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
        {
            var body = PlayerCharacterMasterController.instances[0].master.GetBody();

            if (Util.CheckRoll(SpiceReplaceChance, body.master))
            {
                if (pickupIndex != PickupCatalog.FindPickupIndex(ItemIndex.ArtifactKey)) //safety to prevent softlocks
                {
                    pickupIndex = PickupCatalog.FindPickupIndex(catalogIndex);
                }
            }
            orig(pickupIndex, position, velocity);
        }
 private static void YellowDrops(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, RoR2.PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
 {
     for (int i = 0; i < NewDefsList.Count; i++)
     {
         if (pickupIndex == PickupCatalog.FindPickupIndex(OldDefsList[i].equipmentIndex))
         {
             if (NewDefsList[i] != null)
             {
                 pickupIndex = PickupCatalog.FindPickupIndex(NewDefsList[i].itemIndex);
             }
         }
     }
     orig(pickupIndex, position, velocity);
 }
        private void ReplacePickupDropletSynced(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
        {
            var spiceCount = IntOfMostSpice(SpiceEquipment_MaxPerPlayer);

            // IF all players are over the cap, then it will roll for 0
            if (Util.CheckRoll(spiceCount))
            {
                if (pickupIndex != PickupCatalog.FindPickupIndex(RoR2Content.Items.ArtifactKey.itemIndex)) //safety to prevent softlocks
                {
                    pickupIndex = PickupCatalog.FindPickupIndex(catalogIndex);
                }
            }
            orig(pickupIndex, position, velocity);
        }
Example #5
0
 private void PickupDropletController_CreatePickupDroplet(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
 {
     //var body = PlayerCharacterMasterController.instances[0].master.GetBody();
     if (IsThereARobotInThisSinglePlayerGame())
     {
         if (pickupIndex != PickupCatalog.FindPickupIndex(ItemIndex.ArtifactKey) && pickupIndex == instance.pickupIndex)
         {
             PickupIndex loot = Run.instance.treasureRng.NextElementUniform(Run.instance.availableTier3DropList);
             pickupIndex = PickupCatalog.GetPickupDef(loot).pickupIndex;
             Chat.AddMessage("Sorry, MUL-T breaks the backpack, so I replaced it with a random red!");
         }
     }
     orig(pickupIndex, position, velocity);
 }
Example #6
0
 private void PickupDropletController_CreatePickupDroplet(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
 {
     throw new NotImplementedException();
 }
Example #7
0
        private void PickupDropletController_CreatePickupDroplet(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
        {
            orig(pickupIndex, position, velocity);
            //Check if a lunar coin dropped
            if (pickupIndex != PickupCatalog.FindPickupIndex("LunarCoin.Coin0"))
            {
                return;
            }

            //Send message
            Chat.AddMessage("<color=#307FFF>Lunar Coin</color><style=cEvent> Dropped</style>");

            if (!ShouldPing)
            {
                return;
            }

            //Create a new Ping
            PingerController.PingInfo pingInfo = new PingerController.PingInfo
            {
                active = true
            };

            //Remove old Ping Target
            try
            {
                Destroy(GameObject.Find("FakeLunarCoin"));
            }
            catch
            {
            }

            //Create Ping Target
            //Had weird glitches when I used the real Lunar coin
            GameObject fakeLunarCoin = new GameObject("FakeLunarCoin");

            //Position it to the real Lunar Coin
            fakeLunarCoin.transform.position = position;
            //Add neccesary Component
            fakeLunarCoin.AddComponent <ModelLocator>();

            pingInfo.origin = position;

            //Check if another ping is active
            if (!pingInfo.active && this.pingIndicator != null)
            {
                UnityEngine.Object.Destroy(this.pingIndicator.gameObject);
                this.pingIndicator = null;
                return;
            }
            //Creat new Ping Object
            if (!this.pingIndicator)
            {
                GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/PingIndicator"));
                this.pingIndicator           = gameObject.GetComponent <PingIndicator>();
                this.pingIndicator.pingOwner = base.gameObject;
            }
            //Set some stuff
            this.pingIndicator.pingOrigin = pingInfo.origin;
            this.pingIndicator.pingNormal = pingInfo.normal;
            this.pingIndicator.pingTarget = fakeLunarCoin;
            this.pingIndicator.pingOwner  = LocalUserManager.GetFirstLocalUser().cachedMasterObject;
            this.pingIndicator.RebuildPing();

            //Clear old Coroutine
            //Dont wanna have it removed because of the old one
            try
            {
                StopCoroutine(clearCoroutine);
            }
            catch (System.Exception)
            {
                Debug.Log("No Coroutine Running!");
            }
            clearCoroutine = StartCoroutine(ClearPing());
        }
Example #8
0
        private void PickupDropletController_CreatePickupDroplet(On.RoR2.PickupDropletController.orig_CreatePickupDroplet orig, PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
        {
            orig.Invoke(pickupIndex, position, velocity);
            //Check if a lunar coin dropped
            if (pickupIndex != PickupIndex.lunarCoin1)
            {
                return;
            }

            //Send message
            Chat.AddMessage("<color=#307FFF>Lunar Coin</color><style=cEvent> Dropped</style>");

            if (!shouldPing)
            {
                return;
            }

            //Create a new Ping
            PingerController.PingInfo pingInfo = new PingerController.PingInfo
            {
                active = true
            };

            //Remove old Ping Target
            try
            {
                Destroy(GameObject.Find("FakeLunarCoin"));
            }
            catch (System.Exception)
            {
            }

            //Create Ping Target
            //Had weird glitches when I used the real Lunar coin
            GameObject fakeLunarCoin = new GameObject("FakeLunarCoin");

            #region OLD

            /*try
             * {
             *  //<style=cIsHealing>💝 Der Felix 💝 wants to move here.</style>
             *  if(GameObject.Find("PickupLunarCoin") != null)
             *  {
             *      fakeLunarCoin = GameObject.Find("PickupLunarCoin");
             *      if (fakeLunarCoin.GetComponentInParent<IDisplayNameProvider>() != null)
             *          Chat.AddMessage("1 Not Null");
             *      else
             *          Chat.AddMessage("1 Null");
             *
             *      if (fakeLunarCoin.GetComponent<IDisplayNameProvider>() != null)
             *          Chat.AddMessage("2 Not Null");
             *      else
             *          Chat.AddMessage("2 Null");
             *
             *      if (fakeLunarCoin.GetComponentInChildren<IDisplayNameProvider>() != null)
             *          Chat.AddMessage("3 Not Null");
             *      else
             *          Chat.AddMessage("3 Null");
             *  }
             *
             * }
             * catch (System.Exception)
             * {
             *
             *  Chat.AddMessage("Not Found!");
             * }*/
            #endregion

            //Position it to the real Lunar Coin
            fakeLunarCoin.transform.position = position;
            //Add neccesary Component
            fakeLunarCoin.AddComponent <ModelLocator>();

            pingInfo.origin = position;

            //Check if another ping is active
            if (!pingInfo.active && this.pingIndicator != null)
            {
                UnityEngine.Object.Destroy(this.pingIndicator.gameObject);
                this.pingIndicator = null;
                return;
            }
            //Creat new Ping Object
            if (!this.pingIndicator)
            {
                GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("Prefabs/PingIndicator"));
                this.pingIndicator           = gameObject.GetComponent <PingIndicator>();
                this.pingIndicator.pingOwner = base.gameObject;
            }
            //Set some stuff
            this.pingIndicator.pingOrigin = pingInfo.origin;
            this.pingIndicator.pingNormal = pingInfo.normal;
            this.pingIndicator.pingTarget = fakeLunarCoin;
            this.pingIndicator.pingOwner  = LocalUserManager.GetFirstLocalUser().cachedMasterObject;
            this.pingIndicator.RebuildPing();

            //Clear old Coroutine
            //Dont wanna have it removed because of the old one
            try
            {
                StopCoroutine(clearCoroutine);
            }
            catch (System.Exception)
            {
                Debug.Log("No Coroutine Running!");
            }
            clearCoroutine = StartCoroutine(ClearPing());
        }