Beispiel #1
0
        public void Update()
        {
            if (Input.GetKeyDown(KeyCode.F3))
            {
                var trans       = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
                var chestPrefab = Resources.Load <SpawnCard>("SpawnCards/InteractableSpawnCard/iscEquipmentBarrel");

                /*foreach (var pu in ItemLib.CustomItemList.Select(x => new RoR2.PickupIndex(x.ItemDef.itemIndex)))
                 * {
                 *  PickupDropletController.CreatePickupDroplet(pu, trans.position, trans.forward * 20f);
                 * }*/

                var dropList = Run.instance.availableTier3DropList;
                Debug.Log(dropList.Count);
                foreach (var item in dropList)
                {
                    PickupDropletController.CreatePickupDroplet(item, trans.position, trans.forward * 20f);
                }

                _chest = chestPrefab.DoSpawn(trans.position, trans.rotation, null);
            }

            if (Input.GetKeyDown(KeyCode.F4))
            {
                _chest.GetComponent <ChestBehavior>().Open();
            }
        }
Beispiel #2
0
            private void CreateDropletFromEquipmentSlot(byte equipmentSlot)
            {
                var slot        = equipmentDropQueue[equipmentSlot];
                var pickupIndex = PickupCatalog.FindPickupIndex(slot);

                PickupDropletController.CreatePickupDroplet(pickupIndex, characterBody.corePosition, Vector3.up * 5);
            }
        //override because i dunno IL
        private void DuplicateDrops(On.RoR2.ChestBehavior.orig_ItemDrop orig, ChestBehavior self)
        {
            if (self.tier3Chance != 1)
            {
                orig(self);
                return;
            }
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'System.Void RoR2.ChestBehavior::ItemDrop()' called on client");
                return;
            }
            if (self.dropPickup == PickupIndex.none)
            {
                return;
            }

            int        participatingPlayerCount = Run.instance.participatingPlayerCount != 0 ? Run.instance.participatingPlayerCount : 1;
            float      angle         = 360f / participatingPlayerCount;
            var        chestVelocity = Vector3.up * self.dropUpVelocityStrength + self.dropTransform.forward * self.dropForwardVelocityStrength;
            Quaternion rotation      = Quaternion.AngleAxis(angle, Vector3.up);
            int        i             = 0;

            while (i < participatingPlayerCount)
            {
                PickupDropletController.CreatePickupDroplet(self.dropPickup, self.dropTransform.position + Vector3.up * 1.5f, chestVelocity);
                i++;
                chestVelocity = rotation * chestVelocity;
            }
            self.dropPickup = PickupIndex.none;
        }
Beispiel #4
0
        static void HandleDropEquipment(NetworkMessage netMsg)
        {
            var dropEquipment = netMsg.ReadMessage <DropEquipmentPacket>();
            var body          = dropEquipment.Player.GetComponent <CharacterBody>();

            PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(dropEquipment.EquipmentIndex), body.transform.position + Vector3.up * 1.5f, Vector3.up * 20f + body.transform.forward * 2f);
        }
Beispiel #5
0
        private static void CreateMarkedPickupDroplet(PickupIndex pickupIndex, Vector3 position, Vector3 velocity)
        {
            GenericPickupController.CreatePickupInfo pickupInfo = new GenericPickupController.CreatePickupInfo {
                rotation = Quaternion.identity, pickupIndex = pickupIndex
            };

            GameObject droplet = UnityEngine.Object.Instantiate(PickupDropletController.pickupDropletPrefab, position, Quaternion.identity);

            PickupDropletController controller = droplet.GetComponent <PickupDropletController>();

            if (controller)
            {
                controller.createPickupInfo   = pickupInfo;
                controller.NetworkpickupIndex = pickupInfo.pickupIndex;
            }

            Rigidbody rigidBody = droplet.GetComponent <Rigidbody>();

            rigidBody.velocity = velocity;
            rigidBody.AddTorque(UnityEngine.Random.Range(150f, 120f) * UnityEngine.Random.onUnitSphere);

            droplet.AddComponent <ZetDropMarker>();

            NetworkServer.Spawn(droplet);
        }
