Пример #1
0
        protected override void ActivateLocally(Character _targetCharacter, object[] _infos)
        {
            if (SummonManager.Instance == null)
            {
                return;
            }

            if (SummonManager.Instance.FindWeakestSummon(_targetCharacter.UID) is Character summonChar &&
                summonChar.isActiveAndEnabled)
            {
                // change blast position to the summon's position
                _infos[0] = summonChar.transform.position;
                base.ActivateLocally(_targetCharacter, _infos);

                // kill the summon
                summonChar.Stats.ReceiveDamage(999f);

                // fix for cooldown not working on this skill for some reason
                var skill = this.ParentItem as Skill;
                At.SetField(skill, "m_lastActivationTime", Time.time);
                At.SetField(skill, "m_lastCooldownProgress", -1);

                // plague aura interaction
                if (PlagueAuraProximityCondition.IsInsidePlagueAura(summonChar.transform.position))
                {
                    // if you're inside a plague aura, detonate resets your Summon cooldown.
                    if (this.OwnerCharacter?.Inventory?.SkillKnowledge?.GetItemFromItemID(8890103) is Skill summonSkill)
                    {
                        summonSkill.ResetCoolDown();
                    }
                }
            }
        }
Пример #2
0
        protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            if (SummonManager.Instance == null)
            {
                return;
            }

            if (SummonManager.Instance.FindWeakestSummon(_affectedCharacter.UID) is Character summonChar)
            {
                bool insideSigil = PlagueAuraProximityCondition.IsInsidePlagueAura(_affectedCharacter.transform.position);

                float healSummon = insideSigil ? 0.66f : 0.33f;

                // restores HP to the summon
                summonChar.Stats.AffectHealth(summonChar.ActiveMaxHealth * healSummon);

                // add status effects
                summonChar.StatusEffectMngr.AddStatusEffect(ResourcesPrefabManager.Instance.GetStatusEffectPrefab("Rage"), null);
                summonChar.StatusEffectMngr.AddStatusEffect(ResourcesPrefabManager.Instance.GetStatusEffectPrefab("Possessed"), null);
                summonChar.StatusEffectMngr.AddStatusEffect(ResourcesPrefabManager.Instance.GetStatusEffectPrefab("Speed Up"), null);

                if (insideSigil)
                {
                    // add decay imbue
                    summonChar.CurrentWeapon.AddImbueEffect(ResourcesPrefabManager.Instance.GetEffectPreset(211) as ImbueEffectPreset, 180f);
                }
            }
            else
            {
                //_affectedCharacter.CharacterUI.ShowInfoNotification("You need a summon to do that!");
                //// refund the cooldown
                //if (this.ParentItem is Skill skill)
                //{
                //    skill.ResetCoolDown();
                //    float manacost = m_affectedCharacter.Stats.GetFinalManaConsumption(new Tag[] { Tag.None }, ManaCost);
                //    _affectedCharacter.Stats.SetMana(m_affectedCharacter.Stats.CurrentMana + manacost);
                //}
            }
        }
