void Awake() { UIEventHandler.OnDamageTaken += UpdateStats; UIEventHandler.OnPlayerDamageTaken += UpdatePlayerStats; health = combatPanel.transform.Find("Stats").GetChild(1).GetComponent <Text>(); stamina = combatPanel.transform.Find("Stats").GetChild(2).GetComponent <Text>(); enemyHealth = combatPanel.transform.Find("EnemySelect").GetChild(1).GetComponent <Text>(); enemyName = combatPanel.transform.Find("EnemySelect").GetChild(2).GetComponent <Text>(); abilityOne = combatPanel.transform.Find("CombatPanel").Find("Abilities").GetChild(0).GetComponent <Button>(); abilityTwo = combatPanel.transform.Find("CombatPanel").Find("Abilities").GetChild(1).GetComponent <Button>(); abilityThree = combatPanel.transform.Find("CombatPanel").Find("Abilities").GetChild(2).GetComponent <Button>(); abilityOne.onClick.AddListener(delegate { DebugButtons(abilityOne); }); abilityTwo.onClick.AddListener(delegate { DebugButtons(abilityTwo); }); abilityThree.onClick.AddListener(delegate { DebugButtons(abilityThree); }); combatPanel.SetActive(true); selectedEnemy.SetActive(false); if (Instance != null && Instance != this) { Destroy(gameObject); } else { Instance = this; } }
void SpellResult(JSONObject data) { if (data[0] == true) { if (Convert.ToInt16(LocalizationHelper.StripQuotationsFromJson(data["defenderHealth"])) > 0) { Debug.Log(LocalizationHelper.StripQuotationsFromJson(data["defenderId"])); //Debug.Log(SessionData.Match.GetPlayerBySocketID(LocalizationHelper.StripQuotationsFromJson(data["result"]["socket_id"]))); Player pl = SessionData.Match.GetPlayerBySocketID(LocalizationHelper.StripQuotationsFromJson(data["defenderId"])); /* * NUR DEBUG LÖSUNG * !!!DURCH GLOBALEN UI HANDLER UMSCHREIBEN!!!! * */ pl.Health = Convert.ToInt16(LocalizationHelper.StripQuotationsFromJson(data["defenderHealth"])); if (pl.SocketID == SessionData.Match.LocalPlayerID) { GameObject.Find("LocalHP").GetComponent <Text>().text = "Your HP: " + pl.Health; } else { GameObject.Find("EnemyHP").GetComponent <Text>().text = "Enemy HP: " + pl.Health; } CombatUI.DeleteIncomingSpell(); } } else { Debug.Log("Spell failed"); } }
//On scene load find the scripts and UI in the scene void Start() { _aux = gameObject.GetComponent <AuxilliaryPower>(); _tM = gameObject.GetComponent <TurnManager>(); _pT = GameObject.Find("Player").GetComponent <PlayerTurn>(); _combatUI = gameObject.GetComponent <CombatUI>(); }
new void Awake() { combatui = FindObjectOfType <CombatUI>(); character = FindObjectOfType <PlayerCharacter>(); equipment = FindObjectOfType <PlayerEquipmentSlots>(); base.Awake(); }
public void Pause() { CombatUI cUI = FindObjectOfType <CombatUI>(); FindObjectOfType <GameLogic>()._paused = true; cUI._paused = true; cUI.PauseGame(true); }
public void PlayGame() { CombatUI cUI = FindObjectOfType <CombatUI>(); FindObjectOfType <GameLogic>()._paused = false; cUI._paused = false; cUI.PauseGame(false); }
void Awake() { _combatUI = gameObject.GetComponent <CombatUI>(); _tooltip = gameObject.GetComponent <Tooltip>(); _pT = GameObject.Find("Player").GetComponent <PlayerTurn>(); _skillsButton = GameObject.Find("Skills").GetComponent <Button>(); _auxButton = GameObject.Find("AuxilliaryPower").GetComponent <Button>(); Initialize(); }
private static void Turn() { turnsGone = 0; while (turnsGone < turns) { CombatUI.Turn(order[turnsGone]); turnsGone++; } }
void Start() { _combatUI = gameObject.GetComponent <CombatUI>(); _aux = gameObject.GetComponent <AuxilliaryPower>(); _pT = GameObject.Find("Player").GetComponent <PlayerTurn>(); _playerMenu = GameObject.Find("PlayerTurn"); _skillsMenu = GameObject.Find("SkillsMenu"); _menuRect = _skillsMenu.GetComponent <RectTransform>(); SpawnMenu(); _skillsMenu.SetActive(false); }
public void OnMouseOver() { Inspect(); if (!clicked) { if (selectionCircle == null) { combatUI = FindObjectOfType <CombatUI>(); abilitySelected = combatUI.GetCurrentAbility(); DisplayCircle(); } } }
// Use this for initialization void Start() { _auxPower = gameObject.GetComponent <AuxilliaryPower>(); _combatUI = gameObject.GetComponent <CombatUI>(); _pT = GameObject.Find("Player").GetComponent <PlayerTurn>(); _toolTipName = GameObject.Find("TooltipName").GetComponent <Text>(); _toolTipDesc = GameObject.Find("TooltipDesc").GetComponent <Text>(); _toolTipAP = GameObject.Find("TooltipAP").GetComponent <Text>(); _toolTipGO = GameObject.Find("TooltipGO"); _tooltipRect = _toolTipGO.GetComponent <RectTransform>(); _tooltipRect.anchoredPosition = _lowerPos; _toolTipGO.SetActive(false); }
public static void DamageMonster(string text, string text2, Creature p, Dungeon d, List <Monster> monster, int damage) { CombatUI.ActionSelect(p, monster); Console.SetCursorPosition(0, 9); PlayerStatusDamage(p, d); monster[target].health -= damage; if (text != "") { Console.WriteLine(text); } Console.WriteLine(text2); Thread.Sleep(300); MonsterAI.KillCheck(p, d, monster[target], monster); }
void CallInit() { CombatUI CUI = GameObject.Find("CombatUI").GetComponent <CombatUI>(); ButtonsUI[] buttonsUIs = FindObjectsOfType <ButtonsUI> (); CUI.CM = combatObj.GetComponent <CombatManager>(); GameObject.Find("Cursor").GetComponent <CursorManager> ().CM = combatObj.GetComponent <CombatManager>(); for (int i = 0; i < buttonsUIs.Length; i++) { buttonsUIs [i].CM = combatObj.GetComponent <CombatManager>(); } }
public Tutorial_Combat_01_TrainingDummy(Party playerParty) : base(playerParty) { EnemyParty = new Party(); EnemyParty.AddPartyMember(new TrainingDummy(100, 0, 0, "Training Dummy 1")); EnemyParty.AddPartyMember(new TrainingDummy(100, 0, 0, "Training Dummy 2")); EnemyParty.AddPartyMember(new TrainingDummy(100, 0, 0, "Training Dummy 3", new Dictionary <Item, int>() { { new Rubbish(), 1 } })); CombatUI.SetTargetList(EnemyParty.PartyMembers); }
private void Start() { combat = Combat.instance; evolveManager = EvolveManager.instance; pBag = PlayerBag.instance; attackLearnManager = AttackLearnManager.instance; tInspect = TeamInspect.instance; rCombat = RandomCombatManager.instance; pcManager = PCManager.instance; pTeam = PlayerTeamManager.instance; pause = PauseManager.instance; combatUI = CombatUI.instance; cManager = ConversationManager.instance; pMovement = FindObjectOfType <PlayerMovement>(); interaction = FindObjectOfType <Interaction>(); }
public static void SelectTarget(Creature p, List <Monster> monster, Dungeon d) { if (monster.Count == 1) { target = 0; } else { CombatUI.ActionSelect(p, monster); Console.SetCursorPosition(0, 18); for (int i = 0; i < monster.Count; i++) { Utilities.CenterText($" [{i + 1}] " + Colour.MONSTER + $"{monster[i].name} " + Colour.RESET); } Console.Write(""); Utilities.CenterText("Please choose a monster"); int choice; do { } while (!int.TryParse(Console.ReadKey(true).KeyChar.ToString().ToLower(), out choice)); if (choice == 1) { target = 0; } else if (choice == 2) { target = 1; } else if (choice == 3 && monster.Count == 3) { target = 2; } else if (choice == 0) { ActionSelect(p, monster, d); } else { SelectTarget(p, monster, d); } } }
// Use this for initialization void Start() { Destroy(GameObject.Find("BattleButtonsCanvas")); combatObj = GameObject.Find("CombatManager").GetComponent <CombatManager>(); CUI = GameObject.Find("CombatUI").GetComponent <CombatUI> (); CUI.CM = combatObj; buttonsUIs = FindObjectsOfType <ButtonsUI> (); GameObject.Find("Cursor").GetComponent <CursorManager> ().CM = combatObj; GameObject.Find("ConflictCursor").GetComponent <ConflictCursorManager> ().CM = combatObj; //Destroy(GameObject.Find ("BattleButtonsCanvas")); characters = FindObjectsOfType <Character> (); characterselectUIs = CharacterSelectUI.FindObjectsOfType <CharacterSelectUI> (); temporaryUIIntegrations = TemporaryUIIntegration.FindObjectsOfType <TemporaryUIIntegration> (); for (int i = 0; i < buttonsUIs.Length; i++) { buttonsUIs [i].CM = combatObj; } Destroy(GameObject.Find("BattleSimulator")); Destroy(this); }
// Use this for initialization void Start() { if (GameStateManager.Instance.fightingBoss) { GameObject bg = GameObject.Find("BattleBGNormal"); bg.SetActive(false); } //used to create the combat ui singleton instance early CombatUI combatUI = CombatUI.Instance; GameObject player = GameObject.FindGameObjectWithTag("Player").transform.parent.gameObject; playerBattler = player.GetComponent <PlayerBattleController>(); playerBattler.battleState = new BattleState(); PlayerStateManager.Instance.CopyPlayerBattleState(playerBattler.battleState); battlers = GameObject.FindGameObjectsWithTag("Battler"); battlers = battlers.OrderByDescending(go => go.GetComponent <Battler>().battleState.speed).ToArray(); activeBattler = battlers[activeBattlerIndex].GetComponent <Battler>(); }
void Start() { Initialize(); floorMask = LayerMask.GetMask("Floor"); uiMask = LayerMask.GetMask("UI"); indicatorCubePrefab = Resources.Load("IndicatorCubeGreen", typeof(GameObject)) as GameObject; //attackFrequency = 1 / attackSpeed; attackButton = GameManager.instance.hud.Find("CombatUI").Find("Panel").Find("AttackButton").GetComponent <AttackButton>(); cameraButton = GameManager.instance.hud.Find("CameraButton").Find("Panel").Find("CameraButton").GetComponent <CameraButton>(); healthScript = GetComponent <PlayerHealth>(); equipment = Inventory.instance.equipment; combatUI = equipment.weapon.combatUI; TouchInputManager.instance.touchStart += GetMoveTo; }
public static void FullRound(Creature p, List <Monster> monster, Dungeon d) { round++; Player.target = 0; Update(p); foreach (Monster mon in monster) { Update(mon); } MonsterAI.SelectAction(p, monster, d); if (p.canAct) { Player.ActionSelect(p, monster, d); Console.WriteLine(); } else { CombatUI.Stunned(p, monster); } MonsterAI.PerformAction(p, monster, d); Utilities.Keypress(); FullRound(p, monster, d); }
void Awake() { //Find and allocate the referenced objects and scripts in the scene _muzzleFlash = gameObject.GetComponentInChildren <MuzzleFlash>(); _midPoint = GameObject.Find("MidPoint"); _anim = gameObject.GetComponent <Animator>(); _agent = gameObject.GetComponent <NavMeshAgent>(); _obstacle = gameObject.GetComponent <NavMeshObstacle>(); _combatUI = GameObject.Find("_combatMan").GetComponent <CombatUI>(); _calcDam = GameObject.Find("_combatMan").GetComponent <CalculateDamage>(); _targetedEnemy = GameObject.Find("_combatMan").GetComponent <TargetedEnemy>(); _moveIndicator = GameObject.Find("Player").GetComponent <MoveIndicator>(); _playerTurnUI = GameObject.Find("PlayerTurn"); _cam = GameObject.Find("_cameraParent").GetComponent <CameraController>(); _combatOver = GameObject.Find("EndCanvas").GetComponent <CombatOver>(); _aux = GameObject.Find("_combatMan").GetComponent <AuxilliaryPower>(); //Determine player stats based off _ap = _CombatManager._maxAP; _combatUI.Initialize(); //Prepare the elements used for navigation _mask = ~_mask; _path = new NavMeshPath(); _aux.Initialize(); }
public bool isShowing = false; //whether or not the ui is showing // Use this for initialization void Start() { S = this; //sets the combat UI to not show when the game begins ui.SetActive(isShowing); }
// Use this for initialization void Start() { S = this; //sets the combat UI to not show when the game begins ui.SetActive(isShowing); }
public void Init() { cmbtUI = CombatFlow.cl.cUI; cmbtUI.Initialize(); }
public Game(GameUIConstants gameUIConstants, CombatUI combatUI) { ShutdownTriggered = false; _gameUIConstants = gameUIConstants; _combatUI = combatUI; }
public void OnChangeWeapon(Weapon newWeapon) { combatUI = newWeapon.combatUI; }
public static void ActionSelect(Creature p, List <Monster> monster, Dungeon d) { CombatUI.ActionSelect(p, monster); Console.SetCursorPosition(50, 18); Console.Write("SELECT AN ACTION"); string choice = Console.ReadKey(true).KeyChar.ToString().ToLower(); if (choice == "h") { CombatUI.ActionSelect(p, monster); if (p.health == p.maxHealth || p.potions < 1) { CombatUI.ActionSelect(p, monster); Console.SetCursorPosition(50, 18); if (p.health == p.maxHealth) { Utilities.ColourText(Colour.SPEAK, "You don't need healing!\n"); } else if (p.potions < 1) { Utilities.ColourText(Colour.SPEAK, "You don't have enough potions!\n"); } Utilities.CenterText("Press any key to continue"); Console.ReadKey(true); ActionSelect(p, monster, d); } else { Console.SetCursorPosition(0, 9); p.health = p.maxHealth; p.potions -= 1; Utilities.ColourText(Colour.HEALTH, "You heal to full health\n"); } } else if (choice == "c") { Utilities.CharacterSheet(p); ActionSelect(p, monster, d); } else if (choice == "1") { SelectTarget(p, monster, d); int hitRoll = Utilities.rand.Next(1, 101); if (hitRoll <= (p.hit - monster[target].defence)) { int critRoll = Utilities.rand.Next(1, 101); int damage = (critRoll <= p.crit) ? (p.damage + p.Weapon.damageEffect + p.Weapon.effect) * 2 : p.damage + p.Weapon.damageEffect + p.Weapon.effect; string a = (critRoll <= p.crit) ? Colour.CRIT + "crit" : Colour.RESET + "hit"; DamageMonster("", "You " + $"{a} " + "the " + Colour.MONSTER + $"{monster[target].name} " + Colour.RESET + "for " + Colour.DAMAGE + $"{damage} " + Colour.RESET + "damage!", p, d, monster, damage); } else { CombatUI.ActionSelect(p, monster); Console.SetCursorPosition(0, 9); Console.WriteLine($"You miss the {monster[target].name}!"); } } else if (choice == "2") { int damage = (p.damage + p.Weapon.damageEffect + p.Weapon.effect) / 2; SelectTarget(p, monster, d); string text = "You get in a defensive stance, raising your defence and lowering your damage\nYou hit the " + Colour.MONSTER + $"{monster[target].name} " + Colour.RESET + "for " + Colour.DAMAGE + $"{damage} " + Colour.RESET + "damage!"; p.tempDef = (p.pClass.type == 3)? 7 * p.level: 5 * p.level; DamageMonster("", text, p, d, monster, damage); } else if (choice == "3" && currentAttackOptions[0] != "" && p.energy > 0) { Player.Attack(p, d, monster, 3); } else if (choice == "4" && currentAttackOptions[1] != "") { Player.Attack(p, d, monster, 4); } else if (choice == "5" && currentAttackOptions[2] != "") { Player.Attack(p, d, monster, 5); } else if (choice == "6" && currentAttackOptions[3] != "") { Player.Attack(p, d, monster, 6); } else if ((choice == "3" && currentAttackOptions[0] != "" || choice == "4" && currentAttackOptions[1] != "" || choice == "5" && currentAttackOptions[2] != "" || choice == "6" && currentAttackOptions[3] != "") && p.energy > 0) { CombatUI.ActionSelect(p, monster); Console.SetCursorPosition(50, 18); Utilities.EmbedColourText(Colour.ENERGY, "You don't have enough ", "energy", "!"); ActionSelect(p, monster, d); } else { ActionSelect(p, monster, d); } }
//Sprite icon; // Use this for initialization void Start() { combatUI = FindObjectOfType <CombatUI>(); DeselectSelf(); //icon = transform.Find("Image").GetComponent<Image>().sprite; }
void Start() { combatQueue = new Character[6]; CUI = GameObject.Find("CombatUI").GetComponent <CombatUI> (); tCursor = GameObject.Find("TargetCursors").GetComponent <TargetCursor> (); GameObject[] CharUI = new GameObject[3]; GameObject[] EnemyUI = new GameObject[3]; Player = new Character[3]; Enemy = new Character[3]; playerSelect = new Button [3]; enemySelect = new Button [3]; // his block sets up the the characters and character select buttons for (int i = 0; i < 3; i++) { // set up the Character select buttons CharacterSelectUI PlayerSUI = GameObject.Find("Player" + i).GetComponent <CharacterSelectUI> (); CharacterSelectUI EnemySUI = GameObject.Find("Enemy" + i).GetComponent <CharacterSelectUI> (); PlayerSUI.Init(this); EnemySUI.Init(this); // Set up the players Player[i] = GameObject.Find("Character" + i).GetComponent <Character>(); Enemy [i] = GameObject.Find("Character" + (i + 3)).GetComponent <Character> (); Player [i].Init(this, PlayerSUI); Enemy [i].Init(this, EnemySUI); playerSelect [i] = GameObject.Find("Player" + i).GetComponent <Button> (); enemySelect [i] = GameObject.Find("Enemy" + i).GetComponent <Button> (); // Set up each character's UI CharUI [i] = GameObject.Find("CharacterUI" + i); CharUI [i].GetComponent <CharacterUI> ().Init(Player [i]); EnemyUI [i] = GameObject.Find("CharacterUI" + (i + 3)); EnemyUI [i].GetComponent <CharacterUI> ().Init(Enemy [i]); // Set the character's positions to the buttons Player[i].transform.position = new Vector3(playerSelect [i].transform.position.x, playerSelect [i].transform.position.y, 98); Enemy [i].transform.position = new Vector3(enemySelect [i].transform.position.x, enemySelect [i].transform.position.y, 98); } // Get the action buttons and set them up Button[] action = new Button[5]; action [0] = GameObject.Find("ThrowButton").GetComponent <Button> (); action [1] = GameObject.Find("CatchButton").GetComponent <Button> (); action [2] = GameObject.Find("Skill1Button").GetComponent <Button> (); action [3] = GameObject.Find("Skill2Button").GetComponent <Button> (); action [4] = GameObject.Find("Skill3Button").GetComponent <Button> (); for (int i = 0; i < action.Length; i++) { action [i].GetComponent <ButtonsUI> ().CM = this; } // Get text components and the end buttons combatAction = GameObject.Find("CombatAction").GetComponent <Text> (); combatLog = GameObject.Find("CombatLog").GetComponentInChildren <CombatLog> (); //ballsCaught = new System.Collections.Generic.List<bool>(); // This sets up the character's healthbars and sets their allies and enemies internally for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { Player [i].allies [j] = Player [j]; Player [i].enemies [j] = Enemy [j]; Enemy [i].allies [j] = Enemy [j]; Enemy [i].enemies [j] = Player [j]; } } AI = gameObject.GetComponentInChildren <EnemyAI> (); }
public static void InitCombatUI(GameObject _combatUIElement, UIHandler _handler) { CombatUI.Init(_combatUIElement, _handler); }
private void Awake() { instance = this; }