Example #1
0
 protected override void Awake()
 {
     vp_FPController.cs = this;
     base.Awake();
     this.m_CharacterController         = base.gameObject.GetComponent <CharacterController>();
     this.m_NormalHeight                = this.CharacterController.height;
     this.CharacterController.center    = (this.m_NormalCenter = new Vector3(0f, this.m_NormalHeight * 0.5f, 0f));
     this.CharacterController.radius    = this.m_NormalHeight * 0.25f;
     this.m_CrouchHeight                = this.m_NormalHeight * 0.5f;
     this.m_CrouchCenter                = this.m_NormalCenter * 0.5f;
     this.m_CharacterController.enabled = false;
     this.steps_audio            = base.gameObject.AddComponent <AudioSource>();
     this.steps_walk_concrete[0] = SND.GetSoundByName("player/movement/walk_concrete1");
     this.steps_walk_concrete[1] = SND.GetSoundByName("player/movement/walk_concrete2");
     this.steps_walk_concrete[2] = SND.GetSoundByName("player/movement/walk_concrete3");
     this.steps_walk_concrete[3] = SND.GetSoundByName("player/movement/walk_concrete4");
     this.steps_run_concrete[0]  = SND.GetSoundByName("player/movement/run_concrete1");
     this.steps_run_concrete[1]  = SND.GetSoundByName("player/movement/run_concrete2");
     this.steps_run_concrete[2]  = SND.GetSoundByName("player/movement/run_concrete3");
     this.steps_run_concrete[3]  = SND.GetSoundByName("player/movement/run_concrete4");
     this.steps_walk_gravel[0]   = SND.GetSoundByName("player/movement/walk_gravel1");
     this.steps_walk_gravel[1]   = SND.GetSoundByName("player/movement/walk_gravel2");
     this.steps_walk_gravel[2]   = SND.GetSoundByName("player/movement/walk_gravel3");
     this.steps_walk_gravel[3]   = SND.GetSoundByName("player/movement/walk_gravel4");
     this.steps_run_gravel[0]    = SND.GetSoundByName("player/movement/run_gravel1");
     this.steps_run_gravel[1]    = SND.GetSoundByName("player/movement/run_gravel2");
     this.steps_run_gravel[2]    = SND.GetSoundByName("player/movement/run_gravel3");
     this.steps_run_gravel[3]    = SND.GetSoundByName("player/movement/run_gravel4");
 }
Example #2
0
 public static void Init()
 {
     foreach (KeyValuePair <int, CWeaponData> current in WeaponData.weapons)
     {
         current.Value.fire1 = SND.GetSoundByName("weapon/" + current.Value.wName.ToLower() + "_fire1");
         current.Value.icon  = TEX.GetTextureByName("weapon_" + current.Value.wName.ToLower());
         if (current.Value.icon == null)
         {
             Debug.Log("[TEX] can't load: weapon_" + current.Value.wName.ToLower());
         }
         if (current.Value.icon)
         {
             int width  = current.Value.icon.width;
             int height = current.Value.icon.height;
             current.Value.icon2_inverted = new Texture2D(width, height, TextureFormat.RGBA32, false);
             current.Value.icon2          = new Texture2D(width, height, TextureFormat.RGBA32, false);
             for (int i = 0; i < width; i++)
             {
                 for (int j = 0; j < height; j++)
                 {
                     current.Value.icon2.SetPixel(width - i, j, new Color(1f, 1f, 1f, current.Value.icon.GetPixel(i, j).a));
                     current.Value.icon2_inverted.SetPixel(i, j, new Color(1f, 1f, 1f, current.Value.icon.GetPixel(i, j).a));
                 }
             }
             current.Value.icon2.Apply(true);
             current.Value.icon2_inverted.Apply(true);
         }
     }
 }
Example #3
0
 public void PostAwake()
 {
     Zombie.tInfectedScreen = Resources.Load <Texture2D>("Textures/blood_w");
     Zombie.infectionSound  = SND.GetSoundByName("zombie_infection");
     Zombie.attackSound     = SND.GetSoundByName("zombie_attack");
     this.tGradient         = TEX.GetTextureByName("GUI/left_gradient");
     Zombie.infectedScreen  = false;
     this.OnResize();
 }
