public override IEnumerator OnEnterPreBattle() { if (Target != null) { if (!PlayerUnitUtils.CheckIfEnemyIsInBattleWithOtherUnit(Target)) { yield return(StartCoroutine(PlayerUnitUtils.TellEnemyToPrepareFor1on1battleWithMe(Target, this))); animationController.OnWalking(); yield return(StartCoroutine(PlayerUnitUtils.MoveToTargetAndInvokeAction(this, PlayerUnitUtils.FindDirectBattlePosition(SR, Target.SR), dataLegacy.speed, (Target == null), Target.OnBattleInitiate))); SM.SetState(States.InDirectBattle); } else { animationController.OnWalking(); yield return(StartCoroutine(PlayerUnitUtils.MoveToTargetAndInvokeAction(this, PlayerUnitUtils.FindJoinBattlePosition(SR, Target.SR), dataLegacy.speed, (Target == null), null))); SM.SetState(States.JoinBattle); } yield break; } else { SM.SetState(States.Default); } }
public override IEnumerator OnEnterDefault() { dataLegacy.EnemyTarget = null; dataLegacy.EffectableTarget = null; animationController.OnWalking(); yield return(StartCoroutine(PlayerUnitUtils.ReturnToBattlePosition(this))); animationController.OnIdle(); yield break; }
public override IEnumerator OnEnterJoinBattle() { if (Target != null) { if (Target.transform.position.x > transform.position.x) { SetXdirection(false); } if (Target.transform.position.x < transform.position.x) { SetXdirection(true); } animationController.OnIdle(); yield return(StartCoroutine(PlayerUnitUtils.AttackCoroutineAndInvokeAction(this, !PlayerUnitUtils.StandardConditionToAttack(this), dataLegacy.AttackRate, OnAttack))); } SM.SetState(States.PostBattle); yield break; }
public override bool IsTargetable() { return(PlayerUnitUtils.StandardIsTargetable(this)); }
public override IEnumerator OnEnterPostBattle() { yield return(StartCoroutine(PlayerUnitUtils.StandardPostBattleCheck(this))); yield break; }