66
77namespace API . Patches
88{
9- [ HarmonyPatch ( typeof ( CardTriggerHandler ) , "AddAbility" , new [ ] { typeof ( Ability ) } ) ]
9+ [ HarmonyPatch ( typeof ( CardTriggerHandler ) , "AddAbility" , typeof ( Ability ) ) ]
1010 public class CardTriggerHandler_AddAbility_Ability
1111 {
1212 public static bool Prefix ( Ability ability , CardTriggerHandler __instance )
@@ -22,9 +22,9 @@ public static bool Prefix(Ability ability, CardTriggerHandler __instance)
2222 // return true if the ability is equal to the ability in the pair OR if ability cannot stack and is passive
2323 if ( ! __instance . triggeredAbilities . Exists ( checkAbilityExists ) )
2424 {
25- NewAbility newAbility = NewAbility . abilities . Find ( ( NewAbility x ) => x . ability == ability ) ;
25+ NewAbility newAbility = NewAbility . abilities . Find ( x => x . ability == ability ) ;
2626 Type type = newAbility . abilityBehaviour ;
27- Component baseC = ( Component ) __instance ;
27+ Component baseC = __instance ;
2828 AbilityBehaviour item = baseC . gameObject . GetComponent ( type ) as AbilityBehaviour ;
2929 if ( item == null )
3030 {
@@ -43,24 +43,23 @@ private static bool AbilityCanStackAndIsNotPassive(Ability ability)
4343 }
4444 }
4545
46- [ HarmonyPatch ( typeof ( CardTriggerHandler ) , "AddAbility" , new [ ] { typeof ( SpecialTriggeredAbility ) } ) ]
46+ [ HarmonyPatch ( typeof ( CardTriggerHandler ) , "AddAbility" , typeof ( SpecialTriggeredAbility ) ) ]
4747 public class CardTriggerHandler_AddAbility_SpecialTriggeredAbility
4848 {
4949 public static bool Prefix ( SpecialTriggeredAbility ability , CardTriggerHandler __instance )
5050 {
5151 Plugin . Log . LogInfo ( $ "Attempting to add spec ability to card trigger handler [{ ability } ]") ;
52- if ( ( int ) ability < 99 )
52+ if ( ( int ) ability < 25 )
5353 {
5454 return true ;
5555 }
56- // return true if the ability is equal to the ability in the pair OR if ability cannot stack and is passive
5756 if ( ! __instance . specialAbilities . Exists ( ab => ab . Item1 == ability ) )
5857 {
59- Plugin . Log . LogInfo ( $ "-> spec ability does not exist yet, adding") ;
58+ Plugin . Log . LogInfo ( "-> spec ability does not exist yet, adding" ) ;
6059 NewSpecialAbility newAbility = NewSpecialAbility . specialAbilities
6160 . Find ( x => x . specialTriggeredAbility == ability ) ;
6261 Type type = newAbility . abilityBehaviour ;
63- Component baseC = ( Component ) __instance ;
62+ Component baseC = __instance ;
6463 SpecialCardBehaviour item = baseC . gameObject . GetComponent ( type ) as SpecialCardBehaviour ;
6564 if ( item == null )
6665 {
0 commit comments