コード例 #1
0
        private void GrantEquipment(CharacterBody body, Inventory inventory)
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'System.Void RoR2.GenericPickupController::GrantEquipment(RoR2.CharacterBody,RoR2.Inventory)' called on client");
                return;
            }
            this.waitStartTime = Run.FixedTimeStamp.now;
            EquipmentIndex currentEquipmentIndex = inventory.currentEquipmentIndex;
            EquipmentIndex equipmentIndex        = this.pickupIndex.equipmentIndex;

            inventory.SetEquipmentIndex(equipmentIndex);
            this.NetworkpickupIndex = new PickupIndex(currentEquipmentIndex);
            this.consumed           = false;
            GenericPickupController.SendPickupMessage(inventory.GetComponent <CharacterMaster>(), new PickupIndex(equipmentIndex));
            if (this.pickupIndex == PickupIndex.none)
            {
                UnityEngine.Object.Destroy(base.gameObject);
                return;
            }
            if (this.selfDestructIfPickupIndexIsNotIdeal && this.pickupIndex != PickupIndex.Find(this.idealPickupIndex.pickupName))
            {
                PickupDropletController.CreatePickupDroplet(this.pickupIndex, base.transform.position, new Vector3(UnityEngine.Random.Range(-4f, 4f), 20f, UnityEngine.Random.Range(-4f, 4f)));
                UnityEngine.Object.Destroy(base.gameObject);
            }
        }
コード例 #2
0
        // Token: 0x06000B5B RID: 2907 RVA: 0x00032150 File Offset: 0x00030350
        public void SetPickupIndexFromString(string pickupString)
        {
            if (!NetworkServer.active)
            {
                return;
            }
            PickupIndex networkpickupIndex = PickupIndex.Find(pickupString);

            this.NetworkpickupIndex = networkpickupIndex;
        }
コード例 #3
0
        // Token: 0x06001190 RID: 4496 RVA: 0x00057190 File Offset: 0x00055390
        public void DropItems()
        {
            CharacterBody body = this.characterMaster.GetBody();

            if (body)
            {
                SerializablePickupIndex[] array = this.pickupsToDrop;
                for (int i = 0; i < array.Length; i++)
                {
                    PickupDropletController.CreatePickupDroplet(PickupIndex.Find(array[i].pickupName), body.coreTransform.position, new Vector3(UnityEngine.Random.Range(-4f, 4f), 20f, UnityEngine.Random.Range(-4f, 4f)));
                }
            }
        }
 private static void Init()
 {
     GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport damageReport)
     {
         CharacterMaster characterMaster = damageReport.attackerMaster;
         if (characterMaster)
         {
             if (characterMaster.minionOwnership.ownerMaster)
             {
                 characterMaster = characterMaster.minionOwnership.ownerMaster;
             }
             PlayerCharacterMasterController component = characterMaster.GetComponent <PlayerCharacterMasterController>();
             if (component && Util.CheckRoll(1f * component.lunarCoinChanceMultiplier, 0f, null))
             {
                 PickupDropletController.CreatePickupDroplet(PickupIndex.Find("LunarCoin.Coin0"), damageReport.victim.transform.position, Vector3.up * 10f);
                 component.lunarCoinChanceMultiplier *= 0.5f;
             }
         }
     };
 }