Example #4
0
 private void Start()
 {
     this.detonationSound                   = SND.GetSoundByName("smokegrenade");
     GrenadeSmoke.asDetonation              = base.GetComponent <AudioSource>();
     GrenadeSmoke.asDetonation.maxDistance  = 50f;
     GrenadeSmoke.asDetonation.rolloffMode  = AudioRolloffMode.Linear;
     GrenadeSmoke.asDetonation.volume       = 0.5f * Options.gamevol;
     GrenadeSmoke.asDetonation.spatialBlend = 1f;
     GrenadeSmoke.asDetonation.PlayOneShot(this.detonationSound);
     this.smoketime   = Time.time + 35f;
     this.destroytime = Time.time + 50f;
 }
Example #5
0
 private void Start()
 {
     this.detonationSound                   = SND.GetSoundByName("flashbang");
     GrenadeFlash.asDetonation              = base.GetComponent <AudioSource>();
     GrenadeFlash.asDetonation.maxDistance  = 50f;
     GrenadeFlash.asDetonation.rolloffMode  = AudioRolloffMode.Linear;
     GrenadeFlash.asDetonation.volume       = 0.5f * Options.gamevol;
     GrenadeFlash.asDetonation.spatialBlend = 1f;
     GrenadeFlash.asDetonation.PlayOneShot(this.detonationSound);
     this.lightComp   = base.GetComponentInChildren <Light>();
     this.destroytime = Time.time + 3f;
 }
Example #6
0
 protected override void Awake()
 {
     base.Awake();
     this.m_FPSCamera           = base.transform.root.GetComponentInChildren <vp_FPCamera>();
     this.m_OperatorTransform   = this.m_FPSCamera.transform;
     this.m_NextAllowedFireTime = Time.time;
     this.ProjectileSpawnDelay  = Mathf.Min(this.ProjectileSpawnDelay, this.ProjectileFiringRate - 0.1f);
     this.as_dryfire            = base.Parent.GetComponent <AudioSource>();
     if (this.sndSoundDryFire == null)
     {
         this.sndSoundDryFire = SND.GetSoundByName(this.SoundDryFire);
     }
 }
Example #7
0
        public float?EstimateProbability(float term)
        {
            var dispersion = maxDurationPath?.First().SqrDispersionPath();

            if (dispersion == null)
            {
                return(null);
            }

            var z = (term - maxDurationPath.First().duration) / dispersion;

            return(SND.GetChance((float)z));
        }
Example #8
0
 protected virtual void Awake()
 {
     this.m_Audio  = base.gameObject.transform.parent.GetComponent <AudioSource>();
     this.m_Player = (vp_FPPlayerEventHandler)base.transform.root.GetComponentInChildren(typeof(vp_FPPlayerEventHandler));
     if (this.sndSoundReload == null)
     {
         this.sndSoundReload = SND.GetSoundByName(this.SoundReload);
     }
     if (this.sndSoundReloadEmpty == null)
     {
         this.sndSoundReloadEmpty = SND.GetSoundByName(this.SoundReloadEmpty);
     }
 }
Example #9
0
 public void PostAwake()
 {
     C4.checkTime       = Time.realtimeSinceStartup;
     C4.trPlayer        = GameObject.Find("LocalPlayer").transform;
     C4.placeBomb       = ContentLoader_.LoadGameObject("c4_place");
     C4.plantStartSound = SND.GetSoundByName("c4_plant");
     C4.showDiffuseBar  = false;
     C4.sector          = new C4.PlantSector[2];
     C4.plant           = new List <C4.PlantSector> [2];
     C4.plant[0]        = new List <C4.PlantSector>();
     C4.plant[1]        = new List <C4.PlantSector>();
     this.csCamera      = (vp_FPCamera)UnityEngine.Object.FindObjectOfType(typeof(vp_FPCamera));
     this.csController  = (vp_FPController)UnityEngine.Object.FindObjectOfType(typeof(vp_FPController));
 }