Пример #3
0
        protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            if (SummonManager.Instance == null)
            {
                return;
            }

            bool armyOfDeathLearned = _affectedCharacter.Inventory.SkillKnowledge.IsItemLearned(8890108);

            int maxSummons = armyOfDeathLearned
                                ? NecromancerBase.settings.Summon_MaxSummons_WithArmyOfDeath
                                : NecromancerBase.settings.Summon_MaxSummons_NoArmyOfDeath;

            if (SummonManager.Instance.SummonedCharacters.ContainsKey(_affectedCharacter.UID))
            {
                var list      = SummonManager.Instance.SummonedCharacters[_affectedCharacter.UID];
                int toDestroy = list.Count - maxSummons;

                while (toDestroy >= 0)
                {
                    if (SummonManager.Instance.FindWeakestSummon(_affectedCharacter.UID) is Character summon)
                    {
                        SummonManager.DestroySummon(summon);
                    }

                    toDestroy--;
                }
            }

            // custom health cost for casting
            _affectedCharacter.Stats.UseBurntHealth = NecromancerBase.settings.Summon_BurnsHealth;
            float healthcost = NecromancerBase.settings.Summon_HealthCost * _affectedCharacter.Stats.MaxHealth;

            _affectedCharacter.Stats.ReceiveDamage(healthcost);
            _affectedCharacter.Stats.UseBurntHealth = true;

            // only host should do this
            if (!PhotonNetwork.isNonMasterClientInRoom)
            {
                bool insidePlagueAura = PlagueAuraProximityCondition.IsInsidePlagueAura(_affectedCharacter.transform.position);

                var template = insidePlagueAura ? SummonManager.Ghost : SummonManager.Skeleton;
                this.SLCharacter_UID = template.UID;

                CustomCharacters.Templates.TryGetValue(this.SLCharacter_UID, out m_charTemplate);

                this.ExtraRpcData = _affectedCharacter.UID.ToString();

                if (armyOfDeathLearned)
                {
                    for (int i = 0; i < NecromancerBase.settings.Summon_Summoned_Per_Cast_withArmyOfDeath; i++)
                    {
                        base.ActivateLocally(_affectedCharacter, _infos);
                    }
                }
                else
                {
                    base.ActivateLocally(_affectedCharacter, _infos);
                }
            }
        }
Пример #4
0
        protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            if (SummonManager.Instance == null)
            {
                return;
            }

            bool armyOfDeathLearned = _affectedCharacter.Inventory.SkillKnowledge.IsItemLearned(8890108);

            int MaxSummons = armyOfDeathLearned ? NecromancerBase.settings.Summon_MaxSummons_WithArmyOfDeath : NecromancerBase.settings.Summon_MaxSummons_NoArmyOfDeath;

            if (SummonManager.Instance.SummonedCharacters.ContainsKey(_affectedCharacter.UID))
            {
                var list = SummonManager.Instance.SummonedCharacters[_affectedCharacter.UID];
                int diff = MaxSummons - list.Count;

                if (armyOfDeathLearned)
                {
                    while (diff < NecromancerBase.settings.Summon_Summoned_Per_Cast_withArmyOfDeath)
                    {
                        if (SummonManager.Instance.FindWeakestSummon(_affectedCharacter.UID) is Character summon)
                        {
                            SummonManager.DestroySummon(summon);
                        }

                        diff++;
                    }
                }
                else
                {
                    if (list.Count == MaxSummons && SummonManager.Instance.FindWeakestSummon(_affectedCharacter.UID) is Character summon)
                    {
                        SummonManager.DestroySummon(summon);
                    }
                }
            }

            // custom health cost for casting
            _affectedCharacter.Stats.UseBurntHealth = NecromancerBase.settings.Summon_BurnsHealth;
            float healthcost = NecromancerBase.settings.Summon_HealthCost * _affectedCharacter.Stats.MaxHealth;

            _affectedCharacter.Stats.ReceiveDamage(healthcost);
            _affectedCharacter.Stats.UseBurntHealth = true;

            // only host should do this
            if (!PhotonNetwork.isNonMasterClientInRoom)
            {
                bool insidePlagueAura = PlagueAuraProximityCondition.IsInsidePlagueAura(_affectedCharacter.transform.position);

                if (armyOfDeathLearned)
                {
                    for (int i = 0; i < NecromancerBase.settings.Summon_Summoned_Per_Cast_withArmyOfDeath; i++)
                    {
                        var uid = UID.Generate().ToString();
                        SummonManager.Instance.SummonSpawn(_affectedCharacter, uid, insidePlagueAura);
                    }
                }
                else
                {
                    var uid = UID.Generate().ToString();
                    SummonManager.Instance.SummonSpawn(_affectedCharacter, uid, insidePlagueAura);
                }
            }
        }