Example #1
0
        public override void ActivateLocally(Character _targetCharacter, object[] _infos)
        {
            if (SummonManager.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;
                skill.m_lastActivationTime           = Time.time;
                skill.m_lastReceivedCooldownProgress = -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();
                    }
                }
            }
        }
Example #2
0
        public override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            // SL.Log("summoning necromancer summon...");

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

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

            int amtToSummon = armyOfDeathLearned
                                ? NecromancerMod.settings.Summon_Summoned_Per_Cast_withArmyOfDeath
                                : 1;

            if (SummonManager.SummonedCharacters.ContainsKey(_affectedCharacter.UID))
            {
                int summoned  = SummonManager.SummonedCharacters[_affectedCharacter.UID].Count;
                int toDestroy = summoned - maxSummons + amtToSummon - 1;

                while (toDestroy >= 0)
                {
                    if (SummonManager.FindWeakestSummon(_affectedCharacter.UID) is Character summon)
                    {
                        CustomCharacters.DestroyCharacterRPC(summon);
                        SummonManager.OnSummonDeath(summon);
                    }

                    toDestroy--;
                }
            }

            // custom health cost for casting
            _affectedCharacter.Stats.UseBurntHealth = NecromancerMod.settings.Summon_BurnsHealth;
            float healthcost = NecromancerMod.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 charTemplate);

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

                for (int i = 0; i < amtToSummon; i++)
                {
                    base.ActivateLocally(_affectedCharacter, _infos);
                }
            }
        }
Example #3
0
        public override bool CheckIsValid(Character _affectedCharacter)
        {
            var targetSummon = SummonManager.FindWeakestSummon(_affectedCharacter.UID);

            if (targetSummon && targetSummon.GetComponentInChildren <Character>() is Character c && c.Inventory.HasEquipped(RequiredSummonEquipment))
            {
                return(true);
            }

            return(false);
        }
Example #4
0
        public static bool Prefix(Skill __instance, bool _tryingToActivate, ref bool __result)
        {
            if (_tryingToActivate)
            {
                var self = __instance;

                // custom check for Life Ritual and Death Ritual (requires a summoned skeleton)
                if (self.ItemID == 8890105 || self.ItemID == 8890106)
                {
                    if (!SummonManager.FindWeakestSummon(self.OwnerCharacter.UID))
                    {
                        self.OwnerCharacter.CharacterUI.ShowInfoNotification("You need a Summon to do that!");
                        __result = false;
                        return(false);
                    }
                }
            }

            return(true);
        }
Example #5
0
        public override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            if (SummonManager.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);
                }
            }
        }