// Use this for initialization void Start() { // Need to readjust the ring! if (unitRangeRingGO) { unitRangeRingGO.SetActive(true); unitRangeRingGO.transform.localScale = new Vector3(m_Range, m_Range, 1); unitRangeRingGO.SetActive(false); } m_Morale = DEFAULT_MORALE; m_leftOverMoveSpeed = m_MoveSpeed; if (!damageEffect) { // If linking does not occur, find the tag! damageEffect = GameObject.FindGameObjectWithTag("ExplodeParticle").GetComponent <PerticleExplosion>(); } if (!damageText) { // If linking does not occur, find the tag! damageText = GameObject.FindGameObjectWithTag("DamageText").GetComponent <DamageTextControl>(); } if (m_Warlike > m_Emotional && m_Warlike > m_Wary) { m_characterCharis = CHARACTER_CHARACTERISTIC.WARLIKE; } else if (m_Emotional > m_Warlike && m_Emotional > m_Wary) { m_characterCharis = CHARACTER_CHARACTERISTIC.EMOTIONAL; } else if (m_Wary > m_Warlike && m_Wary > m_Emotional) { m_characterCharis = CHARACTER_CHARACTERISTIC.WARY; } }
//Attack public void attackWithCurrentPlayer(Tile destTile) { Player target = null; foreach (Player p in players) { if (p.gridPosition == destTile.gridPosition) { target = p; } } if (target != null) { players[currentPlayerIndex].Energy -= 50; int amountOfDamage = (int)Mathf.Floor(players[currentPlayerIndex].damageBase); target.HP -= amountOfDamage; DamageTextControl.CreateDamageText(amountOfDamage.ToString(), transform); Debug.Log(players[currentPlayerIndex].playerName + " hit " + target.playerName + " for " + amountOfDamage + " damage"); } }
// Use this for initialization void Start() { instance = this; }
// Use this for initialization void Start() { generateMap(); generatePlayers(); DamageTextControl.Initialize(); }