/// <summary> /// Execute the player move. This would need way more information in full implementation. /// Should just be ExecuteMove, take the source and the target and apply result accordingly /// </summary> /// <param name="move"></param> IEnumerator ExecuteMove(MoveModel move, BaseBattleAgent source, BaseBattleAgent target) { uiManager.battleTextPanel.SetInfoText($"{source.CurrentStats.agentName} used {move.MoveName}!"); var roll = UnityEngine.Random.Range(0, move.Accuracy); yield return(new WaitForSeconds(2)); if (roll >= move.Accuracy) { Debug.Log($"missed!"); Debug.Log($"roll {roll}, Move accuracy: {move.Accuracy}"); yield return(new WaitForSeconds(3)); } else { target.Damage(move.Power); uiManager.battleTextPanel.SetInfoText($"Hit for {move.Power} damage!"); yield return(new WaitForSeconds(3)); if (target.GetType() == typeof(PlayerBattleAgent)) { uiManager.playerStatusPanel.UpdateHealthText(target.CurrentStats.healthPoints, target.BaseStats.healthPoints); } else { uiManager.enemyStatusPanel.UpdateHealthText(target.CurrentStats.healthPoints, target.BaseStats.healthPoints); } uiManager.battleTextPanel.SetInfoText($"{target.CurrentStats.agentName} has {target.CurrentStats.healthPoints} hp!"); yield return(new WaitForSeconds(3)); } executing = false; }
public BattleEnums.FighterStatus CheckAgentStatus(BaseBattleAgent agent) { return(0); }