Example #10
0
 protected override void Awake()
 {
     base.Awake();
     this.m_OperatorTransform   = base.Transform;
     this.m_CharacterController = this.m_OperatorTransform.root.GetComponentInChildren <CharacterController>();
     this.m_NextAllowedFireTime = Time.time;
     this.ProjectileSpawnDelay  = Mathf.Min(this.ProjectileSpawnDelay, this.ProjectileFiringRate - 0.1f);
     if (this.sndSoundFire == null)
     {
         this.sndSoundFire = SND.GetSoundByName(this.SoundFire);
     }
     if (this.sndSoundFire == null)
     {
         MonoBehaviour.print("[WEAPON] can't load audioclip: " + this.SoundFire);
     }
 }
Example #11
0
 public void PostAwake()
 {
     HitSound.hit[0]         = SND.GetSoundByName("player/player_hit0");
     HitSound.hit[1]         = SND.GetSoundByName("player/player_hit1");
     HitSound.hit[2]         = SND.GetSoundByName("player/player_hit2");
     HitSound.hitZombie[0]   = SND.GetSoundByName("zombie_hit01");
     HitSound.hitZombie[1]   = SND.GetSoundByName("zombie_hit02");
     HitSound.hitZombie[2]   = SND.GetSoundByName("zombie_hit03");
     HitSound.death[0]       = SND.GetSoundByName("player/player_die1");
     HitSound.death[1]       = SND.GetSoundByName("player/player_die2");
     HitSound.death[2]       = SND.GetSoundByName("player/player_die3");
     HitSound.death[3]       = SND.GetSoundByName("player/player_die4");
     HitSound.deathZombie[0] = SND.GetSoundByName("zombie_die01");
     HitSound.deathZombie[1] = SND.GetSoundByName("zombie_die02");
     HitSound.a             = base.gameObject.AddComponent <AudioSource>();
     HitSound.a.loop        = false;
     HitSound.a.playOnAwake = false;
 }
Example #12
0
 public void Init()
 {
     C4Place.detonationSound      = SND.GetSoundByName("c4_explosion");
     C4Place.detonationFarSound   = SND.GetSoundByName("FarExplosionA");
     C4Place.beepSound            = SND.GetSoundByName("c4_beep");
     C4Place.diffuseStartSound    = SND.GetSoundByName("c4_diffuse");
     C4Place.diffuseEndSound      = SND.GetSoundByName("c4_diffuse_end");
     C4Place.plantEndSound        = SND.GetSoundByName("c4_plant_end");
     C4Place.asBeep               = base.GetComponent <AudioSource>();
     C4Place.asBeep.maxDistance   = 50f;
     C4Place.asBeep.rolloffMode   = AudioRolloffMode.Linear;
     C4Place.asBeep.volume        = 0.5f * Options.gamevol;
     C4Place.asBeep.spatialBlend  = 1f;
     C4Place.asInstr              = base.GetComponent <AudioSource>();
     C4Place.asInstr.maxDistance  = 50f;
     C4Place.asInstr.rolloffMode  = AudioRolloffMode.Linear;
     C4Place.asInstr.volume       = 0.5f * Options.gamevol;
     C4Place.asInstr.spatialBlend = 1f;
 }
Example #13
0
        public float?EstimateMaxPossibleTime(float chance)
        {
            var duration = maxDurationPath?.First().duration;

            if (duration == null)
            {
                return(null);
            }

            var z = SND.GetZ(chance);

            if (z == null)
            {
                return(null);
            }

            return
                (maxDurationPath.First().duration +
                 z * maxDurationPath.First().SqrDispersionPath());
        }
