public Hellion(int x, int y, TurretType turretType, TurretPlacement placement, ref SetUpVariables variables) : base(x, y, turretType, placement, ref variables) { m_timeDeparture = DateTime.Now; m_MoveCommands = new List <Position>(); m_CurrentCommand = 0; }
public FireTrapper(int x, int y, TurretType turretType, TurretPlacement placement, ref SetUpVariables variables, bool isCopied) : base(x, y, turretType, placement, ref variables) { CurrentExtendTime = DateTime.Now; m_CurrentExtensionCounter = 0; m_IsClone = isCopied; }
public void SetButtonInteractable(TurretPlacement _turretPlacement, bool _condiction) { turretPlacement = _turretPlacement; TurretOne.interactable = _condiction; TurretTwo.interactable = _condiction; TurretThree.interactable = _condiction; }
// Start is called before the first frame update public void SetUp(int count, collectable collect) { building = collect; transform.GetChild(0).GetComponent <UnityEngine.UI.Image>().sprite = building.sprite; transform.GetChild(1).GetComponent <Text>().text = building.objectName; player = GameObject.FindGameObjectWithTag("Player").GetComponent <TurretPlacement>(); //GetComponent<RectTransform>().localPosition = new Vector3(0, -200 * count + 500, 0); }
public void Click(Button button) { if (attackButtons.ContainsKey(button)) { int i = attackButtons[button]; GameObject g = attackTurrets[i]; TurretPlacement.SetTurret(g); } }
public void Click(Button button) { if (defenseButtons.ContainsKey(button)) { int i = defenseButtons[button]; GameObject g = defenseTurrets[i]; TurretPlacement.SetTurret(g); } }
public Turret(int x, int y, TurretType turretType, TurretPlacement placement, ref SetUpVariables variables) : base(x, y) { m_Type = turretType; m_Placement = placement; m_LevelDamage = 1; internal_Variables = variables; m_LastTimeShot = DateTime.Now; // loading the turret it must have time to prepare it self this is the time; this.SetStats(); }
void Start() { turretPlacement = GameObject.Find("Main Camera").GetComponent <TurretPlacement>(); orderPanel = GameObject.Find("BuildTowerPanel"); orderPanel.SetActive(false); orderPanelIsActive = false; orderButton = GameObject.Find("Order"); healthText = statusPanel.transform.Find("Health").GetComponent <Text>(); scrapText = statusPanel.transform.Find("Scrap").GetComponent <Text>(); }
//Rework for android void OnMouseUp() { Debug.Log("TowerPlace clicked."); TurretPlacement tp = GameObject.FindObjectOfType <TurretPlacement>(); if (tp.selectedTurret != null) { InventoryController ic = GameObject.FindObjectOfType <InventoryController>(); if (ic.currency < tp.selectedTurret.GetComponent <TurretBehaviour>().cost) { Debug.Log("Not enough money!"); return; } ic.currency -= tp.selectedTurret.GetComponent <TurretBehaviour>().cost; // FIXME: Right now we assume that this is an object nested in a parent. Instantiate(tp.selectedTurret, transform.parent.position, transform.parent.rotation); Destroy(transform.parent.gameObject); } }
public Demoman(int x, int y, TurretType turretType, TurretPlacement placement, ref SetUpVariables variables) : base(x, y, turretType, placement, ref variables) { }
public FlameThrower(int x, int y, TurretType turretType, TurretPlacement placement, ref SetUpVariables variables) : base(x, y, turretType, placement, ref variables) { }
private void Awake() { inception = this; }
void Start() { turretplacement = TurretPlacement.inception; }
void Start() { Instance = this; ignoreMask = 18; }
public void ReadInput() { if (Console.KeyAvailable) { ConsoleKeyInfo userInput = Console.ReadKey(true); if (userInput.Key == ConsoleKey.A || userInput.Key == ConsoleKey.D || userInput.Key == ConsoleKey.W || userInput.Key == ConsoleKey.S) { MovePlayer(userInput); } else if (userInput.Key == ConsoleKey.P || userInput.Key == ConsoleKey.O || userInput.Key == ConsoleKey.I || userInput.Key == ConsoleKey.U) { char turretSymbol = ' '; TurretType newTurretType = TurretType.Cannon; // I want to build the turret in front of the player so I need to oversee his cursor int newTurretX = internal_Variables.PlayerCol; int newTurretY = internal_Variables.PlayerRow; if (internal_Variables.PlayerView == 'v') { newTurretY++; } else if (internal_Variables.PlayerView == '^') { newTurretY--; } else if (internal_Variables.PlayerView == '<') { newTurretX--; } else if (internal_Variables.PlayerView == '>') { newTurretX++; } if (newTurretX < 0 || newTurretX >= Console.WindowWidth || newTurretY < 0 || newTurretY >= Console.WindowHeight) { return; } TurretPlacement placeOn = DeterminePlayerPosition(); if (internal_Variables.PocketMoney >= 50 && userInput.Key == ConsoleKey.P) { turretSymbol = '*'; // the turret type is the already defined one internal_Variables.PocketMoney -= 50; } else if (internal_Variables.PocketMoney >= 340 && userInput.Key == ConsoleKey.O) { turretSymbol = '&'; newTurretType = TurretType.FireBunker_Hellion; internal_Variables.PocketMoney -= 340; } else if (internal_Variables.PocketMoney >= 165 && userInput.Key == ConsoleKey.I) { turretSymbol = '%'; newTurretType = TurretType.Tardus; internal_Variables.PocketMoney -= 165; } else if (internal_Variables.PocketMoney >= 500 && userInput.Key == ConsoleKey.U) { turretSymbol = '#'; newTurretType = TurretType.LaserAnnihilator; internal_Variables.PocketMoney -= 500; } foreach (var obstaclePosition in internal_Variables.ObstaclePositions) { if (obstaclePosition.X == newTurretX && obstaclePosition.Y == newTurretY) { return; } } Console.SetCursorPosition(newTurretX, newTurretY); Console.Write(turretSymbol); if (userInput.Key == ConsoleKey.P || userInput.Key == ConsoleKey.U) { internal_Variables.TurretsPosition.Add(new Cannon(newTurretX, newTurretY, newTurretType, placeOn, ref internal_Variables)); } else if (userInput.Key == ConsoleKey.I) { internal_Variables.TurretsPosition.Add(new Tardus(newTurretX, newTurretY, newTurretType, placeOn, ref internal_Variables)); } else if (userInput.Key == ConsoleKey.O) { var turret = new Hellion(newTurretX, newTurretY, newTurretType, placeOn, ref internal_Variables); /* // else no sense to care for the newly created gadget * for (int j = 0; j < internal_Variables.Battleground.Count; j++) * { * var curPosition = internal_Variables.Battleground[j]; * if (curPosition.Uniq_X == newTurretX && curPosition.Uniq_Y == newTurretY) * { * internal_Variables.FireTrappers.Add(trap); * break; * } * } */ internal_Variables.Hellions.Add(turret); internal_Variables.TurretsPosition.Add(turret); } } } }