예제 #1
0
        private void ApplyHealing(HealthComponent healthComponent, CharacterBody body = null)
        {
            bool  embryoProc = Embryo.instance.CheckEmbryoProc(body);
            float restore    = healthRestoreAmount;

            if (embryoProc)
            {
                restore *= 2f;
            }
            if (!body)
            {
                body = healthComponent.body;
            }
            if (healType == 0)
            {
                healthComponent.HealFraction(restore, default);
            }
            else
            {
                healthComponent.Heal(restore, default);
            }
            if (enableRegenBuff)
            {
                body.AddTimedBuff(regenBuff, regenDuration);
                if (embryoProc)
                {
                    body.AddTimedBuff(regenBuff, regenDuration);
                }
            }
        }
예제 #2
0
        protected override bool PerformEquipmentAction(EquipmentSlot slot)
        {
            CharacterBody body = slot.characterBody;

            if (!body)
            {
                return(false);
            }
            HealthComponent health = body.healthComponent;

            if (!health)
            {
                return(false);
            }

            int MeatBunBoostCount = body.GetBuffCount(MeatbunBoost);

            if (MeatBunBoostCount < MaxBuffLimit)
            {
                body.AddBuff(MeatbunBoost);
            }

            if (PercentMaxHealthHealAmount > 0)
            {
                health.HealFraction(PercentMaxHealthHealAmount, default);
            }
            return(true);
        }
예제 #3
0
        protected override bool PerformEquipmentAction(EquipmentSlot slot)
        {
            CharacterBody body = slot.characterBody;

            if (!body)
            {
                return(false);
            }
            HealthComponent health = body.healthComponent;

            if (!health)
            {
                return(false);
            }
            Inventory inventory = body.inventory;

            if (!inventory)
            {
                return(false);
            }

            inventory.SetEquipmentIndex(EquipmentIndex.None); //credit to : Rico
            inventory.GiveItem(OrangeConsumedDef);
            health.HealFraction(1, default);

            return(false);
        }
예제 #4
0
 private void RationUse(HealthComponent health, Inventory inventory, int equipmentSlot)
 {
     if (PercentMaxHealthHeal > 0)
     {
         health.body.AddTimedBuff(RoR2Content.Buffs.Immune, 0.5f);
         health.HealFraction(PercentMaxHealthHeal, default);
     }
     inventory.equipmentStateSlots[equipmentSlot].equipmentIndex = EquipmentIndex.None;
 }
 // Token: 0x06002B3F RID: 11071 RVA: 0x000B65C0 File Offset: 0x000B47C0
 private void HealPulse()
 {
     if (this.owner)
     {
         HealthComponent component = this.owner.GetComponent <HealthComponent>();
         if (component)
         {
             component.HealFraction(this.healPulseHealthFractionValue, this.procChainMask);
         }
     }
 }
예제 #6
0
        public override void OnArrival()
        {
            //Handle normal arrival shit like damage and destruction of the orb
            base.OnArrival();
            //Grab the owner's health component
            HealthComponent health = attacker.GetComponent <HealthComponent>();

            //If the target actually exists (so if orb hit something) heal the owner for the amount
            if (target)
            {
                health.HealFraction(this.healthFraction, default);
            }
        }
예제 #7
0
        protected override bool PerformEquipmentAction(EquipmentSlot slot)
        {
            CharacterBody body = slot.characterBody;

            if (!body)
            {
                return(false);
            }
            HealthComponent health = body.healthComponent;

            if (!health)
            {
                return(false);
            }

            var BarrierAmt = health.fullBarrier * PercentBarrierAmount;

            health.HealFraction(PercentHealAmount, default);
            health.AddBarrier(BarrierAmt);
            body.AddTimedBuff(RoR2Content.Buffs.Immune, ImmuneDuration);
            body.inventory?.SetEquipmentIndex(EquipmentIndex.None); //credit to : Rico
            return(true);
        }
예제 #8
0
 // Token: 0x06002BFE RID: 11262 RVA: 0x000B9EA0 File Offset: 0x000B80A0
 private void HealTarget(HealthComponent target)
 {
     target.HealFraction(this.healFractionValue, default(ProcChainMask));
     Util.PlaySound("Play_item_proc_TPhealingNova_hitPlayer", target.gameObject);
 }
