Ejemplo n.º 1
0
        // Buff //

        private static void Charmed_EnableComponent(On.RoR2.CharacterBody.orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType)
        {
            if (buffType == Charm.buffIndex)
            {
                if (self.isBoss) //prevents adding the buff if it's a boss and the config is disabled
                {
                    if (!Config_Charm_Boss)
                    {
                        return;
                    }
                }

                if (!self.isPlayerControlled && self.masterObject && self.masterObject.GetComponent <BaseAI>())
                {
                    var isCharmed = self.gameObject.GetComponent <IsCharmed>();
                    if (!isCharmed)
                    {
                        isCharmed = self.gameObject.AddComponent <IsCharmed>();
                        isCharmed.characterBody = self;
                        isCharmed.baseAI        = self.masterObject.GetComponent <BaseAI>();
                        isCharmed.oldTeamIndex  = self.teamComponent.teamIndex;
                    }
                    orig(self, buffType); //unneeded?
                    return;
                }
            }
            orig(self, buffType);
        }
Ejemplo n.º 2
0
        private void Check(On.RoR2.CharacterBody.orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buff)
        {
            if (self)
            {
                if (self.activeBuffsList != null)
                {
                    if (self.activeBuffsListCount >= 4)
                    {
                        if (base.meetsBodyRequirement)
                        {
                            base.Grant();
                        }
                    }
                }
            }

            orig(self, buff);
        }