private void Start() { dataRetainer = DataRetainer.instance; playerStatus = FindObjectsOfType <PlayerStatusExploring>(); rb = GetComponent <Rigidbody>(); //Get the player position that it was on before changing scenes ( or initial position if it is the first scene ) transform.position = dataRetainer.GetPlayerPosition(GetComponent <PlayerStatusExploring>().playerIndex); }
private void Start() { turnBaseScript = TurnBaseScript.instance; inventory = Inventory.instance; dataRetainer = DataRetainer.instance; equipmentHolder = EquipmentHolder.instance; endBattleMenu.SetActive(false); playerLevelUpMenu.SetActive(false); }
private void Start() { healthBar.SetActive(true); //Initialize variables meshRender = GetComponent <MeshRenderer>(); combatStatistics = CombatStatistics.instance; equipmentHolder = EquipmentHolder.instance; dataRetainer = DataRetainer.instance; if (gameObject.tag == "Player") { playerLevel = dataRetainer.GetPlayerLevel(playerIndex); } maxHealth = baseStatus.health + (int)(((playerLevel / 10.0) + baseStatus.health / 8.0) * playerLevel); health = maxHealth; defense = baseStatus.defense + (int)((baseStatus.defense / 4.0) * playerLevel); speed = baseStatus.speed + (int)((baseStatus.speed / 4.0) * playerLevel); strength = baseStatus.strength + (int)((baseStatus.strength / 4.0) * playerLevel); dexterity = baseStatus.dexterity + (int)((baseStatus.dexterity / 4.0) * playerLevel); intelligence = baseStatus.intelligence + (int)((baseStatus.intelligence / 4.0) * playerLevel); maxMP = 2 * intelligence; currentMp = maxMP; //Calculate all status variables if (gameObject.tag == "Player") { //If it is a player we add the base status + the equipment status health = dataRetainer.GetPlayerHealth(playerIndex); currentMp = dataRetainer.GetPlayerMP(playerIndex); maxHealth += equipmentHolder.playersHealth[playerIndex]; speed += equipmentHolder.playersSpeed[playerIndex]; defense += equipmentHolder.playersDefense[playerIndex]; strength += equipmentHolder.playersStrength[playerIndex]; dexterity += equipmentHolder.playersDexterity[playerIndex]; intelligence += equipmentHolder.playersIntelligence[playerIndex]; xpNeeded = baseStatus.xp + (4 * (playerLevel ^ 3)) / 7; currentXP = dataRetainer.GetPlayerXP(playerIndex); } //Set the UI damageText.text = ""; healthBarFill.fillAmount = (float)health / maxHealth; healthText.text = "" + health + "/" + maxHealth; mpBar.fillAmount = (float)currentMp / maxMP; mpText.text = "" + currentMp + "/" + maxMP; enemyCombatAI = EnemyCombatAI.instance; }
private void Awake() { if (instance != null) { Destroy(this.gameObject); return; } else { instance = this; DontDestroyOnLoad(this.gameObject); } }
private void Start() { //When we start the game turn everything off eventSys = EventSystem.current; dataRetainer = DataRetainer.instance; inventoryMenu.SetActive(false); equipmentMenu.SetActive(false); statusMenu.SetActive(false); pauseGameMenu.SetActive(false); statusMenuScript = StatusMenu.instance; equipmentMenuScript = GetComponent <EquipmentMenu>(); dataRetainer.ExploringInit(); }
private void Start() { pauseMenu = PauseMenu.instance; dataRetainer = DataRetainer.instance; for (int index = 0; index < spawnPoints.Length; index++) { //Check if we have encountered the enemy, if so spawn it with a delay if (dataRetainer.defeatedEnemiesIndex.Contains(index)) { StartCoroutine(SpawnWithDelay(index)); } else { //Otherwise spawn it instantly SpawnEnemy(index); } } }
private void Start() { dataRetainer = DataRetainer.instance; equipmentHolder = EquipmentHolder.instance; //Set the UI currentHealth = dataRetainer.GetPlayerHealth(playerIndex); currentMP = dataRetainer.GetPlayerMP(playerIndex); playerLevel = dataRetainer.GetPlayerLevel(playerIndex); UpdatePlayerStatus(); healthBar.fillAmount = (float)currentHealth / maxHealth; healthText.text = "" + currentHealth + " / " + maxHealth; mpBar.fillAmount = (float)currentMP / maxMP; mpText.text = "" + currentMP + " / " + maxMP; xpNeeded = baseStatus.xp + (4 * (playerLevel ^ 3)) / 7; currentXP = dataRetainer.GetPlayerXP(playerIndex); }
private void Start() { // Initialize variables dataRetainer = DataRetainer.instance; combatManager = CombatScript.instance; combatStatistics = CombatStatistics.instance; enemyAI = GetComponent <EnemyCombatAI>(); characters = FindObjectsOfType <Status>(); turnWaitTime = new int[characters.Length]; // Assign the default value to all locations in turnLayout for (int index = 0; index < turnLayout.Length; index++) { turnLayout[index] = -1; } DefaultInit(); //Initialize the default turn layout StartCoroutine(ChangeTurnsWaitTime(0.5f)); //Start changing turns with delay }
private void Awake() { dataRetainer = DataRetainer.instance; for (int index = 0; index < enemy1.Length; index++) { if (enemy1[index].baseStatus == dataRetainer.enemiesEncountered[0]) { enemy1[index].gameObject.SetActive(true); enemy1[index].playerLevel = dataRetainer.enemiesEncounteredLevel[0]; break; } } for (int index = 0; index < enemy2.Length; index++) { if (enemy2[index].baseStatus == dataRetainer.enemiesEncountered[1]) { enemy2[index].gameObject.SetActive(true); enemy2[index].playerLevel = dataRetainer.enemiesEncounteredLevel[1]; break; } } for (int index = 0; index < enemy3.Length; index++) { if (enemy3[index].baseStatus == dataRetainer.enemiesEncountered[2]) { enemy3[index].gameObject.SetActive(true); enemy3[index].playerLevel = dataRetainer.enemiesEncounteredLevel[2]; break; } } for (int index = 0; index < enemy4.Length; index++) { if (enemy4[index].baseStatus == dataRetainer.enemiesEncountered[3]) { enemy4[index].gameObject.SetActive(true); enemy4[index].playerLevel = dataRetainer.enemiesEncounteredLevel[3]; break; } } }
private int[] healthDifference = new int[4]; //When we change the equipment we remember the damage each player took before changing private void Start() { statusMenu = StatusMenu.instance; dataRetainer = DataRetainer.instance; }