public static void DoesNetrixiAttack(int playerAttack, int attackNumber) { // Check if Netrixi is still alive if (!CombatManagerScript.netrixiAlive) { // Skip the attack if (attackNumber == 1) { CombatSimulationScript.attack1Delay = DamageValues.standardDelay; } else { CombatSimulationScript.attack2Delay = DamageValues.standardDelay; } } else { float original; float burnRate; // ATTACK 1 // Netrixi's Fireball if (playerAttack == 1) { original = DamageValues.fireball * AttackScript.damageModifier; burnRate = DamageValues.fireballBurn; int damageValue = (int)original; if (CombatManagerScript.enemy1Alive) { if (CombatManagerScript.enemy2Alive && EnemyManagerScript.enemy2 != "null") { // If Enemies 1 + 2 + 3 are alive if (CombatManagerScript.enemy3Alive && EnemyManagerScript.enemy3 != "null") { DamageValues.ChangeDelay(3); // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } // If Enemies 1 + 2 are alive else { DamageValues.ChangeDelay(2); int randomValue = UnityEngine.Random.Range(0, 2); if (randomValue <= 1) { // Launch 2 fireballs at Enemy 2 // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue * 1, burnRate); HealthManagerScript.ChangeHealth("Enemy 2", damageValue * 2, burnRate); } else { // Launch 2 fireballs at Enemy 1 // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue * 2, burnRate); HealthManagerScript.ChangeHealth("Enemy 2", damageValue * 1, burnRate); } } } else { // If Enemies 1 + 3 are alive if (CombatManagerScript.enemy3Alive && EnemyManagerScript.enemy3 != "null") { DamageValues.ChangeDelay(2); int randomValue = UnityEngine.Random.Range(0, 2); if (randomValue <= 1) { // Launch 2 fireballs at Enemy 3 // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue * 1, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue * 2, burnRate); } else { // Launch 2 fireballs at Enemy 1 // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue * 2, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue * 1, burnRate); } } // If only Enemy 1 is alive else { DamageValues.ChangeDelay(1); // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue * 3, burnRate); } } } else { if (CombatManagerScript.enemy2Alive && EnemyManagerScript.enemy2 != "null") { // If Enemies 2 + 3 are alive if (CombatManagerScript.enemy3Alive && EnemyManagerScript.enemy3 != "null") { DamageValues.ChangeDelay(2); int randomValue = UnityEngine.Random.Range(0, 2); if (randomValue <= 1) { // Launch 2 fireballs at Enemy 3 // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue * 1, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue * 2, burnRate); } else { // Launch 2 fireballs at Enemy 2 // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue * 2, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue * 1, burnRate); } } // If only Enemy 2 is alive else { DamageValues.ChangeDelay(1); // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue * 3, burnRate); } } else { // If only Enemy 3 is alive if (CombatManagerScript.enemy3Alive && EnemyManagerScript.enemy3 != "null") { DamageValues.ChangeDelay(1); // TODO: Play Netrixi Fireball animation HealthManagerScript.ChangeHealth("Enemy 3", damageValue * 3, burnRate); } } } AttackScript.delayRate = DamageValues.fireballDelay; } // ATTACK 2 // Netrixi's Lightning if (playerAttack == 2) { original = DamageValues.lightning * AttackScript.damageModifier; burnRate = DamageValues.lightningBurn; AttackScript.delayRate = DamageValues.lightningDelay; int damageValue = (int)original; if (attackNumber == 1) { DetermineEnemyPosition(CombatManagerScript.target1Location); } else { DetermineEnemyPosition(CombatManagerScript.target2Location); } void DetermineEnemyPosition(int targetLocation) { switch (targetLocation) { // If an enemy is on square 6 case 1: if (EnemyManagerScript.enemy1Position == 6) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } if (EnemyManagerScript.enemy2Position == 6) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } if (EnemyManagerScript.enemy3Position == 6) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } break; // If an enemy is on square 7 case 2: if (EnemyManagerScript.enemy1Position == 7) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } if (EnemyManagerScript.enemy2Position == 7) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } if (EnemyManagerScript.enemy3Position == 7) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } break; // If an enemy is on square 8 case 3: if (EnemyManagerScript.enemy1Position == 8) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } if (EnemyManagerScript.enemy2Position == 8) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } if (EnemyManagerScript.enemy3Position == 8) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } break; // If an enemy is on square 9 case 4: if (EnemyManagerScript.enemy1Position == 9) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } if (EnemyManagerScript.enemy2Position == 9) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } if (EnemyManagerScript.enemy3Position == 0) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } break; // If an enemy is on square 10 case 5: if (EnemyManagerScript.enemy1Position == 10) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } if (EnemyManagerScript.enemy2Position == 10) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } if (EnemyManagerScript.enemy3Position == 10) { // TODO: Play Netrixi Lightning animation HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } break; } } } // ATTACK 3 // Netrixi's Transmutate if (playerAttack == 3) { AttackScript.delayRate = DamageValues.transmutateDelay; List <String> enemiesToTransform = new List <string>(); List <String> transformChoices = new List <string>(); // Determine which enemies can be transformed if (CombatManagerScript.enemy1Alive && CombatManagerScript.canEnemy1Attack) { enemiesToTransform.Add("Enemy 1"); } if (CombatManagerScript.enemy2Alive && CombatManagerScript.canEnemy2Attack) { enemiesToTransform.Add("Enemy 2"); } if (CombatManagerScript.enemy3Alive && CombatManagerScript.canEnemy3Attack) { enemiesToTransform.Add("Enemy 3"); } // Choose a random enemy to transform if (enemiesToTransform.Count >= 1) { var randomIndex = UnityEngine.Random.Range(0, (enemiesToTransform.Count)); // Determine whether the enemy is transformed or not transformChoices.Add("Cat"); transformChoices.Add("Dog"); transformChoices.Add("Frog"); // Creates the option for the transmutation spell to fail for (int i = 0; i < DamageValues.choices - transformChoices.Count; i++) { transformChoices.Add("None"); } // Choose a random creature for the enemy to transform into var randomIndex1 = UnityEngine.Random.Range(0, (transformChoices.Count)); // If an animal was chosen for the enemy to transform into if (transformChoices[randomIndex1] != "None") { TransformEnemy(enemiesToTransform[randomIndex], CombatManagerScript.roundNumber, transformChoices[randomIndex1]); } else { print("Spell cast failed: " + enemiesToTransform[randomIndex] + " was not transformed"); } } else { print("There are no enemies to transform"); } } } }
public static void DoesFolkvarAttack(int playerAttack, int attackNumber) { // Check if Folkvar is still alive if (!CombatManagerScript.folkvarAlive) { // Skip the attack if (attackNumber == 1) { CombatSimulationScript.attack1Delay = DamageValues.standardDelay; } else { CombatSimulationScript.attack2Delay = DamageValues.standardDelay; } return; } else { float original; float burnRate; // ATTACK 1 // Folkvar's Swing Sword if (playerAttack == 4) { original = DamageValues.swingSword * AttackScript.damageModifier; burnRate = DamageValues.swingSwordBurn; AttackScript.delayRate = DamageValues.swingSwordDelay; int damageValue = (int)original; // Chance of a Critical Strike int randomValue = UnityEngine.Random.Range(0, DamageValues.critChance); // Attack the first enemy if (CombatManagerScript.enemy1Alive) { // TODO: Play Folkvar Swing Sword animation if (randomValue <= 1) { // Critical strike HealthManagerScript.ChangeHealth("Enemy 1", damageValue * 2, burnRate); print("Critical strike!"); } else { // Regular attack HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } } else { // Attack the second enemy if (CombatManagerScript.enemy2Alive) { // TODO: Play Folkvar Swing Sword animation if (randomValue <= 1) { // Critical strike HealthManagerScript.ChangeHealth("Enemy 2", damageValue * 2, burnRate); print("Critical strike!"); } else { // Regular attack HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } } else { // Attack the third enemy if (CombatManagerScript.enemy3Alive) { // TODO: Play Folkvar Swing Sword animation if (randomValue <= 1) { // Critical strike HealthManagerScript.ChangeHealth("Enemy 3", damageValue * 2, burnRate); print("Critical strike!"); } else { // Regular attack HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } } } } } // ATTACK 2 // Folkvar's Holy Smite if (playerAttack == 5) { original = DamageValues.smite * AttackScript.damageModifier; burnRate = DamageValues.smiteBurn; AttackScript.delayRate = DamageValues.smiteDelay; int damageValue = (int)original; int lowestEnemyHP = 500; int targetEnemy = 0; // Determine which enemy has the lowest HP; if (CombatManagerScript.enemy1Alive) { targetEnemy = 1; lowestEnemyHP = CombatManagerScript.enemy1HP; } if (CombatManagerScript.enemy2Alive) { if (CombatManagerScript.enemy2HP < lowestEnemyHP) { targetEnemy = 2; lowestEnemyHP = CombatManagerScript.enemy2HP; } } if (CombatManagerScript.enemy3Alive) { if (CombatManagerScript.enemy3HP < lowestEnemyHP) { targetEnemy = 3; lowestEnemyHP = CombatManagerScript.enemy3HP; } } switch (targetEnemy) { // Enemy 1 case 1: if (lowestEnemyHP <= CombatManagerScript.enemy1StartingHP * DamageValues.executeThreshold) { // TODO: Play Folkvar Holy Smite animation // Enemy is below the threshold for Execution HealthManagerScript.ChangeHealth("Enemy 1", damageValue * 2, burnRate); print("Enemy 1 will be executed"); } else { // TODO: Play Folkvar Holy Smite animation // Enemy is not below the threshold for Execution HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } break; // Enemy 2 case 2: if (lowestEnemyHP <= CombatManagerScript.enemy2StartingHP * DamageValues.executeThreshold) { // TODO: Play Folkvar Holy Smite animation // Enemy is below the threshold for Execution HealthManagerScript.ChangeHealth("Enemy 2", damageValue * 2, burnRate); print("Enemy 2 will be executed"); } else { // TODO: Play Folkvar Holy Smite animation // Enemy is not below the threshold for Execution HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } break; // Enemy 3 case 3: if (lowestEnemyHP <= CombatManagerScript.enemy3StartingHP * DamageValues.executeThreshold) { // TODO: Play Folkvar Holy Smite animation // Enemy is below the threshold for Execution HealthManagerScript.ChangeHealth("Enemy 3", damageValue * 2, burnRate); print("Enemy 3 will be executed"); } else { // TODO: Play Folkvar Holy Smite animation // Enemy is not below the threshold for Execution HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } break; } } // ATTACK 3 // Folkvar's Grand Slam if (playerAttack == 6) { original = DamageValues.grandSlam * AttackScript.damageModifier; burnRate = DamageValues.grandSlamBurn; AttackScript.delayRate = DamageValues.grandSlamDelay; int damageValue = (int)original; // If Enemy 1 is alive if (CombatManagerScript.enemy1Alive) { // If Enemy 2 is alive if (CombatManagerScript.enemy2Alive) { // If Enemy 2 is close to Enemy 1 if (EnemyManagerScript.enemy1Position + 1 == EnemyManagerScript.enemy2Position) { // If Enemy 3 is alive if (CombatManagerScript.enemy3Alive) { // If Enemy 3 is close to Enemies 1 + 2 if (EnemyManagerScript.enemy2Position + 1 == EnemyManagerScript.enemy3Position) { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 2 and deal splash damage to Enemies 1 + 3 HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 1", damageValue / 2, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue / 2, burnRate); } else { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 1 and deal splash damage to Enemy 2 HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 2", damageValue / 2, burnRate); } } else { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 1 and deal splash damage to Enemy 2 HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 2", damageValue / 2, burnRate); } } else { // If Enemy 2 is close to Enemy 3 if (EnemyManagerScript.enemy2Position + 1 == EnemyManagerScript.enemy3Position) { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 2 and deal splash damage to Enemy 3 HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue / 2, burnRate); } else { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 1 and deal no splash damage to other enemies HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } } } else { // If Enemy 3 is alive if (CombatManagerScript.enemy3Alive) { // If Enemy 1 is close to Enemy 3 if (EnemyManagerScript.enemy1Position + 1 == EnemyManagerScript.enemy3Position) { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 1 and deal splash damage to Enemy 3 HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue / 2, burnRate); } else { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 1 and deal no splash damage to other enemies HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } } else { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 1 and deal no splash damage to other enemies HealthManagerScript.ChangeHealth("Enemy 1", damageValue, burnRate); } } } // If Enemy 1 isn't alive else { // If Enemy 2 is alive if (CombatManagerScript.enemy2Alive) { // If Enemy 2 is close to Enemy 3 if (EnemyManagerScript.enemy2Position + 1 == EnemyManagerScript.enemy3Position) { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 2 and deal splash damage to Enemy 3 HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); HealthManagerScript.ChangeHealth("Enemy 3", damageValue / 2, burnRate); } else { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 2 and deal no splash damage to other enemies HealthManagerScript.ChangeHealth("Enemy 2", damageValue, burnRate); } } else { // TODO: Play Folkvar Grand Slam animation // Attack Enemy 3 and deal no splash damage to other enemies HealthManagerScript.ChangeHealth("Enemy 3", damageValue, burnRate); } } } } }
public static void DoesIvAttack(int playerAttack, int attackNumber) { if (!CombatManagerScript.ivAlive) { // Skip the attack if (attackNumber == 1) { CombatSimulationScript.attack1Delay = DamageValues.standardDelay; } else { CombatSimulationScript.attack2Delay = DamageValues.standardDelay; } return; } else { float original; float burnRate; // ATTACK 1 // Iv's Block if (playerAttack == 7) { // TODO: Play Iv Block animation AttackScript.delayRate = DamageValues.blockDelay; blocking = true; tempBlock = AttackScript.enemyAttack; } // ATTACK 2 // Iv's Heal if (playerAttack == 8) { original = DamageValues.heal * AttackScript.damageModifier; burnRate = DamageValues.healBurn; int damageValue = (int)original; int lowestHP = 500; int targetCharacter = 0; // Determine which character has the lowest HP; if (CombatManagerScript.netrixiAlive) { targetCharacter = 1; lowestHP = CombatManagerScript.netrixiHP; } if (CombatManagerScript.folkvarAlive) { if (CombatManagerScript.folkvarHP < lowestHP) { targetCharacter = 2; lowestHP = CombatManagerScript.folkvarHP; } } if (CombatManagerScript.ivAlive) { if (CombatManagerScript.ivHP < lowestHP) { targetCharacter = 3; lowestHP = CombatManagerScript.ivHP; } } switch (targetCharacter) { // Netrixi case 1: // If Netrixi is below her starting HP if (CombatManagerScript.netrixiHP < HealthValues.netrixiHP) { // TODO: Play Iv Heal animation int temp = CalculateMissingHealth(CombatManagerScript.netrixiHP, HealthValues.netrixiHP, damageValue); DamageValues.ChangeHealDelay(temp, 0); HealthManagerScript.ChangeHealth("Netrixi", -temp, burnRate); print("Heal Netrixi"); } else { print("Netrixi is already at full health!"); DamageValues.healDelay = DamageValues.standardDelay; } break; // Folkvar case 2: // If Folkvar is below his starting HP if (CombatManagerScript.folkvarHP < HealthValues.folkvarHP) { // TODO: Play Iv Heal animation int temp = CalculateMissingHealth(CombatManagerScript.folkvarHP, HealthValues.folkvarHP, damageValue); DamageValues.ChangeHealDelay(temp, 0); HealthManagerScript.ChangeHealth("Folkvar", -temp, burnRate); print("Heal Folkvar"); } else { print("Folkvar is already at full health!"); DamageValues.healDelay = DamageValues.standardDelay; } break; // Iv case 3: // If Iv is below her starting HP if (CombatManagerScript.ivHP < HealthValues.ivHP) { // TODO: Play Iv Heal animation int temp = CalculateMissingHealth(CombatManagerScript.ivHP, HealthValues.ivHP, damageValue); DamageValues.ChangeHealDelay(temp, 0); HealthManagerScript.ChangeHealth("Iv", -temp, burnRate); print("Heal Iv"); } else { print("Iv is already at full health!"); DamageValues.healDelay = DamageValues.standardDelay; } break; } AttackScript.delayRate = DamageValues.healDelay; } // ATTACK 3 // Iv's Empower if (playerAttack == 9) { // TODO: Play Iv Empower animation AttackScript.delayRate = DamageValues.empowerDelay; empowered = true; tempEmpower = AttackScript.playerAttack; // Determine how much to increase the damage of the next attack by if (attackNumber == 1) { DetermineDamageBoost(CombatManagerScript.target1Location); } else { DetermineDamageBoost(CombatManagerScript.target2Location); } // TODO: Finish Empower-Counter interaction } } }