Beispiel #6
0
 public void Update()
 {
     NModLoader.Update();
     if (Input.GetKeyDown(KeyCode.F2))
     {
         //Get the player body to use a position:
         var transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
         //And then drop our defined item in front of the player.
         PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(NModLoader.LoadedCustomItems[Envy.Name].Index), transform.position, transform.forward * 20f);
     }
     if (Input.GetKeyDown(KeyCode.F3))
     {
         //Get the player body to use a position:
         var transform   = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
         var customItems = NModLoader.LoadedCustomItems.Values.ToArray();
         for (var i = 0; i < customItems.Length; i++)
         {
             var rotation = Math.PI * 2 * (i / (float)customItems.Length);
             PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(customItems[i].Index), transform.position, new Vector3((float)Math.Cos(rotation), 0.05f, (float)Math.Sin(rotation)) * 30f);
         }
     }
     if (Input.GetKeyDown(KeyCode.F4))
     {
         //Get the player body to use a position:
         var transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
         //And then drop our defined item in front of the player.
         PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex((ItemIndex)53), transform.position, transform.forward * 20f);
     }
 }
Beispiel #7
0
            public void OnKilledServer(DamageReport damageReport)
            {
                Vector3 position = Vector3.zero;

                if (damageReport.attackerBody)
                {
                    position = damageReport.victimBody.corePosition;
                }
                else
                {
                    foreach (var teammate in TeamComponent.GetTeamMembers(TeamIndex.Player))
                    {
                        if (teammate.body?.master?.playerCharacterMasterController)
                        {
                            position = teammate.body.corePosition;
                        }
                    }
                }

                DropItems(position);

                PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(equipmentIndex), position, Vector3.up * 20f);

                DropCoins(position);
            }
Beispiel #8
0
        public override void InvokeServer(Dictionary <string, string> contents)
        {
            if (!int.TryParse(contents["Id"], out int idx))
            {
                SandboxMain.Log($"Invalid  ID \"{contents["Id"]}\" Replicated", true);
                return;
            }

            if (!int.TryParse(contents["Amount"], out int amt))
            {
                SandboxMain.Log($"Invalid amount \"{contents["Amount"]}\" Replicated, overriding to 1", true);
                amt = 1;
            }

            if (!DataUtils.ReadVector3FromDictionary("Location", ref contents, out Vector3 hit))
            {
                SandboxMain.Log(
                    $"Invalid location \"[{contents["Location.x"]}, {contents["Location.y"]}, {contents["Location.z"]}] Replicated",
                    true);
                return;
            }

            for (int i = 0; i < amt; i++)
            {
                Vector3 randomDirection = new Vector3(Random.value, Random.value, Random.value);
                PickupDropletController.CreatePickupDroplet(MakeIndex(idx),
                                                            hit + Vector3.up * 1.5f,
                                                            Vector3.up * 20f + randomDirection * 5f);
            }
        }
Beispiel #9
0
        /*public void shift_up() {
         *  vertical_tile_offset++;
         *  Debug.Log(vertical_tile_offset);
         * }
         * public void shift_down() {
         *  vertical_tile_offset--;
         *  Debug.Log(vertical_tile_offset);
         * }
         * public void shift_left() {
         *  tile_size -= 0.5f;
         *  Debug.Log(tile_size);
         * }
         * public void shift_right() {
         *  tile_size += 0.5f;
         *  Debug.Log(tile_size);
         * }*/

        public void RegisterOffer(int ItemListLocation, CharacterBody CB)
        {
            // LocalUser User = LocalUserManager.GetFirstLocalUser();

            // Chat.AddMessage($"Item Loc: {ItemListLocation}, Item List: {InvData.Count}, {InvData[ItemListLocation].item_index}");

            ItemIndex item = InvData[ItemListLocation].item_index;

            Transform UserTransform = CB.transform;

            // Debug.Log(firstLocalUser.userProfile.name);
            CB.inventory.RemoveItem(item, 1);
            float player_rot = 0;

            Vector3 mod_rot = new Vector3((float)(Math.Cos(player_rot)) * 10, 20, (float)(Math.Sin(player_rot)) * 10);

            PickupDropletController.CreatePickupDroplet(
                new PickupIndex(item), UserTransform.position, mod_rot);

            string color_tag = "#" + ColorCatalog.GetColorHexString(ItemCatalog.GetItemDef(item).colorIndex);

            // Chat.AddMessage($"{CB.name} has dropped <color={color_tag}> {Language.GetString(ItemCatalog.GetItemDef(item).nameToken)} </color>");
            sendChatMessage($"{CB.GetUserName()} has dropped <color={color_tag}> {Language.GetString(ItemCatalog.GetItemDef(item).nameToken)} </color>");


            InvData[ItemListLocation].count -= 1;
            if (InvData[ItemListLocation].count <= 0)
            {
                InvData.RemoveAt(ItemListLocation);
                Destroy(TileList[TileList.Count - 1]);
                TileList.RemoveAt(TileList.Count - 1);
            }
        }
