// 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); }
// Token: 0x06000025 RID: 37 RVA: 0x00002CF8 File Offset: 0x00000EF8 protected override void ActivateLocally(Character _affectedCharacter, object[] _infos) { bool isDead = _affectedCharacter.IsDead; base.ActivateLocally(_affectedCharacter, _infos); Skill skill = null; bool flag; if (!isDead && _affectedCharacter.IsDead) { skill = (base.ParentItem as Skill); flag = (skill != null); } else { flag = false; } bool flag2 = flag; if (flag2) { bool flag3 = this.SetCooldown != -1f; if (flag3) { At.SetValue <float>(this.SetCooldown, typeof(Skill), skill, "m_remainingCooldownTime"); } } }
// Token: 0x06000019 RID: 25 RVA: 0x00002810 File Offset: 0x00000A10 public static StatusEffectFamily MakeStatusEffectFamiliy(string familyName, StatusEffectFamily.StackBehaviors stackBehavior, int maxStackCount, StatusEffectFamily.LengthTypes lengthType, UID?uid = null, string modGUID = null) { StatusEffectFamily statusEffectFamily = new StatusEffectFamily(); uid = new UID?(uid ?? ((modGUID != null) ? TinyUIDManager.MakeUID(familyName, modGUID, "Status Effect Family") : UID.Generate())); At.SetValue <UID>(uid.Value, typeof(StatusEffectFamily), statusEffectFamily, "m_uid"); statusEffectFamily.Name = familyName; statusEffectFamily.StackBehavior = stackBehavior; statusEffectFamily.MaxStackCount = maxStackCount; statusEffectFamily.LengthType = lengthType; return(statusEffectFamily); }
// Token: 0x06000020 RID: 32 RVA: 0x00002A90 File Offset: 0x00000C90 public static ImbueEffectPreset MakeImbuePreset(int imbueID, string name, string description, string iconFileName, int visualEffectID, float flatDamage, float scalingDamage, DamageType.Types damageType, string statusEffect, Skill skill, int chanceToContract = 0, int buildUp = 0) { Dictionary <int, EffectPreset> dictionary = (Dictionary <int, EffectPreset>)At.GetValue(typeof(ResourcesPrefabManager), null, "EFFECTPRESET_PREFABS"); bool flag = !dictionary.ContainsKey(imbueID); ImbueEffectPreset result; if (flag) { GameObject gameObject = new GameObject(imbueID.ToString() + "_" + name.Replace(" ", "")); gameObject.SetActive(true); UnityEngine.Object.DontDestroyOnLoad(gameObject); ImbueEffectPreset imbueEffectPreset = gameObject.AddComponent <ImbueEffectPreset>(); imbueEffectPreset.name = imbueID.ToString() + "_" + name.Replace(" ", ""); At.SetValue <int>(imbueID, typeof(EffectPreset), imbueEffectPreset, "m_StatusEffectID"); At.SetValue <string>(name, typeof(ImbueEffectPreset), imbueEffectPreset, "m_imbueNameKey"); At.SetValue <string>(description, typeof(ImbueEffectPreset), imbueEffectPreset, "m_imbueDescKey"); imbueEffectPreset.ImbueStatusIcon = ((ImbueEffectPreset)dictionary[visualEffectID]).ImbueStatusIcon; imbueEffectPreset.ImbueFX = ((ImbueEffectPreset)dictionary[visualEffectID]).ImbueFX; TinyEffectManager.SetNameAndDesc(imbueEffectPreset, name, description); dictionary.Add(imbueID, imbueEffectPreset); GameObject gameObject2 = new GameObject("Effects"); gameObject2.SetActive(true); UnityEngine.Object.DontDestroyOnLoad(gameObject2); gameObject2.transform.SetParent(imbueEffectPreset.transform); bool flag2 = statusEffect != null && chanceToContract > 0; if (flag2) { TinyEffectManager.AddStatusEffectChance(imbueEffectPreset, chanceToContract, statusEffect); } bool flag3 = statusEffect != null && buildUp > 0; if (flag3) { TinyEffectManager.AddStatusEffectBuildUp(imbueEffectPreset, (float)buildUp, statusEffect); } bool flag4 = scalingDamage > 0f || flatDamage > 0f; if (flag4) { TinyEffectManager.AddWeaponDamage(imbueEffectPreset, flatDamage, scalingDamage, damageType); } bool flag5 = skill != null; if (flag5) { skill.GetComponentInChildren <ImbueWeapon>().ImbuedEffect = imbueEffectPreset; } result = imbueEffectPreset; } else { result = null; } return(result); }
// Token: 0x06000023 RID: 35 RVA: 0x00002C84 File Offset: 0x00000E84 public static void Stagger(Character character) { At.SetValue <Character.HurtType>(Character.HurtType.Knockback, typeof(Character), character, "m_hurtType"); character.Animator.SetTrigger("Knockback"); character.ForceCancel(false, true); character.Invoke("DelayedForceCancel", 0.3f); bool flag = character.CharacterUI; if (flag) { character.CharacterUI.OnPlayerKnocked(); } }
// Token: 0x06000007 RID: 7 RVA: 0x00002228 File Offset: 0x00000428 public static Skill.ActivationCondition AddToSkill(Skill skill, bool allowDrawnTwoHandedInRight = false, bool allowSheathedTwoHandedInLeft = false) { GameObject gameObject = new GameObject("EmptyOffhandCondition"); Skill.ActivationCondition activationCondition = new Skill.ActivationCondition(); EmptyOffHandCondition emptyOffHandCondition = gameObject.AddComponent <EmptyOffHandCondition>(); UnityEngine.Object.DontDestroyOnLoad(emptyOffHandCondition); gameObject.SetActive(false); activationCondition.Condition = emptyOffHandCondition; emptyOffHandCondition.AllowDrawnTwoHandedInRight = allowDrawnTwoHandedInRight; emptyOffHandCondition.AllowSheathedTwoHandedInLeft = allowSheathedTwoHandedInLeft; At.SetValue <string>("Requires an empty left hand.", typeof(Skill.ActivationCondition), activationCondition, "m_defaultMessage"); Skill.ActivationCondition[] array = At.GetValue(typeof(Skill), skill, "m_additionalConditions") as Skill.ActivationCondition[]; List <Skill.ActivationCondition> list = ((array != null) ? array.ToList <Skill.ActivationCondition>() : null) ?? new List <Skill.ActivationCondition>(); list.Add(activationCondition); At.SetValue <Skill.ActivationCondition[]>(list.ToArray(), typeof(Skill), skill, "m_additionalConditions"); return(activationCondition); }