예제 #1
0
 void GMModule()
 {
     powerLevel    = GM.numberOfPlayerBatteries;
     numbOfBossDef = GM.numOfBossesBeat;
     //tracks the state of the guns were last in
     if (GM.playerRHGunState == GameManager.StateGun.lvl1)
     {
         rHGunState = StateGun.lvl1;
     }
     if (GM.playerRHGunState == GameManager.StateGun.lvl2)
     {
         rHGunState = StateGun.lvl2;
     }
     if (GM.playerRHGunState == GameManager.StateGun.lvl3)
     {
         rHGunState = StateGun.lvl3;
     }
     if (GM.dualWieldWeapons == true)
     {//it checks to see if it was dual weild and to see what kind of thelvl it was at too
         leftHandIsEquipped = true;
         if (GM.playerLHGunState == GameManager.StateGun.lvl1)
         {
             lHGunState = StateGun.lvl1;
         }
         if (GM.playerLHGunState == GameManager.StateGun.lvl2)
         {
             lHGunState = StateGun.lvl2;
         }
         if (GM.playerLHGunState == GameManager.StateGun.lvl3)
         {
             lHGunState = StateGun.lvl3;
         }
     }
     //tracks the players color
     if (GM.playerColorState == GameManager.StatePlayerColor.blue)
     {
         colorState = StateArmorColorSet.blue;
     }
     if (GM.playerColorState == GameManager.StatePlayerColor.green)
     {
         colorState = StateArmorColorSet.green;
     }
     if (GM.playerColorState == GameManager.StatePlayerColor.red)
     {
         colorState = StateArmorColorSet.red;
     }
     //tracks the level of armor, light, medium and heavy.
     if (GM.playerArmorState == GameManager.StateArmor.light)
     {
         armorState = StateArmor.light;
     }
     if (GM.playerArmorState == GameManager.StateArmor.medium)
     {
         armorState = StateArmor.medium;
     }
     if (GM.playerArmorState == GameManager.StateArmor.heavy)
     {
         armorState = StateArmor.heavy;
     }
 }
예제 #2
0
    protected IEnumerator TimeToBetweenShot()
    {
        m_State = StateGun.BetweenShots;
        float currentTime = m_WeaponInfo.FireTime;

        //драчка с погрешностями времени
        if (currentTime <= TimeManager.TimeDeltaTime)
        {
            m_TimeError += (TimeManager.TimeDeltaTime - m_WeaponInfo.FireTime);
            yield return(m_WaitEndFrame);

            m_TimeError += TimeManager.TimeDeltaTime;
            yield return(m_WaitEndFrame);
        }
        else
        {
            while (currentTime > 0f)
            {
                yield return(null);

                currentTime -= TimeManager.TimeDeltaTime;
                //драчка с погрешностями времени
                if (currentTime < 0f)
                {
                    m_TimeError -= currentTime;
                }
            }
        }
        m_State = StateGun.Ready;
    }
예제 #3
0
    public void PickUpCheck(GameObject pickUp)
    {
        /*so this module will take in a gameobject that should be pass in the trigger method
         * it will compareTag and change the state of that affected object i
         * if the left hand is not equipped nothing will happen when the player picks up a left handed weapon
         */
        if (pickUp.CompareTag("DualWield"))
        {
            leftHandIsEquipped = true;
        }
        if (pickUp.CompareTag("ShieldPickUp"))
        {
            ActivateShield();
        }

        //basic level upgrades for each hand 3 lvls
        if (pickUp.CompareTag("GunPickUP1"))
        {
            rHGunState = StateGun.lvl1;
        }
        if (pickUp.CompareTag("LGunPickUp1"))
        {
            lHGunState = StateGun.lvl1;
        }

        if (pickUp.CompareTag("GunPickUP2"))
        {
            rHGunState = StateGun.lvl2;
        }
        if (pickUp.CompareTag("LGunPickUp2"))
        {
            lHGunState = StateGun.lvl2;
        }
        if (pickUp.CompareTag("GunPickUP3"))
        {
            rHGunState = StateGun.lvl3;
        }
        if (pickUp.CompareTag("LGunPickUp3"))
        {
            lHGunState = StateGun.lvl3;
        }

        if (pickUp.CompareTag("ArmorStation1"))
        {
            ChangeArmorStateTo(0);
        }

        if (pickUp.CompareTag("ArmorStation2"))
        {//level 2 check
            ChangeArmorStateTo(1);
        }

        if (pickUp.CompareTag("ArmorStation3"))
        {//level 3 check
            ChangeArmorStateTo(2);
        }
    }
