Unify ability schema: canonical AbilitiesJson with EffectsJson compatibility
This commit is contained in:
@@ -860,7 +860,9 @@ else
|
||||
|
||||
_abilitiesJson = _card.CardType is CardType.Repentance
|
||||
or CardType.Instinct or CardType.Terramorpha
|
||||
? _card.EffectsJson ?? string.Empty
|
||||
? (!string.IsNullOrWhiteSpace(_card.AbilitiesJson)
|
||||
? _card.AbilitiesJson!
|
||||
: _card.EffectsJson ?? string.Empty)
|
||||
: _card.AbilitiesJson ?? string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -880,9 +882,17 @@ else
|
||||
_card.Genus = _selectedGenus.Count > 0 ? _selectedGenus.ToArray() : null;
|
||||
|
||||
if (_card.CardType is CardType.Repentance or CardType.Instinct or CardType.Terramorpha)
|
||||
_card.EffectsJson = string.IsNullOrWhiteSpace(_abilitiesJson) ? null : _abilitiesJson;
|
||||
{
|
||||
var canonical = string.IsNullOrWhiteSpace(_abilitiesJson) ? null : _abilitiesJson;
|
||||
// Canonical store for ability-schema cards.
|
||||
_card.AbilitiesJson = canonical;
|
||||
// Transition mirror-write for backward compatibility.
|
||||
_card.EffectsJson = canonical;
|
||||
}
|
||||
else
|
||||
{
|
||||
_card.AbilitiesJson = string.IsNullOrWhiteSpace(_abilitiesJson) ? null : _abilitiesJson;
|
||||
}
|
||||
|
||||
_card.UpdatedAt = DateTimeOffset.UtcNow;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user