protected override void Think() { if (TileUtils.AI_SquareFind(currentTile, 2) && attackCooltime <= 0) { currentActionList = attackList; } else { currentActionList = moveList; } }
public IEnumerator AIRoutine() { isActing = true; if (currentState == State.OFF) { if (TileUtils.AI_SquareFind(currentTile, visionDistance)) { currentState = State.DELAY; } else { OnEndTurn(); yield break; } } if (currentState == State.DELAY) { if (DelayList != null) { yield return(StartCoroutine(DelayList[delayCount]())); delayCount++; if (delayCount >= DelayList.Count) { delayCount = 0; currentState = State.THINK; OnEndTurn(); yield break; } } else { currentState = State.THINK; } } if (currentState == State.THINK) { Think(); //생각해서 ActionList에 행동해야할 List들을 대입 currentState = State.ACT; } if (currentState == State.ACT) { yield return(StartCoroutine(currentActionList[actCount]())); actCount++; if (actCount >= currentActionList.Count) { actCount = 0; currentState = State.DELAY; } } OnEndTurn(); }
protected override void Think() { if (TileUtils.AI_Find(GetEnvironment())) { currentActionList = environmentAttack; } else if (TileUtils.AI_SquareFind(currentTile, 1)) { currentActionList = meeleAttack; } else { currentActionList = moveList; } }
protected override void Think() { if (TileUtils.AI_SquareFind(currentTile, 1)) { currentActionList = attackList; } else if (currentHp < fullHp) { currentActionList = suicideList; } else { currentActionList = justDeleay; } }
IEnumerator MeeleAttack() { SoundDelegate.instance.PlayEffectSound(SoundEffect.SFX5, transform.position); enemyUI.ActionImageOff(); List <Arch.Tile> tiles = TileUtils.SquareRange(currentTile, 1); for (int i = 0; i < tiles.Count; i++) { ObjectPoolManager.instance.PoolEffect(EnemyEffect.SPACE, tiles[i]); } if (TileUtils.AI_SquareFind(currentTile, 1)) { PlayerControl.player.GetDamage(atk); } yield return(StartCoroutine(AnimationRoutine(0))); }