Пример #1
0
        public static void Prefix(PlayerPhysics __instance)
        {
            bool correctOffset = Camouflager.camouflageTimer <= 0f && (__instance.myPlayer == Child.child || (Morphling.morphling != null && __instance.myPlayer == Morphling.morphling && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f));

            if (correctOffset)
            {
                float currentScaling = (Child.growingProgress() + 1) * 0.5f;
                __instance.myPlayer.Collider.offset = currentScaling * Child.defaultColliderOffset * Vector2.down;
            }
        }
Пример #2
0
        public static void childUpdate()
        {
            foreach (PlayerControl p in PlayerControl.AllPlayerControls)
            {
                if (p == null)
                {
                    continue;
                }
                p.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
                if (Child.child == null)
                {
                    continue;
                }

                float  growingProgress = Child.growingProgress();
                float  scale           = growingProgress * 0.35f + 0.35f;
                string suffix          = "";
                if (growingProgress != 1f)
                {
                    suffix = " [FAD934FF](" + Mathf.FloorToInt(growingProgress * 18) + ")";
                }

                if (Child.child == p)
                {
                    p.transform.localScale = new Vector3(scale, scale, 1f);
                    p.nameText.Text       += suffix;
                    if (MeetingHud.Instance != null)
                    {
                        foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
                        {
                            if (player.NameText != null && p.PlayerId == player.TargetPlayerId)
                            {
                                player.NameText.Text += suffix;
                            }
                        }
                    }
                }
                else if (Morphling.morphling != null && Morphling.morphling == p && Morphling.morphTarget != null && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f)
                {
                    p.transform.localScale = new Vector3(scale, scale, 1f);
                    p.nameText.Text       += suffix;
                }
                else
                {
                    p.transform.localScale = new Vector3(0.7f, 0.7f, 1f);
                }
            }
        }
        public static void playerSizeUpdate(PlayerControl p)
        {
            if (Child.child == null || Camouflager.camouflageTimer > 0f)
            {
                return;
            }

            float growingProgress = Child.growingProgress();
            float scale           = growingProgress * 0.35f + 0.35f;

            if (p == Child.child)
            {
                Child.child.transform.localScale = new Vector3(scale, scale, 1f);
            }
            if (Morphling.morphling != null && p == Morphling.morphling && Morphling.morphTarget == Child.child && Morphling.morphTimer > 0f)
            {
                p.transform.localScale = new Vector3(scale, scale, 1f);
            }
        }