// ========= internal ========== internal void Awake() { Instance = this; Ghost.Prepare(); Skeleton.Prepare(); Ghost.OnSpawn += OnSpawn; Skeleton.OnSpawn += OnSpawn; }
protected override void ActivateLocally(Character _affectedCharacter, object[] _infos) { if (SummonManager.Instance == null) { return; } bool armyOfDeathLearned = _affectedCharacter.Inventory.SkillKnowledge.IsItemLearned(8890108); int MaxSummons = armyOfDeathLearned ? NecromancyBase.settings.Summon_MaxSummons_WithArmyOfDeath : NecromancyBase.settings.Summon_MaxSummons_NoArmyOfDeath; if (SummonManager.Instance.SummonedCharacters.ContainsKey(_affectedCharacter.UID)) { var list = SummonManager.Instance.SummonedCharacters[_affectedCharacter.UID]; if (list.Count == MaxSummons) { if (SummonManager.Instance.FindWeakestSummon(_affectedCharacter.UID) is Character summon) { SummonManager.DestroySummon(summon); } } } // custom health cost for casting _affectedCharacter.Stats.UseBurntHealth = NecromancyBase.settings.Summon_BurnsHealth; float healthcost = NecromancyBase.settings.Summon_HealthCost * _affectedCharacter.Stats.MaxHealth; _affectedCharacter.Stats.ReceiveDamage(healthcost); _affectedCharacter.Stats.UseBurntHealth = true; // only host should do this if (!PhotonNetwork.isNonMasterClientInRoom) { var uid = UID.Generate().ToString(); //int sceneViewID = PhotonNetwork.AllocateSceneViewID(); bool insidePlagueAura = PlagueAuraProximityCondition.IsInsidePlagueAura(_affectedCharacter.transform.position); // The main stuff happens here SummonManager.Instance.SummonSpawn(_affectedCharacter, uid, insidePlagueAura); } }