Code changes needed to add a new item modifier - ZaneDubya/MedievaLandsPublic GitHub Wiki
Adding a new mod requires at least seven steps. Half of these are required due to the way the MedievaLands server treats objects:
- Items are MedievaItem : YsItem : GenericItem
- Players are YsPlayerServer : YsPlayer : GenericPlayer
I designed this inheritance schema so I could handle almost any dungeon crawler type game with the same MedievaLands server... but as a side effect, the classes themselves are very complicated. Surely there must be a better way to approach this...
Anyways, to add a new MedievaLands mod to Yserbius, one must, at a minimum:
- Add the declaration to IYsItemTooltipInfo
- Add the declaration to classes that implement IYsITemTooltipInfo (YsItem and CanoItemInfo).
- Add serialization/deserialization routines (in YsItem or GenericItem, as appropriate).
- Add the override to MedievaItem.
- Add to client tooltip generation code in UiToolTipItem.GenerateToolTipText()
- Override the declaration (in YsPlayer or GenericPlayer).
- Finally, add the game logic code. This could be in YsPlayer, GenericPlayer, YsBattleMechanics, YsSpellSystem, YsSkillSystem...