ModernUO/Projects/UOContent/Mobiles/Abilities
Kamron Batman f4327e6a3a
refactor: BaseCreature to the SerializationGenerator with SaveFlag elision
Converts BaseCreature's hand-written v22 serialization to codegen v23.
Nearly every field sits behind a [SaveFlag], so a creature matching its
defaults writes only [version int][ulong flags][default AI] - 13 bytes -
instead of ~236, and the writer's work is mostly branch-not-taken. With
500k-1M creatures in a world, this is the dominant slice of mobile save
freeze time and disk.

- Speeds serialize only when they differ from the creature's npc-speeds
  values (GetSpeeds/GetMoveSpeeds on both the flag check and the load
  default), so table edits now reach existing unmodified spawns on
  restart, and former paragons (snapped back to table values) elide
  fully. CurrentSpeed writes only when it differs from PassiveSpeed.
- The delete countdown is a [DeserializeTimer] field (anchored);
  stabled/controlled pets never persist one, and the abandoned-pet
  3-day fallback lives in AfterDeserialization for both load paths.
- SummonEnd stays anchored, written only while summoned.
- Old saves (v0-22) load through the retained legacy
  Deserialize(reader, version), now assigning raw fields; the shared
  post-load fixups (stat timers, AI creation, followers, animate-dead
  registration, unsummon timer) moved to [AfterDeserialization].
- Side-effect setters became generated-field hooks (Team, Controlled,
  Summoned, Loyalty clamp, resistance seeds, CurrentSpeed); properties
  whose semantics the hooks cannot express stay hand-written as
  [SerializableProperty] (ControlMaster/SummonMaster bracket the
  assignment with follower bookkeeping, ControlOrder must run on equal
  re-assignment, Tamable/IsParagon/move speeds have custom getters).
- CreatureDeathEvent/CreatureDeletedEvent moved to a CreatureEvents
  host class: the events generator and the serialization generator each
  emit a [GeneratedCode] partial for the declaring type, and the
  attribute forbids duplicates (CS0579).
- m_ fields renamed to _camelCase.

Tests: new-format round trips (default and fully populated) with exact
byte consumption, back-to-back saves byte-identical, and a
byte-authentic fossilized v22 stream loading through the legacy path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 10:50:38 -07:00
..
Fire Breath feat: Adds ability groups, DOT abilities, and combat abilities (#1264) 2022-11-23 12:33:27 -08:00
Summon Undead chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
AreaEffectMonsterAbility.cs fix: Adds guard for monster ability recursion (#2363) 2026-03-12 19:26:49 -07:00
BloodBathAttack.cs fix: Fixes Dot abilities. Adds blood bath attack (#1277) 2022-11-23 19:40:48 -08:00
ColossalBlow.cs fix: Fixes crafter deserialize, cleans up bandages, and codegens misc items (#1350) 2023-02-25 00:54:12 -08:00
DeathExplosion.cs fix: Adds guard for monster ability recursion (#2363) 2026-03-12 19:26:49 -07:00
DestroyEquipment.cs fix: Streamlines insurance. Insurance only executes when enabled. (#2550) 2026-07-26 09:47:49 -07:00
DrainLifeAreaAttack.cs feat: Adds drain life ability (#1181) 2022-10-02 11:36:15 -07:00
DrainLifeAttack.cs fix: Fixes Dot abilities. Adds blood bath attack (#1277) 2022-11-23 19:40:48 -08:00
EnergyBoltCounter.cs fix: Fixes single target abilities. Adds drain life ability. (#1276) 2022-11-23 19:06:27 -08:00
FanningFire.cs feat: Adds SpecialAttack monster ability trigger. Fixes fanning fire. (#2186) 2025-05-15 22:14:52 -07:00
FanThrowCounter.cs fix: Fixes single target abilities. Adds drain life ability. (#1276) 2022-11-23 19:06:27 -08:00
GraspingClaw.cs fix: Fixes Dot abilities. Adds blood bath attack (#1277) 2022-11-23 19:40:48 -08:00
MagicalBarrier.cs fix: Fixes magical barrier NPE and an edge case (#2162) 2025-04-22 17:52:09 -07:00
MonsterAbilities.cs feat(throwing): add Ter Mur reptiles (Raptor + slith family) and their SA claws (#2515) 2026-07-02 23:58:29 -07:00
MonsterAbility.cs refactor: BaseCreature to the SerializationGenerator with SaveFlag elision 2026-08-23 10:50:38 -07:00
MonsterAbilityGroup.cs fix: Cleans up potential memory leak in monster abilities. (#2185) 2025-05-15 19:42:54 -07:00
MonsterAbilitySingleTarget.cs fix: Fixes single target abilities. Adds drain life ability. (#1276) 2022-11-23 19:06:27 -08:00
MonsterAbilitySingleTargetDoT.cs fix: Timer Remaining Count off by 1 fix (#2046) 2025-01-01 20:19:38 -08:00
MonsterAbilityTrigger.cs feat: Adds magical barrier and ebolt counter ability (#1182) 2022-10-02 20:48:53 -07:00
MonsterAbilityType.cs feat(throwing): add Ter Mur reptiles (Raptor + slith family) and their SA claws (#2515) 2026-07-02 23:58:29 -07:00
PoisonGasAreaAttack.cs feat: Adds magical barrier and ebolt counter ability (#1182) 2022-10-02 20:48:53 -07:00
PoisonGasCounter.cs fix: Fixes single target abilities. Adds drain life ability. (#1276) 2022-11-23 19:06:27 -08:00
ReflectPhysicalDamage.cs fix: Cleans up potential memory leak in monster abilities. (#2185) 2025-05-15 19:42:54 -07:00
RuneCorruption.cs fix: Fixes Dot abilities. Adds blood bath attack (#1277) 2022-11-23 19:40:48 -08:00
StunAttack.cs fix: Fixes NPE with stun attack (#1751) 2024-04-30 19:20:06 -07:00
SummonPixiesCounter.cs fix: Adds summon pixies. Fixes other abilities (#1274) 2022-11-23 17:39:23 -08:00
TailSwipe.cs feat(throwing): add Ter Mur reptiles (Raptor + slith family) and their SA claws (#2515) 2026-07-02 23:58:29 -07:00
ThrowHatchetCounter.cs fix: Fixes single target abilities. Adds drain life ability. (#1276) 2022-11-23 19:06:27 -08:00