public void setReady() { Debug.Log("set ready to true"); BattleEventController.setReady(true); isTrue = true; }
public void setNotReady() { Debug.Log("set not ready to true"); BattleEventController.setReady(false); isTrue = false; }
public static void step(int type) { Stats heroStats = EventController.hero.getStats(); Stats enemyStats = EventController.enemy.getStats(); int enemyAttackRegion = Random.Range((int)region.chest, (int)region.right_leg); int enemyDefRegion = Random.Range((int)region.chest, (int)region.right_leg); Debug.Log("New fight step with type = " + type); Debug.Log("Fight step. Enemy attack region = " + enemyAttackRegion.ToString()); Debug.Log("Fight step. Enemy defence region = " + enemyDefRegion.ToString()); BattleEventController.toDefault(); switch (type) { case (int)attackType.meele: Debug.Log("Fight. Step. Meele."); BattleEventController.toAttack(true); hit(EventController.hero, EventController.enemy, BattleEventController.heroAttackRegion, enemyDefRegion); // BattleEventController.setReady (false); break; case (int)attackType.magic: BattleEventController.toMagic(true); magicHit(EventController.enemy); BattleEventController.setReady(false); break; default: Debug.Log("Error! Wrong attack type"); break; } if (EventController.enemy.getAffect((int)affect.poison).time > 0) { BattleEventController.updHealth(EventController.enemy.getAffect((int)affect.poison).value, EventController.enemy); EventController.enemy.decAffectTime((int)affect.poison); } Debug.Log("Fight! Current health = " + enemyStats.GetCurPoints((int)statName.health)); if (enemyStats.GetCurPoints((int)statName.health) == 0.0f) { BattleEventController.toDeath(false); } else { BattleEventController.toAttack(false); hit(EventController.enemy, EventController.hero, enemyAttackRegion, BattleEventController.heroAttackRegion); Debug.Log("EventControler hero time = " + EventController.hero.getAffect((int)affect.poison).time); Debug.Log("EventControler hero time = " + EventController.enemy.getAffect((int)affect.poison).time); if (EventController.hero.getAffect((int)affect.poison).time > 0) { BattleEventController.updHealth(EventController.hero.getAffect((int)affect.poison).value, EventController.hero); EventController.hero.decAffectTime((int)affect.poison); } if (heroStats.GetCurPoints((int)statName.health) == 0) { BattleEventController.toDeath(true); } } }