RiftMayhem/Assets/Scripts/Networking/NecroAutoSummonOnSceneRefresh.cs
Pedro Gomes 59c74b1d31 New abilities, bugfix necro autosummon, updated effects
- Knight Challenging Shout AoE Taunt ability
- Mage Firewall AoE Burn ability
- Added support for movement speed modifier effects to slow enemies instead of only buffing allies.
- Added different movement speed minimum cap to enemies and bosses
2024-12-21 20:40:31 +00:00

48 lines
1.3 KiB
C#

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NecroAutoSummonOnSceneRefresh : MonoBehaviour
{
public List<BaseAbility> possibleAutoSummons = new List<BaseAbility>();
protected RiftPlayer player;
PhotonView photonView;
BaseAbility autocastAbility;
int index = 0;
private void Awake()
{
player = GetComponentInParent<RiftPlayer>();
photonView = GetComponentInParent<PhotonView>();
index = PlayerPrefs.GetInt(GameConstants.PlayerPrefsKeys.NecroAutoSummonOnSceneRefreshIndexKey, 0);
index %= possibleAutoSummons.Count;
}
private IEnumerator Start()
{
if(photonView.IsMine)
{
yield return new WaitForSeconds(1f);
autocastAbility = possibleAutoSummons[index];
(autocastAbility as SummonAbility).AutoSummonOnSceneLoad(player.photonView);
yield return new WaitForSeconds(0.5f);
index++;
autocastAbility = possibleAutoSummons[index];
(autocastAbility as SummonAbility).AutoSummonOnSceneLoad(player.photonView);
index++;
PlayerPrefs.SetInt(GameConstants.PlayerPrefsKeys.NecroAutoSummonOnSceneRefreshIndexKey, (index %= possibleAutoSummons.Count));
}
}
}