Pedro Gomes e1081a2bf4 Necromancer and Minions update
- Necromancer class playable
- Savage minion ability & npc
- Mage minion ability & npc
- rogue minion ability & npc
- warrior minion ability & npc
- golem minion ability & npc
- minion abilities
- Class resource (used to automatically summon minions based on the amount of souls drained, in case of necromancer)
- class resource spender (auto cast from priority list)
- class resource regen instant effect option
2024-07-22 16:46:13 +01:00

43 lines
1.7 KiB
C#

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "SummonAbility", menuName = "RiftMayhem/AbilitySystem/Abilities/Summon Ability", order = 0)]
public class SummonAbility : BaseAbility
{
public GameObject minionPrefab;
private GameObject instantiatedMinion;
public override void Execute(PhotonView user, Taggable userTag)
{
base.Execute(user, userTag);
Debug.Log($"Player {user.name} casted {this.name} and spent {manaCost} mana.");
instantiatedMinion = PhotonNetwork.Instantiate("Abilities/" + minionPrefab.name, user.GetComponentInChildren<ProjectileSpawnLocationController>().transform.position, user.GetComponentInChildren<ProjectileSpawnLocationController>().transform.rotation);
}
public override void Execute(PhotonView user, Taggable userTag, Vector3 point)
{
base.Execute(user, userTag);
Debug.Log($"Player {user.name} casted {this.name} and spent {manaCost} mana.");
instantiatedMinion = PhotonNetwork.Instantiate("Abilities/" + minionPrefab.name, user.GetComponentInChildren<ProjectileSpawnLocationController>().transform.position, user.GetComponentInChildren<ProjectileSpawnLocationController>().transform.rotation);
}
public override void Execute(PhotonView user, Taggable userTag, Transform target)
{
base.Execute(user, userTag);
Debug.Log($"Player {user.name} casted {this.name} and spent {manaCost} mana.");
instantiatedMinion = PhotonNetwork.Instantiate("Abilities/" + minionPrefab.name, user.GetComponentInChildren<ProjectileSpawnLocationController>().transform.position, user.GetComponentInChildren<ProjectileSpawnLocationController>().transform.rotation);
}
}