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; } }
void CheckOnPlayersArmorStatus() { if (thePlayer.colorState == TopDownControlls.StateArmorColorSet.blue) { playerColorState = StatePlayerColor.blue; } if (thePlayer.colorState == TopDownControlls.StateArmorColorSet.green) { playerColorState = StatePlayerColor.green; } if (thePlayer.colorState == TopDownControlls.StateArmorColorSet.red) { playerColorState = StatePlayerColor.red; } if (thePlayer.armorState == TopDownControlls.StateArmor.light) { playerArmorState = StateArmor.light; } if (thePlayer.armorState == TopDownControlls.StateArmor.medium) { playerArmorState = StateArmor.medium; } if (thePlayer.armorState == TopDownControlls.StateArmor.heavy) { playerArmorState = StateArmor.heavy; } }
// we will have a boss that will go down the levels of the armor and will take 3 dead batteries to kill about 30 hit points void Start() { //at the start boss will be at max levels bossState = StateBoss.alive; armorState = StateArmor.heavy; rHGunState = StateRHGun.lvl3; lHGunState = StateLHGun.lvl3; powerLevel = 2; playerTarget = FindObjectOfType <TopDownControlls>().gameObject.transform; moveSpot.position = new Vector2(Random.Range(minX, maxX), Random.Range(minY, maxY)); maxSpeed = speed; }
public void ChangeArmorStateTo(int armorLevel) { if (armorLevel == 0) { armorState = StateArmor.light; moveSpeed = moveSpeedOptions[0]; } if (armorLevel == 1) { armorState = StateArmor.medium; moveSpeed = moveSpeedOptions[1]; } if (armorLevel == 2) { armorState = StateArmor.heavy; moveSpeed = moveSpeedOptions[2]; } }
//------------------------------------------------- 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); } }