/// <summary> /// Called by Unity to initialize the <seealso cref="GenericPrefab"/> whether it is active or not /// </summary> private void Awake() { GenericPrefab.StatusDisplayPlayer = this.statusDisplayPlayer; GenericPrefab.StatusDisplayEnemy = this.statusDisplayEnemy; GenericPrefab.Panel = this.panel; GenericPrefab.Button = this.button; GenericPrefab.WorldButton = this.worldButton; GenericPrefab.Text = this.text; GenericPrefab.Text3D = this.text3D; MonoBehaviour.Destroy(this.gameObject); }
/// <summary> /// Recruits this entity to the player party /// </summary> private void Recruit() { if (PlayerDriver.Party.CapacityFilled) { Debug.Log("Cannot recruit as the party is already full."); Text3DController floatingText = MonoBehaviour.Instantiate(GenericPrefab.Text3D); floatingText.Text = "Cannot recruit.\nYour Party is full!"; floatingText.transform.position = this.transform.position + new Vector3(0.0f, TextHeight, 0.0f); return; } PlayerDriver.Party.Add(this.playerDriver); this.transform.parent = null; }
/// <summary> /// Use this action against a set list of targets /// </summary> /// <param name="targets">A list of targets</param> public void Use(BaseBattleDriver[] targets) { Debug.LogFormat("{0} is using {1}!", this.User.name, this.Name); this.User.AttackPoints -= this.AttackPointCost; Text3DController text3D = MonoBehaviour.Instantiate(GenericPrefab.Text3D); text3D.transform.position = this.User.spriteManager.rootTransform.position; text3D.Text = string.Format(BattleAction.MessageFormat, this.Name, this.User.BattleName, this.GetTargetLabel(targets)); foreach (BaseBattleDriver target in targets) { // Highlight the target if (!target.TakingTurn) { target.HighlightAsTarget(); } // Actually apply action this.Use(target); } }