Example #14
0
 private void Awake()
 {
     Application.runInBackground = true;
     BlackScreen.SetActive(false);
     Zombie.SetInfectedScreen(false);
     GUI2.Init();
     TEX.Init();
     SND.Init();
     PlayerControll.Init();
     WeaponData.Init();
     BasePlayer.Init();
     EntControll.Init();
     this.goGUI = GameObject.Find("GUI");
     this.goGUI.GetComponent <global::Console>().PostAwake();
     this.goGUI.GetComponent <Crosshair>().PostAwake();
     this.goGUI.GetComponent <HUD>().PostAwake();
     this.goGUI.GetComponent <ChooseTeam>().PostAwake();
     this.goGUI.GetComponent <ScoreBoard>().PostAwake();
     this.goGUI.GetComponent <Chat>().PostAwake();
     this.goGUI.GetComponent <ScoreTop>().PostAwake();
     this.goGUI.GetComponent <Award>().PostAwake();
     this.goGUI.GetComponent <PlayerNames>().PostAwake();
     this.goGUI.GetComponent <Message>().PostAwake();
     this.goGUI.GetComponent <Indicator>().PostAwake();
     this.goGUI.GetComponent <BuyMenu>().PostAwake();
     this.goGUI.GetComponent <EscapeMenu>().PostAwake();
     this.goGUI.GetComponent <Vote>().PostAwake();
     this.goGUI.GetComponent <C4>().PostAwake();
     this.goGUI.GetComponent <MenuBanList>().PostAwake();
     this.goGUI.GetComponent <BlackScreen>().PostAwake();
     this.goGUI.GetComponent <Zombie>().PostAwake();
     this.goPlayer = GameObject.Find("LocalPlayer");
     this.goPlayer.GetComponent <HitSound>().PostAwake();
     this.goPlayer.GetComponent <HitEffect>().PostAwake();
     this.goCore = GameObject.Find("Core");
     this.goCore.GetComponent <UDPClient>().PostAwake();
     this.goCore.GetComponent <Client>().PostAwake();
     base.SendMessage("PostAwake");
     base.StartCoroutine("autostart");
     RenderSettings.fog = false;
 }
Example #15
0
 private void Start()
 {
     CutoffFX.asDetonation = base.GetComponent <AudioSource>();
     CutoffFX.fxSound      = SND.GetSoundByName("flashbang_fx");
     CutoffFX.phaseStep    = 4;
 }
 private void NoDelayHitHS()
 {
     BasePlayer.go.GetComponent <AudioSource>().PlayOneShot(SND.GetSoundByName("player/enemy_headshot"));
 }
Example #17
0
 public static extern bool PlaySound([In, Optional, MarshalAs(UnmanagedType.LPTStr)] string pszSound, [In, Optional] HINSTANCE hmod, [In, Optional] SND fdwSound);
