RiftMayhem/Assets/Scripts/AbilitySystem/AreaOfEffectOverTimeAbility.cs
Pedro Gomes 81f2ac424e Insane update
Abilities:

- area of effect ability with impact event/chain reaction type added
- melee slash timing bugfix
- melee slash VFX added
- blizzard (second mage ability) added
- holy circle (ultimate priest ability) added
- consecration (ultimate knight ability) added
- whirling axes (second barbarian ability) added
- glacial bomb (ultimate mage ability) added
- ice shard (first mage ability) added

Others:

- aoe location snapshot on cast mechanic added
- reduced realtime shadows on rifthunters inn
2024-07-04 21:27:15 +01:00

78 lines
3.4 KiB
C#

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "AoEOverTimeAbility", menuName = "RiftMayhem/AbilitySystem/Abilities/Area of Effect Over Time Ability", order = 0)]
public class AreaOfEffectOverTimeAbility : AreaOfEffectAbility
{
public float duration;
public bool followUser;
private NetworkedAreaOfEffectOverTime networkedAreaOfEffectOverTime;
public override void Execute(PhotonView user, Taggable userTag)
{
user.GetComponent<Mana>().ChangeValue(-manaCost);
if (spawnUnderUser)
{
instantiatedArea = PhotonNetwork.Instantiate("Abilities/" + aoePrefab.name, user.transform.position, Quaternion.identity);
//instantiatedArea.transform.parent = user.transform;
networkedAreaOfEffectOverTime = instantiatedArea.GetComponent<NetworkedAreaOfEffectOverTime>();
networkedAreaOfEffectOverTime.owner = user;
networkedAreaOfEffectOverTime.ownerTag = userTag;
networkedAreaOfEffectOverTime.ability = this;
networkedAreaOfEffectOverTime.radius = radius;
networkedAreaOfEffectOverTime.telegraphDelay = telegraphDelay;
networkedAreaOfEffectOverTime.lifeSpan = lifeSpan;
networkedAreaOfEffectOverTime.duration = duration;
networkedAreaOfEffectOverTime.followUser = followUser;
networkedAreaOfEffectOverTime.canHitSelf = canHitSelf;
networkedAreaOfEffectOverTime.Init();
return;
}
instantiatedArea = PhotonNetwork.Instantiate("Abilities/" + aoePrefab.name, user.GetComponentInChildren<AoERayHitLocationSnapshotController>().aoeRayHitLocationSnapshot.position, Quaternion.identity);
networkedAreaOfEffectOverTime = instantiatedArea.GetComponent<NetworkedAreaOfEffectOverTime>();
networkedAreaOfEffectOverTime.owner = user;
networkedAreaOfEffectOverTime.ownerTag = userTag;
networkedAreaOfEffectOverTime.ability = this;
networkedAreaOfEffectOverTime.radius = radius;
networkedAreaOfEffectOverTime.telegraphDelay = telegraphDelay;
networkedAreaOfEffectOverTime.lifeSpan = lifeSpan;
networkedAreaOfEffectOverTime.duration = duration;
networkedAreaOfEffectOverTime.followUser = followUser;
networkedAreaOfEffectOverTime.canHitSelf = canHitSelf;
networkedAreaOfEffectOverTime.Init();
}
public override void Execute(PhotonView user, Taggable userTag, Vector3 point)
{
user.GetComponent<Mana>().ChangeValue(-manaCost);
instantiatedArea = PhotonNetwork.Instantiate("Abilities/" + aoePrefab.name, point, Quaternion.identity);
networkedAreaOfEffectOverTime = instantiatedArea.GetComponent<NetworkedAreaOfEffectOverTime>();
networkedAreaOfEffectOverTime.owner = user;
networkedAreaOfEffectOverTime.ownerTag = userTag;
networkedAreaOfEffectOverTime.ability = this;
networkedAreaOfEffectOverTime.radius = radius;
networkedAreaOfEffectOverTime.telegraphDelay = telegraphDelay;
networkedAreaOfEffectOverTime.lifeSpan = lifeSpan;
networkedAreaOfEffectOverTime.duration = duration;
networkedAreaOfEffectOverTime.followUser = followUser;
networkedAreaOfEffectOverTime.canHitSelf = canHitSelf;
networkedAreaOfEffectOverTime.Init();
}
}