Esempio n. 1
0
        private IEnumerator <float> TeleportToOutput(ReferenceHub hub, Vector3 oldPos, Vector3 tpPos, Inventory inv, float healthPerc)
        {
            yield return(Timing.WaitForSeconds(1.5f));

            DebugBoi("Teleporting " + hub.nicknameSync.MyNick + " to the output of 914.");

            hub.playerStats.SetHPAmount(hub.characterClassManager.Classes.SafeGet(hub.GetRole()).maxHP);
            hub.plyMovementSync.OverridePosition(oldPos + tpPos, hub.gameObject.transform.rotation.y);

            yield return(Timing.WaitForSeconds(0.5f));

            hub.inventory.Clear();
            foreach (var item in inv.items)
            {
                hub.AddItem(item);
            }
            hub.SetHealth(hub.characterClassManager.Classes.SafeGet(hub.GetRole()).maxHP *healthPerc);
        }
Esempio n. 2
0
        private IEnumerator <float> SetMtf(ReferenceHub player)
        {
            yield return(Timing.WaitForSeconds(0.5f));

            player.SetRole(RoleType.NtfLieutenant);
            yield return(Timing.WaitForSeconds(0.5f));

            foreach (Inventory.SyncItemInfo itemInfo in player.GetAllItems())
            {
                player.RemoveItem(itemInfo);
            }
            player.AddItem(ItemType.GunE11SR);
            player.AddItem(ItemType.GunProject90);
            player.AddItem(ItemType.GunLogicer);
            player.AddItem(ItemType.GrenadeFlash);
            player.AddItem(ItemType.GrenadeFrag);
            player.AddItem(ItemType.Medkit);
            player.AddItem(ItemType.GunUSP);
            player.AddItem(ItemType.KeycardO5);
        }