void Awake() { //find and set the map parent. map = this.GetComponentInParent <TileArrangement> (); tileEffects = new List <TileEffect>(); }
public List <TileAttributes> GetPossibleMoves() { t = moved.owner.tile; map = t.map; m = map.tileMap; possibilities = new List <TileAttributes> (); times = new double[m.GetLength(0), m.GetLength(1)]; paths = new List <TileAttributes> [m.GetLength(0), m.GetLength(1)]; propogateTimes(t, timeSpent - tileTypeTimes[moved.owner.tile.type], new List <TileAttributes>()); times [moved.owner.x, moved.owner.y] = 0; for (int n = 0; n < times.GetLength(0); n++) { for (int nn = 0; nn < times.GetLength(1); nn++) { if (times [n, nn] != 0) { possibilities.Add(m [n, nn]); } } } return(possibilities); }
// Use this for initialization void Start() { initialOffset = 0.7f; offset = 0.0f; map = GameObject.FindGameObjectWithTag("Map").GetComponent <TileArrangement> (); UIcamera = GameObject.Find("UI Camera"); //originalUIpos=map.uiCameraPosition; UIposition = UIcamera.transform.position; //originalCameraSize = map.uiCameraSize; cameraSize = UIcamera.GetComponent <Camera>().orthographicSize; initialOffset *= cameraSize / 3.5f; gameObject.transform.position = (new Vector3(308f / 85.75285f * cameraSize / 3.5f, 2f, -2f * cameraSize / 3.5f));//TODO: Figure out why you need such weird values. gameObject.transform.Translate(Vector3.Scale(new Vector3(1f, 1f, 0f), (UIposition - new Vector3(0f, 2f, 10f)))); gameObject.transform.localScale.Set(1, 1, 1); foreach (Ability a in map.highlighter.chosenCharacter.specialAbilities) { AddLabel(a); } /*foreach (Ability a in map.highlighter.chosenCharacter.type.classAbilities) * { * AddLabel (a); * }*/ }
// Use this for initialization public override void Start() { name = "Repair Bridge"; specs = GetComponentInParent <ClassSpecifications> (); map = GameObject.FindGameObjectWithTag("Map").GetComponent <TileArrangement>(); breakableBridgeMat = GetComponent <MeshRenderer>().material; }
void Awake() { map = this.GetComponentInParent <TileArrangement> (); manager = this.GetComponentInParent <TeamManager> (); pieces = this.GetComponentsInChildren <CharacterCharacter> (); activePieces = pieces.Length; }
public void Threat(CharacterCharacter c) { map = GameObject.FindGameObjectWithTag("Map").GetComponent <TileArrangement>(); enemysInRange = new List <CharacterCharacter> (); searchRadius = c.type.range; //check characters move + attackRange enemysInRange = inRange(c.x, c.y, (float)searchRadius, c); //if list has elements if (enemysInRange.Count != 0) { //calculate ratio between morale and distance away getRatio(enemysInRange, c); //Move towards character with the most 'threat' highestThreat = getHighestThreat(); moveTowardsHighThreat(c, highestThreat); if (!c.usedAbility) { useStrongestAbility(c, highestThreat); } } //else find the closest enemy and move towards else { moveTowardsHighThreat(c, findClosest(c)); } }
public override void Use() { TileAttributes t = specs.owner.tile; if (t.north != null && t.north.containedCharacter != null) { t.north.containedCharacter.damage(1); } if (t.south != null && t.south.containedCharacter != null) { t.south.containedCharacter.damage(1); } if (t.east != null && t.east.containedCharacter != null) { t.east.containedCharacter.damage(1); } if (t.west != null && t.west.containedCharacter != null) { t.west.containedCharacter.damage(1); } map = specs.owner.tile.map; map.highlighter.mode = Highlighter.SelectionMode.PIECE_TO_USE; specs.owner.usedAbility = true; cooldownTimer = cooldown; }
void Awake() { map = GetComponentInParent <TileArrangement> (); chosenTiles = new Stack <TileAttributes> (); possibleMoveHighlighters = new List <GameObject> (); abilitySelectorObject = savedAbilitySelectorObject; abilitySelector = abilitySelectorObject.GetComponent <AbilitySelector> (); }
// Use this for initialization public override void Start() { map = GameObject.FindGameObjectWithTag("Map").GetComponent <TileArrangement>(); targets = new List <TileAttributes> (); charachterTargets = new List <CharacterCharacter> (); targetsAquired = false; targetsToAquire = numberOfTargets; GameObject.Destroy(GameObject.FindGameObjectWithTag("Ability Selector")); instructionLabel = GameObject.FindGameObjectWithTag("Ability Instructions").GetComponentInChildren <Text>(); }
public Move(GameObject subject, TileAttributes source, TileAttributes target, double speed) { this.subject = subject; sourceX = source.x; sourceY = source.y; targetX = target.x; targetY = target.y; this.speed = speed; direction = (new Vector3((float)(targetX - sourceX), (float)(targetY - sourceY), 0.0f)); direction = direction.normalized; direction.Scale(new Vector3((float)speed, (float)speed, (float)speed)); map = target.map; }
// Use this for initialization void Start() { map = GameObject.FindGameObjectWithTag("Map").GetComponentInChildren <TileArrangement>(); }
// Use this for initialization public override void Start() { name = "Inspiring Presence"; specs = GetComponentInParent <ClassSpecifications> (); map = GameObject.FindGameObjectWithTag("Map").GetComponent <TileArrangement>(); }
void Awake() { map = this.GetComponentInParent <TileArrangement> (); teams = this.GetComponentsInChildren <Team> (); threatDet = this.GetComponentInChildren <ThreatDetermination>(); }