Beispiel #10
0
        private void MaybeAwardLoot(On.RoR2.CharacterBody.orig_OnInventoryChanged orig, CharacterBody self)
        {
            orig(self);
            var amount = self.inventory.GetItemCount(Definition.itemIndex);

            if (amount > 0 && amount % 3 == 0)
            {
                self.inventory.RemoveItem(Definition.itemIndex, 3);
                PickupIndex loot;
                if (Util.CheckRoll(5, self.master))
                {
                    loot = Run.instance.treasureRng.NextElementUniform(Run.instance.availableTier3DropList);
                }
                else
                {
                    loot = Run.instance.treasureRng.NextElementUniform(Run.instance.availableTier2DropList);
                }
                if (self.isPlayerControlled)
                {
                    PickupDropletController.CreatePickupDroplet(loot, self.corePosition, Vector3.up * 5);
                }
                else
                {
                    PickupDef def = PickupCatalog.GetPickupDef(loot);
                    self.inventory.GiveItem(def.itemIndex);
                    var lootCount = self.inventory.GetItemCount(def.itemIndex);
                    Chat.AddPickupMessage(self, def.nameToken, ColorCatalog.GetColor(ItemCatalog.GetItemDef(def.itemIndex).colorIndex), (uint)lootCount);
                }
            }
        }
Beispiel #11
0
        private void Check(TeleporterInteraction teleporterInteraction)
        {
            if (!hasBeenHit)
            {
                for (int i = 0; i < CharacterMaster.readOnlyInstancesList.Count; i++)
                {
                    //body.GetComponent<CharacterBody>()?.inventory.GiveItem(catalogIndex);

                    var player = CharacterMaster.readOnlyInstancesList[i];
                    if (player)
                    {
                        var body = player.GetComponent <CharacterBody>();
                        if (body)
                        {
                            Chat.AddMessage(i.ToString() + "= Gave Master Round to " + player.name);
                            PickupIndex pickupIndex    = PickupCatalog.FindPickupIndex(catalogIndex);
                            Vector3     pickupVelocity = new Vector3(100 * i, 100, 100 * i);
                            PickupDropletController.CreatePickupDroplet(pickupIndex, teleporterInteraction.transform.position, pickupVelocity);
                        }
                    }
                }
            }
            else
            {
                Chat.AddMessage("Players didn't survive the hits");
            }
        }
Beispiel #12
0
        /// <summary>
        /// Spawn an item of the given tier at the position of the given CharacterBody.
        /// </summary>
        /// <param name="src">The body to spawn an item from.</param>
        /// <param name="tier">The tier of item to spawn. Must be within 0 and 5, inclusive (Tier 1, Tier 2, Tier 3, Lunar, Equipment, Lunar Equipment).</param>
        /// <param name="rng">An instance of Xoroshiro128Plus to use for random item selection.</param>
        public static void SpawnItemFromBody(CharacterBody src, int tier, Xoroshiro128Plus rng)
        {
            List <PickupIndex> spawnList;

            switch (tier)
            {
            case 1:
                spawnList = Run.instance.availableTier2DropList;
                break;

            case 2:
                spawnList = Run.instance.availableTier3DropList;
                break;

            case 3:
                spawnList = Run.instance.availableLunarDropList;
                break;

            case 4:
                spawnList = Run.instance.availableNormalEquipmentDropList;
                break;

            case 5:
                spawnList = Run.instance.availableLunarEquipmentDropList;
                break;

            case 0:
                spawnList = Run.instance.availableTier1DropList;
                break;

            default:
                throw new ArgumentOutOfRangeException("tier", tier, "spawnItemFromBody: Item tier must be between 0 and 5 inclusive");
            }
            PickupDropletController.CreatePickupDroplet(spawnList[rng.RangeInt(0, spawnList.Count)], src.transform.position, new Vector3(UnityEngine.Random.Range(-5.0f, 5.0f), 20f, UnityEngine.Random.Range(-5.0f, 5.0f)));
        }
