コード例 #1
0
        private static void On_TreebotFlower2RootPulse(On.EntityStates.Treebot.TreebotFlower.TreebotFlower2Projectile.orig_RootPulse orig, TreebotFlower2Projectile self)
        {
            var owner      = self.GetFieldValue <GameObject>("owner");
            var isBoosted  = Scepter.instance.GetCount(owner?.GetComponent <CharacterBody>()) > 0;
            var origRadius = TreebotFlower2Projectile.radius;

            if (isBoosted)
            {
                TreebotFlower2Projectile.radius *= 2f;
            }
            orig(self);
            TreebotFlower2Projectile.radius = origRadius;
            if (!isBoosted)
            {
                return;
            }
            var rb = self.GetFieldValue <List <CharacterBody> >("rootedBodies");

            rb.ForEach(cb => {
                var nbi = Scepter.instance.itemRng.NextElementUniform(new[] {
                    BuffIndex.Bleeding,
                    BuffIndex.ClayGoo,
                    BuffIndex.Cripple,
                    BuffIndex.HealingDisabled,
                    BuffIndex.OnFire,
                    BuffIndex.Weak,
                    BuffIndex.Pulverized,
                    ClassicItemsPlugin.freezeBuff
                });
                if (nbi == ClassicItemsPlugin.freezeBuff)
                {
                    var ssoh = cb.gameObject.GetComponent <SetStateOnHurt>();
                    if (ssoh && ssoh.canBeFrozen)
                    {
                        ssoh.SetFrozen(1.5f);
                    }
                    else
                    {
                        return;
                    }
                }
                if (nbi == BuffIndex.OnFire)
                {
                    DotController.InflictDot(cb.gameObject, owner, DotController.DotIndex.Burn, 1.5f, 1f);
                }
                if (nbi == BuffIndex.Bleeding)
                {
                    DotController.InflictDot(cb.gameObject, owner, DotController.DotIndex.Bleed, 1.5f, 1f);
                }
                cb.AddTimedBuff(nbi, 1.5f);
            });
        }
コード例 #2
0
        private void On_TreebotFlower2RootPulse(On.EntityStates.Treebot.TreebotFlower.TreebotFlower2Projectile.orig_RootPulse orig, TreebotFlower2Projectile self)
        {
            var isBoosted  = AncientScepterItem.instance.GetCount(self.owner?.GetComponent <CharacterBody>()) > 0;
            var origRadius = TreebotFlower2Projectile.radius;

            if (isBoosted)
            {
                TreebotFlower2Projectile.radius *= 2f;
            }
            orig(self);
            TreebotFlower2Projectile.radius = origRadius;
            if (!isBoosted)
            {
                return;
            }
            self.rootedBodies.ForEach(cb => {
                var nbi = AncientScepterItem.instance.rng.NextElementUniform(new[] {
                    RoR2Content.Buffs.Bleeding,
                    RoR2Content.Buffs.ClayGoo,
                    RoR2Content.Buffs.Cripple,
                    RoR2Content.Buffs.HealingDisabled,
                    RoR2Content.Buffs.OnFire,
                    RoR2Content.Buffs.Weak,
                    RoR2Content.Buffs.Pulverized
                }); //todo: freezebuff
                if (nbi == RoR2Content.Buffs.OnFire)
                {
                    DotController.InflictDot(cb.gameObject, self.owner, DotController.DotIndex.Burn, 1.5f, 1f);
                }
                if (nbi == RoR2Content.Buffs.Bleeding)
                {
                    DotController.InflictDot(cb.gameObject, self.owner, DotController.DotIndex.Bleed, 1.5f, 1f);
                }
                cb.AddTimedBuff(nbi, 1.5f);
            });
        }