public static void ScrollingMenu_CanHaveTrait(ScrollingMenu __instance, Unlock myUnlock, ref bool __result)
 {
     if (__result)
     {
         foreach (Trait trait in __instance.agent.statusEffects.TraitList)
         {
             if (myUnlock.cancellations.Contains(trait.traitName))
             {
                 __result = false;
                 return;
             }
             Unlock traitUnlock = RogueLibs.GetUnlock(trait.traitName, UnlockTypes.Trait)?.Unlock;
             if (traitUnlock?.cancellations.Contains(myUnlock.unlockName) == true)
             {
                 __result = false;
                 return;
             }
         }
     }
 }
Beispiel #2
0
 protected static IEnumerator StatusEffects_SpecialAbilityInterfaceCheck2(IEnumerator iEnumerator, StatusEffects __instance)
 {
     while (iEnumerator.MoveNext())
     {
         CustomAbility ability = RogueLibs.GetAbility(__instance.agent?.specialAbility);
         if (ability?.IndicatorCheck != null)
         {
             PlayfieldObject res = ability.IndicatorCheck.Invoke(__instance.agent?.inventory?.equippedSpecialAbility, __instance.agent);
             if (res == null)
             {
                 __instance.agent.specialAbilityIndicator.Revert();
             }
             else
             {
                 __instance.agent.specialAbilityIndicator.ShowIndicator(res, __instance.agent?.specialAbility);
             }
         }
         yield return(iEnumerator.Current);
     }
 }
Beispiel #3
0
        protected static void StatusEffects_GiveSpecialAbility(StatusEffects __instance, string abilityName)
        {
            if (GameController.gameController.levelType == "HomeBase" && !__instance.agent.isDummy)
            {
                return;
            }
            if (__instance.agent.name == "DummyAgent" || __instance.agent.name.Contains("BackupAgent"))
            {
                return;
            }

            CustomAbility ability = RogueLibs.GetAbility(__instance.agent.inventory.equippedSpecialAbility.invItemName);

            if (ability?.IndicatorCheck != null)
            {
                __instance.SpecialAbilityInterfaceCheck();
            }
            if (ability?.Recharge != null)
            {
                __instance.RechargeSpecialAbility(abilityName);
            }
        }
Beispiel #4
0
        protected static void SpecialAbilityIndicator_ShowIndicator(SpecialAbilityIndicator __instance, string specialAbilityType)
        {
            CustomAbility ability = RogueLibs.GetAbility(specialAbilityType);

            __instance.image.sprite = ability.Sprite;
        }