Beispiel #13
0
        private void DuplicateDropChest(On.RoR2.ChestBehavior.orig_ItemDrop orig, ChestBehavior self)
        {
            orig(self);
            if (GetCountFromPlayers(ItemDef, true) > 0)
            {
                //chestPickup = Reflection.GetFieldValue<PickupIndex>(self, "dropPickup");
                chestPickup = dropTable.GenerateDrop(treasureRng);
                var HighestChance = GetCountHighestFromPlayers(ItemDef, true);                   //Doesn't work well across multiple players, but I don't really want to make clover but lunar and it f*****g kills you dont know?
                var DupeChance    = dupeChanceInitial + ((HighestChance - 1) * dupeChanceStack); //Also I do not know how to get the cb that interacted and opened the chest
#if DEBUG
                Chat.AddMessage("Turbo Edition: " + ItemName + " duplication taking place, check logs.");
                TurboEdition._logger.LogWarning(ItemName + " duplication chance of: " + DupeChance + ", duplicating pickup index: " + chestPickup);
#endif
                if (Util.CheckRoll(DupeChance)) //hopefully this rolls only the chance WITHOUT luck
                {
                    if (chestPickup == PickupIndex.none)
                    {
#if DEBUG
                        Chat.AddMessage("Turbo Edition: " + ItemName + " Chest didn't have a pickup, how did this happen?");
#endif
                        return;
                    }
#if DEBUG
                    Chat.AddMessage("Turbo Edition: " + ItemName + " Duplicated a chest drop.");
#endif
                    PickupDropletController.CreatePickupDroplet(chestPickup, self.dropTransform.position + Vector3.up * 1.5f, Vector3.up * self.dropUpVelocityStrength + self.dropTransform.forward * self.dropForwardVelocityStrength);
                    //Reflection.SetFieldValue(self, "dropPickup", PickupIndex.none); //I actually dont know what or why is this here?
                }
            }
        }
Beispiel #14
0
            public void Unearth()
            {
                if (NetworkServer.active)
                {
                    EffectManager.SimpleEffect(effectPrefab, transform.position, Quaternion.identity, true);
                    PointSoundManager.EmitSoundServer(soundEventDef.index, transform.position);

                    var dropCount = 1;
                    if (dropItemForEachPlayer)
                    {
                        dropCount = Mathf.Max(Run.instance.participatingPlayerCount, 1);
                    }
                    float      angle    = 360f / (float)dropCount;
                    Vector3    vector   = Vector3.up * dropUpVelocityStrength + dropTransform.forward * dropForwardVelocityStrength;
                    Quaternion rotation = Quaternion.AngleAxis(angle, Vector3.up);
                    for (int i = 0; i < dropCount; i++)
                    {
                        PickupDropletController.CreatePickupDroplet(dropPickup, dropTransform.position + Vector3.up * 1.5f, vector);
                        vector = rotation * vector;
                    }
                }

                if (holdoutZoneController && holdoutZoneController.radiusIndicator)
                {
                    holdoutZoneController.radiusIndicator.transform.localScale = Vector3.zero;
                }

                Object.Destroy(gameObject);
            }
        private void Run_Update(On.RoR2.Run.orig_Update orig, Run self)
        {
            if (Input.GetKeyDown(KeyCode.F5))
            {
                Debug.Log("Spawn DIO");
                LocalUser localUser = LocalUserManager.GetFirstLocalUser();
                Transform transform = localUser.cachedBodyObject.transform;

                PickupIndex dio = new PickupIndex(ItemIndex.ExtraLife);
                PickupDropletController.CreatePickupDroplet(dio, transform.position, Vector3.up * 5f);
            }

            if (Input.GetKeyDown(KeyCode.F6))
            {
                Debug.Log("Spawn Random");
                LocalUser localUser = LocalUserManager.GetFirstLocalUser();
                Transform transform = localUser.cachedBodyObject.transform;

                List <PickupIndex> tier3Items = Run.instance.availableTier3DropList;
                int rng = random.Next(0, tier3Items.Count);

                ItemIndex rngItem = tier3Items[rng].itemIndex;

                PickupIndex dio = new PickupIndex(rngItem);
                PickupDropletController.CreatePickupDroplet(dio, transform.position, Vector3.up * 5f);
            }
        }
 void DropItemIndex(Vector3 position, ItemIndex itemIndex, int count)
 {
     for (uint i = 0; i < count; i++)
     {
         PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(itemIndex), position, Vector3.up * 5f);
     }
 }
