Addition of Special Abilities#8
Conversation
Added rulebook patching for special abilities Added SpecialAbilityIdentifier.cs Refactored StatIconInfo.cs to now point at LoadAbilityData
Refactored to now check if the ability already exists. Added Card_AttachAbilities_NewSpecialAbilities.cs to add SpecialAbilities. Cleaned up AbilitiesUtil.cs and AbilityIdentifier.cs
Refactored CustomCard to include special abilities now
| public SpecialAbilityIdentifier id; | ||
|
|
||
| public NewSpecialAbility( | ||
| StatIconInfo statIconInfo, |
There was a problem hiding this comment.
statIconInfo is optional, so should be nullable here
| NewSpecialAbility newAbility = NewSpecialAbility.specialAbilities | ||
| .Find(x => x.specialTriggeredAbility == specialTriggeredAbility); | ||
| Type type = newAbility.abilityBehaviour; | ||
| Plugin.Log.LogInfo($"-> Type is [{type}]"); |
There was a problem hiding this comment.
This probably wants more information or wants to be a debug message
| min, | ||
| doAddPageFunc, | ||
| __instance.FillStatIconPage, | ||
| Localization.Translate("APPENDIX XII, SUBSECTION I - MOD SPEC. ABILITIES {0}"))); |
There was a problem hiding this comment.
APPENDIX XII, SUBSECTION II - VARIABLE STATS {0}
| { | ||
| NewCard.cards[item.Key].abilities.Add(id.id); | ||
| // if the card already has the ability then no point and adding it | ||
| if (!newCard.abilities.Contains(id.id)) newCard.abilities.Add(id.id); |
There was a problem hiding this comment.
Some abilities can stack. If you try to add a duplicate which can't stack, then it will be removed, but certain abilitiies stack
There was a problem hiding this comment.
A fix for toRemove does need to be added to make this work as intended but I have the code for that and will add it after I merge
| { | ||
| CustomCard.cards[item.Key].abilities.Add(id.id); | ||
| // if the card already has the ability then no point and adding it | ||
| if (!customCard.abilities.Contains(id.id)) customCard.abilities.Add(id.id); |
Added method for handling StatIconInfo
|
For an example of a working example: https://github.com/julian-perge/InscryptionMods/blob/main/Cards_And_Abilities/MoreAnts/DomeAnt.cs |


No description provided.