- Mage Mana Barrier ability - Added absorb fill visual on top of max health, showing how much absorb the player has compared to his health - Updated Knight ShieldWall anti projectile ability
38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
using Photon.Pun;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[CreateAssetMenu(fileName = "AntiProjectileAbility", menuName = "RiftMayhem/AbilitySystem/Abilities/Anti Projectile Ability", order = 0)]
|
|
public class AntiProjectileAbility : BaseAbility
|
|
{
|
|
public GameObject antiProjectilePrefab;
|
|
|
|
public float duration;
|
|
public bool followUser;
|
|
public bool breakOnHit;
|
|
|
|
private GameObject instantiatedProjectile;
|
|
private NetworkedAntiProjectile networkedAntiProjectile;
|
|
|
|
public override void Execute(PhotonView user, Taggable userTag)
|
|
{
|
|
base.Execute(user, userTag);
|
|
|
|
//Debug.Log($"Player {user.name} casted {this.name} and spent {manaCost} mana.");
|
|
|
|
instantiatedProjectile = PhotonNetwork.Instantiate("Abilities/" + antiProjectilePrefab.name, user.transform.position, user.GetComponentInChildren<ProjectileSpawnLocationController>().transform.rotation);
|
|
|
|
networkedAntiProjectile = instantiatedProjectile.GetComponent<NetworkedAntiProjectile>();
|
|
|
|
networkedAntiProjectile.duration = duration;
|
|
networkedAntiProjectile.owner = user;
|
|
networkedAntiProjectile.ownerTag = userTag;
|
|
networkedAntiProjectile.ability = this;
|
|
networkedAntiProjectile.followUser = followUser;
|
|
networkedAntiProjectile.breakOnHit = breakOnHit;
|
|
|
|
networkedAntiProjectile.Init();
|
|
}
|
|
}
|