Feature: card unit SFX + genus multi-select + CardEditor UX fixes
- CardDefinition: add MoveSoundUrl, DamagedSoundUrl, BlockedSoundUrl,
AttackSoundUrl, DeathSoundUrl columns (nullable text)
- Migration 20260317100000_AddCardUnitSounds: 5 new columns on card_definitions
- CardDefinitionDto + ContentDtoMapper: expose 5 SFX fields to client
- CardEditor:
- Genus: replace plain text input with DB-backed checkbox multi-select
(loads distinct tags from all cards; add new tags inline)
- Channel range (Min/Max): now ArchSpirit-only (removed from Spirit)
- CanUseAbility / RequiresLos: default true for display & new cards
- Assets tab: Unit Sound Effects section (5 CDN URL inputs)
- model-viewer script injected lazily so 3D preview renders
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -126,6 +126,8 @@ else
|
|||||||
@if (_card.CardType is CardType.ArchSpirit or CardType.Spirit)
|
@if (_card.CardType is CardType.ArchSpirit or CardType.Spirit)
|
||||||
{
|
{
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
|
@if (_card.CardType == CardType.ArchSpirit)
|
||||||
|
{
|
||||||
<div class="col-12"><h6 class="text-muted">Channeling</h6></div>
|
<div class="col-12"><h6 class="text-muted">Channeling</h6></div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label class="form-label">Min Channel Range</label>
|
<label class="form-label">Min Channel Range</label>
|
||||||
@@ -135,8 +137,6 @@ else
|
|||||||
<label class="form-label">Max Channel Range</label>
|
<label class="form-label">Max Channel Range</label>
|
||||||
<input @bind="_card.MaxChannelRange" type="number" min="0" class="form-control" />
|
<input @bind="_card.MaxChannelRange" type="number" min="0" class="form-control" />
|
||||||
</div>
|
</div>
|
||||||
@if (_card.CardType == CardType.ArchSpirit)
|
|
||||||
{
|
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<label class="form-label">Tier</label>
|
<label class="form-label">Tier</label>
|
||||||
<input @bind="_card.Tier" type="number" min="1" max="5" class="form-control" />
|
<input @bind="_card.Tier" type="number" min="1" max="5" class="form-control" />
|
||||||
@@ -207,9 +207,33 @@ else
|
|||||||
|
|
||||||
<div class="col-12"><h6 class="text-muted mt-2">Genus Tags</h6></div>
|
<div class="col-12"><h6 class="text-muted mt-2">Genus Tags</h6></div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input @bind="_genusInput" class="form-control"
|
@if (_availableGenus.Count > 0)
|
||||||
placeholder="Comma-separated tags, e.g. Elemental, Beast" />
|
{
|
||||||
<div class="form-text">Stored as a Postgres text[] array.</div>
|
<div class="border rounded p-2 mb-1" style="max-height:160px;overflow-y:auto">
|
||||||
|
@foreach (var tag in _availableGenus)
|
||||||
|
{
|
||||||
|
var capturedTag = tag;
|
||||||
|
<div class="form-check">
|
||||||
|
<input type="checkbox" class="form-check-input"
|
||||||
|
id="genus_@capturedTag"
|
||||||
|
checked="@_selectedGenus.Contains(capturedTag)"
|
||||||
|
@onchange="e => ToggleGenus(capturedTag, (bool)(e.Value ?? false))" />
|
||||||
|
<label class="form-check-label" for="genus_@capturedTag">@capturedTag</label>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<div class="input-group input-group-sm">
|
||||||
|
<input @bind="_newGenusTag" class="form-control"
|
||||||
|
placeholder="Add new genus tag…" />
|
||||||
|
<button class="btn btn-outline-secondary" type="button" @onclick="AddGenusTag">
|
||||||
|
<i class="bi bi-plus-lg"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@if (_selectedGenus.Count > 0)
|
||||||
|
{
|
||||||
|
<div class="form-text">Selected: @string.Join(", ", _selectedGenus)</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -491,6 +515,35 @@ else
|
|||||||
<button class="btn btn-sm btn-outline-secondary" @onclick="AddAnimation">
|
<button class="btn btn-sm btn-outline-secondary" @onclick="AddAnimation">
|
||||||
<i class="bi bi-plus-lg me-1"></i>Add Animation
|
<i class="bi bi-plus-lg me-1"></i>Add Animation
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<h6 class="text-muted mb-3 mt-4">Unit Sound Effects</h6>
|
||||||
|
<div class="row g-3">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label">Move Sound URL</label>
|
||||||
|
<input @bind="_card.MoveSoundUrl" class="form-control form-control-sm"
|
||||||
|
placeholder="https://cdn.sor.gg/sfx/…" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label">Damaged Sound URL</label>
|
||||||
|
<input @bind="_card.DamagedSoundUrl" class="form-control form-control-sm"
|
||||||
|
placeholder="https://cdn.sor.gg/sfx/…" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label">Blocked Sound URL</label>
|
||||||
|
<input @bind="_card.BlockedSoundUrl" class="form-control form-control-sm"
|
||||||
|
placeholder="https://cdn.sor.gg/sfx/…" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label">Attack Sound URL</label>
|
||||||
|
<input @bind="_card.AttackSoundUrl" class="form-control form-control-sm"
|
||||||
|
placeholder="https://cdn.sor.gg/sfx/…" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label">Death Sound URL</label>
|
||||||
|
<input @bind="_card.DeathSoundUrl" class="form-control form-control-sm"
|
||||||
|
placeholder="https://cdn.sor.gg/sfx/…" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,6 +622,17 @@ else
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<!-- model-viewer web component (guard: only load once per page) -->
|
||||||
|
<script>
|
||||||
|
if (!window.__modelViewerLoaded) {
|
||||||
|
window.__modelViewerLoaded = true;
|
||||||
|
var s = document.createElement('script');
|
||||||
|
s.type = 'module';
|
||||||
|
s.src = 'https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js';
|
||||||
|
document.head.appendChild(s);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- JS: model-viewer animation interop (guard prevents double-define if CdnBrowser also loaded it) -->
|
<!-- JS: model-viewer animation interop (guard prevents double-define if CdnBrowser also loaded it) -->
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
@@ -600,7 +664,9 @@ else
|
|||||||
private bool _saving;
|
private bool _saving;
|
||||||
private string? _saveError;
|
private string? _saveError;
|
||||||
private bool _saveSuccess;
|
private bool _saveSuccess;
|
||||||
private string _genusInput = string.Empty;
|
private List<string> _selectedGenus = new();
|
||||||
|
private List<string> _availableGenus = new();
|
||||||
|
private string _newGenusTag = string.Empty;
|
||||||
private string _abilitiesJson = string.Empty;
|
private string _abilitiesJson = string.Empty;
|
||||||
private readonly HashSet<Guid> _uploading = new();
|
private readonly HashSet<Guid> _uploading = new();
|
||||||
private string? _uploadError;
|
private string? _uploadError;
|
||||||
@@ -755,12 +821,25 @@ else
|
|||||||
{
|
{
|
||||||
_isNew = Id == null;
|
_isNew = Id == null;
|
||||||
|
|
||||||
|
// Load all distinct genus tags from the DB for the multi-select.
|
||||||
|
var allGenusArrays = await Db.CardDefinitions
|
||||||
|
.Where(c => c.Genus != null)
|
||||||
|
.Select(c => c.Genus!)
|
||||||
|
.ToListAsync();
|
||||||
|
_availableGenus = allGenusArrays
|
||||||
|
.SelectMany(g => g)
|
||||||
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
.OrderBy(g => g)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
if (_isNew)
|
if (_isNew)
|
||||||
{
|
{
|
||||||
_card = new CardDefinition
|
_card = new CardDefinition
|
||||||
{
|
{
|
||||||
CreatedAt = DateTimeOffset.UtcNow,
|
CreatedAt = DateTimeOffset.UtcNow,
|
||||||
UpdatedAt = DateTimeOffset.UtcNow,
|
UpdatedAt = DateTimeOffset.UtcNow,
|
||||||
|
CanUseAbility = true,
|
||||||
|
RequiresLos = true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -772,9 +851,12 @@ else
|
|||||||
|
|
||||||
if (_card != null)
|
if (_card != null)
|
||||||
{
|
{
|
||||||
_genusInput = _card.Genus != null
|
_selectedGenus = _card.Genus?.ToList() ?? new List<string>();
|
||||||
? string.Join(", ", _card.Genus)
|
// Ensure any card-specific tags appear in the available list.
|
||||||
: string.Empty;
|
foreach (var tag in _selectedGenus)
|
||||||
|
if (!_availableGenus.Contains(tag, StringComparer.OrdinalIgnoreCase))
|
||||||
|
_availableGenus.Add(tag);
|
||||||
|
_availableGenus.Sort(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
_abilitiesJson = _card.CardType is CardType.Repentance
|
_abilitiesJson = _card.CardType is CardType.Repentance
|
||||||
or CardType.Instinct or CardType.Terramorpha
|
or CardType.Instinct or CardType.Terramorpha
|
||||||
@@ -795,9 +877,7 @@ else
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_card.Genus = string.IsNullOrWhiteSpace(_genusInput)
|
_card.Genus = _selectedGenus.Count > 0 ? _selectedGenus.ToArray() : null;
|
||||||
? null
|
|
||||||
: _genusInput.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
|
||||||
|
|
||||||
if (_card.CardType is CardType.Repentance or CardType.Instinct or CardType.Terramorpha)
|
if (_card.CardType is CardType.Repentance or CardType.Instinct or CardType.Terramorpha)
|
||||||
_card.EffectsJson = string.IsNullOrWhiteSpace(_abilitiesJson) ? null : _abilitiesJson;
|
_card.EffectsJson = string.IsNullOrWhiteSpace(_abilitiesJson) ? null : _abilitiesJson;
|
||||||
@@ -945,6 +1025,28 @@ else
|
|||||||
_ => "*/*",
|
_ => "*/*",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ── Genus helpers ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
private void ToggleGenus(string tag, bool selected)
|
||||||
|
{
|
||||||
|
if (selected) { if (!_selectedGenus.Contains(tag)) _selectedGenus.Add(tag); }
|
||||||
|
else _selectedGenus.Remove(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddGenusTag()
|
||||||
|
{
|
||||||
|
var tag = _newGenusTag.Trim();
|
||||||
|
if (string.IsNullOrEmpty(tag)) return;
|
||||||
|
if (!_availableGenus.Contains(tag, StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
_availableGenus.Add(tag);
|
||||||
|
_availableGenus.Sort(StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
if (!_selectedGenus.Contains(tag, StringComparer.OrdinalIgnoreCase))
|
||||||
|
_selectedGenus.Add(tag);
|
||||||
|
_newGenusTag = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
// ── Flag descriptors ──────────────────────────────────────────────────────
|
// ── Flag descriptors ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
private sealed record FlagDescriptor(
|
private sealed record FlagDescriptor(
|
||||||
@@ -960,8 +1062,8 @@ else
|
|||||||
new("Can Be Blocked", c => c.CanBeBlocked ?? false, (c, v) => c.CanBeBlocked = v),
|
new("Can Be Blocked", c => c.CanBeBlocked ?? false, (c, v) => c.CanBeBlocked = v),
|
||||||
new("Can Move", c => c.CanMove ?? false, (c, v) => c.CanMove = v),
|
new("Can Move", c => c.CanMove ?? false, (c, v) => c.CanMove = v),
|
||||||
new("Can Be Obstructed", c => c.CanBeObstructed ?? false, (c, v) => c.CanBeObstructed = v),
|
new("Can Be Obstructed", c => c.CanBeObstructed ?? false, (c, v) => c.CanBeObstructed = v),
|
||||||
new("Requires LOS", c => c.RequiresLos ?? false, (c, v) => c.RequiresLos = v),
|
new("Requires LOS", c => c.RequiresLos ?? true, (c, v) => c.RequiresLos = v),
|
||||||
new("Can Use Ability", c => c.CanUseAbility ?? false, (c, v) => c.CanUseAbility = v),
|
new("Can Use Ability", c => c.CanUseAbility ?? true, (c, v) => c.CanUseAbility = v),
|
||||||
new("Can Be Sacrificed", c => c.CanBeSacrificed ?? false, (c, v) => c.CanBeSacrificed = v),
|
new("Can Be Sacrificed", c => c.CanBeSacrificed ?? false, (c, v) => c.CanBeSacrificed = v),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,12 @@ public sealed record CardDefinitionDto(
|
|||||||
// Visual / 3D model (card-level)
|
// Visual / 3D model (card-level)
|
||||||
float? ModelScale,
|
float? ModelScale,
|
||||||
string? ModelTintColor,
|
string? ModelTintColor,
|
||||||
|
// Unit SFX
|
||||||
|
string? MoveSoundUrl,
|
||||||
|
string? DamagedSoundUrl,
|
||||||
|
string? BlockedSoundUrl,
|
||||||
|
string? AttackSoundUrl,
|
||||||
|
string? DeathSoundUrl,
|
||||||
// Assets
|
// Assets
|
||||||
IEnumerable<CardAssetDto> Assets,
|
IEnumerable<CardAssetDto> Assets,
|
||||||
IEnumerable<CardAnimationBindingDto> AnimationBindings);
|
IEnumerable<CardAnimationBindingDto> AnimationBindings);
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ internal static class ContentDtoMapper
|
|||||||
DefinitionVersion: c.DefinitionVersion,
|
DefinitionVersion: c.DefinitionVersion,
|
||||||
ModelScale: c.ModelScale,
|
ModelScale: c.ModelScale,
|
||||||
ModelTintColor: c.ModelTintColor,
|
ModelTintColor: c.ModelTintColor,
|
||||||
|
MoveSoundUrl: c.MoveSoundUrl,
|
||||||
|
DamagedSoundUrl: c.DamagedSoundUrl,
|
||||||
|
BlockedSoundUrl: c.BlockedSoundUrl,
|
||||||
|
AttackSoundUrl: c.AttackSoundUrl,
|
||||||
|
DeathSoundUrl: c.DeathSoundUrl,
|
||||||
Assets: c.Assets.Select(a => new CardAssetDto(
|
Assets: c.Assets.Select(a => new CardAssetDto(
|
||||||
a.Id,
|
a.Id,
|
||||||
a.AssetType.ToString(),
|
a.AssetType.ToString(),
|
||||||
|
|||||||
@@ -89,6 +89,13 @@ public sealed class CardDefinition
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? ModelTintColor { get; set; }
|
public string? ModelTintColor { get; set; }
|
||||||
|
|
||||||
|
// ── Unit sound effects (card-level SFX CDN URLs) ────────────────────────
|
||||||
|
public string? MoveSoundUrl { get; set; }
|
||||||
|
public string? DamagedSoundUrl { get; set; }
|
||||||
|
public string? BlockedSoundUrl { get; set; }
|
||||||
|
public string? AttackSoundUrl { get; set; }
|
||||||
|
public string? DeathSoundUrl { get; set; }
|
||||||
|
|
||||||
// ── Ability / Effect data (JSONB) ────────────────────────────────────────
|
// ── Ability / Effect data (JSONB) ────────────────────────────────────────
|
||||||
/// <summary>JSONB array of AbilityDefinition objects (ArchSpirit, Spirit, Ruin).</summary>
|
/// <summary>JSONB array of AbilityDefinition objects (ArchSpirit, Spirit, Ruin).</summary>
|
||||||
public string? AbilitiesJson { get; set; }
|
public string? AbilitiesJson { get; set; }
|
||||||
|
|||||||
+502
@@ -0,0 +1,502 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using SOR.Database.Contexts;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace SOR.Database.Migrations.Catalog
|
||||||
|
{
|
||||||
|
[DbContext(typeof(CatalogDbContext))]
|
||||||
|
[Migration("20260317100000_AddCardUnitSounds")]
|
||||||
|
partial class AddCardUnitSounds
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasDefaultSchema("catalog")
|
||||||
|
.HasAnnotation("ProductVersion", "8.0.0")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAnimationBinding", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("ActionName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("AnimationCdnUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("AnimationTrackName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("CardDefinitionId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("CastSoundCdnUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ImpactSoundCdnUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAiGenerated")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CardDefinitionId", "ActionName")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("card_animation_bindings", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAsset", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("AssetType")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("CardDefinitionId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("CdnUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAiGenerated")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("MimeType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ModelFacingDirection")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ModelTintMaskUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CardDefinitionId", "AssetType");
|
||||||
|
|
||||||
|
b.ToTable("card_assets", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardDefinition", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("AbilitiesJson")
|
||||||
|
.HasColumnType("jsonb")
|
||||||
|
.HasColumnName("abilities");
|
||||||
|
|
||||||
|
b.Property<string>("Affinity")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("AttackSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("AttackType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("BlockedSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanAttack")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanBeAttacked")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanBeBlocked")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanBeObstructed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanBeSacrificed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanDefend")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanMove")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool?>("CanUseAbility")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("CardType")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int?>("CollectorNumber")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<int?>("Damage")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("DamagedSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("DeathSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("DefinitionVersion")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasDefaultValue(0L);
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EffectsJson")
|
||||||
|
.HasColumnType("jsonb")
|
||||||
|
.HasColumnName("effects");
|
||||||
|
|
||||||
|
b.Property<string[]>("Genus")
|
||||||
|
.HasColumnType("text[]");
|
||||||
|
|
||||||
|
b.Property<bool>("IsPublished")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRetired")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<int?>("MaxAttackRange")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int?>("MaxChannelRange")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int?>("MaxDefense")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int?>("MaxHealth")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int?>("MinAttackRange")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int?>("MinChannelRange")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<float?>("ModelScale")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
b.Property<string>("ModelTintColor")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("MoveSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int?>("MovementPoints")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("MovementType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("OtherCostsJson")
|
||||||
|
.HasColumnType("jsonb")
|
||||||
|
.HasColumnName("other_costs");
|
||||||
|
|
||||||
|
b.Property<Guid?>("PreviousTierId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Rarity")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool?>("RequiresLos")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("RetiredAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<Guid?>("SetId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int>("SpCost")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("StCost")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("TerramorphaMode")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int?>("Tier")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Affinity");
|
||||||
|
|
||||||
|
b.HasIndex("CardType");
|
||||||
|
|
||||||
|
b.HasIndex("DefinitionVersion");
|
||||||
|
|
||||||
|
b.HasIndex("Name");
|
||||||
|
|
||||||
|
b.HasIndex("PreviousTierId");
|
||||||
|
|
||||||
|
b.HasIndex("Rarity");
|
||||||
|
|
||||||
|
b.HasIndex("SetId");
|
||||||
|
|
||||||
|
b.HasIndex("IsPublished", "SetId");
|
||||||
|
|
||||||
|
b.ToTable("card_definitions", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardSet", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Code")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateOnly?>("ReleaseDate")
|
||||||
|
.HasColumnType("date");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Code")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("card_sets", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CdnUploadRecord", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("ContentType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsAiGenerated")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("ObjectKey")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Prefix")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PublicUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("UploadedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("IsAiGenerated");
|
||||||
|
|
||||||
|
b.HasIndex("ObjectKey")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.HasIndex("Prefix");
|
||||||
|
|
||||||
|
b.ToTable("cdn_upload_records", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.GameAudioConfig", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Context")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("TrackCdnUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("TrackName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Context");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.ToTable("game_audio_configs", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.TileBottomModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("CdnKey")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("PublicUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.ToTable("tile_bottom_models", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.TileModelBinding", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Affinity")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ModelCdnKey")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ModelPublicUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Shape")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("TexturePublicUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Affinity", "Shape")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("tile_model_bindings", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAnimationBinding", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SOR.Database.Entities.Catalog.CardDefinition", "CardDefinition")
|
||||||
|
.WithMany("AnimationBindings")
|
||||||
|
.HasForeignKey("CardDefinitionId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("CardDefinition");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAsset", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SOR.Database.Entities.Catalog.CardDefinition", "CardDefinition")
|
||||||
|
.WithMany("Assets")
|
||||||
|
.HasForeignKey("CardDefinitionId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("CardDefinition");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardDefinition", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("SOR.Database.Entities.Catalog.CardDefinition", "PreviousTier")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("PreviousTierId")
|
||||||
|
.OnDelete(DeleteBehavior.SetNull);
|
||||||
|
|
||||||
|
b.HasOne("SOR.Database.Entities.Catalog.CardSet", "Set")
|
||||||
|
.WithMany("Cards")
|
||||||
|
.HasForeignKey("SetId")
|
||||||
|
.OnDelete(DeleteBehavior.SetNull);
|
||||||
|
|
||||||
|
b.Navigation("PreviousTier");
|
||||||
|
|
||||||
|
b.Navigation("Set");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardDefinition", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("AnimationBindings");
|
||||||
|
|
||||||
|
b.Navigation("Assets");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardSet", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Cards");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace SOR.Database.Migrations.Catalog
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AddCardUnitSounds : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "AttackSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions",
|
||||||
|
type: "text",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "BlockedSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions",
|
||||||
|
type: "text",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "DamagedSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions",
|
||||||
|
type: "text",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "DeathSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions",
|
||||||
|
type: "text",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "MoveSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions",
|
||||||
|
type: "text",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "AttackSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "BlockedSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DamagedSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "DeathSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "MoveSoundUrl",
|
||||||
|
schema: "catalog",
|
||||||
|
table: "card_definitions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -113,9 +113,15 @@ namespace SOR.Database.Migrations.Catalog
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("AttackSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<string>("AttackType")
|
b.Property<string>("AttackType")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("BlockedSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<bool?>("CanAttack")
|
b.Property<bool?>("CanAttack")
|
||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
@@ -153,6 +159,12 @@ namespace SOR.Database.Migrations.Catalog
|
|||||||
b.Property<int?>("Damage")
|
b.Property<int?>("Damage")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("DamagedSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("DeathSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<long>("DefinitionVersion")
|
b.Property<long>("DefinitionVersion")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint")
|
.HasColumnType("bigint")
|
||||||
@@ -199,6 +211,9 @@ namespace SOR.Database.Migrations.Catalog
|
|||||||
b.Property<string>("ModelTintColor")
|
b.Property<string>("ModelTintColor")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("MoveSoundUrl")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int?>("MovementPoints")
|
b.Property<int?>("MovementPoints")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
@@ -365,6 +380,33 @@ namespace SOR.Database.Migrations.Catalog
|
|||||||
b.ToTable("game_audio_configs", "catalog");
|
b.ToTable("game_audio_configs", "catalog");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.TileBottomModel", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("CdnKey")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsActive")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("PublicUrl")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("UpdatedAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("IsActive");
|
||||||
|
|
||||||
|
b.ToTable("tile_bottom_models", "catalog");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("SOR.Database.Entities.Catalog.TileModelBinding", b =>
|
modelBuilder.Entity("SOR.Database.Entities.Catalog.TileModelBinding", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
|
|||||||
Reference in New Issue
Block a user