public void SetTarget(Character_Handler pc) { if (currTarget == null || currTarget.gameObject.activeSelf == false) { currTarget = pc; } }
public bool CheckForPlayers(int originX, int originY, int range) { // Looping through the tiles in an area surrounding this enemy, limited by range for (int x = originX - range; x < originX + range; x++) { for (int y = originY - range; y < originY + range; y++) { //foreach(Character_Handler pc in Battle_Loader.Instance.playerSquadMap.Values) // { // if (pc.GetCurrentTileCoords() == new Vector2(x, y)) // { // Debug.Log("ENEMY: Found target at " + new Vector2(x, y)); // currTarget = pc; // return true; // } // } currTarget = Battle_Controller.Instance.GetPCAtVector2(new Vector2(x, y)); if (currTarget != null) { Debug.Log("ENEMY: Found target at " + new Vector2(x, y)); return true; } } } Debug.Log("ENEMY BATTLE: Found no player characters in range!"); return false; }
public bool CheckForPlayers(int originX, int originY, int range) { // Looping through the tiles in an area surrounding this enemy, limited by range for (int x = originX - range; x < originX + range; x++) { for (int y = originY - range; y < originY + range; y++) { //foreach(Character_Handler pc in Battle_Loader.Instance.playerSquadMap.Values) // { // if (pc.GetCurrentTileCoords() == new Vector2(x, y)) // { // Debug.Log("ENEMY: Found target at " + new Vector2(x, y)); // currTarget = pc; // return true; // } // } currTarget = Battle_Controller.Instance.GetPCAtVector2(new Vector2(x, y)); if (currTarget != null) { Debug.Log("ENEMY: Found target at " + new Vector2(x, y)); return(true); } } } Debug.Log("ENEMY BATTLE: Found no player characters in range!"); return(false); }
public void SetNewPCPosition(Vector2 newPos, Character_Handler pc) { if (!PCPositionsMap.ContainsKey(newPos)) { PCPositionsMap.Add(newPos, pc); Debug.Log("BATTLE CONTROL: Set new PC position at " + newPos); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
public void ReSetPCPosition(Vector2 oldPos, Vector2 newPos, Character_Handler pc) { if (PCPositionsMap.ContainsKey(oldPos)) { PCPositionsMap.Remove(oldPos); Debug.Log("BATTLE CONTROL: Removed PC position at " + oldPos); SetNewPCPosition(newPos, pc); } else { SetNewPCPosition(newPos, pc); } }
public void KillPC(Character_Handler pc) { if (Battle_Loader.Instance.playerSquadMap.ContainsKey(pc.myChar.Name)) { // Remove from player squad dictionary Battle_Loader.Instance.playerSquadMap.Remove(pc.myChar.Name); } // Check if player has lost all their units if (Battle_Loader.Instance.playerSquadMap.Count < 1) { Battle_StateManager.Instance.Lose(); } }
void Start() { char_handler = GetComponent<Character_Handler>(); }
void DoDamage(Character_Handler character, float dmg) { Debug.Log("ENEMY: Damaging " + character.myChar.Name + " for " + dmg); character.TakeDamage(dmg); }
void Awake() { char_handler = GetComponent <Character_Handler>(); }
void Start() { char_handler = GetComponent <Character_Handler>(); }
public void SetTarget(Character_Handler pc) { if (currTarget == null || currTarget.gameObject.activeSelf == false) currTarget = pc; }
void Awake() { char_handler = GetComponent<Character_Handler>(); }