void Start() { xp = XP.FindObjectOfType <XP> (); selectorEnemy1 = SelectEnemyScript.FindObjectOfType <SelectEnemyScript> (); selectorEnemy2 = SelectEnemy2Script.FindObjectOfType <SelectEnemy2Script> (); animator = statusTextPanel.GetComponent <Animator> (); music = Music.FindObjectOfType <Music> (); //TURN THIS OFF WHEN BUILDING //music.BattleClip (); enemyFlee = false; playerFlee = false; attackPoints = PlayerPrefs.GetInt("PLAYER_AP"); playerController = PlayerAttackScriptMultipleEnemies.FindObjectOfType <PlayerAttackScriptMultipleEnemies>(); xp.UpdateDisplay(); playerTurn = true; }
void Start() { aimingReticle.SetActive(false); selected2.SetActive(false); enemy1 = SelectEnemyScript.FindObjectOfType <SelectEnemyScript> (); }
public void OnMouseOver() { if (enemy1 == null) { enemy1 = SelectEnemyScript.FindObjectOfType <SelectEnemyScript> (); } if (Input.GetMouseButtonDown(0) && !enemy2Selected) { aimingReticle.SetActive(true); aimingReticleOther.SetActive(false); enemy2Selected = true; selected2.SetActive(true); enemy1.selected.SetActive(false); SelectEnemyScript.enemy1Selected = false; Debug.Log("CLIIICKKKED"); } }
void Update() { if (selectorEnemy1 == null) { selectorEnemy1 = SelectEnemyScript.FindObjectOfType <SelectEnemyScript> (); } if (selectorEnemy2 == null) { selectorEnemy2 = SelectEnemy2Script.FindObjectOfType <SelectEnemy2Script> (); } Debug.Log("Player evade is " + playerController.evadeOn); if (playerTurn && !playerFlee && !enemyTurn1 && !enemyTurn2 && !doneFighting) { playerController.playerAnimator.SetBool("Evade", false); StartPlayerTurn(); } if (!playerTurn && enemyTurn1 && !enemyTurn2 && !doneFighting) { selectorEnemy1.selected.SetActive(false); selectorEnemy2.selected2.SetActive(false); SelectEnemyScript.enemy1Selected = false; SelectEnemy2Script.enemy2Selected = false; aimingReticle.SetActive(false); aimingReticle2.SetActive(false); if (pirate1.thisAiDead) { playerController.playerAnimator.SetBool("Evade", false); EndTurn(); } StartEnemy1Turn(); } if (!playerTurn && !enemyTurn1 && enemyTurn2 && !doneFighting) { aimingReticle.SetActive(false); aimingReticle2.SetActive(false); selectorEnemy1.selected.SetActive(false); selectorEnemy2.selected2.SetActive(false); SelectEnemyScript.enemy1Selected = false; SelectEnemy2Script.enemy2Selected = false; if (pirate2.thisAiDead) { playerController.playerAnimator.SetBool("Evade", false); EndTurn(); } StartEnemy2Turn(); } if (doneFighting) { } }