public async Task ActAsync(IActor target) { if (await AttackRoll.RollAsync() >= target.ArmorClass) { await target.DamageAsync(Damage); } }
//---------------------------------------------------------------------------- // AttackHit //---------------------------------------------------------------------------- #region AttackHit public IEnumerator AttackHit(AttackRoll attackRoll) { MyAttackRoll = attackRoll; MyTextMesh.text = MyAttackData.MyHasAttack.MyName + " rolls a " + MyAttackRoll.PureRoll + " + " + MyAttackData.SumOfModifiers + " to hit, hitting " + MyAttackData.MyIsVictim.Name + "." + " It hits against their AC of " + MyAttackData.MyIsVictim.AC; while (!Input.GetMouseButton(0)) { yield return(null); } yield return(new WaitForSeconds(0.2f)); }
//---------------------------------------------------------------------------- // AttackMiss //---------------------------------------------------------------------------- #region AttackMiss public IEnumerator AttackMiss(AttackRoll attackRoll) { MyTextMesh.text = "The attack misses with a " + attackRoll.PureRoll + " + " + MyAttackData.SumOfModifiers + ", glancing off " + MyAttackData.MyIsVictim.Name + "'s shield."; while (!Input.GetMouseButton(0)) { yield return(null); } yield return(StartCoroutine(HideCanvas())); yield return(new WaitForSeconds(0.2f)); }
public IEnumerator TakeAttack(AttackRoll attackRoll) { Debug.Log("Death!"); yield break; }
public IEnumerator TakeAttack(AttackRoll attackRoll) { yield return(StartCoroutine(MyNarrator.HasTurnDeath(MyHasTurn))); yield return(StartCoroutine(MyDeathManager.Die(MyHasTurn))); }