예제 #4
0
 void OnDisable()
 {
     DisableActionsGun();
     m_State = StateGun.Busy;
     if (m_StreamReload != null)
     {
         StopCoroutine(m_StreamReload);
     }
     m_StreamReload = null;
 }
예제 #5
0
    protected IEnumerator TimeToReload()
    {
        m_State = StateGun.Reload;
        yield return(YI_ttra);

        yield return(m_WaitEndFrame);

        m_State = StateGun.Ready;
        SetAmmoInCage();
    }
예제 #6
0
 public bool InstantlyReload()
 {
     if (m_State == StateGun.Busy || m_WeaponInfo.IsFullCage)
     {
         return(false);
     }
     DisableActionsGun();
     SetAmmoInCage();
     m_State = StateGun.Ready;
     return(true);
 }
예제 #7
0
    //Использовать очень аккуратно
    public void SetForceState(int NewState)
    {
        StateGun newState = (StateGun)NewState;

        if (m_State == newState)
        {
            return;
        }
        DisableActionsGun();
        //if (SG == StateGun.Reload) SetAmmoInCage();
        //if (newState == StateGun.Reload) SetAmmoInCage();
        m_State = newState;
    }
예제 #8
0
    //------------------------------------------------- end changing color section---------------------------------------------------------------------------

    private void OnTriggerEnter2D(Collider2D other)
    {//when the players trigger is entered the it will take the name
        Debug.Log("I am touching " + other.gameObject.name);
        //and cash it in a varibale
        GameObject hitItem = other.gameObject;

        if (hitItem.CompareTag("EnemyAmmo"))
        {//if that item is enemyammo then it will take the projectilebehaviours damage out vairable and takedamage with that amount
            ProjectileBehaviour hit = hitItem.GetComponent <ProjectileBehaviour>();
            if (hit != null)
            {
                TakeDamage(hit.damageOut);
            }
        }
        else if (hitItem.CompareTag("Enemy"))
        {//if the object is just an enemy itself them the player loses their second weapon
            if (leftHandIsEquipped == true)
            {
                leftHandIsEquipped = false;
                return;
            }// but if the player doesn have the left hand equipped then it will reduce the gunstate to 1
            else if (rHGunState > 0)
            {
                rHGunState = StateGun.lvl1;
                return;
            }
            else if (armorState > 0)
            {
                armorState = StateArmor.light;
            }
        }
        else
        {
            PickUpCheck(hitItem);
        }
    }
예제 #9
0
    void CheckOnPlayersWeaponStatus()
    {
        if (thePlayer.rHGunState == TopDownControlls.StateGun.lvl1)
        {
            playerRHGunState = StateGun.lvl1;
        }
        if (thePlayer.rHGunState == TopDownControlls.StateGun.lvl2)
        {
            playerRHGunState = StateGun.lvl2;
        }
        if (thePlayer.rHGunState == TopDownControlls.StateGun.lvl3)
        {
            playerRHGunState = StateGun.lvl3;
        }

        if (thePlayer.leftHandIsEquipped == true)
        {
            dualWieldWeapons = true;
            if (thePlayer.lHGunState == TopDownControlls.StateGun.lvl1)
            {
                playerLHGunState = StateGun.lvl1;
            }
            if (thePlayer.lHGunState == TopDownControlls.StateGun.lvl2)
            {
                playerLHGunState = StateGun.lvl2;
            }
            if (thePlayer.lHGunState == TopDownControlls.StateGun.lvl3)
            {
                playerLHGunState = StateGun.lvl3;
            }
        }
        else if (thePlayer.leftHandIsEquipped == false)
        {
            dualWieldWeapons = false;
        }
    }
예제 #10
0
 protected virtual void OnEnable()
 {
     m_State = StateGun.Ready;
     ActiveStreamReload(true);
 }
예제 #11
0
 public void SetDefaultState(bool completeCurrent)
 {
     m_State = StateGun.Ready;
 }
예제 #12
0
 public void SetBusy()
 {
     DisableActionsGun();
     m_State = StateGun.Busy;
 }