// Token: 0x06000018 RID: 24 RVA: 0x000025D0 File Offset: 0x000007D0
        public static StatusEffect MakeStatusEffectPrefab(string effectName, string familyName, string description, float lifespan, float refreshRate, StatusEffectFamily.StackBehaviors stackBehavior, string targetStatusName, bool isMalusEffect, string tagID = null, UID?uid = null, string modGUID = null)
        {
            Dictionary <string, StatusEffect> dictionary = At.GetValue(typeof(ResourcesPrefabManager), null, "STATUSEFFECT_PREFABS") as Dictionary <string, StatusEffect>;
            StatusEffectFamily statusEffectFamily        = TinyEffectManager.MakeStatusEffectFamiliy(familyName, stackBehavior, -1, StatusEffectFamily.LengthTypes.Short, null, null);
            GameObject         gameObject   = TinyEffectManager.InstantiateClone(dictionary[targetStatusName].gameObject, effectName, false, true);
            StatusEffect       statusEffect = dictionary[effectName] = (gameObject.GetComponent <StatusEffect>() ?? gameObject.AddComponent <StatusEffect>());

            At.SetValue <string>(effectName, typeof(StatusEffect), statusEffect, "m_identifierName");
            At.SetValue <StatusEffectFamily>(statusEffectFamily, typeof(StatusEffect), statusEffect, "m_bindFamily");
            At.SetValue <string>(effectName, typeof(StatusEffect), statusEffect, "m_nameLocKey");
            At.SetValue <string>(description, typeof(StatusEffect), statusEffect, "m_descriptionLocKey");
            statusEffect.RefreshRate   = refreshRate;
            statusEffect.IsMalusEffect = isMalusEffect;
            At.SetValue <StatusEffect.EffectSignatureModes>(StatusEffect.EffectSignatureModes.Reference, typeof(StatusEffect), statusEffect, "m_effectSignatureMode");
            At.SetValue <StatusEffect.FamilyModes>(StatusEffect.FamilyModes.Bind, typeof(StatusEffect), statusEffect, "m_familyMode");
            TagSourceSelector value = (tagID != null) ? new TagSourceSelector(TagSourceManager.Instance.GetTag(tagID)) : new TagSourceSelector();

            At.SetValue <TagSourceSelector>(value, typeof(StatusEffect), statusEffect, "m_effectType");
            StatusData statusData = statusEffect.StatusData = new StatusData(statusEffect.StatusData);

            statusData.LifeSpan = lifespan;
            List <StatusData> list = At.GetValue(typeof(StatusEffect), statusEffect, "m_statusStack") as List <StatusData>;

            list[0] = statusData;
            UnityEngine.Object.Destroy(gameObject.GetComponentInChildren <EffectSignature>().gameObject);
            EffectSignature effectSignature = statusEffectFamily.EffectSignature = (statusData.EffectSignature = TinyEffectManager.MakeFreshObject("Signature", true, true, null).AddComponent <EffectSignature>());

            effectSignature.name         = "Signature";
            effectSignature.SignatureUID = (uid ?? ((modGUID != null) ? TinyUIDManager.MakeUID(effectName, modGUID, "Status Effect") : UID.Generate()));
            StatusEffectFamilySelector statusEffectFamilySelector = new StatusEffectFamilySelector();

            statusEffectFamilySelector.Set(statusEffectFamily);
            At.SetValue <StatusEffectFamilySelector>(statusEffectFamilySelector, typeof(StatusEffect), statusEffect, "m_stackingFamily");
            return(statusEffect);
        }
Exemplo n.º 2
0
        // Token: 0x06000007 RID: 7 RVA: 0x00002370 File Offset: 0x00000570
        private void MakeSittingPrefab()
        {
            StatusEffect    statusEffect          = TinyEffectManager.MakeStatusEffectPrefab(SkilledAtSitting.SITTING_EFFECT_NAME, SkilledAtSitting.SITTING_EFFECT_NAME, "Regain health, burnt health and stamina while sitting.", -1f, 1f, StatusEffectFamily.StackBehaviors.Override, "Bandage", false, null, null, "com.ehaugw.skilledatsitting");
            EffectSignature statusEffectSignature = statusEffect.StatusEffectSignature;
            Sitting         sitting = TinyEffectManager.MakeFreshObject("Effects", true, true, statusEffectSignature.transform).AddComponent <Sitting>();

            sitting.UseOnce = false;
            statusEffectSignature.Effects = new List <Effect>
            {
                sitting
            };
            statusEffect.IsHidden     = false;
            statusEffect.DisplayInHud = true;
        }
        // Token: 0x06000031 RID: 49 RVA: 0x000041FC File Offset: 0x000023FC
        public static StatusEffect MakeRadiatingPrefab()
        {
            StatusEffect    statusEffect          = TinyEffectManager.MakeStatusEffectPrefab("Radiating", "Radiating", "Damages you and your nearby allies.", 15f, 1f, StatusEffectFamily.StackBehaviors.Override, "Doom", true, 134.ToString(), null, "com.ehaugw.templarclass");
            EffectSignature statusEffectSignature = statusEffect.StatusEffectSignature;
            Radiating       radiating             = TinyEffectManager.MakeFreshObject("Effects", true, true, statusEffectSignature.transform).AddComponent <Radiating>();

            radiating.UseOnce             = false;
            statusEffectSignature.Effects = new List <Effect>
            {
                radiating
            };
            statusEffect.OverrideIcon = CustomTextures.CreateSprite(SL.Packs["Templar"].Texture2D["radiatingIcon"], 0);
            return(statusEffect);
        }
        // Token: 0x0600002D RID: 45 RVA: 0x00004028 File Offset: 0x00002228
        public static StatusEffect MakePrayerPrefab()
        {
            StatusEffect    statusEffect          = TinyEffectManager.MakeStatusEffectPrefab("Prayer", "Prayer", "You are praying...", -1f, 0.25f, StatusEffectFamily.StackBehaviors.Override, "Mana Ratio Recovery 3", true, null, null, "com.ehaugw.templarclass");
            EffectSignature statusEffectSignature = statusEffect.StatusEffectSignature;
            PrayerEffect    prayerEffect          = TinyEffectManager.MakeFreshObject("Effects", true, true, statusEffectSignature.transform).AddComponent <PrayerEffect>();

            prayerEffect.UseOnce          = false;
            statusEffectSignature.Effects = new List <Effect>
            {
                prayerEffect
            };
            statusEffect.IsHidden     = true;
            statusEffect.DisplayInHud = false;
            return(statusEffect);
        }