//Combat Logic public void ExecuteAttack(PhyAttack t) { print(t.myName + " attack does " + t.Damage + " damage"); t.AttackAnim(enemyObj[i_enemySelect]); AddText(t.Damage.ToString(), enemyObj[i_enemySelect]); battleInfo.GetComponent <BattleInfo>().action.text = ""; //actually do damage to target battler t.Attack(enemies[i_enemySelect]); battleInfo.GetComponent <BattleInfo>().DisplayTargetCharacter(enemies[i_enemySelect]); CheckTargetHealth(enemies[i_enemySelect]); }
public void BackButton() { if (b_selectMove && !attackReady && !abilityReady) { b_selectParty = true; battleInfo.GetComponent <BattleInfo>().action.text = "select party member"; b_selectMove = false; } else if (abilityReady) { if (selectedAbility != null) { ClearEnemySelector(); b_selectEnemy = false; b_selectMove = true; PopulateAbilities(); selectedAbility = null; selectedAttack = null; } else { abilityReady = false; DisableMoves(true); } } else if (attackReady) { if (selectedAttack != null) { ClearEnemySelector(); b_selectEnemy = false; b_selectMove = true; PopulatePhysAttacks(); selectedAbility = null; selectedAttack = null; } else { DisableMoves(true); battleInfo.GetComponent <BattleInfo>().action.text = "Select action"; attackReady = false; } } else if (itemReady) { itemReady = false; DisableMoves(true); } else { print("nothing assigned to go back from"); } }
//handles the actual moment the button gets clicked, val is assigned on the button public void SelectMove(int val) { if (abilityReady) { selectedAbility = party[i_partySelect].myAbilities[val]; if (selectedAbility.targetEnemy) { SelectArrow(enemyObj[i_enemySelect]); } } if (attackReady) { selectedAttack = party[i_partySelect].myPhyattacks[val]; SelectArrow(enemyObj[i_enemySelect]); } battleInfo.GetComponent <BattleInfo>().action.text = "select target"; DisableMoves(); b_selectEnemy = true; b_selectMove = false; }
//Battle UI IEnumerator playerRearm(float t = 2) { CheckVictory(); yield return(new WaitForSeconds(t)); if (!battleEnd) { battleInfo.GetComponent <BattleInfo>().ClearPlayerInfo(); battleInfo.GetComponent <BattleInfo>().ClearTargetInfo(); battleInfo.GetComponent <BattleInfo>().action.text = "Select party member"; b_selectParty = true; i_partySelect = 0; SelectArrow(partyObj[i_partySelect]); } else { } attackReady = false; abilityReady = false; itemReady = false; selectedAbility = null; selectedAttack = null; }