예제 #9
0
        public override void OnArrival()
        {
            try
            {
                switch (bonusType)
                {
                    #region DamageBoost
                case 1 when targetTeam == TeamIndex.Player:
                    targetInventory.GiveItem(Items.DamageBoostIndex);
                    targetBody.baseDamage *= (ConfigHandler.DamageValue * 0.01f) + 1f;
                    break;

                case 1 when targetTeam == TeamIndex.Monster:
                    targetBody.AddBuff(Buffs.DamageBoostIndex);
                    targetBody.baseDamage *= (ConfigHandler.DamageValue * 0.1f) + 1f;
                    break;

                    #endregion
                    #region HealthBoost
                case 2 when targetTeam == TeamIndex.Player:
                    targetInventory.GiveItem(Items.HealthBoostIndex);
                    targetBody.baseMaxHealth *= (ConfigHandler.HealthValue * 0.01f) + 1f;
                    break;

                case 2 when targetTeam == TeamIndex.Monster:
                    targetBody.AddBuff(Buffs.HealthBoostIndex);
                    targetBody.baseMaxHealth *= (ConfigHandler.HealthValue * 0.1f) + 1f;
                    break;

                    #endregion
                case 3:
                    targetHealth.HealFraction(ConfigHandler.HealingValue * 0.01f, new ProcChainMask());
                    break;

                case 4:
                    ulong exp = (targetTeamManager.GetTeamNextLevelExperience(targetTeam) - targetTeamManager.GetTeamCurrentLevelExperience(targetTeam)) * (ulong)(ConfigHandler.ExpValue * 0.01f);
                    targetTeamManager.GiveTeamExperience(targetTeam, exp);
                    break;

                case 5:
                    switch (affixType)
                    {
                    case 0:                                     //Nothing
                        break;

                    case 1:                                     //Blue
                        if (targetTeam == TeamIndex.Player && ConfigHandler.AffixOverride)
                        {
                            targetInventory.SetEquipmentIndex(EquipmentIndex.AffixBlue);
                        }
                        else
                        {
                            targetBody.AddBuff(BuffIndex.AffixBlue);
                        }
                        break;

                    case 2:                                     //Red
                        if (targetTeam == TeamIndex.Player && ConfigHandler.AffixOverride)
                        {
                            targetInventory.SetEquipmentIndex(EquipmentIndex.AffixRed);
                        }
                        else
                        {
                            targetBody.AddBuff(BuffIndex.AffixRed);
                        }
                        break;

                    case 3:                                     //White
                        if (targetTeam == TeamIndex.Player && ConfigHandler.AffixOverride)
                        {
                            targetInventory.SetEquipmentIndex(EquipmentIndex.AffixWhite);
                        }
                        else
                        {
                            targetBody.AddBuff(BuffIndex.AffixWhite);
                        }
                        break;

                    case 4:                                     //Ghost
                        if (targetTeam == TeamIndex.Player && ConfigHandler.AffixOverride)
                        {
                            targetInventory.SetEquipmentIndex(EquipmentIndex.AffixHaunted);
                        }
                        else
                        {
                            targetBody.AddBuff(BuffIndex.AffixHaunted);
                        }
                        break;

                    case 5:                                     //Poison
                        if (targetTeam == TeamIndex.Player && ConfigHandler.AffixOverride)
                        {
                            targetInventory.SetEquipmentIndex(EquipmentIndex.AffixPoison);
                        }
                        else
                        {
                            targetBody.AddBuff(BuffIndex.AffixPoison);
                        }
                        break;
                    }
                    break;

                    #region SpeedBoost
                case 6 when targetTeam == TeamIndex.Player:
                    targetInventory.GiveItem(Items.SpeedBoostIndex);
                    targetBody.baseMoveSpeed *= (ConfigHandler.SpeedValue * 0.01f) + 1f;
                    break;

                case 6 when targetTeam == TeamIndex.Monster:
                    targetBody.AddBuff(Buffs.SpeedBoostIndex);
                    targetBody.baseMoveSpeed *= (ConfigHandler.SpeedValue * 0.1f) + 1f;
                    break;

                    #endregion
                    #region DexBoost
                case 7 when targetTeam == TeamIndex.Player:
                    targetInventory.GiveItem(Items.DexBoostIndex);
                    targetBody.baseAttackSpeed *= (ConfigHandler.DexValue * 0.01f) + 1f;
                    break;

                case 7 when targetTeam == TeamIndex.Monster:
                    targetBody.AddBuff(Buffs.DexBoostIndex);
                    targetBody.baseAttackSpeed *= (ConfigHandler.DexValue * 0.1f) + 1f;
                    break;

                    #endregion
                    #region ArmorBoost
                case 8 when targetTeam == TeamIndex.Player:
                    targetInventory.GiveItem(Items.ArmorBoostIndex);
                    targetBody.baseArmor *= (ConfigHandler.ArmorValue * 0.01f) + 1f;
                    break;

                case 8 when targetTeam == TeamIndex.Monster:
                    targetBody.AddBuff(Buffs.ArmorBoostIndex);
                    targetBody.baseArmor *= (ConfigHandler.ArmorValue * 0.1f) + 1f;
                    break;
                    #endregion
                }
                targetBody.RecalculateStats();
            }
            catch { }
        }