Example #18
0
        protected override void Shutdown()
        {
            try
            {
                lib.gameStatus = 0;
                if (lib.status == 0)
                {
                    Utility.WindowText("Asheron's Call");
                }
                else if (lib.Autorelog == false)
                {
                    Utility.AddWindowText(lib.MyServer + " : " + lib.MyName + " logged off by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt"));
                    if (lib.UseMacroLogic == true && lib.reason != "user")
                    {
                        Utility.ActivateWindow();
                    }
                }
                else if (lib.Autorelog == true && lib.longcycle == false)
                {
                    Utility.AddWindowText(lib.MyServer + " : " + lib.MyName + " logged off by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt") + ". Relogger is set to " + lib.Timer + " seconds. Counter: " + lib.relogcounter);
                    if (lib.UseMacroLogic == true)
                    {
                        Utility.ActivateWindow();
                    }
                }
                else if (lib.Autorelog == true && lib.longcycle == true)
                {
                    Utility.AddWindowText(lib.MyServer + " : " + lib.MyName + " logged off by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt") + ". Relogger is on Long Cycle (10 minutes).");
                    lib.longcycle = false;
                    if (lib.UseMacroLogic == true)
                    {
                        Utility.ActivateWindow();
                    }
                }

                lib.MyCore.CharacterFilter.Login -= Core_Login_Init;

                if (lib.AuthInstance > 0)
                {
                    ATH.Dispose();
                }
                if (lib.CommandsInstance > 0)
                {
                    CMD.Dispose();
                }
                if (lib.LoggingInstance > 0)
                {
                    LGM.Dispose();
                }
                if (lib.ViewControlInstance > 0)
                {
                    VCT.Dispose();
                }
                if (lib.ScannerInstance > 0)
                {
                    SCN.Dispose();
                }
                if (lib.DeathParseInstance > 0)
                {
                    DTH.Dispose();
                }
                if (lib.SoundInstance > 0)
                {
                    SND.Dispose();
                }
                if (lib.MacroInstance > 0)
                {
                    MCL.Dispose();
                }
                if (lib.VersInstance > 0)
                {
                    VSC.Dispose();
                }
                if (lib.HUDInstance > 0)
                {
                    HUD.Dispose();
                }
                if (lib.ReportInstance > 0)
                {
                    REP.Dispose();
                }

                if (SCN != null)
                {
                    SCN = null;
                }
                if (SND != null)
                {
                    SND = null;
                }
                if (ATH != null)
                {
                    ATH = null;
                }
                if (VCT != null)
                {
                    VCT = null;
                }
                if (DTH != null)
                {
                    DTH = null;
                }
                if (CMD != null)
                {
                    CMD = null;
                }
                if (VSC != null)
                {
                    VSC = null;
                }
                if (LGM != null)
                {
                    LGM = null;
                }
                if (MCL != null)
                {
                    MCL = null;
                }
                if (HUD != null)
                {
                    HUD = null;
                }
                if (REP != null)
                {
                    REP = null;
                }

                if (ShrtTmr.Enabled == true)
                {
                    ShrtTmr.Stop(); ShrtTmr.Dispose();
                }
                if (LngTmr.Enabled == true)
                {
                    LngTmr.Stop(); LngTmr.Dispose();
                }
                if (LogTmr.Enabled == true)
                {
                    LogTmr.Stop(); LogTmr.Dispose();
                }

                PGCore = null;
                lib.PluginInstance--;
                lib.Dispose();
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
Example #19
0
        public void Core_Login_Retry()
        {
            try
            {
                if (lib.PluginInstance == 1)
                {
                    if (lib.DFTEXT != null)
                    {
                        lib.DFTEXT.Dispose(); lib.DFTEXT = null;
                    }
                    if (lib.DF2TEXT != null)
                    {
                        lib.DF2TEXT.Dispose(); lib.DF2TEXT = null;
                    }
                    if (lib.AuthInstance > 0)
                    {
                        ATH.Dispose();
                    }
                    if (lib.CommandsInstance > 0)
                    {
                        CMD.Dispose();
                    }
                    if (lib.LoggingInstance > 0)
                    {
                        LGM.Dispose();
                    }
                    if (lib.ViewControlInstance > 0)
                    {
                        VCT.Dispose();
                    }
                    if (lib.ScannerInstance > 0)
                    {
                        SCN.Dispose();
                    }
                    if (lib.DeathParseInstance > 0)
                    {
                        DTH.Dispose();
                    }
                    if (lib.SoundInstance > 0)
                    {
                        SND.Dispose();
                    }
                    if (lib.MacroInstance > 0)
                    {
                        MCL.Dispose();
                    }
                    if (lib.VersInstance > 0)
                    {
                        VSC.Dispose();
                    }
                    if (lib.HUDInstance > 0)
                    {
                        HUD.Dispose();
                    }
                    if (lib.ReportInstance > 0)
                    {
                        REP.Dispose();
                    }

                    if (SCN != null)
                    {
                        SCN = null;
                    }
                    if (SND != null)
                    {
                        SND = null;
                    }
                    if (ATH != null)
                    {
                        ATH = null;
                    }
                    if (VCT != null)
                    {
                        VCT = null;
                    }
                    if (DTH != null)
                    {
                        DTH = null;
                    }
                    if (CMD != null)
                    {
                        CMD = null;
                    }
                    if (VSC != null)
                    {
                        VSC = null;
                    }
                    if (LGM != null)
                    {
                        LGM = null;
                    }
                    if (MCL != null)
                    {
                        MCL = null;
                    }
                    if (HUD != null)
                    {
                        HUD = null;
                    }
                    if (REP != null)
                    {
                        REP = null;
                    }

                    CMD = new Commands();
                    CMD.InitCommands(PGCore);
                    Core_Login_Check();
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
Example #20
0
 protected virtual void OnStart_Reload()
 {
     this.m_Player.Reload.AutoDuration = this.ReloadDuration;
     if (this.AnimationReload == "null")
     {
         this.StartReload   = Time.time;
         vp_FPInput.ZoomTap = false;
         return;
     }
     if (this.m_Weapon.WeaponID == 9 || this.m_Weapon.WeaponID == 16)
     {
         int ammoType = BasePlayer.currweapon.data.ammoType;
         if (BasePlayer.currweapon.data.maxClip - BasePlayer.currweapon.clip == 1 || BasePlayer.ammo[ammoType] == 1)
         {
             if (this.currAnimation == "ReloadStart" || this.currAnimation == "ReloadLoop")
             {
                 this.currAnimation  = "ReloadEnd";
                 this.ReloadDuration = this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().GetClip(this.currAnimation).length - 0.1f;
                 this.m_Player.Reload.AutoDuration = this.ReloadDuration;
                 this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Stop("ReloadEnd");
                 this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Play("ReloadEnd");
             }
             else
             {
                 this.currAnimation  = "ReloadOne";
                 this.ReloadDuration = this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().GetClip(this.currAnimation).length - 0.1f;
                 this.m_Player.Reload.AutoDuration = this.ReloadDuration;
                 this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Stop("ReloadOne");
                 this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Play("ReloadOne");
             }
         }
         else if (this.currAnimation == "Idle" || this.currAnimation == "ReloadEnd" || this.currAnimation == "ReloadOne")
         {
             this.currAnimation  = "ReloadStart";
             this.ReloadDuration = this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().GetClip(this.currAnimation).length - 0.1f;
             this.m_Player.Reload.AutoDuration = this.ReloadDuration;
             this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Stop("ReloadStart");
             this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Play("ReloadStart");
         }
         else
         {
             this.currAnimation  = "ReloadLoop";
             this.ReloadDuration = this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().GetClip(this.currAnimation).length - 0.1f;
             this.m_Player.Reload.AutoDuration = this.ReloadDuration;
             this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Stop("ReloadLoop");
             this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Play("ReloadLoop");
         }
         this.m_Audio.pitch = 1f;
         this.m_Audio.PlayOneShot(SND.GetSoundByName("bullet_insert"));
         this.StartReload   = Time.time;
         vp_FPInput.ZoomTap = false;
         return;
     }
     if (this.m_Weapon.WeaponID == 24 || this.m_Weapon.WeaponID == 25)
     {
         this.AnimationReloadEmpty = "null";
     }
     if (BasePlayer.currweapon.clip == 0 && this.AnimationReloadEmpty != "null")
     {
         this.ReloadDuration = this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().GetClip(this.AnimationReloadEmpty).length - 0.1f;
         this.m_Player.Reload.AutoDuration = this.ReloadDuration;
         this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Stop(this.AnimationReloadEmpty);
         this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Play(this.AnimationReloadEmpty);
     }
     else
     {
         this.ReloadDuration = this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().GetClip(this.AnimationReload).length - 0.1f;
         this.m_Player.Reload.AutoDuration = this.ReloadDuration;
         this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Stop(this.AnimationReload);
         this.m_Weapon.WeaponCoreModel.GetComponent <Animation>().Play(this.AnimationReload);
     }
     if (this.m_Audio != null)
     {
         this.m_Audio.pitch = 1f;
         if (BasePlayer.currweapon.clip == 0)
         {
             this.m_Audio.PlayOneShot(this.sndSoundReloadEmpty);
         }
         else
         {
             this.m_Audio.PlayOneShot(this.sndSoundReload);
         }
     }
     this.StartReload   = Time.time;
     vp_FPInput.ZoomTap = false;
 }