Beispiel #17
0
        private bool DropItem(Transform charTransform, Inventory inventory, PickupIndex pickupIndex)
        {
            _pickups[inventory] = new PickupRecord(Time.time, ItemIndex.None);

            //if (!inventory.hasAuthority)
            //    return false;

            var pickupDef = PickupCatalog.GetPickupDef(pickupIndex);

            if (pickupDef.equipmentIndex != EquipmentIndex.None)
            {
                if (inventory.GetEquipmentIndex() != pickupDef.equipmentIndex)
                {
                    return(false);
                }

                inventory.SetEquipmentIndex(EquipmentIndex.None);
            }
            else
            {
                if (inventory.GetItemCount(pickupDef.itemIndex) <= 0)
                {
                    return(false);
                }

                inventory.RemoveItem(pickupDef.itemIndex, 1);
            }

            PickupDropletController.CreatePickupDroplet(pickupIndex,
                                                        charTransform.position, Vector3.up * 20f + charTransform.forward * 10f);
            return(true);
        }
Beispiel #18
0
 private void BossGroup_DropRewards(On.RoR2.BossGroup.orig_DropRewards orig, BossGroup self)
 {
     if (self.dropPosition)
     {
         List <PickupIndex> list = Run.instance.availableTier2DropList;
         if (self.forceTier3Reward)
         {
             list = Run.instance.availableTier3DropList;
         }
         PickupIndex pickupIndex = self.rng.NextElementUniform <PickupIndex>(list);
         int         num         = 1 + self.bonusRewardCount;
         float       angle       = 360f / (float)num;
         Vector3     vector      = Quaternion.AngleAxis((float)UnityEngine.Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f);
         Quaternion  rotation    = Quaternion.AngleAxis(angle, Vector3.up);
         int         i           = 0;
         while (i < num)
         {
             PickupIndex pickupIndex2 = pickupIndex;
             if (self.bossDrops.Count > 0 && self.rng.nextNormalizedFloat <= self.bossDropChance)
             {
                 pickupIndex2 = self.rng.NextElementUniform <PickupIndex>(self.bossDrops);
                 self.bossDrops.Remove(pickupIndex2);
             }
             PickupDropletController.CreatePickupDroplet(pickupIndex2, self.dropPosition.position, vector);
             i++;
             vector = rotation * vector;
         }
     }
 }
 void DropLunarCoin(Vector3 position, int count)
 {
     for (uint i = 0; i < count; i++)
     {
         PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex("LunarCoin.Coin0"), position, Vector3.up * 2f);
     }
 }
 private void PodComponent_onRoboPodLandedServer(VehicleSeat actionVehicleSeat, GameObject passenger)
 {
     if (actionVehicleSeat.rigidbody == vehicleSeat.rigidbody)
     {
         PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(RoR2Content.Equipment.QuestVolatileBattery.equipmentIndex), vehicleSeat.exitPosition.position, Vector3.up);
     }
 }
Beispiel #21
0
        private void GiveItem()
        {
            itemsGiven++;
            PickupIndex index = dropTable.GenerateDrop(Run.instance.treasureRng);

            PickupDropletController.CreatePickupDroplet(index, body.corePosition, Vector3.up * 20f);
        }
