private void StartAttack() { aiStatus = AIStatus.attack; switch (Parameters.AttackType) { case AttackType.hitAndRun: Action = new AttackHitAndRun(this, MainController.Instance.level.MainHero, StartAttack); break; case AttackType.distanceFight: Action = new AttackDistance(this, MainController.Instance.level.MainHero, StartAttack); break; case AttackType.closeCombat: Action = new AttackCloseCombat(this, MainController.Instance.level.MainHero, StartAttack); break; } }
protected virtual void StartAttack(bool byHit) { var heroTarget = MainController.Instance.level.MainHero; if (heroTarget == null) { return; } aiStatus = AIStatus.attack; switch (Parameters.AttackType) { case AttackType.distanceFight: Action = new AttackDistance(this, heroTarget, EndAttack, byHit); break; case AttackType.closeCombat: Action = new AttackCloseCombat(this, heroTarget, EndAttack, byHit); break; } }