Beispiel #1
0
 void Start()
 {
     tr        = transform;
     tss       = footstepSource.GetComponent <TimeScaleSound>();
     msP       = GetComponent <MovementSync_Proxy>();
     footSound = concrete[0];
 }
    private void Explode()
    {
        GameObject dInst = (GameObject)Instantiate(detonationPrefab, transform.position, transform.rotation);

        AreaDamage aDmg = dInst.GetComponent <AreaDamage>();

        if (aDmg != null)
        {
            if (onlyVisual)
            {
                aDmg.enabled = false;
            }
            else
            {
                aDmg.overrideMaxDmg   = explosionDamage;
                aDmg.overrideMaxRange = explosionRadius;
            }
        }

        TimeScaleSound tss = dInst.GetComponent <TimeScaleSound>();

        if (tss != null)
        {
            tss.UpdatePitch(Random.Range(0.88f, 1f));
            tss.PlaySound();
        }
        else if (dInst.GetComponent <AudioSource>() != null)
        {
            dInst.GetComponent <AudioSource>().pitch *= Random.Range(0.88f, 1f);
        }

        RemoveInstance();
    }
 void Start()
 {
     GetComponent <BaseStats>().hasLimbs = true;
     pa         = GetComponent <ProxyAnimator>();
     animator   = GetComponent <Animator>();
     controller = GetComponent <CharacterController>();
     rattleTSS  = equipmentRattleSource.GetComponent <TimeScaleSound>();
     isGrounded = false;
 }
Beispiel #4
0
    void Start()
    {
        tss = GetComponent <TimeScaleSound>();

        if (tss)
        {
            tss.pitchMod = Random.Range(minPitch, maxPitch);
        }
        else
        {
            GetComponent <AudioSource>().pitch = Random.Range(minPitch, maxPitch);
        }
    }
Beispiel #5
0
    public void RunStart()
    {
        if (mpReferenceOnly)
        {
            return;
        }

        PlayerReference pr = GeneralVariables.playerRef;

        pl  = pr.GetComponent <PlayerLook>();
        pm  = pr.GetComponent <PlayerMovement>();
        wm  = pr.wm;
        dm  = pr.dm;
        ac  = pr.ac;
        acs = pr.acs;
        tss = firePos.GetComponent <TimeScaleSound>();

        UIController uiController = GeneralVariables.uiController;

        curAmmoDisplay  = uiController.curAmmoDisplay;
        ammoLeftDisplay = uiController.ammoLeftDisplay;
        ammoBar         = uiController.ammoBar;
        crosshair       = uiController.crosshairs;

        if (muzzleLight != null)
        {
            muzzleBrightness = muzzleLight.intensity;
        }

        initializeTime = Time.time;
        PoolManager.Instance.Initialize();
        gunVisuals       = GetComponent <GunVisuals>();
        shootImpulseGUI  = 1f;
        reloadImpulseGUI = 1f;

        pa       = GetComponent <PistolAnim>();
        maxIndex = 2;
        SwitchFiringMethod();
        flashlightOn  = false;
        startCounting = false;
        fireCount     = 0;
        asm           = 1f;
        spreadReal    = baseSpreadAmount;
        bsna          = baseSpreadAmount;
    }
Beispiel #6
0
    void Start()
    {
        GeneralVariables.player = gameObject;
        GeneralVariables.uiController.guiCamera.enabled = true;
        tr             = transform;
        controller     = GetComponent <CharacterController>();
        tss            = footsteps.footstepPos.GetComponent <TimeScaleSound>();
        playerMeshAnim = animations.playerMesh.GetComponent <Animation>();

        UIController uic = GeneralVariables.uiController;

        fadeSprite = uic.fadeFromBlack;
        uic.guiCamera.GetComponent <GUISway>().InitializeVariables();

        PlayerReference pr = GetComponent <PlayerReference>();

        pv = GetComponent <PlayerVitals>();
        pl = GetComponent <PlayerLook>();
        ia = pr.ia;
        wc = pr.wc;
        ac = pr.ac;
        wm = pr.wm;
        dm = pr.dm;

        defaultHeight  = controller.height;
        defaultHeadPos = head.localPosition;
        defaultLegPos  = animations.playerMesh.transform.localPosition + (Vector3.down * animations.meshOffset);
        normalLimit    = Mathf.Cos(controller.slopeLimit * Mathf.Deg2Rad);
        curSpeed       = movement.runSpeed;
        jumpTime       = -0.25f;
        impactMod      = 1f;
        fDmgSpeedMult  = 1f;

        AntiHackSystem.ProtectFloat("runSpeed", movement.runSpeed);
        AntiHackSystem.ProtectFloat("sprintSpeed", movement.sprintSpeed);
        AntiHackSystem.ProtectFloat("crouchSpeed", movement.crouchSpeed);
        AntiHackSystem.ProtectFloat("walkSpeed", movement.walkSpeed);
        AntiHackSystem.ProtectFloat("jumpHeight", movement.jumpHeight);

        grounded = false;
        movement.crouchDetection.gameObject.SetActive(false);
        AudioSource.PlayClipAtPoint(initializeSound, footsteps.footstepPos.transform.position, 0.12f);
        StartCoroutine(FadeFromBlack());
    }
Beispiel #7
0
    void Start()
    {
        base.isLocalPlayer = true;
        GeneralVariables.cachedSpectCam = cachedSpectCam;
        uic       = GeneralVariables.uiController;
        rattleTSS = equipmentRattleSource.GetComponent <TimeScaleSound>();

        healthBar         = uic.healthBar;
        healthText        = uic.healthText;
        shieldBar         = uic.shieldBar;
        shieldText        = uic.shieldText;
        staminaBar        = uic.staminaBar;
        shieldTexture     = uic.shieldTexture;
        ne                = uic.guiCamera.GetComponent <NoiseEffect>();
        disE              = uic.guiCamera.GetComponent <DistortionEffect>();
        staminaBackground = staminaBar.backgroundWidget;
        defStaminaBGCol   = staminaBackground.color;
        bloodyScreen      = uic.bloodyScreen;
        flickeringGUI     = uic.flickeringPanels;
        sa                = uic.screenAdjustment;

        bloodyScreen.material.color = DarkRef.SetAlpha(bloodyScreen.material.color, 0f);

        PlayerReference pr = GeneralVariables.playerRef;

        pm         = GetComponent <PlayerMovement>();
        playerLook = GetComponent <PlayerLook>();
        vignetting = cam.GetComponent <VignettingC>();

        damageBreathBoost  = 0f;
        ne.grainIntensity  = 0f;
        disE.baseIntensity = 0f;
        guiSizeModH        = guiSizeModS = 1f;
        healthBar.value    = 0f;
        shieldBar.value    = 0f;
        breathFactor       = 1f;
        hearingPenalty     = 1f;
        standardFreq       = 5000f;

        wm = pr.wm;
        wc = pr.wc;

        shieldAlpha      = 0f;
        finalShAlpha     = 0f;
        flickerIntensity = 0.5f;
        percent          = 1f;
        shPercent        = 1f;
        recovering       = true;
        canSprint        = true;
        initTime         = Time.time;

        damageIDs       = new List <byte>();
        damageInflicted = new List <int>();
        killerID        = -1;
        headID          = -1;
        lastWeaponID    = -1;
        builtData       = "";

        //Initialize values.
        curHealth = maxHealth;
        curShield = maxShield;
        AntiHackSystem.ProtectInt("maxHealth", maxHealth);
        AntiHackSystem.ProtectInt("maxShield", maxShield);

        oldHealth = curHealth;
        oldShield = curShield;
    }