예제 #1
0
        public void AddBuff(string type, float value, float time)
        {
            switch (type)
            {
            case "Freeze":
                buffStatus.IsFreeze = value != 0 ? true : false;
                BuffTimer[type]     = time;
                BuffWatcher.Add(type);
                break;

            case "Shooter":
                audios[3].Play();
                buffStatus.IsShooting = value != 0 ? true : false;
                BuffTimer[type]       = time;
                BuffWatcher.Add(type);
                foreach (SimpleShooter st in shooterGroup)
                {
                    st.ShootEnable = true;
                }
                break;

            case "Shield":
                buffStatus.IsShield = value != 0 ? true : false;
                BuffTimer[type]     = time;
                BuffWatcher.Add(type);
                SubDecorations["helmet"].SetActive(true);
                break;

            case "JumpMul":
                buffStatus.JumpMul = value;
                BuffTimer[type]    = time;
                BuffWatcher.Add(type);
                break;

            case "JumpMulDelta":
                buffStatus.JumpMul  += value;
                BuffTimer["JumpMul"] = time;
                BuffWatcher.Add("JumpMul");
                if (buffStatus.JumpMul > 0)
                {
                    audios[0].PlayOneShot(speedupAudio, 1f);
                    ParticlePlay("dust");
                    ParticleStop("dec");
                }
                else
                {
                    audios[2].PlayOneShot(decAudio, 1f);
                    ParticlePlay("dec");
                    ParticleStop("dust");
                }
                break;

            default:
                break;
            }
        }
예제 #2
0
        public void RemoveBuff(string type)
        {
            switch (type)
            {
            case "Freeze":
                buffStatus.IsFreeze = false;
                BuffWatcher.Remove(type);
                break;

            case "Shooter":
                audios[3].Stop();
                buffStatus.IsShooting = false;
                foreach (SimpleShooter st in shooterGroup)
                {
                    st.ShootEnable = false;
                }
                BuffWatcher.Remove(type);
                break;

            case "Shield":
                buffStatus.IsShield = false;
                BuffWatcher.Remove(type);
                SubDecorations["helmet"].SetActive(false);
                break;

            case "JumpMul":
                buffStatus.JumpMul = 0;
                BuffWatcher.Remove(type);
                ParticleStop("dec");
                ParticleStop("dust");
                break;

            case "All":    //Will remove in next turn
                foreach (string index in BuffWatcher)
                {
                    BuffTimer[index] = 0;
                }
                break;

            default:
                break;
            }
        }