Skip to content
Snippets Groups Projects
Commit 1e8a2c95 authored by Graham Solie's avatar Graham Solie
Browse files

Pot and blessing bugs squished

squished em
parent d907dadc
No related branches found
No related tags found
No related merge requests found
Showing
with 41 additions and 35 deletions
No preview for this file type
No preview for this file type
......@@ -37,6 +37,9 @@ public class ArenaCombatControl : MonoBehaviour {
public float dashTimerA;
public bool dashD = false;
public bool dashA = false;
public static bool drinkStength = false;
public static bool drinkAgility = false;
public static bool drinkDefence = false;
public static int winCount;
......@@ -138,6 +141,31 @@ public class ArenaCombatControl : MonoBehaviour {
private void EnemyDeadCheck() {
if (EnemyAI.isEnemyDead == true) {
myAnimator.SetBool("victory", true);
if (PlayerStats.offenseBlessing == true) {
PlayerStats.agility -= 1;
PlayerStats.strength -= 1;
PlayerStats.offenseBlessing = false;
}
if (PlayerStats.defenseBlessing == true) {
PlayerStats.defense -= 1;
PlayerStats.vitality -= 1;
PlayerStats.defenseBlessing = false;
}
if (PlayerStats.luckBlessing == true) {
PlayerStats.luck -= 2;
PlayerStats.luckBlessing = false;
}
if (drinkStength == true) {
StrengthBoostCoolDown();
}
if (drinkDefence == true) {
DefenceBoostCoolDown();
}
if (drinkAgility == true) {
AgilityBoostCoolDown();
}
}
else {
myAnimator.SetBool("victory", false);
......@@ -352,16 +380,19 @@ public class ArenaCombatControl : MonoBehaviour {
if (Input.GetKeyDown(KeyCode.Alpha1) && PlayerStats.strengthPotions >= 1) {
boostStrength();
PlayerStats.strengthPotions--;
drinkStength = true;
myAnimator.SetBool("drink", true);
}
else if (Input.GetKeyDown(KeyCode.Alpha2) && PlayerStats.agilityPotions >= 1) {
boostAgility();
PlayerStats.agilityPotions--;
drinkAgility = true;
myAnimator.SetBool("drink", true);
}
else if (Input.GetKeyDown(KeyCode.Alpha3) && PlayerStats.defensePotions >= 1) {
boostDefence();
PlayerStats.defensePotions--;
drinkDefence = true;
myAnimator.SetBool("drink", true);
}
else if (Input.GetKeyDown(KeyCode.Alpha4) && PlayerStats.healthPotions >= 1) {
......@@ -396,13 +427,16 @@ public class ArenaCombatControl : MonoBehaviour {
//take boost off the respected skills
private void StrengthBoostCoolDown() {
drinkStength = false;
PlayerStats.strength -= 15;
}
private void DefenceBoostCoolDown() {
drinkDefence = false;
PlayerStats.defense -= 15;
}
private void AgilityBoostCoolDown() {
drinkAgility = false;
PlayerStats.agility -= 15;
}
......
......@@ -93,22 +93,7 @@ public class PlayerMovement : MonoBehaviour
*/
private void Drink() {
//Can only drink the respected potion if the respected potion exists
if (Input.GetKeyDown(KeyCode.Alpha1) && PlayerStats.strengthPotions >= 1) {
boostStrength();
PlayerStats.strengthPotions--;
myAnimator.SetBool("drink", true);
}
else if (Input.GetKeyDown(KeyCode.Alpha2) && PlayerStats.agilityPotions >= 1) {
boostAgility();
PlayerStats.agilityPotions--;
myAnimator.SetBool("drink", true);
}
else if (Input.GetKeyDown(KeyCode.Alpha3) && PlayerStats.defensePotions >= 1) {
boostDefence();
PlayerStats.defensePotions--;
myAnimator.SetBool("drink", true);
}
else if (Input.GetKeyDown(KeyCode.Alpha4) && PlayerStats.healthPotions >= 1) {
if (Input.GetKeyDown(KeyCode.Alpha4) && PlayerStats.healthPotions >= 1) {
PlayerStats.curHealth += (int)(PlayerStats.maxHealth*0.5); //heal as soon as you drink the pot
if (PlayerStats.curHealth > PlayerStats.maxHealth) {
PlayerStats.curHealth = PlayerStats.maxHealth;
......@@ -122,21 +107,7 @@ public class PlayerMovement : MonoBehaviour
}
}
//Apply the boost to the respected skill
private void boostStrength() {
PlayerStats.strength += 15;
Invoke("StrengthBoostCoolDown", 150); //boost lasts 2.5 mins
}
private void boostDefence() {
PlayerStats.strength += 15;
Invoke("DefenceBoostCoolDown", 150); //boost lasts 2.5 mins
}
private void boostAgility() {
PlayerStats.strength += 15;
Invoke("AgilityBoostCoolDown", 150); //boost lasts 2.5 mins
}
//take boost off the respected skills
private void StrengthBoostCoolDown() {
......
......@@ -5,15 +5,16 @@ using UnityEngine.UI;
public class Money : MonoBehaviour {
// total coins
private static int coins = 0;
private static int coins = PlayerStats.luck * 2;
public Text coinAmount;
// Use this for initialization
void Start () {
// Use this for initialization
void Start() {
// starting amount of cash at spawn (change for balance)
coins = PlayerStats.luck * 2;
coinAmount.text = coins.ToString();
}
}
// Method for increasing coin amount
public void increaseCoins(int amount) {
coins += amount;
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment