Example #1
0
        public void OnPepObtain(int pepCount, Collider other)
        {
            if (pepCount > 0 && other != null)
            {
                PlayerMachine p = other.GetComponent <PlayerMachine>();

                if (p && !p.voided && !PlayerMachine.CurrentCostume.Equals(Costumes.Miku))
                {
                    int costumeIndex = Convert.ToInt32(Math.Truncate(UnityEngine.Random.Range(0f, 3.99f)));
                    p.SetCostume((Costumes)costumeIndex);

                    if ((Costumes)costumeIndex != Costumes.Default)
                    {
                        Manager.Dialogue.UpdateCostumePortrait();
                    }

                    if (UnityEngine.Random.value <= zapPercent)
                    {
                        LogDebug($"{_name}: Zaptime!");
                        p.GetStunned(1.2f);
                    }
                }
            }
        }