ModernUO/Projects/UOContent/Mobiles
Kamron Batman f77dd91811
fix: Overhauls virtue system (#1376)
## MAJOR CHANGE (API BREAKING)

Moved the virtues to it's own system _VirtueSystem_. This should make it easier to extend or remove the virtue system. Virtues will be saved to a new folder called _Virtues_.

### Motivation

The motivation was also two-fold, performance/stability, and to fix bugs.

First, virtues is the second system (first is murders), that has a pre-world-save check on _every mobile in the game_ to atrophy virtue stats. This is taxing since it freexes the world and makes world saves take longer. Every mobile had Gain/Loss dates for each virtue, whether they needed them or not. Most players don't even use the virtue system, so this will increase performance considerably.

Second, when I tried to optimize/refactor the code, I found several bugs that needed to be fixed.

### Major API Changes

- [X] The properties on players related to virtues are gone. Use `pm.GetVirtues()?.<PropertyName>` instead.
- [X] Virtues were removed from non-player Mobiles.
- [X] `pm.JusticeProtectors` was removed. Use `JusticeVirtue.GetProtector()` or `JusticeVirtue.GetProtected()` instead.

### Screenshots

<img width="221" alt="Props-1" src="https://github.com/modernuo/ModernUO/assets/3953314/5c09cb83-b8d5-44a2-b899-a7ed7cd736ac">
<img width="220" alt="props-2" src="https://github.com/modernuo/ModernUO/assets/3953314/aeade4d3-8df0-47bd-955a-a864d0946cf7">
2023-07-19 21:43:47 -07:00
..
Abilities fix: Fixes stabled, abilities targeting self, and unsummon memory leak (#1418) 2023-07-03 09:45:22 -07:00
AI fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
Animals fix: Codegens mutation core (#1370) 2023-03-11 17:33:31 -08:00
Familiars fix: Fixes random bias & Adds back champion arties for UOML (#1235) 2022-11-09 16:33:27 -08:00
Guards cleanup: Fixes bugs and cleans up code (#660) 2021-07-19 20:49:59 -07:00
Healers fix: Fixes random bias & Adds back champion arties for UOML (#1235) 2022-11-09 16:33:27 -08:00
Hireables feat: Adds hireables (#1393) 2023-04-16 20:24:14 -07:00
Monsters fix: Fixes leaking/errors caused by categorization (#1404) 2023-05-19 18:41:31 -07:00
Special fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
Townfolk fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
Vendors fix: Fixes stabled, abilities targeting self, and unsummon memory leak (#1418) 2023-07-03 09:45:22 -07:00
BaseCreature.cs fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
ChampionTitleInfo.cs fix: NullReference in ChampionTileInfo (#1258) 2022-11-21 20:35:45 -08:00
NPCSpeeds.cs fix: Makes NPC active movement half think speed (#1256) 2022-11-20 20:05:43 -08:00
PlayerMobile.cs fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00