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; } }
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; }
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); } }
void OnDisable() { DisableActionsGun(); m_State = StateGun.Busy; if (m_StreamReload != null) { StopCoroutine(m_StreamReload); } m_StreamReload = null; }
protected IEnumerator TimeToReload() { m_State = StateGun.Reload; yield return(YI_ttra); yield return(m_WaitEndFrame); m_State = StateGun.Ready; SetAmmoInCage(); }
public bool InstantlyReload() { if (m_State == StateGun.Busy || m_WeaponInfo.IsFullCage) { return(false); } DisableActionsGun(); SetAmmoInCage(); m_State = StateGun.Ready; return(true); }
//Использовать очень аккуратно 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; }
//------------------------------------------------- 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); } }
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; } }
protected virtual void OnEnable() { m_State = StateGun.Ready; ActiveStreamReload(true); }
public void SetDefaultState(bool completeCurrent) { m_State = StateGun.Ready; }
public void SetBusy() { DisableActionsGun(); m_State = StateGun.Busy; }