// Token: 0x060021EA RID: 8682 RVA: 0x000927D4 File Offset: 0x000909D4 public void Flash() { BuffDef buffDef = BuffCatalog.GetBuffDef(this.buffIndex); this.iconImage.color = Color.white; this.iconImage.CrossFadeColor(buffDef.buffColor, 0.25f, true, false); }
static void ReturnBuffList(CharacterBody body, ref string buffList, ref string debuffList) { BuffIndex buffIndex = (BuffIndex)0; BuffIndex buffCount = (BuffIndex)BuffCatalog.buffCount; while (buffIndex < buffCount) { int buffCount2 = body.GetBuffCount(buffIndex); bool flag3 = buffCount2 > 0; if (flag3) { BuffDef buffDef = BuffCatalog.GetBuffDef(buffIndex); string @string = Language.GetString(buffDef.name); string text5 = @string ?? ""; bool canStack = buffDef.canStack; if (canStack) { text5 += string.Format(" ({0})", buffCount2); } text5 += ", "; bool isDebuff = buffDef.isDebuff; if (isDebuff) { debuffList += text5; } else { buffList += text5; } } buffIndex++; } }
private void RW_EditEnrageBuff() { BuffDef enrage = BuffCatalog.GetBuffDef(BuffIndex.EnrageAncientWisp); enrage.buffColor = new Color(0.5f, 0.1f, 0.7f, 1f); enrage.iconPath = "Textures/BuffIcons/texMovespeedBuffIcon"; }
private static BuffIndex?GetBuffIndex(String name) { var ind = BuffCatalog.FindBuffIndex(name); if (ind == BuffIndex.None) { return(null); } return(ind); }
public static void InitBuffs(AssetBundle bundle) { LoadedCustomBuffs = new Dictionary <string, CustomBuffBase>(); var customItemTypes = typeof(NModLoader).Assembly.GetTypes().Where(t => t.GetCustomAttribute <NModBuffAttribute>() != null); var customBuffs = customItemTypes.Select(t => { try { return((CustomBuffBase)Activator.CreateInstance(t)); } catch (Exception e) { NModMain.Log.LogError("ERROR Initializing " + t.FullName + ":"); NModMain.Log.LogError(e.ToString()); return(null); } }); foreach (var customBuff in customBuffs) { if (customBuff == null) { continue; } LoadAssetsAndInit(customBuff, bundle); } NModMain.Log.LogMessage($"CustomItemManager added {customBuffs.Count()} buffs"); On.RoR2.BuffCatalog.Init += (orig) => { orig(); NModMain.Log.LogWarning($"Buff catalog init"); foreach (var customBuff in customBuffs) { if (customBuff != null) { customBuff.Index = BuffCatalog.FindBuffIndex(customBuff.InternalName); if (customBuff.Index == BuffIndex.None) { NModMain.Log.LogError($"Got NONE Buff Index for " + customBuff.InternalName); } customBuff.RegisterHooks(customBuff.Index); LoadedCustomBuffs.Add(customBuff.InternalName, customBuff); } } }; }
private void Start() { BuffCatalog.GetBuffDef(BuffIndex.Poisoned).canStack = true; var refState2 = (EntityStates.AimThrowableBase)EntityStates.EntityState.Instantiate(new EntityStates.SerializableEntityStateType(typeof(EntityStates.Toolbot.AimStunDrone))); States.Utility.BasePrepJump.arcPrefab = refState2.arcVisualizerPrefab; States.Utility.BasePrepJump.endPrefab = refState2.endpointVisualizerPrefab; States.Utility.BasePrepJump.endScale = 5f; States.Utility.BasePrepJump.maxDistance = 100f; States.Utility.BasePrepJump.rayRadius = 0.25f; States.Utility.BasePrepJump.useGravity = true; States.Utility.BasePrepJump.baseSpeed = 30f; }
private static void ShortenTimedDebuffs(On.RoR2.CharacterBody.orig_AddTimedBuff orig, CharacterBody self, BuffIndex buffType, float duration) { float newduration = duration; var component = self.GetComponent <DebuffStatComponent>(); if (component) { var buffDef = BuffCatalog.GetBuffDef(buffType); if (buffDef.isDebuff) { newduration *= component.Reduction; } } orig(self, buffType, newduration); }
public static BuffDef[] ReturnBuffs(CharacterBody characterBody, bool returnDebuffs, bool returnBuffs) { List <BuffDef> buffDefs = new List <BuffDef>(); BuffIndex buffIndex = (BuffIndex)0; BuffIndex buffCount = (BuffIndex)BuffCatalog.buffCount; while (buffIndex < buffCount) { BuffDef buffDef = BuffCatalog.GetBuffDef(buffIndex); if (characterBody.HasBuff(buffDef)) { if ((buffDef.isDebuff && returnDebuffs) || (!buffDef.isDebuff && returnBuffs)) { buffDefs.Add(buffDef); } } buffIndex++; } return(buffDefs.ToArray()); }
public BuffList() : base(buffList) { if (UmbraMenu.characterCollected) { List <Button> buttons = new List <Button>(); int i = 0; foreach (BuffIndex buffIndex in UmbraMenu.buffs) { BuffDef def = BuffCatalog.GetBuffDef(buffIndex); void ButtonAction() => ApplyBuff(buffIndex); Button button = new Button(new NormalButton(this, i + 1, def.name, ButtonAction)); buttons.Add(button); i++; } AddButtons(buttons); SetActivatingButton(Utility.FindButtonById(1, 6)); SetPrevMenuId(1); } }
public static bool CheckForDebuffs(CharacterBody characterBody) { BuffIndex buffIndex = 0; BuffIndex buffCount = (BuffIndex)BuffCatalog.buffCount; while (buffIndex < buffCount) { BuffDef buffDef = BuffCatalog.GetBuffDef(buffIndex); if (buffDef.isDebuff && characterBody.HasBuff(buffIndex)) { if (characterBody.HasBuff(buffIndex)) { //Debug.Log("debuffs!"); return(true); } } buffIndex++; } Debug.Log("no debuffs?!"); return(false); }
private static void BuffText(BuffIcon bufficon, float time) { if (TextBool.Value) { System.Text.StringBuilder builder = new System.Text.StringBuilder(); //prefixes the buff stack count if (BuffCatalog.GetBuffDef(bufficon.buffIndex).canStack) { builder.Append("x"); builder.Append(bufficon.buffCount); builder.Append(" "); } //adds the buff time to the display builder.Append(time.ToString(BuffToText)); bufficon.stackCount.enabled = true; bufficon.stackCount.SetText(builder); bufficon.stackCount.enableWordWrapping = false; } }
// Token: 0x060021EB RID: 8683 RVA: 0x00092818 File Offset: 0x00090A18 public void UpdateIcon() { BuffDef buffDef = BuffCatalog.GetBuffDef(this.buffIndex); if (buffDef == null) { this.iconImage.sprite = null; return; } this.iconImage.sprite = Resources.Load <Sprite>(buffDef.iconPath); this.iconImage.color = buffDef.buffColor; if (buffDef.canStack) { BuffIcon.sharedStringBuilder.Clear(); BuffIcon.sharedStringBuilder.Append("x"); BuffIcon.sharedStringBuilder.AppendInt(this.buffCount, 0U, uint.MaxValue); this.stackCount.enabled = true; this.stackCount.SetText(BuffIcon.sharedStringBuilder); return; } this.stackCount.enabled = false; }
private static void RegisterBuffInfo(BuffIndex buffIndex, BuffInfo buffInfo) { if (buffIndexToInfo.ContainsKey(buffIndex)) { BuffIconTooltips.Logger.LogWarning($"Attempted to register duplicate buff info for {buffIndex}!"); return; } if (buffIndex < BuffIndex.Count) { buffInfo.Name = buffIndex.ToString(); } buffInfo.BuffIndex = buffIndex; string desc = buffInfo.Effect; if (!string.IsNullOrWhiteSpace(desc)) { desc += "\n\n"; } if (buffInfo.Sources.Any()) { desc += $"{"Source(s):".Stylize(Style.Artifact)} {string.Join(", ", buffInfo.Sources)}"; } buffInfo.Description = desc; BuffDef buffDef = BuffCatalog.GetBuffDef(buffIndex); if (buffDef != null) { buffInfo.Color = buffDef.buffColor; buffInfo.IsDebuff = buffDef.isDebuff; } buffIndexToInfo[buffIndex] = buffInfo; }
private void BuffIcon_UpdateIcon(On.RoR2.UI.BuffIcon.orig_UpdateIcon orig, BuffIcon self) { orig(self); var tooltipProvider = self.GetComponent <TooltipProvider>(); if (tooltipProvider != null) { BuffInfo buffInfo = BuffInfoProvider.GetBuffInfoFromIndex(self.buffIndex); string title; string body; Color titleColor = Color.black; Color bodyColor = new Color(0.6f, 0.6f, 0.6f, 1f); if (buffInfo != null) { title = buffInfo.Name; body = buffInfo.Description; titleColor = buffInfo.Color; } else { title = BuffCatalog.GetBuffDef(self.buffIndex)?.name; body = ""; } TooltipContent ttContent = new TooltipContent { titleToken = title, bodyToken = body, titleColor = titleColor, bodyColor = bodyColor }; tooltipProvider.SetContent(ttContent); } }
private static void editBuffs(bufficons bufficons, BuffIcon bufficon) { foreach (var item in bufficons.timedbuffs) { if ((BuffIndex)index.GetValue(item) == bufficon.buffIndex) { var time = (float)timer.GetValue(item); System.Text.StringBuilder builder = new System.Text.StringBuilder(); builder.Clear(); if (BuffCatalog.GetBuffDef(bufficon.buffIndex).canStack) { builder.Append("x"); builder.Append(bufficon.buffCount); builder.Append(" "); } builder.Append(time.ToString("0.0")); bufficon.stackCount.enabled = true; bufficon.stackCount.SetText(builder); bufficon.stackCount.enableWordWrapping = false; return; } } }
private static void doMultiElite(GameObject gameObject, CombatDirector self) { DirectorCard card = self.lastAttemptedMonsterCard; float credit = self.monsterCredit; CharacterBody body = gameObject.GetComponentInChildren <CharacterMaster>().GetBody(); CombatDirector.EliteTierDef[] eliteDefs = typeof(CombatDirector).GetFieldValue <CombatDirector.EliteTierDef[]>("eliteTiers"); int currentEliteTypes = 1; foreach (BuffIndex buff in BuffCatalog.eliteBuffIndices) { BuffDef buffDef = BuffCatalog.GetBuffDef(buff); if (body.HasBuff(buff)) { currentEliteTypes += 1; } } if (currentEliteTypes > 1) { foreach (CombatDirector.EliteTierDef tierDef in eliteDefs) { foreach (EliteIndex eliteIndex in tierDef.eliteTypes) { if (credit > card.cost * tierDef.costMultiplier * currentEliteTypes) { BuffDef buffDef = BuffCatalog.GetBuffDef(BuffIndex.None); foreach (BuffIndex buff in BuffCatalog.eliteBuffIndices) { BuffDef tempDef = BuffCatalog.GetBuffDef(buff); if (tempDef.eliteIndex == eliteIndex) { buffDef = tempDef; } } if (buffDef != null) { if (!(body.HasBuff(buffDef.buffIndex))) { body.AddBuff(buffDef.buffIndex); self.monsterCredit -= card.cost * tierDef.costMultiplier * currentEliteTypes; credit -= card.cost * tierDef.costMultiplier * currentEliteTypes; currentEliteTypes++; float num3 = tierDef.healthBoostCoefficient; float damageBoostCoefficient = tierDef.damageBoostCoefficient; if (self.combatSquad) { int livingPlayerCount = Run.instance.livingPlayerCount; num3 *= Mathf.Pow((float)livingPlayerCount, 1f); } body.inventory.GiveItem(ItemIndex.BoostHp, Mathf.RoundToInt((num3 - 1f) * 10f)); body.inventory.GiveItem(ItemIndex.BoostDamage, Mathf.RoundToInt((damageBoostCoefficient - 1f) * 10f)); EliteDef eliteDef = EliteCatalog.GetEliteDef(eliteIndex); EquipmentIndex equipmentIndex = (eliteDef != null) ? eliteDef.eliteEquipmentIndex : EquipmentIndex.None; if (equipmentIndex != EquipmentIndex.None) { if (body.inventory.GetEquipmentIndex() == EquipmentIndex.None) { body.inventory.SetEquipmentIndex(equipmentIndex); } } } } } } } } }
public ShorterMedkits(ConfigFile config, string name, bool defaultEnabled, string description) : base(config, name, defaultEnabled, description) { MedkitDef = BuffCatalog.GetBuffDef(BuffIndex.MedkitHeal); VanillaDebuffVal = MedkitDef.isDebuff; }
public void FixedUpdate() { //Make protection ward match teleported bubble, and void bubble up to twice the full radius. protectionWard.radius = target.holdoutZoneController.currentRadius; switch (roundsCleared) { case 0: break; case 4: if (orbLocator.FindChild("OrbW").gameObject.activeSelf == false) { orbLocator.FindChild("OrbW").gameObject.SetActive(true); } break; case 3: if (orbLocator.FindChild("OrbE").gameObject.activeSelf == false) { orbLocator.FindChild("OrbE").gameObject.SetActive(true); } break; case 2: if (orbLocator.FindChild("OrbS").gameObject.activeSelf == false) { orbLocator.FindChild("OrbS").gameObject.SetActive(true); } break; case 1: if (orbLocator.FindChild("OrbN").gameObject.activeSelf == false) { orbLocator.FindChild("OrbN").gameObject.SetActive(true); } break; case 5: if (orbLocator.transform.GetChild(0).GetComponent <ParticleSystem>().isStopped == false) { orbLocator.transform.GetChild(0).GetComponent <ParticleSystem>().Stop(true, ParticleSystemStopBehavior.StopEmitting); } if (orbLocator.FindChild("OrbN").gameObject.activeSelf == false) { orbLocator.FindChild("OrbN").gameObject.SetActive(true); } if (orbLocator.FindChild("OrbS").gameObject.activeSelf == false) { orbLocator.FindChild("OrbS").gameObject.SetActive(true); } if (orbLocator.FindChild("OrbE").gameObject.activeSelf == false) { orbLocator.FindChild("OrbE").gameObject.SetActive(true); } if (orbLocator.FindChild("OrbW").gameObject.activeSelf == false) { orbLocator.FindChild("OrbW").gameObject.SetActive(true); } break; } if (!target.isCharged) { voidWard.radius = (protectionWard.radius * 2) + 100 + (15 * roundsCleared); } else if (voidWard.radius > 0.001) { voidWard.radius /= 1.05f; if (orbLocator) { orbLocator.transform.localScale /= 1.05f; } } else if (orbLocator) { orbLocator.transform.localScale /= 1.01f; } if (NetworkServer.active) { NetMessageExtensions.Send(new CRMissionNetworkMessage { riftsCompleted = this.roundsCleared }, R2API.Networking.NetworkDestination.Clients); this.degenTimer += Time.fixedDeltaTime; if (this.degenTimer > 1f / degenTickFrequency) { this.degenTimer -= 1f / degenTickFrequency; foreach (TeamComponent teamComponent in TeamComponent.GetTeamMembers(TeamIndex.Player)) { if (!teamComponent.body.HasBuff(BuffCatalog.FindBuffIndex("CRVoidProtectionBuff")) && teamComponent.body.HasBuff(BuffCatalog.FindBuffIndex("CRVoidDebuff")) && !(teamComponent.body.baseNameToken.Contains("DRONE") || teamComponent.body.baseNameToken.Contains("TURRET"))) { float damage = (CRCore3.voidDegenerationRate.Value / 100f) / degenTickFrequency * teamComponent.body.healthComponent.fullCombinedHealth; teamComponent.body.healthComponent.TakeDamage(new DamageInfo { damage = damage, position = teamComponent.body.corePosition, damageType = DamageType.Silent }); } } } } else { if (roundsCleared >= roundsCount) { ObjectivePanelController.collectObjectiveSources -= OnCollectObjectives; } } }
private void Main_FirstFrame() { this.resetDebuff = BuffCatalog.FindBuffIndex("SniperResetDebuff"); }
private void Awake() { this.projectileStick.stickEvent.AddListener(this.OnStick); this.buffApplier.buffDef = BuffCatalog.GetBuffDef(CatalogModule.resetDebuff); this.projDamage.damageType = CatalogModule.sniperResetDamageType; }
public static void GetBuffIndices() { sacrificeBuff = BuffCatalog.FindBuffIndex("Sacrifice"); }
public static void EnableGodMode() { switch (UmbraMenu.GodVersion) { case 0: { // works // Normal UmbraMenu.LocalHealth.godMode = true; break; } case 1: { // works // Buff UmbraMenu.LocalPlayerBody.AddBuff(BuffCatalog.FindBuffIndex("Intangible")); break; } case 2: { // works // Regen UmbraMenu.LocalHealth.Heal(float.MaxValue, new ProcChainMask(), false); break; } case 3: { // works // Negative UmbraMenu.LocalHealth.SetField <bool>("wasAlive", false); break; } case 4: { // works // Revive UmbraMenu.LocalHealth.SetField <bool>("wasAlive", false); int itemELCount = UmbraMenu.LocalPlayerInv.GetItemCount(ItemCatalog.FindItemIndex("ExtraLife")); int itemELCCount = UmbraMenu.LocalPlayerInv.GetItemCount(ItemCatalog.FindItemIndex("ExtraLifeConsumed")); if (UmbraMenu.LocalHealth.health < 1) { if (itemELCount == 0) { ItemList.GiveItem(ItemCatalog.FindItemIndex("ExtraLife")); UmbraMenu.LocalHealth.SetField <bool>("wasAlive", true); } } if (itemELCCount > 0) { UmbraMenu.LocalPlayerInv.RemoveItem(ItemCatalog.FindItemIndex("ExtraLifeConsumed"), itemELCCount); } if (itemELCount > 0) { UmbraMenu.LocalPlayerInv.RemoveItem(ItemCatalog.FindItemIndex("ExtraLifeConsumed"), itemELCount); } break; } default: break; } }
private void GetBuffInds() { RW_curseBurn = BuffCatalog.FindBuffIndex("WispCurseBurn"); RW_flameChargeBuff = BuffCatalog.FindBuffIndex("WispFlameChargeBuff"); RW_armorBuff = BuffCatalog.FindBuffIndex("WispArmorBuff"); }