/// <summary> /// Is called once at the start of the turn /// </summary> /// <param name="Turn"></param> public void OnTurn(Battle.Turn Turn) { if (!gameObject.activeSelf) { return; } AITImer = 0; if (isAI) { targetThisTurn = GameManager.GM.InGameActors[Random.Range(0, GameManager.CurrentBattle.Players.Count)].actor; } actor.TileWalkedThisTurn = 0; GameManager.GM.ShowUI(actor); if (sprity[0] != null) { sprity[0].color = Color.white; } MyTurn = true; if (actor.SP > 0 && MyTurn && isAI && !attacking) { AI(); } if (!isAI) { GameManager.CursorPos = this.actor.TilePosition; GameManager.SetActor(this.actor); } else { AI(Turn); } attacking = false; UpdateEffectUI(); }
public virtual void OnTurn(Battle.Turn t) { if ((_actor != null && remainingturn <= 0) && !Curse) { _actor.Remove(this); return; } remainingturn--; ///Do shit there }
public override void OnTurn(Battle.Turn t) { base.OnTurn(t); if (UnityEngine.Random.Range(0, 100f) < ChanceToCauseEffect) { if (FXID < Effects.Core.Count) { _actor.Apply(Core[FXID]); } else { UnityEngine.Debug.Log("FXID: " + FXID + " is not valid. Max Effect in Effect.Core is " + Effects.Core.Count + ". Consider making it lower than such number."); } } }
public override void OnTurn(Battle.Turn t) { base.OnTurn(t); _actor.HP -= DamageEachTurn.x; _actor.MP -= DamageEachTurn.y; }
public virtual void ClassLogic(Battle.Turn turn) { }
//Action and Attack public void AI(Battle.Turn Turn = null) { Weapon weapon; imageAIMenu.gameObject.SetActive(true); GameManager.SelectedActor = null; if (!MyTurn) { return; } AI ai = new AI(); var collectionDumb = ai.Monster_Grunt_Ai(); var nodesList = collectionDumb[0].NodesS; //text over ai AIUIDialogues aIUIDialogues = new AIUIDialogues(); aIUIDialogues.AIUIDialogueGrunt(collectionDumb); AIHoverText.text = aIUIDialogues.AIUIDialogueGrunt(collectionDumb); int counter = 0; int max = collectionDumb[0].MyMovePoints; if (collectionDumb[0].Distancefoe > 0 || ai.flee) { foreach (var item in nodesList) { if (counter == max) { break; } if (counter > 0) { fromNode = nodesList[counter - 1].Pos; actor.Move(nodesList[counter].Pos, true, true); } else { fromNode = nodesList[0].Pos; } counter++; } } if (collectionDumb[0].Distancefoe == 1) { if (!ai.flee) { if (actor.inventory.GetWeapons != null) { actor.inventory.GetWeapons.Sort((a, b) => (a.ATK.CompareTo(b.ATK))); weapon = actor.inventory.GetWeapons[0]; Attack(collectionDumb[0].Target, Skill.Weapon(weapon)); } else { Attack(collectionDumb[0].Target, Skill.Base); } } } }