Пример #1
0
    public void OnMagSlideAnimCompleted()
    {
        if (GameSettings.Instance == null)
        {
            _myGunBools.CanAcceptNewClip = false;
            return;
        }

        if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY)
        {
            _myGunBools.CanAcceptNewClip = false;
            StemKitMNGR.CALL_Start_UIcell(2);
        }
    }
Пример #2
0
    public void OnSlideOutAnimComplete()
    {
        if (GameSettings.Instance == null)
        {
            DropMagFromGun();
            return;
        }

        if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY)
        {
            DropMagFromGun();
            _myGunBools.CanAcceptNewClip = true;
            StemKitMNGR.CALL_Start_UIcell(1);
        }
    }
Пример #3
0
    void GunHandle_CellFiled(int argIdOfFilledCEll)
    {
        if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY)
        {
            if (argIdOfFilledCEll == 0)
            {
                _myGunAnimate.Gunimate_OPENSLIDER();
                _myGunEffect.AUDIO_PopMagOut();
            }
            else
            if (argIdOfFilledCEll == 1)
            {
                GunInjstantiateMagANDSLIDEINanim(); _myGunBools.CanAcceptNewClip = false;
                _myGunEffect.AUDIO_PushMagIn();
            }
            else
            if (argIdOfFilledCEll == 2)
            {
                // Debug.Log("CAN  SHOOT not yet, wiat for a mock HAMERanimatoin time to end , and just play HAMMERDOWN?");
                StemKitMNGR.CALL_Start_UIcell(-666);
                //___ time0.8 seconds of wait time before this point \
                _myGunAnimate.Gunimate_HAMMERDOWN(); //                |~
                _myGunEffect.AUDIO_Chamber();        //                                                     | to this poit is a wait of .8
            }//                                                       |
            else//                                                    V
            if (argIdOfFilledCEll == -666) //this is wird, since i dont have animation event on hammerdown, i ll fake it by making reloadmeterctrl run a waitforseconds, and at the same time jujst play the hammerdown anim. when waitfr ends, it should call CEllfilled(-666) which will hit here
            {
                // Debug.Log("and now i can shoot");
                _myGunBools.ThisGunIsReloading = false;
                _myGunBools.CAnManuallyDropMag = true;


                if (GameManager.Instance != null)
                {
                    GameManager.Instance.GetScoreMAnager().Increment_ReloadsCNT();
                }
            }
            else
            {
                Debug.LogError("there should only be 0,1,2, -666 right now");
            }
        }
    }
Пример #4
0
    //_myGunBools.CanAcceptNewClip = true;
    public void GUN_FIRE()
    {
        //****************************************************************************************************************************************
        //gunhelper.DrawStatic(barrelTran.transform.position, barrelTran.transform.position + (barrelTran.transform.forward * -5));
        //****************************************************************************************************************************************

        Quaternion thenewrot = DoSpread(stopSpreading);

        // gunhelper.DrawStatic(barrelTran.transform.position, thenewrot  * Vector3.one *5);

        //****************************************************************************************************************************************
        //gunhelper.DrawStatic(barrelTran.transform.position, barrelTran.transform.position + (thenewrot*(barrelTran.transform.forward * 5)  ));
        //****************************************************************************************************************************************
        if (_myGunBools.ThisGunIsReloading)
        {
            Debug.Log("no shot I b reloading "); return;
        }

        if (!_myMagazineMNGR.IsMagPlaced())
        {
            Debug.Log("no shot no mag in "); return;
        }

        if (!_myMagazineMNGR.IsThereBulletsInCurmag())
        {
            // Debug.Log("play dry shot  caling cell0");
            _myGunEffect.AUDIO_Dry();
            if (GameSettings.Instance.ReloadDifficulty != ARZReloadLevel.EASY)
            {
                StemKitMNGR.CALL_Start_UIcell(0);

                _myGunBools.ThisGunIsReloading = true;
                _myGunBools.CAnManuallyDropMag = true;
            }
            return;
        }


        {
            // repeat fire if gun type is uzi
            if (gunType == GunType.UZI)
            {
                _myGunAnimate.PlayFastest();
                stopSpreading = false;
                repeatTimer.StartTimer(repeatTime, GUN_FIRE, false);
            }
            else
            {
                _myGunAnimate.PlayFast();
            }

            if (!_myMagazineMNGR.IsMagPlaced())
            {
                Debug.Log("no mag");
                GUN_STOP_FIRE();//FOR SAFE MEASURE
                return;
            }
            if (_myMagazineMNGR.CanDecrementCurMagBulletCount())
            {
                //_myGunBools.BHazBullets = true;

                Instantiate(_myMagazineMNGR.GetChamberedBullet(), barrelTran.position, thenewrot);// barrelTran.rotation);
                _myGunAnimate.Gunimate_FIRE();
                GunFlash_FIRE();
            }
        }
    }