RiftMayhem/Assets/Scripts/Networking/NetworkDrainEffectChainReaction.cs
Pedro Gomes c67f5f1b84 Nerfs & updates
- Stopped necro's spell interaction that allowed souls to be constantly drained from own minions
- Replaced mage melee ability with ice shard with simbolic mana cost
- Updated Mana Barrier as class signature for mage, making it more aligned in power
2024-12-25 22:26:16 +00:00

38 lines
1.2 KiB
C#

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NetworkDrainEffectChainReaction : NetworkAbilityChainReaction
{
NetworkedDrainProjectile drainProjectile;
public bool canDrainAllies;
public override void ExecuteAbilityChainReaction(PhotonView owner, Taggable ownerTag, List<Taggable> targets)
{
if (!owner.IsMine) return;
for (int i = 0; i < targets.Count; i++)
{
if(!canDrainAllies)
{
if (ownerTag.AlliedTagsContains(targets[i].targetTag)) continue;
}
spawnedChainReaction = PhotonNetwork.Instantiate("Abilities/" + abilityPrefabName.name, targets[i].transform.position + Vector3.up * 0.5f, Quaternion.identity);
drainProjectile = spawnedChainReaction.GetComponent<NetworkedDrainProjectile>();
drainProjectile.speed = ((ProjectileAbility)ability).projectileSpeed;
drainProjectile.owner = owner;
drainProjectile.ownerTag = ownerTag;
drainProjectile.ability = ((ProjectileAbility)ability);
drainProjectile.lifeSpan = ((ProjectileAbility)ability).lifeSpan;
drainProjectile.Init();
}
}
}