Beispiel #22
0
 public void FixedUpdate()
 {
     // Stopwatch Check
     age += Time.fixedDeltaTime;
     if (age < delay)
     {
         return;
     }
     // Drop Count Check
     if (i < num)
     {
         PickupIndex pickupIndex2 = pickupIndex;
         if (bossDrops.Count > 0 && rng.nextNormalizedFloat <= bossDropChance)
         {
             pickupIndex2 = rng.NextElementUniform <PickupIndex>(bossDrops);
         }
         PickupDropletController.CreatePickupDroplet(pickupIndex2, dropPosition.position, vector);
         i++;
         vector = rotation * vector;
         age    = 0;
     }
     else
     {
         enabled = false;
     }
 }
        public static void DropItem(Transform charTransform, Inventory inventory, PickupIndex pickupIndex)
        {
            KookehsDropItemMod.Logger.LogDebug("Transform: " + charTransform.position.ToString());
            KookehsDropItemMod.Logger.LogDebug("Inventory: " + inventory.name);
            KookehsDropItemMod.Logger.LogDebug("Pickup Index: " + pickupIndex);


            if (PickupCatalog.GetPickupDef(pickupIndex).equipmentIndex != EquipmentIndex.None)
            {
                if (inventory.GetEquipmentIndex() != PickupCatalog.GetPickupDef(pickupIndex).equipmentIndex)
                {
                    return;
                }

                inventory.SetEquipmentIndex(EquipmentIndex.None);
            }
            else
            {
                if (inventory.GetItemCount(PickupCatalog.GetPickupDef(pickupIndex).itemIndex) <= 0)
                {
                    return;
                }

                inventory.RemoveItem(PickupCatalog.GetPickupDef(pickupIndex).itemIndex, 1);
            }

            PickupDropletController.CreatePickupDroplet(pickupIndex,
                                                        charTransform.position, Vector3.up * 20f + charTransform.forward * 10f);
        }
        public void NokiaCall(Transform transform, int itemCount)
        {
            var dropList = Util.CheckRoll((5 * itemCount)) ? Run.instance.availableTier2DropList : Run.instance.availableTier1DropList;
            int nextItem = Run.instance.treasureRng.RangeInt(0, dropList.Count);

            PickupDropletController.CreatePickupDroplet(dropList[nextItem], transform.position, transform.forward * 155);
        }
        public override bool OnUse(EquipmentSlot equipmentSlot)
        {
            MysticsRisky2UtilsEquipmentTarget targetInfo = equipmentSlot.GetComponent <MysticsRisky2UtilsEquipmentTarget>();

            if (targetInfo)
            {
                if (targetInfo.obj)
                {
                    PurchaseInteraction purchaseInteraction = targetInfo.obj.GetComponent <MysticsItemsDuplicatorLocator>().purchaseInteraction;
                    purchaseInteraction.SetAvailable(false);
                    purchaseInteraction.lockGameObject = null;
                    ShopTerminalBehavior shopTerminalBehavior = targetInfo.obj.GetComponent <MysticsItemsDuplicatorLocator>().shopTerminalBehavior;
                    EffectManager.SimpleEffect(LegacyResourcesAPI.Load <GameObject>("Prefabs/Effects/OmniEffect/OmniRecycleEffect"), shopTerminalBehavior.pickupDisplay.transform.position, Quaternion.identity, true);
                    shopTerminalBehavior.SetHasBeenPurchased(true);
                    for (var i = 0; i < amount; i++)
                    {
                        PickupDropletController.CreatePickupDroplet(
                            shopTerminalBehavior.pickupIndex,
                            (shopTerminalBehavior.dropTransform ? shopTerminalBehavior.dropTransform : shopTerminalBehavior.transform).position,
                            shopTerminalBehavior.transform.TransformVector(shopTerminalBehavior.dropVelocity)
                            );
                    }
                    shopTerminalBehavior.SetNoPickup();
                    targetInfo.Invalidate();
                    return(true);
                }
            }
            return(false);
        }
Beispiel #26
0
 //Cheaty Cheaty dev code
 public void Update()
 {
     if (Input.GetKeyDown(KeyCode.F2))
     {
         var transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
         PickupDropletController.CreatePickupDroplet(new PickupIndex(rageID), transform.position, transform.forward * 20f);
     }
 }
        public void spawnEquipment(float offSet, Transform transform)
        {
            var dropList = Run.instance.availableEquipmentDropList;

            var nextItem = Run.instance.treasureRng.RangeInt(0, dropList.Count);

            PickupDropletController.CreatePickupDroplet(dropList[nextItem], transform.position, transform.forward * (20f + offSet));
        }
Beispiel #28
0
        public static void DebugDropLunarPostfix(CharacterBody __instance)
        {
            var def        = LunarScrapProvider.LunarScrapDef;
            var otherIndex = ItemCatalog.FindItemIndex("ScrapLunar");
            var index      = PickupCatalog.FindPickupIndex(def.itemIndex);

            PickupDropletController.CreatePickupDroplet(index, __instance.transform.position, new UnityEngine.Vector3());
        }
Beispiel #29
0
        public GameObject PlaceRod()
        {
            var conduit = UnityEngine.Object.Instantiate <GameObject>(LoaderMain.ConduitPrefab);

            conduit.transform.position = outer.commonComponents.characterBody.corePosition;
            PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(RoR2Content.Items.ArmorPlate.itemIndex), conduit.transform.position, Vector3.up);
            return(conduit);
        }
Beispiel #30
0
        private static void dropPickup(PickupIndex pickupIndex, GameObject obj)
        {
            Transform transform = obj.transform;
            Vector3   position  = transform.position;
            Vector3   velocity  = transform.forward * 20f;

            PickupDropletController.CreatePickupDroplet(pickupIndex, position, velocity);
        }