public void hideChargeBar() { Debug.Log("ButtonForChargingAtack || destroyChargeBar || chargeMultiplier " + (int)(chargeMultiplier * 100 / 3.999998)); bool initialized = false; initialized = dealDamageToMarkedEnemy(); //If choosen enemy is not last in the queue if (dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties()[idOfEnemyParty].getEnemyObjectArray().Count != idOfChoosenEnemy) { StartCoroutine(WaitForDamageDealInitialization(initialized)); chargeMultiplier = 0; } else if (dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties()[idOfEnemyParty].getEnemyObjectArray().Count != 0) { objectSelector.initializeHighlightOnFirstEnemy(); } else { GameObject.Find("EnemyHighlightMaskObject").SetActive(false); dungeonsGenerator.loadAnotherLevel(fightMode.getCurrentCorridorId(), 2); } //Destroying empty party if (dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties()[idOfEnemyParty].getEnemyObjectArray().Count == 0) { dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == idOfCorridor).getEnemyParties().RemoveAt(idOfEnemyParty); Debug.Log("ButtonForChargingAtack || dealDamageToMarkedEnemy || Party destroyed!"); } chargeBar.SetActive(false); chargeBarPointer.SetActive(false); Debug.Log("ButtonForChargingAtack || hideChargeBar || ChargeBar hidden!"); }
public void doTransitionPreparation(int choosenCorridorId) { dungeonGenerator.loadAnotherLevel(choosenCorridorId, typeOfLoadingLevel); previousCorridorId = currentCorridorId; currentCorridorId = choosenCorridorId; Debug.Log("ButtonForUsage || doorTransition || doTransitionPreparation || currentCorridorNumber: " + currentCorridorId); Debug.Log("ButtonForUsage || doorTransition || doTransitionPreparation || Length of corridorList from dungeonGenerator: " + dungeonGenerator.getCorridorList().Count); currentCorridor = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == currentCorridorId); //shouldApplyTransition = true; }
public void escapeFromFight() { //Randomizes chance and checks output //There is 30% of chance of escape and 70% of failure if (randomNumber.Next(0, 101) <= 30) { Debug.Log("Escape succesfull!"); Debug.Log("ButtonForEscape || escapeFromFight || Loading level after fight scene! Scene: " + fightMode.getCurrentCorridorId()); dungeonsGenerator.loadAnotherLevel(fightMode.getCurrentCorridorId(), 2); GameObject.Find("EnemyHighlightMaskObject").SetActive(false); } else { Debug.Log("Escape unsuccesfull!"); displayParty.dealDamageToHero(randomNumber.Next(0, displayParty.getNumberOfHeroesAlive()), randomNumber.Next(9, 30)); } }